diff --git a/.agents/skills/create-cuda-python-pull-request/SKILL.md b/.agents/skills/create-cuda-python-pull-request/SKILL.md new file mode 100644 index 00000000000..4e3a07b83c1 --- /dev/null +++ b/.agents/skills/create-cuda-python-pull-request/SKILL.md @@ -0,0 +1,127 @@ +--- +name: create-cuda-python-pull-request +description: Create a CUDA Python pull request from an approved personal or organization-owned fork, including the GitHub CLI GraphQL fallback for renamed organization-owned forks. Use when the user directly requests creating or opening a CUDA Python pull request. Do not use for local implementation, commits, pushes, branch preparation, PR advice, or general GitHub work without that direct request. +--- + +# Create CUDA Python Pull Request + +This skill supplies technical procedure after the user directly asks to create +a pull request. It does not define when a pull request should be created or +authorize one without that direct request. Do not infer the request from +completed work, a local commit, a push request, or the existence of a suitable +fork. + +## Inspect the topology and proposed change + +1. Run `git status --short --branch`, inspect the branch diff, and confirm the + intended base branch. +2. Run `git remote -v` and resolve the complete `OWNER/REPOSITORY` names of the + base repository and intended fork. Do not rely on remote names alone. +3. Confirm through GitHub that the push target is a fork of the base repository + and is not the base repository itself. +4. Confirm that the intended push target complies with the repository's + remote-write policy and the user's request. +5. Inspect the repository's pull-request template, available labels, and open + milestones. Do not guess required metadata; ask the user when it is unclear. + +## Validate and push + +Run the checks appropriate to the change and review the final diff. Push the +current branch to the approved fork using the explicit remote and branch: + +```bash +git push +``` + +## Create the pull request + +Prepare a complete body from the repository's pull-request template. Every +pull request must have at least one assignee, one label, and a milestone; CI +enforces this through `pr-metadata-check`. + +Use `gh pr create` when it can identify the fork unambiguously. Select the base +repository and branch explicitly and supply the required metadata: + +```bash +gh pr create \ + --repo / \ + --base \ + --head : \ + --title "" \ + --body-file <path-to-pr-body> \ + --assignee <assignee> \ + --label <label> \ + --milestone <milestone> +``` + +Add `--draft` when the user requests a draft pull request. + +## Handle renamed organization-owned forks + +[GitHub CLI issue cli/cli#10093](https://github.com/cli/cli/issues/10093) +tracks `gh pr create` support for cross-repository pull requests within one +organization. Check whether the issue has been resolved before using the +workaround. + +If `gh pr create` cannot identify an organization-owned fork whose repository +name differs from the base repository, create the pull request with GitHub's +GraphQL API and pass `headRepositoryId` explicitly. + +Resolve the repository node IDs: + +```bash +BASE_REPO="<base-owner>/<base-repository>" +HEAD_REPO="<fork-owner>/<fork-repository>" +BASE_REPO_ID="$(gh api "repos/${BASE_REPO}" --jq '.node_id')" +HEAD_REPO_ID="$(gh api "repos/${HEAD_REPO}" --jq '.node_id')" +``` + +Create the pull request. Set `draft` to match the user's request. + +```bash +gh api graphql \ + -f repositoryId="${BASE_REPO_ID}" \ + -f headRepositoryId="${HEAD_REPO_ID}" \ + -f baseRefName="<base-branch>" \ + -f headRefName="<head-branch>" \ + -f title="<title>" \ + -F body="@<path-to-pr-body>" \ + -F draft=false \ + -f query=' + mutation CreatePullRequest( + $repositoryId: ID! + $headRepositoryId: ID! + $baseRefName: String! + $headRefName: String! + $title: String! + $body: String! + $draft: Boolean! + ) { + createPullRequest(input: { + repositoryId: $repositoryId + headRepositoryId: $headRepositoryId + baseRefName: $baseRefName + headRefName: $headRefName + title: $title + body: $body + draft: $draft + }) { + pullRequest { number url } + } + }' \ + --jq '.data.createPullRequest.pullRequest' +``` + +The GraphQL API does not populate the pull-request template automatically. +After creation, add the required metadata to the returned pull-request number: + +```bash +gh pr edit <pr-number> \ + --repo "${BASE_REPO}" \ + --add-assignee "<assignee>" \ + --add-label "<label>" \ + --milestone "<milestone>" +``` + +Verify the resulting URL, base branch, head repository and branch, draft state, +body, assignee, label, and milestone before reporting completion. diff --git a/.agents/skills/create-cuda-python-pull-request/agents/openai.yaml b/.agents/skills/create-cuda-python-pull-request/agents/openai.yaml new file mode 100644 index 00000000000..1d2725a7696 --- /dev/null +++ b/.agents/skills/create-cuda-python-pull-request/agents/openai.yaml @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +interface: + display_name: "Create CUDA Python PR" + short_description: "Open an explicitly requested CUDA Python pull request" + default_prompt: "Use $create-cuda-python-pull-request to create the CUDA Python pull request I explicitly requested." +policy: + allow_implicit_invocation: true diff --git a/.github/ISSUE_TEMPLATE/release_checklist.yml b/.github/ISSUE_TEMPLATE/release_checklist.yml index f7307fbe92a..1edc0e9e12b 100644 --- a/.github/ISSUE_TEMPLATE/release_checklist.yml +++ b/.github/ISSUE_TEMPLATE/release_checklist.yml @@ -20,6 +20,7 @@ body: - label: File an internal nvbug to communicate test plan & release schedule with QA - label: Ensure all pending PRs are reviewed, tested, and merged - label: Check (or update if needed) the dependency requirements + - label: Sweep deprecations whose stated removal version has arrived (`grep -rn 'deprecated::' cuda_core/cuda`) and remove any that are due - label: "Finalize the doc update, including release notes (\"Note: Touching docstrings/type annotations in code is OK during code freeze, apply your best judgement!\")" - label: Update the docs for the new version - label: Create a public release tag diff --git a/.github/RELEASE-core.md b/.github/RELEASE-core.md index 01e182c76ef..72472a42fdc 100644 --- a/.github/RELEASE-core.md +++ b/.github/RELEASE-core.md @@ -66,6 +66,27 @@ requirements are current. --- +## Sweep deprecations whose removal version has arrived + +Deprecated APIs are marked in the source with a Sphinx `deprecated` +directive naming the version that introduced the deprecation, and their +docstrings state the version in which they will be removed. Find them all +with: + +```console +$ grep -rn 'deprecated::' cuda_core/cuda +``` + +For each hit, check the stated removal version against the version being +released. If the release has reached or passed it, remove the API, its +runtime `DeprecationWarning`, and any tests asserting that warning. + +This must happen *before* the release tag is cut. Removals are breaking +changes, so they are only permitted at a major-version boundary per the +[support policy](https://nvidia.github.io/cuda-python/cuda-core/latest/support.html). + +--- + ## Finalize the doc update, including release notes Review every PR included in the release. For each one, check whether new diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index d1e5512a8bf..d09146cb82d 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -27,12 +27,45 @@ on: required: false type: boolean default: false + build-pathfinder: + required: false + type: boolean + default: true + build-bindings: + required: false + type: boolean + default: true + build-core: + required: false + type: boolean + default: true + build-python: + required: false + type: boolean + default: true + test-bindings: + required: false + type: boolean + default: true + test-core: + required: false + type: boolean + default: true + baseline-run-id: + required: false + type: string + default: "" + baseline-sha: + required: false + type: string + default: "" defaults: run: shell: bash --noprofile --norc -xeuo pipefail {0} permissions: + actions: read contents: read # This is required for actions/checkout jobs: @@ -56,7 +89,7 @@ jobs: filter: blob:none - name: Install latest rapidsai/sccache - if: ${{ startsWith(inputs.host-platform, 'linux') }} + if: ${{ startsWith(inputs.host-platform, 'linux') && (inputs.build-bindings || inputs.build-core) }} run: | curl -fsSL "https://github.com/rapidsai/sccache/releases/latest/download/sccache-$(uname -m)-unknown-linux-musl.tar.gz" \ | sudo tar -C /usr/local/bin -xvzf - --wildcards --strip-components=1 -x '*/sccache' @@ -64,6 +97,7 @@ jobs: # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 - name: Adding addtional GHA cache-related env vars + if: ${{ inputs.build-bindings || inputs.build-core }} uses: actions/github-script@v9 with: script: | @@ -91,7 +125,7 @@ jobs: architecture: ${{ ((inputs.host-platform == 'linux-aarch64' || inputs.host-platform == 'win-arm64') && 'arm64') || 'x64' }} - name: Set up MSVC - if: ${{ startsWith(inputs.host-platform, 'win') }} + if: ${{ startsWith(inputs.host-platform, 'win') && (inputs.build-bindings || inputs.build-core || inputs.test-bindings || inputs.test-core) }} uses: step-security/msvc-dev-cmd@22c98154b708dbd743e6f27a933cf6ceba3305c4 # v1.13.1 with: arch: ${{ (inputs.host-platform == 'win-arm64' && 'arm64') || 'x64' }} @@ -104,7 +138,7 @@ jobs: - name: Set up yq # GitHub made an unprofessional decision to not provide it in their Windows VMs, # see https://github.com/actions/runner-images/issues/7443. - if: ${{ startsWith(inputs.host-platform, 'win') && !inputs.single-cuda-major }} + if: ${{ startsWith(inputs.host-platform, 'win') && inputs.build-core && !inputs.single-cuda-major }} env: YQ_VERSION: v4.52.5 YQ_ARCH: ${{ (inputs.host-platform == 'win-arm64' && 'arm64') || 'amd64' }} @@ -143,11 +177,21 @@ jobs: # To keep the build workflow simple, all matrix jobs will build a wheel for later use within this workflow. - name: Build and check cuda.pathfinder wheel + if: ${{ inputs.build-pathfinder }} run: | pushd cuda_pathfinder pip wheel -v --no-deps . popd + - name: Download reusable cuda.pathfinder wheel + if: ${{ !inputs.build-pathfinder }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: cuda-pathfinder-wheel + path: cuda_pathfinder + github-token: ${{ github.token }} + run-id: ${{ inputs.baseline-run-id }} + - name: List the cuda.pathfinder artifacts directory run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then @@ -161,11 +205,12 @@ jobs: # We only need/want a single pure python wheel, pick linux-64 index 0. # This is what we will use for testing & releasing. - name: Check cuda.pathfinder wheel - if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + if: ${{ inputs.build-pathfinder && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} run: | twine check --strict cuda_pathfinder/*.whl - name: Constrain builds to the local cuda.pathfinder wheel + if: ${{ inputs.build-bindings }} run: | pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl) test "${#pathfinder_wheels[@]}" -eq 1 @@ -187,6 +232,7 @@ jobs: if-no-files-found: error - name: Set up mini CTK + if: ${{ inputs.build-bindings || inputs.build-core || inputs.test-bindings || inputs.test-core }} uses: ./.github/actions/fetch_ctk continue-on-error: false with: @@ -195,6 +241,7 @@ jobs: cuda-channel: ${{ inputs.cuda-channel }} - name: Build cuda.bindings wheel + if: ${{ inputs.build-bindings }} uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 with: package-dir: ./cuda_bindings/ @@ -241,13 +288,22 @@ jobs: echo "ok!" - name: Report sccache stats (cuda.bindings) - if: ${{ !startsWith(inputs.host-platform, 'win') }} + if: ${{ inputs.build-bindings && !startsWith(inputs.host-platform, 'win') }} uses: ./.github/actions/sccache-summary with: json-file: sccache_bindings.json label: "cuda.bindings" build-step: "Build cuda.bindings wheel" + - name: Download reusable cuda.bindings wheel + if: ${{ !inputs.build-bindings }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ env.CUDA_BINDINGS_ARTIFACT_BASENAME }}-${{ inputs.baseline-sha }} + path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + github-token: ${{ github.token }} + run-id: ${{ inputs.baseline-run-id }} + - name: List the cuda.bindings artifacts directory run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then @@ -259,10 +315,12 @@ jobs: ls -lahR ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - name: Check cuda.bindings wheel + if: ${{ inputs.build-bindings }} run: | twine check --strict ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl - name: Constrain cuda.core to the local cuda.bindings wheel + if: ${{ inputs.build-core }} run: | pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl) bindings_wheels=("${CUDA_BINDINGS_ARTIFACTS_DIR}"/cuda_bindings-"${BUILD_CUDA_MAJOR}".*.whl) @@ -291,6 +349,7 @@ jobs: if-no-files-found: error - name: Build cuda.core wheel + if: ${{ inputs.build-core }} uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 with: package-dir: ./cuda_core/ @@ -339,7 +398,7 @@ jobs: echo "ok!" - name: Report sccache stats (cuda.core) - if: ${{ !startsWith(inputs.host-platform, 'win') }} + if: ${{ inputs.build-core && !startsWith(inputs.host-platform, 'win') }} uses: ./.github/actions/sccache-summary with: json-file: sccache_core.json @@ -347,6 +406,7 @@ jobs: build-step: "Build cuda.core wheel" - name: List the cuda.core artifacts directory and rename + if: ${{ inputs.build-core }} run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then export CHOWN=chown @@ -369,7 +429,7 @@ jobs: ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - name: Finalize single-major cuda.core wheel - if: ${{ inputs.single-cuda-major }} + if: ${{ inputs.single-cuda-major && inputs.build-core }} run: | for wheel in "${{ env.CUDA_CORE_ARTIFACTS_DIR }}"/cu"${BUILD_CUDA_MAJOR}"/*.cu"${BUILD_CUDA_MAJOR}".whl; do base_name=$(basename "${wheel}" ".cu${BUILD_CUDA_MAJOR}.whl") @@ -377,15 +437,33 @@ jobs: done ls -lahR "${{ env.CUDA_CORE_ARTIFACTS_DIR }}" + - name: Download reusable cuda.core wheel + if: ${{ !inputs.build-core }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_BASENAME }}-${{ inputs.baseline-sha }} + path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} + github-token: ${{ github.token }} + run-id: ${{ inputs.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: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} + if: ${{ inputs.build-python && strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} run: | pushd cuda_python pip wheel -v --no-deps . twine check --strict *.whl popd + - name: Download reusable cuda-python wheel + if: ${{ !inputs.build-python && 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 + github-token: ${{ github.token }} + run-id: ${{ inputs.baseline-run-id }} + - name: List the cuda-python artifacts directory if: ${{ strategy.job-index == 0 && inputs.host-platform == 'linux-64' }} run: | @@ -406,8 +484,8 @@ jobs: if-no-files-found: error - name: Set up Python - if: ${{ !inputs.single-cuda-major }} id: setup-python2 + if: ${{ !inputs.single-cuda-major && (inputs.test-bindings || inputs.test-core) }} uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 with: python-version: ${{ matrix.python-version }} @@ -416,17 +494,17 @@ jobs: allow-prereleases: ${{ startsWith(matrix.python-version, '3.15') }} - name: Enable Scientific Python Nightly Wheels for Python 3.15 - if: ${{ !inputs.single-cuda-major && startsWith(matrix.python-version, '3.15') }} + if: ${{ !inputs.single-cuda-major && (inputs.test-bindings || inputs.test-core) && startsWith(matrix.python-version, '3.15') }} run: | echo "PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" >> "$GITHUB_ENV" echo "PIP_ONLY_BINARY=numpy" >> "$GITHUB_ENV" - name: verify free-threaded build - if: ${{ !inputs.single-cuda-major && endsWith(matrix.python-version, 't') }} + if: ${{ !inputs.single-cuda-major && (inputs.test-bindings || inputs.test-core) && endsWith(matrix.python-version, 't') }} run: python -c 'import sys; assert not sys._is_gil_enabled()' - name: Set up Python include paths - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && (inputs.test-bindings || inputs.test-core) }} run: | if [[ "${{ inputs.host-platform }}" == linux* ]]; then echo "CPLUS_INCLUDE_PATH=${Python3_ROOT_DIR}/include/python${{ matrix.python-version }}" >> $GITHUB_ENV @@ -437,19 +515,19 @@ jobs: echo "PY_EXT_SUFFIX=$(python -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))")" >> $GITHUB_ENV - name: Install cuda.pathfinder (required for next step) - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && (inputs.test-bindings || inputs.test-core) }} run: | pip install cuda_pathfinder/*.whl - name: Hide GNU link.exe so Meson finds MSVC link.exe - if: ${{ !inputs.single-cuda-major && startsWith(inputs.host-platform, 'win') }} + if: ${{ !inputs.single-cuda-major && startsWith(inputs.host-platform, 'win') && (inputs.test-bindings || inputs.test-core) }} run: | if [ -f "/c/Program Files/Git/usr/bin/link.exe" ]; then mv "/c/Program Files/Git/usr/bin/link.exe" "/c/Program Files/Git/usr/bin/link.exe.bak" fi - name: Build cuda.bindings Cython tests - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.test-bindings }} run: | pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl --group ./cuda_bindings/pyproject.toml:test pushd ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }} @@ -457,7 +535,7 @@ jobs: popd - name: Upload cuda.bindings Cython tests - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.test-bindings }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests @@ -465,15 +543,25 @@ jobs: if-no-files-found: error - name: Build cuda.core Cython tests - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.test-core }} run: | - pip install ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/"cu${BUILD_CUDA_MAJOR}"/*.whl --group ./cuda_core/pyproject.toml:test + pip install ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl + if ${{ inputs.build-core }}; then + core_wheel=$(find "${{ env.CUDA_CORE_ARTIFACTS_DIR }}/cu${BUILD_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.core Cython tests - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.test-core }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests @@ -482,7 +570,7 @@ jobs: # Note: This overwrites CUDA_PATH etc - name: Set up mini CTK - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && (inputs.build-core || inputs.test-core) }} uses: ./.github/actions/fetch_ctk continue-on-error: false with: @@ -491,13 +579,13 @@ jobs: cuda-path: "./cuda_toolkit_prev" - name: Build cuda.core test binaries - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.test-core }} run: | nvcc --version python "${{ env.CUDA_CORE_TEST_BINARIES_DIR }}/build_test_binaries.py" - name: Upload cuda.core test binaries - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.test-core }} uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries @@ -508,7 +596,7 @@ jobs: if-no-files-found: error - name: Download cuda.bindings build artifacts from the prior branch - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.build-core }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -526,10 +614,14 @@ jobs: OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml) OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" - LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI") + OLD_WHEEL_ARTIFACT_PATTERN="${OLD_BASENAME}[0-9a-f]" + LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id \ + --branch "${OLD_BRANCH}" \ + --artifact "${OLD_WHEEL_ARTIFACT_PATTERN}" \ + NVIDIA/cuda-python "CI") PREV_BINDINGS_DIR="cuda_bindings/dist-prev" - gh run download $LATEST_PRIOR_RUN_ID -p ${OLD_BASENAME} -R NVIDIA/cuda-python + gh run download "${LATEST_PRIOR_RUN_ID}" -p "${OLD_BASENAME}" -R NVIDIA/cuda-python rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts ls -al $OLD_BASENAME mkdir -p "${PREV_BINDINGS_DIR}" @@ -537,6 +629,7 @@ jobs: rmdir $OLD_BASENAME - name: Constrain previous cuda.core to the downloaded cuda.bindings wheel + if: ${{ !inputs.single-cuda-major && inputs.build-core }} run: | pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl) bindings_wheels=(cuda_bindings/dist-prev/cuda_bindings-"${BUILD_PREV_CUDA_MAJOR}".*.whl) @@ -558,7 +651,7 @@ jobs: } | tee wheel-constraints/cuda-core-prev.txt - name: Build cuda.core wheel - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.build-core }} uses: pypa/cibuildwheel@4726cd35bb13f7bde50cf2761f2499ac7b3aa32c # v4.1.1 with: package-dir: ./cuda_core/ @@ -607,7 +700,7 @@ jobs: echo "ok!" - name: Report sccache stats (cuda.core prev) - if: ${{ !inputs.single-cuda-major && !startsWith(inputs.host-platform, 'win') }} + if: ${{ !inputs.single-cuda-major && inputs.build-core && !startsWith(inputs.host-platform, 'win') }} uses: ./.github/actions/sccache-summary with: json-file: sccache_core_prev.json @@ -615,7 +708,7 @@ jobs: build-step: "Build cuda.core wheel" - name: List the cuda.core artifacts directory and rename - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.build-core }} run: | if [[ "${{ inputs.host-platform }}" == win* ]]; then export CHOWN=chown @@ -639,7 +732,7 @@ jobs: ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - name: Merge cuda.core wheels - if: ${{ !inputs.single-cuda-major }} + if: ${{ !inputs.single-cuda-major && inputs.build-core }} run: | pip install wheel python ci/tools/merge_cuda_core_wheels.py \ @@ -648,6 +741,7 @@ jobs: --output-dir "${{ env.CUDA_CORE_ARTIFACTS_DIR }}" - name: Check cuda.core wheel + if: ${{ inputs.build-core }} run: | twine check --strict ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl diff --git a/.github/workflows/ci-nightly.yml b/.github/workflows/ci-nightly.yml index 0188ebf2524..faae759d9ba 100644 --- a/.github/workflows/ci-nightly.yml +++ b/.github/workflows/ci-nightly.yml @@ -49,6 +49,7 @@ jobs: python -m pytest -v --noconftest ci/tools/tests find-wheels: + if: ${{ github.repository_owner == 'nvidia' }} runs-on: ubuntu-latest outputs: RUN_ID: ${{ steps.find.outputs.run_id }} @@ -309,7 +310,7 @@ jobs: checks: name: Nightly check status - if: always() + if: ${{ always() && github.repository_owner == 'nvidia' }} runs-on: ubuntu-latest needs: - test-ci-tools-for-release diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca3c31ea7dc..a3583a57098 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -486,7 +486,7 @@ jobs: host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} - skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }} + test-bindings: ${{ fromJSON(needs.detect-changes.outputs.test_bindings) }} # See test-linux-64 for why test jobs are split by platform. test-linux-aarch64: @@ -511,7 +511,7 @@ jobs: host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} - skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }} + test-bindings: ${{ fromJSON(needs.detect-changes.outputs.test_bindings) }} # See test-linux-64 for why test jobs are split by platform. test-windows: @@ -536,7 +536,7 @@ jobs: host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} nruns: ${{ (github.event_name == 'schedule' && 5) || 1}} - skip-bindings-test: ${{ !fromJSON(needs.detect-changes.outputs.test_bindings) }} + test-bindings: ${{ fromJSON(needs.detect-changes.outputs.test_bindings) }} doc: name: Docs @@ -584,7 +584,7 @@ jobs: shell: bash run: | set -euxo pipefail - SKIP=lychee pre-commit run --all-files + SKIP=lychee,check-pixi-cuda-version pre-commit run --all-files checks: name: Check job status diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 87bcd8e58d5..00000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,46 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 - -name: "Static Analysis: CodeQL Scan" - -on: - push: - branches: - - "pull-request/[0-9]+" - - "ctk-next" - - "main" -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} - cancel-in-progress: true - -jobs: - analyze: - name: Analyze (${{ matrix.language }}) - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - include: - - language: python - build-mode: none - steps: - - name: Checkout repository - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 - - - name: Initialize CodeQL - uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 - with: - languages: ${{ matrix.language }} - build-mode: ${{ matrix.build-mode }} - queries: security-extended - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/pr-metadata-check.yml b/.github/workflows/pr-metadata-check.yml index 6f60ec45bf4..62110dcd93b 100644 --- a/.github/workflows/pr-metadata-check.yml +++ b/.github/workflows/pr-metadata-check.yml @@ -17,6 +17,9 @@ on: - reopened - ready_for_review +permissions: + pull-requests: read + jobs: check-metadata: name: PR has assignee, labels, and milestone diff --git a/.github/workflows/security-suite.yml b/.github/workflows/security-suite.yml new file mode 100644 index 00000000000..0902db6119a --- /dev/null +++ b/.github/workflows/security-suite.yml @@ -0,0 +1,47 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 +# +# CI security scanning via the NVIDIA/security-workflows suite: Pulse secret scan + CodeQL SAST. +# Pulse runs on Linux nv-gha-runners (Docker image + OIDC/Vault) — Linux-only by design. +# The local secret-scan-trufflehog pre-commit hook is cross-platform (Linux/macOS/Windows). +# Pinned to a reviewed commit SHA. + +name: Security Suite (Pulse + CodeQL) + +on: + push: + branches: + - main + - ctk-next + - "pull-request/[0-9]+" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-on-${{ github.event_name }}-from-${{ github.ref_name }} + cancel-in-progress: true + +# Caller must grant every permission the reusable workflow declares, including scans it disables. +permissions: + contents: read + id-token: write # OIDC -> Vault -> nvcr.io image pull + security-events: write # publish redacted SARIF to code scanning + actions: read + +jobs: + security-suite: + name: Security Suite + # Pulse needs nv-gha-runners + Vault/nvcr vars; skip on forks. + if: github.repository == 'NVIDIA/cuda-python' + uses: NVIDIA/security-workflows/.github/workflows/security-suite.yml@711025b090f2aa728da576700750b195d1e816dc # v0.3.0 + with: + enable-secret-scan: true + enable-sast-scan: true + secret-runs-on: linux-amd64-cpu4 + # Set failure_policy explicitly so enforcement can't drift with upstream defaults. + # unverified — fail on verified/live secrets (183); warn on unverified (185) [default] + # strict — fail on any finding (verified or unverified) + # all — warn only; never fail the job on findings + secret-failure-policy: unverified + # Same analysis the retired codeql.yml performed: python, build-mode none, security-extended. + sast-languages: '["python"]' diff --git a/.github/workflows/test-sdist-linux.yml b/.github/workflows/test-sdist-linux.yml index e88f358bf3f..8d7f250a233 100644 --- a/.github/workflows/test-sdist-linux.yml +++ b/.github/workflows/test-sdist-linux.yml @@ -15,17 +15,35 @@ on: required: false type: string default: stable + build-pathfinder: + required: false + default: true + type: boolean + build-bindings: + required: false + default: true + type: boolean + build-core: + required: false + default: true + type: boolean + build-python: + required: false + default: true + type: boolean defaults: run: shell: bash --noprofile --norc -xeuo pipefail {0} permissions: + actions: read # This is required for actions/download-artifact contents: read # This is required for actions/checkout jobs: test-sdist: name: Test sdist builds + if: ${{ inputs.build-pathfinder || inputs.build-bindings || inputs.build-core || inputs.build-python }} timeout-minutes: 60 runs-on: linux-amd64-cpu8 steps: @@ -47,16 +65,26 @@ jobs: # Pure Python packages -- no CTK needed. - name: Build cuda.pathfinder sdist and wheel-from-sdist + if: ${{ inputs.build-pathfinder }} run: | python -m build --sdist cuda_pathfinder/ pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz - name: Build cuda-python sdist and wheel-from-sdist + if: ${{ inputs.build-python }} run: | python -m build --sdist cuda_python/ pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz + - name: Download cuda.pathfinder wheel + if: ${{ !inputs.build-pathfinder && (inputs.build-bindings || inputs.build-core) }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: cuda-pathfinder-wheel + path: cuda_pathfinder/dist + - name: Constrain builds to the local cuda.pathfinder wheel + if: ${{ inputs.build-bindings }} run: | pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl) test "${#pathfinder_wheels[@]}" -eq 1 @@ -69,12 +97,14 @@ jobs: # The env vars ACTIONS_CACHE_SERVICE_V2, ACTIONS_RESULTS_URL, and ACTIONS_RUNTIME_TOKEN # are exposed by this action. - name: Enable sccache + if: ${{ inputs.build-bindings || inputs.build-core }} uses: mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # 0.0.10 with: disable_annotations: 'true' # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 - name: Adding additional GHA cache-related env vars + if: ${{ inputs.build-bindings || inputs.build-core }} uses: actions/github-script@v9 with: script: | @@ -82,12 +112,14 @@ jobs: core.exportVariable('ACTIONS_RUNTIME_URL', process.env['ACTIONS_RUNTIME_URL']) - name: Setup proxy cache + if: ${{ inputs.build-bindings || inputs.build-core }} uses: nv-gha-runners/setup-proxy-cache@main continue-on-error: true with: enable-apt: true - name: Set up mini CTK + if: ${{ inputs.build-bindings || inputs.build-core }} uses: ./.github/actions/fetch_ctk continue-on-error: false with: @@ -98,6 +130,7 @@ jobs: # cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH # (set by fetch_ctk) must be available for both sdist and wheel builds. - name: Build cuda.bindings sdist and wheel-from-sdist + if: ${{ inputs.build-bindings }} run: | export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) export CC="sccache cc" @@ -107,7 +140,15 @@ jobs: python -m build --sdist cuda_bindings/ pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz + - name: Download cuda.bindings wheel + if: ${{ !inputs.build-bindings && inputs.build-core }} + 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 + - name: Constrain cuda.core to the local cuda.bindings wheel + if: ${{ inputs.build-core }} run: | CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl) @@ -128,6 +169,7 @@ jobs: # wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via # get_requires_for_build_wheel in build_hooks.py). - name: Build cuda.core sdist and wheel-from-sdist + if: ${{ inputs.build-core }} run: | export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" @@ -139,5 +181,5 @@ jobs: pip wheel --no-deps --wheel-dir cuda_core/dist cuda_core/dist/*.tar.gz - name: Show sccache stats - if: always() + if: ${{ always() && (inputs.build-bindings || inputs.build-core) }} run: sccache --show-stats diff --git a/.github/workflows/test-sdist-windows.yml b/.github/workflows/test-sdist-windows.yml index 8ebd9738f0f..40d65e75c4c 100644 --- a/.github/workflows/test-sdist-windows.yml +++ b/.github/workflows/test-sdist-windows.yml @@ -21,17 +21,35 @@ on: required: false type: string default: stable + build-pathfinder: + required: false + default: true + type: boolean + build-bindings: + required: false + default: true + type: boolean + build-core: + required: false + default: true + type: boolean + build-python: + required: false + default: true + type: boolean defaults: run: shell: bash --noprofile --norc -xeuo pipefail {0} permissions: + actions: read # This is required for actions/download-artifact contents: read # This is required for actions/checkout jobs: test-sdist: name: Test sdist builds + if: ${{ inputs.build-pathfinder || inputs.build-bindings || inputs.build-core || inputs.build-python }} timeout-minutes: 60 runs-on: windows-2022 steps: @@ -49,6 +67,7 @@ jobs: python-version: "3.12" - name: Set up MSVC + if: ${{ inputs.build-bindings || inputs.build-core }} uses: step-security/msvc-dev-cmd@22c98154b708dbd743e6f27a933cf6ceba3305c4 # v1.13.1 - name: Install build tools @@ -56,16 +75,26 @@ jobs: # Pure Python packages -- no CTK needed. - name: Build cuda.pathfinder sdist and wheel-from-sdist + if: ${{ inputs.build-pathfinder }} run: | python -m build --sdist cuda_pathfinder/ pip wheel --no-deps --wheel-dir cuda_pathfinder/dist cuda_pathfinder/dist/*.tar.gz - name: Build cuda-python sdist and wheel-from-sdist + if: ${{ inputs.build-python }} run: | python -m build --sdist cuda_python/ pip wheel --no-deps --wheel-dir cuda_python/dist cuda_python/dist/*.tar.gz + - name: Download cuda.pathfinder wheel + if: ${{ !inputs.build-pathfinder && (inputs.build-bindings || inputs.build-core) }} + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: cuda-pathfinder-wheel + path: cuda_pathfinder/dist + - name: Constrain builds to the local cuda.pathfinder wheel + if: ${{ inputs.build-bindings }} run: | pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl) test "${#pathfinder_wheels[@]}" -eq 1 @@ -78,6 +107,7 @@ jobs: # smoke test, not a production build; see build-wheel.yml which also # limits sccache to Linux). - name: Set up mini CTK + if: ${{ inputs.build-bindings || inputs.build-core }} uses: ./.github/actions/fetch_ctk continue-on-error: false with: @@ -90,6 +120,7 @@ jobs: # Constraint paths are passed as native Windows paths because the pip # subprocesses run outside Git Bash. - name: Build cuda.bindings sdist and wheel-from-sdist + if: ${{ inputs.build-bindings }} run: | export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) export PIP_BUILD_CONSTRAINT="$(cygpath -w "$(pwd)/wheel-constraints/cuda-bindings.txt")" @@ -97,7 +128,15 @@ jobs: python -m build --sdist cuda_bindings/ pip wheel --no-deps --wheel-dir cuda_bindings/dist cuda_bindings/dist/*.tar.gz + - name: Download cuda.bindings wheel + if: ${{ !inputs.build-bindings && inputs.build-core }} + 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 + - name: Constrain cuda.core to the local cuda.bindings wheel + if: ${{ inputs.build-core }} run: | CUDA_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" pathfinder_wheels=(cuda_pathfinder/dist/cuda_pathfinder-*.whl) @@ -118,6 +157,7 @@ jobs: # wheel-from-sdist needs CTK and cuda-bindings (dynamic build dep via # get_requires_for_build_wheel in build_hooks.py). - name: Build cuda.core sdist and wheel-from-sdist + if: ${{ inputs.build-core }} run: | export CUDA_PYTHON_PARALLEL_LEVEL=$(nproc) export CUDA_CORE_BUILD_MAJOR="$(echo '${{ inputs.cuda-version }}' | cut -d. -f1)" diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 4235e01d321..2fd918e2859 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -22,13 +22,18 @@ on: nruns: type: number default: 1 - # When true, cuda.bindings tests (and the Cython tests that depend on - # them) are skipped even when CTK majors match. Callers set this based - # on the output of the detect-changes job in ci.yml so PRs that only - # touch unrelated modules avoid the expensive bindings test suite. - skip-bindings-test: + test-pathfinder: type: boolean - default: false + default: true + test-bindings: + type: boolean + default: true + test-core: + type: boolean + default: true + test-python: + type: boolean + default: true run-id: description: > Workflow run ID to download artifacts from. @@ -159,7 +164,7 @@ jobs: LOCAL_CTK: ${{ matrix.LOCAL_CTK }} PY_VER: ${{ matrix.PY_VER }} SHA: ${{ inputs.sha || github.sha }} - SKIP_BINDINGS_TEST_OVERRIDE: ${{ inputs.skip-bindings-test && '1' || '0' }} + SKIP_BINDINGS_TEST_OVERRIDE: ${{ !inputs.test-bindings && '1' || '0' }} run: ./ci/tools/env-vars test - name: Apply extra matrix environment variables @@ -169,6 +174,7 @@ jobs: run: echo "$MATRIX_ENV" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> "$GITHUB_ENV" - name: Download cuda-pathfinder build artifacts + if: ${{ inputs.test-pathfinder || inputs.test-bindings || inputs.test-core || inputs.test-python }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel @@ -177,7 +183,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python build artifacts - if: ${{ env.BINDINGS_SOURCE == 'main' }} + if: ${{ inputs.test-python && env.BINDINGS_SOURCE == 'main' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-python-wheel @@ -186,7 +192,8 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda.bindings build artifacts - if: ${{ env.BINDINGS_SOURCE == 'main' }} + if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) && + env.BINDINGS_SOURCE == 'main' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} @@ -195,7 +202,8 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python & cuda.bindings build artifacts from the prior branch - if: ${{ env.BINDINGS_SOURCE == 'backport' }} + if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) && + env.BINDINGS_SOURCE == 'backport' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | @@ -211,34 +219,46 @@ jobs: OLD_BRANCH=${{ needs.compute-matrix.outputs.OLD_BRANCH }} OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" - LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI") + OLD_WHEEL_ARTIFACT_PATTERN="${OLD_BASENAME}[0-9a-f]" + LOOKUP_ARGS=( + --branch "${OLD_BRANCH}" + --artifact "${OLD_WHEEL_ARTIFACT_PATTERN}" + ) + if ${{ inputs.test-python }}; 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_BASENAME} -R NVIDIA/cuda-python + gh run download "${LATEST_PRIOR_RUN_ID}" -p "${OLD_BASENAME}" -R NVIDIA/cuda-python rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts ls -al $OLD_BASENAME mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" mv $OLD_BASENAME/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/ rmdir $OLD_BASENAME - gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python - ls -al cuda-python-wheel - mv cuda-python-wheel/*.whl . - rmdir cuda-python-wheel + if ${{ inputs.test-python }}; 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.BINDINGS_SOURCE != 'published' }} + if: ${{ inputs.test-python && env.BINDINGS_SOURCE != 'published' }} run: | pwd ls -lah cuda_python*.whl cuda_pathfinder/ - name: Display structure of downloaded cuda.bindings artifacts - if: ${{ env.BINDINGS_SOURCE != 'published' }} + if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) && + env.BINDINGS_SOURCE != 'published' }} run: | pwd ls -lahR $CUDA_BINDINGS_ARTIFACTS_DIR - name: Download cuda.bindings Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} + if: ${{ inputs.test-bindings && env.SKIP_CYTHON_TEST == '0' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests @@ -247,12 +267,13 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.bindings Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} + if: ${{ inputs.test-bindings && env.SKIP_CYTHON_TEST == '0' }} run: | pwd ls -lahR $CUDA_BINDINGS_CYTHON_TESTS_DIR - name: Download cuda.core build artifacts + if: ${{ inputs.test-core }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} @@ -261,12 +282,13 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core build artifacts + if: ${{ inputs.test-core }} run: | pwd ls -lahR $CUDA_CORE_ARTIFACTS_DIR - name: Download cuda.core Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} + if: ${{ inputs.test-core && env.SKIP_CYTHON_TEST == '0' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests @@ -275,12 +297,13 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} + if: ${{ inputs.test-core && env.SKIP_CYTHON_TEST == '0' }} run: | pwd ls -lahR $CUDA_CORE_CYTHON_TESTS_DIR - name: Download cuda.core test binaries + if: ${{ inputs.test-core }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries @@ -289,6 +312,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core test binaries + if: ${{ inputs.test-core }} run: | pwd ls -lahR $CUDA_CORE_TEST_BINARIES_DIR @@ -304,7 +328,8 @@ jobs: AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache" - name: Enable Scientific Python Nightly Wheels for Python 3.15 - if: ${{ startsWith(matrix.PY_VER, '3.15') }} + if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) && + startsWith(matrix.PY_VER, '3.15') }} run: | echo "PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" >> "$GITHUB_ENV" echo "PIP_ONLY_BINARY=numpy" >> "$GITHUB_ENV" @@ -318,7 +343,7 @@ jobs: cuda-version: ${{ matrix.CUDA_VER }} - name: Set up latest cuda_sanitizer_api - if: ${{ env.SETUP_SANITIZER == '1' }} + if: ${{ (inputs.test-bindings || inputs.test-core) && env.SETUP_SANITIZER == '1' }} uses: ./.github/actions/fetch_ctk continue-on-error: false with: @@ -327,6 +352,7 @@ jobs: cuda-components: "cuda_sanitizer_api" - name: Set up compute-sanitizer + if: ${{ inputs.test-bindings || inputs.test-core }} run: setup-sanitizer - name: Set up test repetition on nightly runs @@ -334,7 +360,7 @@ jobs: # ── Standard test steps (skipped for nightly modes) ── - name: Run cuda.pathfinder tests with see_what_works - if: ${{ inputs.test-mode == 'standard' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }} env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works @@ -342,14 +368,14 @@ jobs: run: run-tests pathfinder - name: Run cuda.bindings tests - if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-bindings && env.SKIP_CUDA_BINDINGS_TEST == '0' }} env: CUDA_VER: ${{ matrix.CUDA_VER }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} run: run-tests bindings - name: Run cuda.bindings benchmarks (smoke test) - if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-bindings && env.SKIP_CUDA_BINDINGS_TEST == '0' }} run: | pip install pyperf pushd benchmarks/cuda_bindings @@ -357,25 +383,35 @@ jobs: popd - name: Run cuda.core tests - if: ${{ inputs.test-mode == 'standard' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-core }} env: CUDA_VER: ${{ matrix.CUDA_VER }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} run: run-tests core - name: Ensure cuda-python installable - if: ${{ inputs.test-mode == 'standard' && env.BINDINGS_SOURCE == 'main' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-python && env.BINDINGS_SOURCE == 'main' }} run: | - # Subpackages are already installed from CI artifacts; --no-deps keeps - # tag-release cuda-core wheels from being replaced by PyPI pins. - if [[ "${{ matrix.LOCAL_CTK }}" == 1 ]]; then - pip install --only-binary=:all: --no-deps cuda_python*.whl + # Package suites install their own dependencies. A metapackage-only + # run has no preceding suite, so install the exact local internal + # wheels in one transaction while resolving released dependencies + # such as cuda-core from the package index. + if ${{ inputs.test-bindings || inputs.test-core }}; then + dependency_args=(--no-deps) else - pip install --only-binary=:all: --no-deps $(ls cuda_python*.whl)[all] + dependency_args=( + ./cuda_pathfinder/cuda_pathfinder-*.whl + "${CUDA_BINDINGS_ARTIFACTS_DIR}"/cuda_bindings-*.whl + ) + fi + python_requirements=(cuda_python*.whl) + if [[ "${{ matrix.LOCAL_CTK }}" != 1 ]]; then + python_requirements=("${python_requirements[@]/%/[all]}") fi + pip install --only-binary=:all: "${dependency_args[@]}" "${python_requirements[@]}" - name: Install cuda.pathfinder extra wheels for testing - if: ${{ inputs.test-mode == 'standard' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }} run: | set -euo pipefail pushd cuda_pathfinder @@ -384,7 +420,7 @@ jobs: popd - name: Run cuda.pathfinder tests with all_must_work - if: ${{ inputs.test-mode == 'standard' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }} env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 91da06d9eac..1af7c4b625b 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -22,13 +22,18 @@ on: nruns: type: number default: 1 - # When true, cuda.bindings tests (and the Cython tests that depend on - # them) are skipped even when CTK majors match. Callers set this based - # on the output of the detect-changes job in ci.yml so PRs that only - # touch unrelated modules avoid the expensive bindings test suite. - skip-bindings-test: + test-pathfinder: type: boolean - default: false + default: true + test-bindings: + type: boolean + default: true + test-core: + type: boolean + default: true + test-python: + type: boolean + default: true run-id: description: > Workflow run ID to download artifacts from. @@ -146,7 +151,7 @@ jobs: LOCAL_CTK: ${{ matrix.LOCAL_CTK }} PY_VER: ${{ matrix.PY_VER }} SHA: ${{ inputs.sha || github.sha }} - SKIP_BINDINGS_TEST_OVERRIDE: ${{ inputs.skip-bindings-test && '1' || '0' }} + SKIP_BINDINGS_TEST_OVERRIDE: ${{ !inputs.test-bindings && '1' || '0' }} shell: bash --noprofile --norc -xeuo pipefail {0} run: ./ci/tools/env-vars test @@ -158,6 +163,7 @@ jobs: run: echo "$MATRIX_ENV" | jq -r 'to_entries[] | "\(.key)=\(.value)"' >> "$GITHUB_ENV" - name: Download cuda-pathfinder build artifacts + if: ${{ inputs.test-pathfinder || inputs.test-bindings || inputs.test-core || inputs.test-python }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-pathfinder-wheel @@ -166,7 +172,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python build artifacts - if: ${{ env.BINDINGS_SOURCE == 'main' }} + if: ${{ inputs.test-python && env.BINDINGS_SOURCE == 'main' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: cuda-python-wheel @@ -175,7 +181,8 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda.bindings build artifacts - if: ${{ env.BINDINGS_SOURCE == 'main' }} + if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) && + env.BINDINGS_SOURCE == 'main' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} @@ -184,41 +191,54 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Download cuda-python & cuda.bindings build artifacts from the prior branch - if: ${{ env.BINDINGS_SOURCE == 'backport' }} + if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) && + env.BINDINGS_SOURCE == 'backport' }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash --noprofile --norc -xeuo pipefail {0} run: | OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml) OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" - LATEST_PRIOR_RUN_ID=$(./ci/tools/lookup-run-id --branch "${OLD_BRANCH}" NVIDIA/cuda-python "CI") + OLD_WHEEL_ARTIFACT_PATTERN="${OLD_BASENAME}[0-9a-f]" + LOOKUP_ARGS=( + --branch "${OLD_BRANCH}" + --artifact "${OLD_WHEEL_ARTIFACT_PATTERN}" + ) + if ${{ inputs.test-python }}; 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_BASENAME} -R NVIDIA/cuda-python + gh run download "${LATEST_PRIOR_RUN_ID}" -p "${OLD_BASENAME}" -R NVIDIA/cuda-python rm -rf ${OLD_BASENAME}-tests # exclude cython test artifacts ls -al $OLD_BASENAME mkdir -p "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" mv $OLD_BASENAME/*.whl "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}"/ rmdir $OLD_BASENAME - gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python - ls -al cuda-python-wheel - mv cuda-python-wheel/*.whl . - rmdir cuda-python-wheel + if ${{ inputs.test-python }}; 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.BINDINGS_SOURCE != 'published' }} + if: ${{ inputs.test-python && env.BINDINGS_SOURCE != 'published' }} run: | Get-Location Get-ChildItem cuda_python*.whl | Select-Object Mode, LastWriteTime, Length, FullName - name: Display structure of downloaded cuda.bindings artifacts - if: ${{ env.BINDINGS_SOURCE != 'published' }} + if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) && + env.BINDINGS_SOURCE != 'published' }} run: | Get-Location Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - name: Download cuda.bindings Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} + if: ${{ inputs.test-bindings && env.SKIP_CYTHON_TEST == '0' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests @@ -227,12 +247,13 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.bindings Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} + if: ${{ inputs.test-bindings && env.SKIP_CYTHON_TEST == '0' }} run: | Get-Location Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_CYTHON_TESTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - name: Download cuda.core build artifacts + if: ${{ inputs.test-core }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} @@ -241,12 +262,13 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core build artifacts + if: ${{ inputs.test-core }} run: | Get-Location Get-ChildItem -Recurse -Force $env:CUDA_CORE_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - name: Download cuda.core Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} + if: ${{ inputs.test-core && env.SKIP_CYTHON_TEST == '0' }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests @@ -255,12 +277,13 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} + if: ${{ inputs.test-core && env.SKIP_CYTHON_TEST == '0' }} run: | Get-Location Get-ChildItem -Recurse -Force $env:CUDA_CORE_CYTHON_TESTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - name: Download cuda.core test binaries + if: ${{ inputs.test-core }} uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-test-binaries @@ -269,6 +292,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Display structure of downloaded cuda.core test binaries + if: ${{ inputs.test-core }} run: | Get-Location Get-ChildItem -Recurse -Force $env:CUDA_CORE_TEST_BINARIES_DIR | Select-Object Mode, LastWriteTime, Length, FullName @@ -281,7 +305,8 @@ jobs: allow-prereleases: ${{ startsWith(matrix.PY_VER, '3.15') }} - name: Enable Scientific Python Nightly Wheels for Python 3.15 - if: ${{ startsWith(matrix.PY_VER, '3.15') }} + if: ${{ (inputs.test-bindings || inputs.test-core || inputs.test-python) && + startsWith(matrix.PY_VER, '3.15') }} shell: bash --noprofile --norc -xeuo pipefail {0} run: | echo "PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" >> "$GITHUB_ENV" @@ -310,7 +335,7 @@ jobs: # ── Standard test steps (skipped for nightly modes) ── - name: Run cuda.pathfinder tests with see_what_works - if: ${{ inputs.test-mode == 'standard' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }} env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works @@ -319,7 +344,7 @@ jobs: run: run-tests pathfinder - name: Run cuda.bindings tests - if: ${{ inputs.test-mode == 'standard' && env.SKIP_CUDA_BINDINGS_TEST == '0' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-bindings && env.SKIP_CUDA_BINDINGS_TEST == '0' }} env: CUDA_VER: ${{ matrix.CUDA_VER }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} @@ -327,7 +352,7 @@ jobs: run: run-tests bindings - name: Run cuda.core tests - if: ${{ inputs.test-mode == 'standard' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-core }} env: CUDA_VER: ${{ matrix.CUDA_VER }} LOCAL_CTK: ${{ matrix.LOCAL_CTK }} @@ -335,18 +360,28 @@ jobs: run: run-tests core - name: Ensure cuda-python installable - if: ${{ inputs.test-mode == 'standard' && env.BINDINGS_SOURCE == 'main' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-python && env.BINDINGS_SOURCE == 'main' }} run: | - # Subpackages are already installed from CI artifacts; --no-deps keeps - # tag-release cuda-core wheels from being replaced by PyPI pins. - if ('${{ matrix.LOCAL_CTK }}' -eq '1') { - pip install --only-binary=:all: --no-deps (Get-ChildItem -Filter cuda_python*.whl).FullName + # Package suites install their own dependencies. A metapackage-only + # run has no preceding suite, so install the exact local internal + # wheels in one transaction while resolving released dependencies + # such as cuda-core from the package index. + if ('${{ inputs.test-bindings || inputs.test-core }}' -eq 'true') { + $dependencyArgs = @('--no-deps') } else { - pip install --only-binary=:all: --no-deps "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]" + $dependencyArgs = @( + (Get-Item ./cuda_pathfinder/cuda_pathfinder-*.whl).FullName + (Get-Item "$env:CUDA_BINDINGS_ARTIFACTS_DIR/cuda_bindings-*.whl").FullName + ) + } + $pythonRequirements = @((Get-Item ./cuda_python*.whl).FullName) + if ('${{ matrix.LOCAL_CTK }}' -ne '1') { + $pythonRequirements = @($pythonRequirements | ForEach-Object { "$($_)[all]" }) } + pip install --only-binary=:all: @dependencyArgs @pythonRequirements - name: Install cuda.pathfinder extra wheels for testing - if: ${{ inputs.test-mode == 'standard' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }} shell: bash --noprofile --norc -xeuo pipefail {0} run: | pushd cuda_pathfinder @@ -355,7 +390,7 @@ jobs: popd - name: Run cuda.pathfinder tests with all_must_work - if: ${{ inputs.test-mode == 'standard' }} + if: ${{ inputs.test-mode == 'standard' && inputs.test-pathfinder }} env: CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 451e665cbf6..5b188fd4454 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,12 +9,20 @@ ci: autoupdate_branch: '' autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate' autoupdate_schedule: quarterly - skip: [lychee, check-precommit-installed] + skip: [lychee, check-precommit-installed, secret-scan-trufflehog, check-pixi-cuda-version] submodules: false # Please update the rev: SHAs below with this command: # pre-commit autoupdate --freeze repos: + # Runs first so a leaked credential blocks the commit before any formatter runs. + # Self-installing: the hook downloads a pinned, checksum-verified trufflehog on + # first use (no manual install). Skipped on pre-commit.ci; Pulse CI enforces server-side. + - repo: https://github.com/NVIDIA/security-workflows + rev: 711025b090f2aa728da576700750b195d1e816dc # frozen: v0.3.0 + hooks: + - id: secret-scan-trufflehog + - repo: https://github.com/astral-sh/ruff-pre-commit rev: c60c980e561ed3e73101667fe8365c609d19a438 # frozen: v0.15.9 hooks: @@ -75,12 +83,12 @@ repos: - id: stubgen-pyx-cuda-core name: Generate .pyi stubs for cuda_core - entry: python ./toolshed/run_stubgen_pyx.py + entry: python -X utf8 -m stubgen_pyx cuda_core/cuda --continue-on-error --include-private language: python files: ^cuda_core/cuda/.*\.(pyx|pxd)$ pass_filenames: false additional_dependencies: - - stubgen-pyx==0.2.6 + - stubgen-pyx==0.2.19 - Cython==3.2.9 # Link checking for authored documentation files diff --git a/AGENTS.md b/AGENTS.md index e66437159b0..05f4d9b780d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -14,26 +14,30 @@ guide for package-specific conventions and workflows. # Pull requests -**Never push branches or commits to the upstream repo (github.com/NVIDIA/cuda-python). -Treat it as read-only.** All branch creation and pushes must go to the contributor's -personal fork. Before pushing, confirm which remote points to the contributor's -personal fork (not `upstream`) by running `git remote -v`, then push there -(`git push <personal-fork-remote> <branch>`). Open the PR from that fork with -`gh pr create`. Do not use `git push upstream` or any command that writes to -the `upstream` remote. - -When creating pull requests with `gh pr create`, always assign at least one -label and a milestone. CI enforces this via the `pr-metadata-check` workflow -and will block PRs that are missing labels or a milestone. Use `--label` and -`--milestone` flags, for example: - -``` -gh pr create --title "..." --body "..." --label "bug" --milestone "v1.0" -``` - -If you are unsure which label or milestone to use, check the existing labels -and milestones on the repository with `gh label list` and `gh api -repos/{owner}/{repo}/milestones --jq '.[].title'`, and pick the best match. +Treat the canonical upstream repository as read-only by default. For normal +pull-request work, push branches and commits to an approved fork associated +with the contributor. The fork may be owned by the contributor's personal +account or by an organization. + +Before any push, run `git remote -v` and verify the complete +`OWNER/REPOSITORY` of the intended destination. For normal pull-request work, +confirm that the destination is a fork of the pull-request base. Do not rely +on remote names such as `origin` or `upstream`, or on the owner alone. + +An upstream push is allowed when the user explicitly requests it and provides +a rationale for why the upstream repository is needed, such as testing +`.github/workflows`, triggering CI from a designated upstream ref, or other +infrastructure work. + +For an authorized upstream push, verify the exact source and destination refs +against the user's request. If the repository and refspec are unambiguous, +proceed; do not require the user to perform the push manually solely because +the destination is upstream. + +Authorization is limited to the requested ref update. It does not authorize +pushing to a default or protected branch, force-pushing, creating tags, or +deleting refs unless the user separately and explicitly requests those +operations. # General diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a477edddeb..7474ac4d840 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -179,6 +179,11 @@ commit` workflow. To resolve this, you can either: 2. Skip it by setting the environment variable `SKIP` to `lychee`. This would be `$env:SKIP = "lychee"` in PowerShell or `set SKIP=lychee` in cmd. +## Secret Scanning + +The `secret-scan-trufflehog` pre-commit hook scans staged files and installs TruffleHog into its own environment on first run, on Linux, macOS, and Windows. If it flags a secret, remove it before committing, or contact a maintainer if it's a false positive. Secrets are also scanned server-side in CI. + + ## Signing Your Work Contributions to files licensed under Apache 2.0 must be certified under the diff --git a/LICENSE b/LICENSE index d6f74778be8..f3fe76ecadf 100644 --- a/LICENSE +++ b/LICENSE @@ -176,3 +176,28 @@ Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 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/README.md b/README.md index 10d0bc6a0cf..9c2955f6b7e 100644 --- a/README.md +++ b/README.md @@ -52,3 +52,14 @@ The list of available interfaces is: CUDA Python is licensed under the [Apache License 2.0](./LICENSE). Third-party attributions for `cuda.core` are listed in [`cuda_core/NOTICE`](./cuda_core/NOTICE). + +Each subproject is distributed as its own package and ships a copy of the same +license alongside its sources, so that the license accompanies the built wheel. +The root `LICENSE` governs the repository as a whole: + +| Subproject | License | License file | +| ---------------- | ---------- | -------------------------------------------------------- | +| `cuda.bindings` | Apache-2.0 | [`cuda_bindings/LICENSE`](./cuda_bindings/LICENSE) | +| `cuda.core` | Apache-2.0 | [`cuda_core/LICENSE`](./cuda_core/LICENSE) | +| `cuda.pathfinder`| Apache-2.0 | [`cuda_pathfinder/LICENSE`](./cuda_pathfinder/LICENSE) | +| `cuda-python` | Apache-2.0 | [`cuda_python/LICENSE`](./cuda_python/LICENSE) | diff --git a/benchmarks/cuda_bindings/runner/main.py b/benchmarks/cuda_bindings/runner/main.py index 9c984c340d6..eb2bcdacaf0 100644 --- a/benchmarks/cuda_bindings/runner/main.py +++ b/benchmarks/cuda_bindings/runner/main.py @@ -232,11 +232,18 @@ def parse_args(argv: list[str], default_output: Path = DEFAULT_OUTPUT) -> tuple[ def main( *, - bench_dir: Path = BENCH_DIR, - default_output: Path = DEFAULT_OUTPUT, + bench_dir: Path | None = None, + default_output: Path | None = None, module_name_prefix: str = DEFAULT_MODULE_NAME_PREFIX, bench_filter_env_var: str = DEFAULT_BENCH_FILTER_ENV_VAR, ) -> None: + # Resolve the defaults inside the call, for the same reason + # discover_benchmarks() does: a literal default would be bound at def-time + # and would ignore a later monkeypatch of the module-level constant. + if bench_dir is None: + bench_dir = BENCH_DIR + if default_output is None: + default_output = DEFAULT_OUTPUT parsed, remaining_argv = parse_args(sys.argv[1:], default_output=default_output) registry = discover_benchmarks(bench_dir=bench_dir, module_name_prefix=module_name_prefix) diff --git a/benchmarks/cuda_bindings/tests/test_runner.py b/benchmarks/cuda_bindings/tests/test_runner.py index 56d88444c9e..836653522a1 100644 --- a/benchmarks/cuda_bindings/tests/test_runner.py +++ b/benchmarks/cuda_bindings/tests/test_runner.py @@ -164,3 +164,24 @@ def test_bench_launch_initializes_on_first_use(monkeypatch): assert len(compile_calls) == 1 assert len(launch_calls) == 2 + + +def test_main_honors_a_monkeypatched_bench_dir(monkeypatch, tmp_path, capsys): + """main() must resolve BENCH_DIR at call time, like discover_benchmarks() does. + + A literal default would be bound at def-time and would silently ignore a + later patch of the module-level constant. + """ + runner_main = load_runner_main(monkeypatch) + + (tmp_path / "bench_patched.py").write_text( + "def bench_only_here(loops: int) -> float:\n return loops + 0.5\n", + encoding="utf-8", + ) + monkeypatch.setattr(runner_main, "BENCH_DIR", tmp_path) + runner_main._MODULE_CACHE.clear() + monkeypatch.setattr(sys, "argv", ["run_pyperf.py", "--list"]) + + runner_main.main() + + assert capsys.readouterr().out.split() == ["patched.only_here"] diff --git a/ci/tools/check_release_notes.py b/ci/tools/check_release_notes.py index 75d2c9871f0..1c99ddb019a 100644 --- a/ci/tools/check_release_notes.py +++ b/ci/tools/check_release_notes.py @@ -18,6 +18,7 @@ import os import re import sys +from pathlib import Path COMPONENT_TO_PACKAGE: dict[str, str] = { "cuda-core": "cuda_core", @@ -62,8 +63,8 @@ def is_post_release(version: str) -> bool: return ".post" in version -def load_backport_branch(repo_root: str = ".") -> str | None: - path = os.path.join(repo_root, "ci", "versions.yml") +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: @@ -84,13 +85,16 @@ def is_backport_version(version: str, backport_branch: str) -> bool: return version == backport_branch -def notes_path(package: str, version: str) -> str: - return os.path.join(package, "docs", "source", "release", f"{version}-notes.rst") +def notes_path(package: str, version: str) -> Path: + return Path(package, "docs", "source", "release", f"{version}-notes.rst") -def check_release_notes(git_tag: str, component: str, repo_root: str = ".") -> list[tuple[str, str]]: +def check_release_notes(git_tag: str, component: str, repo_root: Path = Path(".")) -> list[tuple[str | Path, str]]: """Return a list of (path, reason) for missing or empty release notes. + ``path`` is the repo-relative notes path, or a ``<placeholder>`` naming the + offending argument when the tag or component itself is the problem. + Returns an empty list when notes are present and non-empty, or when the tag is a .post release (no new notes required). """ @@ -105,10 +109,10 @@ def check_release_notes(git_tag: str, component: str, repo_root: str = ".") -> l return [] path = notes_path(COMPONENT_TO_PACKAGE[component], version) - full = os.path.join(repo_root, path) - if not os.path.isfile(full): + full = repo_root / path + if not full.is_file(): return [(path, "missing")] - if os.path.getsize(full) == 0: + if full.stat().st_size == 0: return [(path, "empty")] return [] @@ -123,7 +127,7 @@ def write_step_summary(message: str) -> None: f.write("\n") -def warn_missing_backport_notes(git_tag: str, component: str, problems: list[tuple[str, str]]) -> None: +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", @@ -147,8 +151,8 @@ def validate_backport_decision( version: str, backport_git_tag: str, backport_branch: str | None, - repo_root: str, -) -> tuple[int | None, list[tuple[str, str]]]: + 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, [] @@ -205,7 +209,7 @@ def main(argv: list[str] | None = None) -> int: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--git-tag", required=True) parser.add_argument("--component", required=True, choices=list(COMPONENT_TO_PACKAGE)) - parser.add_argument("--repo-root", default=".") + parser.add_argument("--repo-root", default=Path("."), type=Path) parser.add_argument("--backport-git-tag", default="") parser.add_argument("--backport-branch", default="") args = parser.parse_args(argv) diff --git a/ci/tools/lookup-run-id b/ci/tools/lookup-run-id index bd8ba413974..b177727cde5 100755 --- a/ci/tools/lookup-run-id +++ b/ci/tools/lookup-run-id @@ -8,7 +8,7 @@ # # Two modes: # --tag <tag> Find the successful CI run triggered by a tag push. -# --branch <branch> Find the latest successful CI run on a branch. +# --branch <branch> Find the latest qualifying successful CI run on a branch. # # Outputs the run ID on stdout. All diagnostic messages go to stderr. # When --head-sha is passed, a second line with the run's head SHA is printed. @@ -24,11 +24,14 @@ Usage: Options: --tag <tag> Find run by git tag (requires local git repo with the tag) --branch <branch> Find latest successful run on the given branch + --artifact <glob> Require an unexpired artifact matching this shell glob + (repeatable; branch mode only) --head-sha Also print the run's head commit SHA (second line) Examples: $0 --tag v13.0.1 NVIDIA/cuda-python $0 --branch main NVIDIA/cuda-python + $0 --branch 12.9.x --artifact 'cuda-bindings-python313-*' NVIDIA/cuda-python $0 --branch main --head-sha NVIDIA/cuda-python "CI" EOF exit 1 @@ -38,15 +41,21 @@ EOF MODE="" REF="" HEAD_SHA_FLAG=0 +ARTIFACT_PATTERNS=() while [[ $# -gt 0 ]]; do case "${1}" in --tag) + [[ $# -ge 2 ]] || usage [[ -n "${MODE}" && "${MODE}" != "tag" ]] && { echo "Error: --tag and --branch are mutually exclusive" >&2; exit 1; } MODE="tag"; REF="${2}"; shift 2 ;; --branch) + [[ $# -ge 2 ]] || usage [[ -n "${MODE}" && "${MODE}" != "branch" ]] && { echo "Error: --tag and --branch are mutually exclusive" >&2; exit 1; } MODE="branch"; REF="${2}"; shift 2 ;; + --artifact) + [[ $# -ge 2 ]] || usage + ARTIFACT_PATTERNS+=("${2}"); shift 2 ;; --head-sha) HEAD_SHA_FLAG=1; shift ;; -h|--help) @@ -69,6 +78,11 @@ WORKFLOW_NAME="${1:-CI}" if [[ -z "${REPOSITORY}" ]]; then usage; fi +if [[ "${MODE}" != "branch" && ${#ARTIFACT_PATTERNS[@]} -gt 0 ]]; then + echo "Error: --artifact is only supported with --branch" >&2 + exit 1 +fi + # ── Prerequisite checks ── if [[ -z "${GH_TOKEN:-}" ]]; then echo "Error: GH_TOKEN environment variable is required" >&2 @@ -86,17 +100,79 @@ done if [[ "${MODE}" == "branch" ]]; then echo "Looking up latest successful '${WORKFLOW_NAME}' run on branch: ${REF}" >&2 - RUN_ID=$(gh run list \ - -b "${REF}" \ - -L 1 \ - -w "${WORKFLOW_NAME}" \ - -s success \ - -R "${REPOSITORY}" \ - --json databaseId \ - | jq -r '.[0].databaseId // empty') + RUN_DATA=$(gh run list \ + --repo "${REPOSITORY}" \ + --branch "${REF}" \ + --workflow "${WORKFLOW_NAME}" \ + --status success \ + --json databaseId,workflowName,status,conclusion,headSha,headBranch,createdAt,url \ + --limit 100) + + CANDIDATE_RUNS=$(echo "${RUN_DATA}" | jq -r \ + --arg branch "${REF}" ' + map(select( + .headBranch == $branch + and .conclusion == "success" + )) + | sort_by(.createdAt, .databaseId) + | reverse + | .[] + | [.databaseId, .headSha, .createdAt] + | @tsv + ') + + if [[ -z "${CANDIDATE_RUNS}" ]]; then + echo "Error: No successful '${WORKFLOW_NAME}' run found on branch '${REF}'" >&2 + exit 1 + fi + + if [[ ${#ARTIFACT_PATTERNS[@]} -gt 0 ]]; then + echo "Requiring unexpired artifacts matching:" >&2 + printf ' - %s\n' "${ARTIFACT_PATTERNS[@]}" >&2 + fi + + RUN_ID="" + HEAD_SHA="" + while IFS= read -r candidate; do + IFS=$'\t' read -r candidate_id candidate_sha candidate_created_at <<< "${candidate}" + + missing_patterns=() + if [[ ${#ARTIFACT_PATTERNS[@]} -gt 0 ]]; then + if ! ARTIFACT_NAMES=$(gh api --paginate \ + "repos/${REPOSITORY}/actions/runs/${candidate_id}/artifacts?per_page=100" \ + --jq '.artifacts[] | select(.expired == false) | .name'); then + echo "Error: Failed to list artifacts for run ${candidate_id}" >&2 + exit 1 + fi + + for pattern in "${ARTIFACT_PATTERNS[@]}"; do + pattern_matched=0 + while IFS= read -r artifact_name; do + # The caller supplies a shell glob, so the RHS must remain unquoted. + # shellcheck disable=SC2053 + if [[ -n "${artifact_name}" && "${artifact_name}" == ${pattern} ]]; then + pattern_matched=1 + break + fi + done <<< "${ARTIFACT_NAMES}" + if [[ ${pattern_matched} == 0 ]]; then + missing_patterns+=("${pattern}") + fi + done + fi + + if [[ ${#missing_patterns[@]} -gt 0 ]]; then + echo "Skipping run ${candidate_id} (${candidate_created_at}); missing unexpired artifact(s): ${missing_patterns[*]}" >&2 + continue + fi + + RUN_ID="${candidate_id}" + HEAD_SHA="${candidate_sha}" + break + done <<< "${CANDIDATE_RUNS}" if [[ -z "${RUN_ID}" ]]; then - echo "Error: No successful '${WORKFLOW_NAME}' run found on branch '${REF}'" >&2 + echo "Error: No successful '${WORKFLOW_NAME}' run on branch '${REF}' has all required artifacts" >&2 exit 1 fi @@ -104,10 +180,10 @@ if [[ "${MODE}" == "branch" ]]; then echo "${RUN_ID}" if [[ "${HEAD_SHA_FLAG}" == 1 ]]; then - HEAD_SHA=$(gh run view "${RUN_ID}" \ - -R "${REPOSITORY}" \ - --json headSha \ - | jq -r '.headSha') + if [[ -z "${HEAD_SHA}" ]]; then + echo "Error: Run ${RUN_ID} has no head SHA" >&2 + exit 1 + fi echo "Head SHA: ${HEAD_SHA}" >&2 echo "${HEAD_SHA}" fi diff --git a/ci/tools/tests/test_check_release_notes.py b/ci/tools/tests/test_check_release_notes.py index 4f65404eed5..e08eac6610d 100644 --- a/ci/tools/tests/test_check_release_notes.py +++ b/ci/tools/tests/test_check_release_notes.py @@ -3,10 +3,10 @@ from __future__ import annotations -import os import sys +from pathlib import Path -sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) +sys.path.insert(0, str(Path(__file__).parent.parent)) from check_release_notes import ( check_release_notes, is_post_release, @@ -87,43 +87,43 @@ def _make_notes(self, tmp_path, pkg, version, content="Release notes."): def test_present_and_nonempty(self, tmp_path): self._make_notes(tmp_path, "cuda_core", "0.7.0") - problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path)) + problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", tmp_path) assert problems == [] def test_missing(self, tmp_path): - problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path)) + problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", tmp_path) assert len(problems) == 1 assert problems[0][1] == "missing" def test_empty(self, tmp_path): self._make_notes(tmp_path, "cuda_core", "0.7.0", content="") - problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", str(tmp_path)) + problems = check_release_notes("cuda-core-v0.7.0", "cuda-core", tmp_path) assert len(problems) == 1 assert problems[0][1] == "empty" def test_post_release_skipped(self, tmp_path): - problems = check_release_notes("v12.6.2.post1", "cuda-bindings", str(tmp_path)) + problems = check_release_notes("v12.6.2.post1", "cuda-bindings", tmp_path) assert problems == [] def test_invalid_tag(self, tmp_path): - problems = check_release_notes("not-a-tag", "cuda-core", str(tmp_path)) + problems = check_release_notes("not-a-tag", "cuda-core", tmp_path) assert len(problems) == 1 assert "cannot parse" in problems[0][1] def test_component_prefix_mismatch(self, tmp_path): # Pass a cuda-core tag with component=cuda-pathfinder; must be rejected. - problems = check_release_notes("cuda-core-v0.7.0", "cuda-pathfinder", str(tmp_path)) + problems = check_release_notes("cuda-core-v0.7.0", "cuda-pathfinder", tmp_path) assert len(problems) == 1 assert "cannot parse" in problems[0][1] def test_unknown_component(self, tmp_path): - problems = check_release_notes("v13.1.0", "bogus", str(tmp_path)) + problems = check_release_notes("v13.1.0", "bogus", tmp_path) assert len(problems) == 1 assert "unknown component" in problems[0][1] def test_plain_v_tag(self, tmp_path): self._make_notes(tmp_path, "cuda_python", "13.1.0") - problems = check_release_notes("v13.1.0", "cuda-python", str(tmp_path)) + problems = check_release_notes("v13.1.0", "cuda-python", tmp_path) assert problems == [] @@ -133,17 +133,17 @@ def test_from_versions_yml(self, tmp_path): d.mkdir(parents=True) (d / "versions.yml").write_text('backport_branch: "12.9.x"\n') - assert load_backport_branch(str(tmp_path)) == "12.9.x" + 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(str(tmp_path)) == "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(str(tmp_path)) is None + assert load_backport_branch(tmp_path) is None class TestMain: diff --git a/ci/tools/tests/test_lookup_run_id.py b/ci/tools/tests/test_lookup_run_id.py new file mode 100644 index 00000000000..cb972b24ed3 --- /dev/null +++ b/ci/tools/tests/test_lookup_run_id.py @@ -0,0 +1,239 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import json +import os +import subprocess +from pathlib import Path + +import pytest + +LOOKUP_RUN_ID = Path(__file__).parent.parent / "lookup-run-id" + +FAKE_GH = r"""#!/usr/bin/env python3 +import json +import os +import re +import sys + +args = sys.argv[1:] +if args[:2] == ["run", "list"]: + runs = json.loads(os.environ["FAKE_RUNS"]) + try: + status = args[args.index("--status") + 1] + limit = int(args[args.index("--limit") + 1]) + except (ValueError, IndexError): + print("run list requires --status and --limit", file=sys.stderr) + raise SystemExit(2) + if status == "success": + runs = [run for run in runs if run["conclusion"] == "success"] + elif status == "completed": + runs = [run for run in runs if run["status"] == "completed"] + else: + print(f"unsupported status filter: {status}", file=sys.stderr) + raise SystemExit(2) + print(json.dumps(runs[:limit])) + raise SystemExit(0) + +if args[:1] == ["api"]: + if "--paginate" not in args or "--jq" not in args: + print("artifact lookup must be paginated and filtered", file=sys.stderr) + raise SystemExit(2) + match = re.search(r"/runs/(\d+)/artifacts", " ".join(args)) + if match is None: + print("could not determine run ID", file=sys.stderr) + raise SystemExit(2) + artifacts_by_run = json.loads(os.environ["FAKE_ARTIFACTS"]) + artifacts = artifacts_by_run.get(match.group(1)) + if artifacts is None: + print("simulated artifact API failure", file=sys.stderr) + raise SystemExit(3) + for artifact in artifacts: + if not artifact.get("expired", False): + print(artifact["name"]) + raise SystemExit(0) + +print(f"unexpected gh arguments: {args!r}", file=sys.stderr) +raise SystemExit(2) +""" + + +def _run(run_id, created_at, *, branch="12.9.x", workflow="CI", conclusion="success"): + return { + "databaseId": run_id, + "workflowName": workflow, + "status": "completed", + "conclusion": conclusion, + "headSha": f"sha-{run_id}", + "headBranch": branch, + "createdAt": created_at, + "url": f"https://example.invalid/runs/{run_id}", + } + + +@pytest.fixture +def fake_gh(tmp_path): + fake_bin = tmp_path / "bin" + fake_bin.mkdir() + gh = fake_bin / "gh" + gh.write_text(FAKE_GH, encoding="utf-8") + gh.chmod(0o755) + return fake_bin + + +def _lookup(fake_gh, runs, artifacts, *args, workflow="CI"): + env = os.environ.copy() + env.update( + { + "FAKE_ARTIFACTS": json.dumps(artifacts), + "FAKE_RUNS": json.dumps(runs), + "GH_TOKEN": "test-token", + "PATH": f"{fake_gh}{os.pathsep}{env['PATH']}", + } + ) + return subprocess.run( # noqa: S603 - invokes the repository script under test + [str(LOOKUP_RUN_ID), *args, "NVIDIA/cuda-python", workflow], + check=False, + capture_output=True, + env=env, + text=True, + ) + + +@pytest.mark.agent_authored(model="gpt-5.6") +class TestBranchLookup: + def test_filters_successful_runs_before_applying_limit(self, fake_gh): + runs = [ + _run( + run_id, + "2026-08-13T12:00:00Z", + conclusion="failure", + ) + for run_id in range(200, 100, -1) + ] + runs.append(_run(50, "2026-08-12T12:00:00Z")) + + result = _lookup( + fake_gh, + runs, + {}, + "--branch", + "12.9.x", + ) + + assert result.returncode == 0, result.stderr + assert result.stdout.strip() == "50" + + def test_selects_newest_run_with_filename_workflow_selector(self, fake_gh): + runs = [ + _run(100, "2026-08-10T12:00:00Z"), + _run(400, "2026-08-13T12:00:00Z", conclusion="failure"), + _run(300, "2026-08-12T12:00:00Z", branch="other"), + _run(200, "2026-08-11T12:00:00Z"), + ] + + result = _lookup( + fake_gh, + runs, + {}, + "--branch", + "12.9.x", + "--head-sha", + workflow="ci.yml", + ) + + assert result.returncode == 0, result.stderr + assert result.stdout.splitlines() == ["200", "sha-200"] + + def test_falls_back_until_all_required_artifacts_are_unexpired(self, fake_gh): + bindings_pattern = "cuda-bindings-python315-cuda*-linux-64*[0-9a-f]" + runs = [ + _run(300, "2026-08-13T12:00:00Z"), + _run(200, "2026-08-12T12:00:00Z"), + _run(100, "2026-08-11T12:00:00Z"), + ] + artifacts = { + "300": [ + { + "name": "cuda-bindings-python315-cuda12.9.1-linux-64-abc123", + "expired": True, + }, + { + "name": "cuda-bindings-python315-cuda12.9.1-linux-64-abc123-tests", + "expired": False, + }, + {"name": "cuda-python-wheel", "expired": False}, + ], + "200": [ + { + "name": "cuda-bindings-python315-cuda12.9.1-linux-64-def456", + "expired": False, + } + ], + "100": [ + { + "name": "cuda-bindings-python315-cuda12.9.1-linux-64-fedcba", + "expired": False, + }, + {"name": "cuda-python-wheel", "expired": False}, + ], + } + + result = _lookup( + fake_gh, + runs, + artifacts, + "--branch", + "12.9.x", + "--artifact", + bindings_pattern, + "--artifact", + "cuda-python-wheel", + ) + + assert result.returncode == 0, result.stderr + assert result.stdout.strip() == "100" + assert "Skipping run 300" in result.stderr + assert "Skipping run 200" in result.stderr + + def test_reports_when_no_successful_run_has_required_artifacts(self, fake_gh): + runs = [_run(100, "2026-08-11T12:00:00Z")] + artifacts = { + "100": [ + { + "name": "cuda-bindings-python315-cuda12.9.1-linux-64-fedcba", + "expired": True, + } + ] + } + + result = _lookup( + fake_gh, + runs, + artifacts, + "--branch", + "12.9.x", + "--artifact", + "cuda-bindings-python315-cuda*-linux-64*[0-9a-f]", + ) + + assert result.returncode == 1 + assert "has all required artifacts" in result.stderr + + def test_propagates_artifact_api_failures(self, fake_gh): + runs = [_run(100, "2026-08-11T12:00:00Z")] + + result = _lookup( + fake_gh, + runs, + {}, + "--branch", + "12.9.x", + "--artifact", + "cuda-bindings-*", + ) + + assert result.returncode == 1 + assert "Failed to list artifacts for run 100" in result.stderr diff --git a/cuda_bindings/LICENSE b/cuda_bindings/LICENSE index d6f74778be8..f3fe76ecadf 100644 --- a/cuda_bindings/LICENSE +++ b/cuda_bindings/LICENSE @@ -176,3 +176,28 @@ Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 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/build_hooks.py b/cuda_bindings/build_hooks.py index 99ad5c66268..63a371d125d 100644 --- a/cuda_bindings/build_hooks.py +++ b/cuda_bindings/build_hooks.py @@ -137,6 +137,7 @@ def _build_cuda_bindings(debug=False): that metadata queries do not require a CUDA toolkit installation. """ from Cython.Build import cythonize + from Cython.Compiler import Options as _CythonOptions global _extensions @@ -230,6 +231,7 @@ def get_static_libraries(f): ) # Cythonize + _CythonOptions.warning_errors = True cython_directives = {"language_level": 3, "embedsignature": True, "binding": True, "freethreading_compatible": True} if compile_for_coverage: cython_directives["linetrace"] = True diff --git a/cuda_bindings/cuda/bindings/_internal/cudla.pxd b/cuda_bindings/cuda/bindings/_internal/cudla.pxd index 2594bb88da9..0cea9cf7f01 100644 --- a/cuda_bindings/cuda/bindings/_internal/cudla.pxd +++ b/cuda_bindings/cuda/bindings/_internal/cudla.pxd @@ -2,9 +2,21 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=496ca23b9a84c00538bab7ea91ea3789a1caece491349843387a706509454f43 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=39c36382a0106c38b48e265dfbcf434182c3d1452c0f0153e4b6caebe46cd8ec + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + uint32_t, + uint64_t, + uint8_t, +) + + +# <<<< END OF PREAMBLE CONTENT >>>> + from ..cycudla cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx index 284c90b15e1..f7b4a759897 100644 --- a/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx @@ -3,7 +3,7 @@ # This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b11294791915840a6cb53811f7ce9d81a295c011e6d3c7585aa0c4d45be6bf43 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1255a970577407cbee9302ec94e091c26bfb2b73276a84cfc20055c419c89801 # <<<< PREAMBLE CONTENT >>>> @@ -44,7 +44,12 @@ cdef extern from "<dlfcn.h>": void* _cyb_dlsym "dlsym"(void*, const char*) nogil const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport ( + intptr_t, + uint32_t, + uint64_t, + uint8_t, +) import threading as _cyb_threading @@ -193,43 +198,43 @@ cpdef dict _inspect_function_pointers(): _check_or_init_cudla() cdef dict data = {} global __cudlaGetVersion - data["__cudlaGetVersion"] = <_cyb_intptr_t>__cudlaGetVersion + data["__cudlaGetVersion"] = <intptr_t>__cudlaGetVersion global __cudlaDeviceGetCount - data["__cudlaDeviceGetCount"] = <_cyb_intptr_t>__cudlaDeviceGetCount + data["__cudlaDeviceGetCount"] = <intptr_t>__cudlaDeviceGetCount global __cudlaCreateDevice - data["__cudlaCreateDevice"] = <_cyb_intptr_t>__cudlaCreateDevice + data["__cudlaCreateDevice"] = <intptr_t>__cudlaCreateDevice global __cudlaMemRegister - data["__cudlaMemRegister"] = <_cyb_intptr_t>__cudlaMemRegister + data["__cudlaMemRegister"] = <intptr_t>__cudlaMemRegister global __cudlaModuleLoadFromMemory - data["__cudlaModuleLoadFromMemory"] = <_cyb_intptr_t>__cudlaModuleLoadFromMemory + data["__cudlaModuleLoadFromMemory"] = <intptr_t>__cudlaModuleLoadFromMemory global __cudlaModuleGetAttributes - data["__cudlaModuleGetAttributes"] = <_cyb_intptr_t>__cudlaModuleGetAttributes + data["__cudlaModuleGetAttributes"] = <intptr_t>__cudlaModuleGetAttributes global __cudlaModuleUnload - data["__cudlaModuleUnload"] = <_cyb_intptr_t>__cudlaModuleUnload + data["__cudlaModuleUnload"] = <intptr_t>__cudlaModuleUnload global __cudlaSubmitTask - data["__cudlaSubmitTask"] = <_cyb_intptr_t>__cudlaSubmitTask + data["__cudlaSubmitTask"] = <intptr_t>__cudlaSubmitTask global __cudlaDeviceGetAttribute - data["__cudlaDeviceGetAttribute"] = <_cyb_intptr_t>__cudlaDeviceGetAttribute + data["__cudlaDeviceGetAttribute"] = <intptr_t>__cudlaDeviceGetAttribute global __cudlaMemUnregister - data["__cudlaMemUnregister"] = <_cyb_intptr_t>__cudlaMemUnregister + data["__cudlaMemUnregister"] = <intptr_t>__cudlaMemUnregister global __cudlaGetLastError - data["__cudlaGetLastError"] = <_cyb_intptr_t>__cudlaGetLastError + data["__cudlaGetLastError"] = <intptr_t>__cudlaGetLastError global __cudlaDestroyDevice - data["__cudlaDestroyDevice"] = <_cyb_intptr_t>__cudlaDestroyDevice + data["__cudlaDestroyDevice"] = <intptr_t>__cudlaDestroyDevice global __cudlaSetTaskTimeoutInMs - data["__cudlaSetTaskTimeoutInMs"] = <_cyb_intptr_t>__cudlaSetTaskTimeoutInMs + data["__cudlaSetTaskTimeoutInMs"] = <intptr_t>__cudlaSetTaskTimeoutInMs _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx b/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx index 09c20781d71..0f9c17b6164 100644 --- a/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx @@ -3,7 +3,7 @@ # This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e076e29e87500d2bdc0a65891978259cc1be746831c7b7177427daf7a970708e +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a4196ca097125be37ac917ca487c74884fb6fec2c011c21e2a7af60f4d1b35bf # <<<< PREAMBLE CONTENT >>>> @@ -44,7 +44,13 @@ cdef extern from "<windows.h>": ctypedef void* HMODULE void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport ( + intptr_t, + uint32_t, + uint64_t, + uint8_t, + uintptr_t, +) import threading as _cyb_threading @@ -146,43 +152,43 @@ cpdef dict _inspect_function_pointers(): _check_or_init_cudla() cdef dict data = {} global __cudlaGetVersion - data["__cudlaGetVersion"] = <_cyb_intptr_t>__cudlaGetVersion + data["__cudlaGetVersion"] = <intptr_t>__cudlaGetVersion global __cudlaDeviceGetCount - data["__cudlaDeviceGetCount"] = <_cyb_intptr_t>__cudlaDeviceGetCount + data["__cudlaDeviceGetCount"] = <intptr_t>__cudlaDeviceGetCount global __cudlaCreateDevice - data["__cudlaCreateDevice"] = <_cyb_intptr_t>__cudlaCreateDevice + data["__cudlaCreateDevice"] = <intptr_t>__cudlaCreateDevice global __cudlaMemRegister - data["__cudlaMemRegister"] = <_cyb_intptr_t>__cudlaMemRegister + data["__cudlaMemRegister"] = <intptr_t>__cudlaMemRegister global __cudlaModuleLoadFromMemory - data["__cudlaModuleLoadFromMemory"] = <_cyb_intptr_t>__cudlaModuleLoadFromMemory + data["__cudlaModuleLoadFromMemory"] = <intptr_t>__cudlaModuleLoadFromMemory global __cudlaModuleGetAttributes - data["__cudlaModuleGetAttributes"] = <_cyb_intptr_t>__cudlaModuleGetAttributes + data["__cudlaModuleGetAttributes"] = <intptr_t>__cudlaModuleGetAttributes global __cudlaModuleUnload - data["__cudlaModuleUnload"] = <_cyb_intptr_t>__cudlaModuleUnload + data["__cudlaModuleUnload"] = <intptr_t>__cudlaModuleUnload global __cudlaSubmitTask - data["__cudlaSubmitTask"] = <_cyb_intptr_t>__cudlaSubmitTask + data["__cudlaSubmitTask"] = <intptr_t>__cudlaSubmitTask global __cudlaDeviceGetAttribute - data["__cudlaDeviceGetAttribute"] = <_cyb_intptr_t>__cudlaDeviceGetAttribute + data["__cudlaDeviceGetAttribute"] = <intptr_t>__cudlaDeviceGetAttribute global __cudlaMemUnregister - data["__cudlaMemUnregister"] = <_cyb_intptr_t>__cudlaMemUnregister + data["__cudlaMemUnregister"] = <intptr_t>__cudlaMemUnregister global __cudlaGetLastError - data["__cudlaGetLastError"] = <_cyb_intptr_t>__cudlaGetLastError + data["__cudlaGetLastError"] = <intptr_t>__cudlaGetLastError global __cudlaDestroyDevice - data["__cudlaDestroyDevice"] = <_cyb_intptr_t>__cudlaDestroyDevice + data["__cudlaDestroyDevice"] = <intptr_t>__cudlaDestroyDevice global __cudlaSetTaskTimeoutInMs - data["__cudlaSetTaskTimeoutInMs"] = <_cyb_intptr_t>__cudlaSetTaskTimeoutInMs + data["__cudlaSetTaskTimeoutInMs"] = <intptr_t>__cudlaSetTaskTimeoutInMs _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/cufile.pxd b/cuda_bindings/cuda/bindings/_internal/cufile.pxd index b8c508e21de..207a9fc1bb9 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile.pxd +++ b/cuda_bindings/cuda/bindings/_internal/cufile.pxd @@ -3,9 +3,17 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=aa4406f8a34fc4f1cf43294df5b80bcd84c0beb3b43dbcb66ecdbca3e17d439e +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e3b62cfc529f936bb9d3bb29f36bda105c0b7b233457d6a03f8afde19a3a31eb + + +# <<<< PREAMBLE CONTENT >>>> + +from libcpp cimport bool as _cyb_bool + + +# <<<< END OF PREAMBLE CONTENT >>>> + from ..cycufile cimport * @@ -24,7 +32,7 @@ cdef CUfileError_t _cuFileDriverClose() except?<CUfileError_t>CUFILE_LOADING_ERR cdef CUfileError_t _cuFileDriverClose_v2() except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef long _cuFileUseCount() except* nogil cdef CUfileError_t _cuFileDriverGetProperties(CUfileDrvProps_t* props) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil -cdef CUfileError_t _cuFileDriverSetPollMode(cpp_bool poll, size_t poll_threshold_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil @@ -39,10 +47,10 @@ cdef CUfileError_t _cuFileStreamRegister(CUstream stream, unsigned flags) except cdef CUfileError_t _cuFileStreamDeregister(CUstream stream) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileGetVersion(int* version) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil -cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil -cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileSetStatsLevel(int level) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index baa2bd94858..835391cfba7 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=84741b6deffabec746bbb6a7efa6a638e72579f8eae7731380ae3c1718f1854b +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=64e2ed5888cc6da3670011d33eddb92e86df90e083f8590e1d272b007ae57b02 # <<<< PREAMBLE CONTENT >>>> @@ -46,7 +46,8 @@ cdef extern from "<dlfcn.h>": const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" cimport cython as _cyb_cython -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport intptr_t +from libcpp cimport bool as _cyb_bool import threading as _cyb_threading @@ -452,139 +453,139 @@ cpdef dict _inspect_function_pointers(): _check_or_init_cufile() cdef dict data = {} global __cuFileHandleRegister - data["__cuFileHandleRegister"] = <_cyb_intptr_t>__cuFileHandleRegister + data["__cuFileHandleRegister"] = <intptr_t>__cuFileHandleRegister global __cuFileHandleDeregister - data["__cuFileHandleDeregister"] = <_cyb_intptr_t>__cuFileHandleDeregister + data["__cuFileHandleDeregister"] = <intptr_t>__cuFileHandleDeregister global __cuFileBufRegister - data["__cuFileBufRegister"] = <_cyb_intptr_t>__cuFileBufRegister + data["__cuFileBufRegister"] = <intptr_t>__cuFileBufRegister global __cuFileBufDeregister - data["__cuFileBufDeregister"] = <_cyb_intptr_t>__cuFileBufDeregister + data["__cuFileBufDeregister"] = <intptr_t>__cuFileBufDeregister global __cuFileRead - data["__cuFileRead"] = <_cyb_intptr_t>__cuFileRead + data["__cuFileRead"] = <intptr_t>__cuFileRead global __cuFileWrite - data["__cuFileWrite"] = <_cyb_intptr_t>__cuFileWrite + data["__cuFileWrite"] = <intptr_t>__cuFileWrite global __cuFileDriverOpen - data["__cuFileDriverOpen"] = <_cyb_intptr_t>__cuFileDriverOpen + data["__cuFileDriverOpen"] = <intptr_t>__cuFileDriverOpen global __cuFileDriverClose - data["__cuFileDriverClose"] = <_cyb_intptr_t>__cuFileDriverClose + data["__cuFileDriverClose"] = <intptr_t>__cuFileDriverClose global __cuFileDriverClose_v2 - data["__cuFileDriverClose_v2"] = <_cyb_intptr_t>__cuFileDriverClose_v2 + data["__cuFileDriverClose_v2"] = <intptr_t>__cuFileDriverClose_v2 global __cuFileUseCount - data["__cuFileUseCount"] = <_cyb_intptr_t>__cuFileUseCount + data["__cuFileUseCount"] = <intptr_t>__cuFileUseCount global __cuFileDriverGetProperties - data["__cuFileDriverGetProperties"] = <_cyb_intptr_t>__cuFileDriverGetProperties + data["__cuFileDriverGetProperties"] = <intptr_t>__cuFileDriverGetProperties global __cuFileDriverSetPollMode - data["__cuFileDriverSetPollMode"] = <_cyb_intptr_t>__cuFileDriverSetPollMode + data["__cuFileDriverSetPollMode"] = <intptr_t>__cuFileDriverSetPollMode global __cuFileDriverSetMaxDirectIOSize - data["__cuFileDriverSetMaxDirectIOSize"] = <_cyb_intptr_t>__cuFileDriverSetMaxDirectIOSize + data["__cuFileDriverSetMaxDirectIOSize"] = <intptr_t>__cuFileDriverSetMaxDirectIOSize global __cuFileDriverSetMaxCacheSize - data["__cuFileDriverSetMaxCacheSize"] = <_cyb_intptr_t>__cuFileDriverSetMaxCacheSize + data["__cuFileDriverSetMaxCacheSize"] = <intptr_t>__cuFileDriverSetMaxCacheSize global __cuFileDriverSetMaxPinnedMemSize - data["__cuFileDriverSetMaxPinnedMemSize"] = <_cyb_intptr_t>__cuFileDriverSetMaxPinnedMemSize + data["__cuFileDriverSetMaxPinnedMemSize"] = <intptr_t>__cuFileDriverSetMaxPinnedMemSize global __cuFileBatchIOSetUp - data["__cuFileBatchIOSetUp"] = <_cyb_intptr_t>__cuFileBatchIOSetUp + data["__cuFileBatchIOSetUp"] = <intptr_t>__cuFileBatchIOSetUp global __cuFileBatchIOSubmit - data["__cuFileBatchIOSubmit"] = <_cyb_intptr_t>__cuFileBatchIOSubmit + data["__cuFileBatchIOSubmit"] = <intptr_t>__cuFileBatchIOSubmit global __cuFileBatchIOGetStatus - data["__cuFileBatchIOGetStatus"] = <_cyb_intptr_t>__cuFileBatchIOGetStatus + data["__cuFileBatchIOGetStatus"] = <intptr_t>__cuFileBatchIOGetStatus global __cuFileBatchIOCancel - data["__cuFileBatchIOCancel"] = <_cyb_intptr_t>__cuFileBatchIOCancel + data["__cuFileBatchIOCancel"] = <intptr_t>__cuFileBatchIOCancel global __cuFileBatchIODestroy - data["__cuFileBatchIODestroy"] = <_cyb_intptr_t>__cuFileBatchIODestroy + data["__cuFileBatchIODestroy"] = <intptr_t>__cuFileBatchIODestroy global __cuFileReadAsync - data["__cuFileReadAsync"] = <_cyb_intptr_t>__cuFileReadAsync + data["__cuFileReadAsync"] = <intptr_t>__cuFileReadAsync global __cuFileWriteAsync - data["__cuFileWriteAsync"] = <_cyb_intptr_t>__cuFileWriteAsync + data["__cuFileWriteAsync"] = <intptr_t>__cuFileWriteAsync global __cuFileStreamRegister - data["__cuFileStreamRegister"] = <_cyb_intptr_t>__cuFileStreamRegister + data["__cuFileStreamRegister"] = <intptr_t>__cuFileStreamRegister global __cuFileStreamDeregister - data["__cuFileStreamDeregister"] = <_cyb_intptr_t>__cuFileStreamDeregister + data["__cuFileStreamDeregister"] = <intptr_t>__cuFileStreamDeregister global __cuFileGetVersion - data["__cuFileGetVersion"] = <_cyb_intptr_t>__cuFileGetVersion + data["__cuFileGetVersion"] = <intptr_t>__cuFileGetVersion global __cuFileGetParameterSizeT - data["__cuFileGetParameterSizeT"] = <_cyb_intptr_t>__cuFileGetParameterSizeT + data["__cuFileGetParameterSizeT"] = <intptr_t>__cuFileGetParameterSizeT global __cuFileGetParameterBool - data["__cuFileGetParameterBool"] = <_cyb_intptr_t>__cuFileGetParameterBool + data["__cuFileGetParameterBool"] = <intptr_t>__cuFileGetParameterBool global __cuFileGetParameterString - data["__cuFileGetParameterString"] = <_cyb_intptr_t>__cuFileGetParameterString + data["__cuFileGetParameterString"] = <intptr_t>__cuFileGetParameterString global __cuFileSetParameterSizeT - data["__cuFileSetParameterSizeT"] = <_cyb_intptr_t>__cuFileSetParameterSizeT + data["__cuFileSetParameterSizeT"] = <intptr_t>__cuFileSetParameterSizeT global __cuFileSetParameterBool - data["__cuFileSetParameterBool"] = <_cyb_intptr_t>__cuFileSetParameterBool + data["__cuFileSetParameterBool"] = <intptr_t>__cuFileSetParameterBool global __cuFileSetParameterString - data["__cuFileSetParameterString"] = <_cyb_intptr_t>__cuFileSetParameterString + data["__cuFileSetParameterString"] = <intptr_t>__cuFileSetParameterString global __cuFileGetParameterMinMaxValue - data["__cuFileGetParameterMinMaxValue"] = <_cyb_intptr_t>__cuFileGetParameterMinMaxValue + data["__cuFileGetParameterMinMaxValue"] = <intptr_t>__cuFileGetParameterMinMaxValue global __cuFileSetStatsLevel - data["__cuFileSetStatsLevel"] = <_cyb_intptr_t>__cuFileSetStatsLevel + data["__cuFileSetStatsLevel"] = <intptr_t>__cuFileSetStatsLevel global __cuFileGetStatsLevel - data["__cuFileGetStatsLevel"] = <_cyb_intptr_t>__cuFileGetStatsLevel + data["__cuFileGetStatsLevel"] = <intptr_t>__cuFileGetStatsLevel global __cuFileStatsStart - data["__cuFileStatsStart"] = <_cyb_intptr_t>__cuFileStatsStart + data["__cuFileStatsStart"] = <intptr_t>__cuFileStatsStart global __cuFileStatsStop - data["__cuFileStatsStop"] = <_cyb_intptr_t>__cuFileStatsStop + data["__cuFileStatsStop"] = <intptr_t>__cuFileStatsStop global __cuFileStatsReset - data["__cuFileStatsReset"] = <_cyb_intptr_t>__cuFileStatsReset + data["__cuFileStatsReset"] = <intptr_t>__cuFileStatsReset global __cuFileGetStatsL1 - data["__cuFileGetStatsL1"] = <_cyb_intptr_t>__cuFileGetStatsL1 + data["__cuFileGetStatsL1"] = <intptr_t>__cuFileGetStatsL1 global __cuFileGetStatsL2 - data["__cuFileGetStatsL2"] = <_cyb_intptr_t>__cuFileGetStatsL2 + data["__cuFileGetStatsL2"] = <intptr_t>__cuFileGetStatsL2 global __cuFileGetStatsL3 - data["__cuFileGetStatsL3"] = <_cyb_intptr_t>__cuFileGetStatsL3 + data["__cuFileGetStatsL3"] = <intptr_t>__cuFileGetStatsL3 global __cuFileGetBARSizeInKB - data["__cuFileGetBARSizeInKB"] = <_cyb_intptr_t>__cuFileGetBARSizeInKB + data["__cuFileGetBARSizeInKB"] = <intptr_t>__cuFileGetBARSizeInKB global __cuFileSetParameterPosixPoolSlabArray - data["__cuFileSetParameterPosixPoolSlabArray"] = <_cyb_intptr_t>__cuFileSetParameterPosixPoolSlabArray + data["__cuFileSetParameterPosixPoolSlabArray"] = <intptr_t>__cuFileSetParameterPosixPoolSlabArray global __cuFileGetParameterPosixPoolSlabArray - data["__cuFileGetParameterPosixPoolSlabArray"] = <_cyb_intptr_t>__cuFileGetParameterPosixPoolSlabArray + data["__cuFileGetParameterPosixPoolSlabArray"] = <intptr_t>__cuFileGetParameterPosixPoolSlabArray global __cuFileReadv - data["__cuFileReadv"] = <_cyb_intptr_t>__cuFileReadv + data["__cuFileReadv"] = <intptr_t>__cuFileReadv global __cuFileWritev - data["__cuFileWritev"] = <_cyb_intptr_t>__cuFileWritev + data["__cuFileWritev"] = <intptr_t>__cuFileWritev _cyb_func_ptrs = data return data @@ -717,13 +718,13 @@ cdef CUfileError_t _cuFileDriverGetProperties(CUfileDrvProps_t* props) except?<C props) -cdef CUfileError_t _cuFileDriverSetPollMode(cpp_bool poll, size_t poll_threshold_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: +cdef CUfileError_t _cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: global __cuFileDriverSetPollMode _check_or_init_cufile() if __cuFileDriverSetPollMode == NULL: with gil: raise FunctionNotFoundError("function cuFileDriverSetPollMode is not found") - return (<CUfileError_t (*)(cpp_bool, size_t) noexcept nogil>__cuFileDriverSetPollMode)( + return (<CUfileError_t (*)(_cyb_bool, size_t) noexcept nogil>__cuFileDriverSetPollMode)( poll, poll_threshold_size) @@ -868,13 +869,13 @@ cdef CUfileError_t _cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, param, value) -cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: +cdef CUfileError_t _cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: global __cuFileGetParameterBool _check_or_init_cufile() if __cuFileGetParameterBool == NULL: with gil: raise FunctionNotFoundError("function cuFileGetParameterBool is not found") - return (<CUfileError_t (*)(CUFileBoolConfigParameter_t, cpp_bool*) noexcept nogil>__cuFileGetParameterBool)( + return (<CUfileError_t (*)(CUFileBoolConfigParameter_t, _cyb_bool*) noexcept nogil>__cuFileGetParameterBool)( param, value) @@ -898,13 +899,13 @@ cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, param, value) -cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: +cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: global __cuFileSetParameterBool _check_or_init_cufile() if __cuFileSetParameterBool == NULL: with gil: raise FunctionNotFoundError("function cuFileSetParameterBool is not found") - return (<CUfileError_t (*)(CUFileBoolConfigParameter_t, cpp_bool) noexcept nogil>__cuFileSetParameterBool)( + return (<CUfileError_t (*)(CUFileBoolConfigParameter_t, _cyb_bool) noexcept nogil>__cuFileSetParameterBool)( param, value) diff --git a/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx b/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx index 9473f1d6afb..f0922d2f4bd 100644 --- a/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1e5b152412ef388b8a785b8362155fef84faecf8a3575f95461cedb918b08fb0 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0fc726f8d963197a11bba5027050e90528a31b29ece3de3bec606b2c4d66aa7a # <<<< PREAMBLE CONTENT >>>> @@ -44,7 +44,7 @@ cdef extern from * nogil: cdef extern from "<dlfcn.h>": void* _cyb_dlsym "dlsym"(void*, const char*) nogil -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport intptr_t from os import getenv as _cyb_getenv import threading as _cyb_threading @@ -2202,1576 +2202,1576 @@ cpdef dict _inspect_function_pointers(): _check_or_init_driver() cdef dict data = {} global __cuGetErrorString - data["__cuGetErrorString"] = <_cyb_intptr_t>__cuGetErrorString + data["__cuGetErrorString"] = <intptr_t>__cuGetErrorString global __cuGetErrorName - data["__cuGetErrorName"] = <_cyb_intptr_t>__cuGetErrorName + data["__cuGetErrorName"] = <intptr_t>__cuGetErrorName global __cuInit - data["__cuInit"] = <_cyb_intptr_t>__cuInit + data["__cuInit"] = <intptr_t>__cuInit global __cuDriverGetVersion - data["__cuDriverGetVersion"] = <_cyb_intptr_t>__cuDriverGetVersion + data["__cuDriverGetVersion"] = <intptr_t>__cuDriverGetVersion global __cuDeviceGet - data["__cuDeviceGet"] = <_cyb_intptr_t>__cuDeviceGet + data["__cuDeviceGet"] = <intptr_t>__cuDeviceGet global __cuDeviceGetCount - data["__cuDeviceGetCount"] = <_cyb_intptr_t>__cuDeviceGetCount + data["__cuDeviceGetCount"] = <intptr_t>__cuDeviceGetCount global __cuDeviceGetName - data["__cuDeviceGetName"] = <_cyb_intptr_t>__cuDeviceGetName + data["__cuDeviceGetName"] = <intptr_t>__cuDeviceGetName global __cuDeviceGetUuid_v2 - data["__cuDeviceGetUuid_v2"] = <_cyb_intptr_t>__cuDeviceGetUuid_v2 + data["__cuDeviceGetUuid_v2"] = <intptr_t>__cuDeviceGetUuid_v2 global __cuDeviceGetLuid - data["__cuDeviceGetLuid"] = <_cyb_intptr_t>__cuDeviceGetLuid + data["__cuDeviceGetLuid"] = <intptr_t>__cuDeviceGetLuid global __cuDeviceTotalMem_v2 - data["__cuDeviceTotalMem_v2"] = <_cyb_intptr_t>__cuDeviceTotalMem_v2 + data["__cuDeviceTotalMem_v2"] = <intptr_t>__cuDeviceTotalMem_v2 global __cuDeviceGetTexture1DLinearMaxWidth - data["__cuDeviceGetTexture1DLinearMaxWidth"] = <_cyb_intptr_t>__cuDeviceGetTexture1DLinearMaxWidth + data["__cuDeviceGetTexture1DLinearMaxWidth"] = <intptr_t>__cuDeviceGetTexture1DLinearMaxWidth global __cuDeviceGetAttribute - data["__cuDeviceGetAttribute"] = <_cyb_intptr_t>__cuDeviceGetAttribute + data["__cuDeviceGetAttribute"] = <intptr_t>__cuDeviceGetAttribute global __cuDeviceGetNvSciSyncAttributes - data["__cuDeviceGetNvSciSyncAttributes"] = <_cyb_intptr_t>__cuDeviceGetNvSciSyncAttributes + data["__cuDeviceGetNvSciSyncAttributes"] = <intptr_t>__cuDeviceGetNvSciSyncAttributes global __cuDeviceSetMemPool - data["__cuDeviceSetMemPool"] = <_cyb_intptr_t>__cuDeviceSetMemPool + data["__cuDeviceSetMemPool"] = <intptr_t>__cuDeviceSetMemPool global __cuDeviceGetMemPool - data["__cuDeviceGetMemPool"] = <_cyb_intptr_t>__cuDeviceGetMemPool + data["__cuDeviceGetMemPool"] = <intptr_t>__cuDeviceGetMemPool global __cuDeviceGetDefaultMemPool - data["__cuDeviceGetDefaultMemPool"] = <_cyb_intptr_t>__cuDeviceGetDefaultMemPool + data["__cuDeviceGetDefaultMemPool"] = <intptr_t>__cuDeviceGetDefaultMemPool global __cuDeviceGetExecAffinitySupport - data["__cuDeviceGetExecAffinitySupport"] = <_cyb_intptr_t>__cuDeviceGetExecAffinitySupport + data["__cuDeviceGetExecAffinitySupport"] = <intptr_t>__cuDeviceGetExecAffinitySupport global __cuFlushGPUDirectRDMAWrites - data["__cuFlushGPUDirectRDMAWrites"] = <_cyb_intptr_t>__cuFlushGPUDirectRDMAWrites + data["__cuFlushGPUDirectRDMAWrites"] = <intptr_t>__cuFlushGPUDirectRDMAWrites global __cuDeviceGetProperties - data["__cuDeviceGetProperties"] = <_cyb_intptr_t>__cuDeviceGetProperties + data["__cuDeviceGetProperties"] = <intptr_t>__cuDeviceGetProperties global __cuDeviceComputeCapability - data["__cuDeviceComputeCapability"] = <_cyb_intptr_t>__cuDeviceComputeCapability + data["__cuDeviceComputeCapability"] = <intptr_t>__cuDeviceComputeCapability global __cuDevicePrimaryCtxRetain - data["__cuDevicePrimaryCtxRetain"] = <_cyb_intptr_t>__cuDevicePrimaryCtxRetain + data["__cuDevicePrimaryCtxRetain"] = <intptr_t>__cuDevicePrimaryCtxRetain global __cuDevicePrimaryCtxRelease_v2 - data["__cuDevicePrimaryCtxRelease_v2"] = <_cyb_intptr_t>__cuDevicePrimaryCtxRelease_v2 + data["__cuDevicePrimaryCtxRelease_v2"] = <intptr_t>__cuDevicePrimaryCtxRelease_v2 global __cuDevicePrimaryCtxSetFlags_v2 - data["__cuDevicePrimaryCtxSetFlags_v2"] = <_cyb_intptr_t>__cuDevicePrimaryCtxSetFlags_v2 + data["__cuDevicePrimaryCtxSetFlags_v2"] = <intptr_t>__cuDevicePrimaryCtxSetFlags_v2 global __cuDevicePrimaryCtxGetState - data["__cuDevicePrimaryCtxGetState"] = <_cyb_intptr_t>__cuDevicePrimaryCtxGetState + data["__cuDevicePrimaryCtxGetState"] = <intptr_t>__cuDevicePrimaryCtxGetState global __cuDevicePrimaryCtxReset_v2 - data["__cuDevicePrimaryCtxReset_v2"] = <_cyb_intptr_t>__cuDevicePrimaryCtxReset_v2 + data["__cuDevicePrimaryCtxReset_v2"] = <intptr_t>__cuDevicePrimaryCtxReset_v2 global __cuCtxCreate_v2 - data["__cuCtxCreate_v2"] = <_cyb_intptr_t>__cuCtxCreate_v2 + data["__cuCtxCreate_v2"] = <intptr_t>__cuCtxCreate_v2 global __cuCtxCreate_v3 - data["__cuCtxCreate_v3"] = <_cyb_intptr_t>__cuCtxCreate_v3 + data["__cuCtxCreate_v3"] = <intptr_t>__cuCtxCreate_v3 global __cuCtxCreate_v4 - data["__cuCtxCreate_v4"] = <_cyb_intptr_t>__cuCtxCreate_v4 + data["__cuCtxCreate_v4"] = <intptr_t>__cuCtxCreate_v4 global __cuCtxDestroy_v2 - data["__cuCtxDestroy_v2"] = <_cyb_intptr_t>__cuCtxDestroy_v2 + data["__cuCtxDestroy_v2"] = <intptr_t>__cuCtxDestroy_v2 global __cuCtxPushCurrent_v2 - data["__cuCtxPushCurrent_v2"] = <_cyb_intptr_t>__cuCtxPushCurrent_v2 + data["__cuCtxPushCurrent_v2"] = <intptr_t>__cuCtxPushCurrent_v2 global __cuCtxPopCurrent_v2 - data["__cuCtxPopCurrent_v2"] = <_cyb_intptr_t>__cuCtxPopCurrent_v2 + data["__cuCtxPopCurrent_v2"] = <intptr_t>__cuCtxPopCurrent_v2 global __cuCtxSetCurrent - data["__cuCtxSetCurrent"] = <_cyb_intptr_t>__cuCtxSetCurrent + data["__cuCtxSetCurrent"] = <intptr_t>__cuCtxSetCurrent global __cuCtxGetCurrent - data["__cuCtxGetCurrent"] = <_cyb_intptr_t>__cuCtxGetCurrent + data["__cuCtxGetCurrent"] = <intptr_t>__cuCtxGetCurrent global __cuCtxGetDevice - data["__cuCtxGetDevice"] = <_cyb_intptr_t>__cuCtxGetDevice + data["__cuCtxGetDevice"] = <intptr_t>__cuCtxGetDevice global __cuCtxGetFlags - data["__cuCtxGetFlags"] = <_cyb_intptr_t>__cuCtxGetFlags + data["__cuCtxGetFlags"] = <intptr_t>__cuCtxGetFlags global __cuCtxSetFlags - data["__cuCtxSetFlags"] = <_cyb_intptr_t>__cuCtxSetFlags + data["__cuCtxSetFlags"] = <intptr_t>__cuCtxSetFlags global __cuCtxGetId - data["__cuCtxGetId"] = <_cyb_intptr_t>__cuCtxGetId + data["__cuCtxGetId"] = <intptr_t>__cuCtxGetId global __cuCtxSynchronize - data["__cuCtxSynchronize"] = <_cyb_intptr_t>__cuCtxSynchronize + data["__cuCtxSynchronize"] = <intptr_t>__cuCtxSynchronize global __cuCtxSetLimit - data["__cuCtxSetLimit"] = <_cyb_intptr_t>__cuCtxSetLimit + data["__cuCtxSetLimit"] = <intptr_t>__cuCtxSetLimit global __cuCtxGetLimit - data["__cuCtxGetLimit"] = <_cyb_intptr_t>__cuCtxGetLimit + data["__cuCtxGetLimit"] = <intptr_t>__cuCtxGetLimit global __cuCtxGetCacheConfig - data["__cuCtxGetCacheConfig"] = <_cyb_intptr_t>__cuCtxGetCacheConfig + data["__cuCtxGetCacheConfig"] = <intptr_t>__cuCtxGetCacheConfig global __cuCtxSetCacheConfig - data["__cuCtxSetCacheConfig"] = <_cyb_intptr_t>__cuCtxSetCacheConfig + data["__cuCtxSetCacheConfig"] = <intptr_t>__cuCtxSetCacheConfig global __cuCtxGetApiVersion - data["__cuCtxGetApiVersion"] = <_cyb_intptr_t>__cuCtxGetApiVersion + data["__cuCtxGetApiVersion"] = <intptr_t>__cuCtxGetApiVersion global __cuCtxGetStreamPriorityRange - data["__cuCtxGetStreamPriorityRange"] = <_cyb_intptr_t>__cuCtxGetStreamPriorityRange + data["__cuCtxGetStreamPriorityRange"] = <intptr_t>__cuCtxGetStreamPriorityRange global __cuCtxResetPersistingL2Cache - data["__cuCtxResetPersistingL2Cache"] = <_cyb_intptr_t>__cuCtxResetPersistingL2Cache + data["__cuCtxResetPersistingL2Cache"] = <intptr_t>__cuCtxResetPersistingL2Cache global __cuCtxGetExecAffinity - data["__cuCtxGetExecAffinity"] = <_cyb_intptr_t>__cuCtxGetExecAffinity + data["__cuCtxGetExecAffinity"] = <intptr_t>__cuCtxGetExecAffinity global __cuCtxRecordEvent - data["__cuCtxRecordEvent"] = <_cyb_intptr_t>__cuCtxRecordEvent + data["__cuCtxRecordEvent"] = <intptr_t>__cuCtxRecordEvent global __cuCtxWaitEvent - data["__cuCtxWaitEvent"] = <_cyb_intptr_t>__cuCtxWaitEvent + data["__cuCtxWaitEvent"] = <intptr_t>__cuCtxWaitEvent global __cuCtxAttach - data["__cuCtxAttach"] = <_cyb_intptr_t>__cuCtxAttach + data["__cuCtxAttach"] = <intptr_t>__cuCtxAttach global __cuCtxDetach - data["__cuCtxDetach"] = <_cyb_intptr_t>__cuCtxDetach + data["__cuCtxDetach"] = <intptr_t>__cuCtxDetach global __cuCtxGetSharedMemConfig - data["__cuCtxGetSharedMemConfig"] = <_cyb_intptr_t>__cuCtxGetSharedMemConfig + data["__cuCtxGetSharedMemConfig"] = <intptr_t>__cuCtxGetSharedMemConfig global __cuCtxSetSharedMemConfig - data["__cuCtxSetSharedMemConfig"] = <_cyb_intptr_t>__cuCtxSetSharedMemConfig + data["__cuCtxSetSharedMemConfig"] = <intptr_t>__cuCtxSetSharedMemConfig global __cuModuleLoad - data["__cuModuleLoad"] = <_cyb_intptr_t>__cuModuleLoad + data["__cuModuleLoad"] = <intptr_t>__cuModuleLoad global __cuModuleLoadData - data["__cuModuleLoadData"] = <_cyb_intptr_t>__cuModuleLoadData + data["__cuModuleLoadData"] = <intptr_t>__cuModuleLoadData global __cuModuleLoadDataEx - data["__cuModuleLoadDataEx"] = <_cyb_intptr_t>__cuModuleLoadDataEx + data["__cuModuleLoadDataEx"] = <intptr_t>__cuModuleLoadDataEx global __cuModuleLoadFatBinary - data["__cuModuleLoadFatBinary"] = <_cyb_intptr_t>__cuModuleLoadFatBinary + data["__cuModuleLoadFatBinary"] = <intptr_t>__cuModuleLoadFatBinary global __cuModuleUnload - data["__cuModuleUnload"] = <_cyb_intptr_t>__cuModuleUnload + data["__cuModuleUnload"] = <intptr_t>__cuModuleUnload global __cuModuleGetLoadingMode - data["__cuModuleGetLoadingMode"] = <_cyb_intptr_t>__cuModuleGetLoadingMode + data["__cuModuleGetLoadingMode"] = <intptr_t>__cuModuleGetLoadingMode global __cuModuleGetFunction - data["__cuModuleGetFunction"] = <_cyb_intptr_t>__cuModuleGetFunction + data["__cuModuleGetFunction"] = <intptr_t>__cuModuleGetFunction global __cuModuleGetFunctionCount - data["__cuModuleGetFunctionCount"] = <_cyb_intptr_t>__cuModuleGetFunctionCount + data["__cuModuleGetFunctionCount"] = <intptr_t>__cuModuleGetFunctionCount global __cuModuleEnumerateFunctions - data["__cuModuleEnumerateFunctions"] = <_cyb_intptr_t>__cuModuleEnumerateFunctions + data["__cuModuleEnumerateFunctions"] = <intptr_t>__cuModuleEnumerateFunctions global __cuModuleGetGlobal_v2 - data["__cuModuleGetGlobal_v2"] = <_cyb_intptr_t>__cuModuleGetGlobal_v2 + data["__cuModuleGetGlobal_v2"] = <intptr_t>__cuModuleGetGlobal_v2 global __cuLinkCreate_v2 - data["__cuLinkCreate_v2"] = <_cyb_intptr_t>__cuLinkCreate_v2 + data["__cuLinkCreate_v2"] = <intptr_t>__cuLinkCreate_v2 global __cuLinkAddData_v2 - data["__cuLinkAddData_v2"] = <_cyb_intptr_t>__cuLinkAddData_v2 + data["__cuLinkAddData_v2"] = <intptr_t>__cuLinkAddData_v2 global __cuLinkAddFile_v2 - data["__cuLinkAddFile_v2"] = <_cyb_intptr_t>__cuLinkAddFile_v2 + data["__cuLinkAddFile_v2"] = <intptr_t>__cuLinkAddFile_v2 global __cuLinkComplete - data["__cuLinkComplete"] = <_cyb_intptr_t>__cuLinkComplete + data["__cuLinkComplete"] = <intptr_t>__cuLinkComplete global __cuLinkDestroy - data["__cuLinkDestroy"] = <_cyb_intptr_t>__cuLinkDestroy + data["__cuLinkDestroy"] = <intptr_t>__cuLinkDestroy global __cuModuleGetTexRef - data["__cuModuleGetTexRef"] = <_cyb_intptr_t>__cuModuleGetTexRef + data["__cuModuleGetTexRef"] = <intptr_t>__cuModuleGetTexRef global __cuModuleGetSurfRef - data["__cuModuleGetSurfRef"] = <_cyb_intptr_t>__cuModuleGetSurfRef + data["__cuModuleGetSurfRef"] = <intptr_t>__cuModuleGetSurfRef global __cuLibraryLoadData - data["__cuLibraryLoadData"] = <_cyb_intptr_t>__cuLibraryLoadData + data["__cuLibraryLoadData"] = <intptr_t>__cuLibraryLoadData global __cuLibraryLoadFromFile - data["__cuLibraryLoadFromFile"] = <_cyb_intptr_t>__cuLibraryLoadFromFile + data["__cuLibraryLoadFromFile"] = <intptr_t>__cuLibraryLoadFromFile global __cuLibraryUnload - data["__cuLibraryUnload"] = <_cyb_intptr_t>__cuLibraryUnload + data["__cuLibraryUnload"] = <intptr_t>__cuLibraryUnload global __cuLibraryGetKernel - data["__cuLibraryGetKernel"] = <_cyb_intptr_t>__cuLibraryGetKernel + data["__cuLibraryGetKernel"] = <intptr_t>__cuLibraryGetKernel global __cuLibraryGetKernelCount - data["__cuLibraryGetKernelCount"] = <_cyb_intptr_t>__cuLibraryGetKernelCount + data["__cuLibraryGetKernelCount"] = <intptr_t>__cuLibraryGetKernelCount global __cuLibraryEnumerateKernels - data["__cuLibraryEnumerateKernels"] = <_cyb_intptr_t>__cuLibraryEnumerateKernels + data["__cuLibraryEnumerateKernels"] = <intptr_t>__cuLibraryEnumerateKernels global __cuLibraryGetModule - data["__cuLibraryGetModule"] = <_cyb_intptr_t>__cuLibraryGetModule + data["__cuLibraryGetModule"] = <intptr_t>__cuLibraryGetModule global __cuKernelGetFunction - data["__cuKernelGetFunction"] = <_cyb_intptr_t>__cuKernelGetFunction + data["__cuKernelGetFunction"] = <intptr_t>__cuKernelGetFunction global __cuKernelGetLibrary - data["__cuKernelGetLibrary"] = <_cyb_intptr_t>__cuKernelGetLibrary + data["__cuKernelGetLibrary"] = <intptr_t>__cuKernelGetLibrary global __cuLibraryGetGlobal - data["__cuLibraryGetGlobal"] = <_cyb_intptr_t>__cuLibraryGetGlobal + data["__cuLibraryGetGlobal"] = <intptr_t>__cuLibraryGetGlobal global __cuLibraryGetManaged - data["__cuLibraryGetManaged"] = <_cyb_intptr_t>__cuLibraryGetManaged + data["__cuLibraryGetManaged"] = <intptr_t>__cuLibraryGetManaged global __cuLibraryGetUnifiedFunction - data["__cuLibraryGetUnifiedFunction"] = <_cyb_intptr_t>__cuLibraryGetUnifiedFunction + data["__cuLibraryGetUnifiedFunction"] = <intptr_t>__cuLibraryGetUnifiedFunction global __cuKernelGetAttribute - data["__cuKernelGetAttribute"] = <_cyb_intptr_t>__cuKernelGetAttribute + data["__cuKernelGetAttribute"] = <intptr_t>__cuKernelGetAttribute global __cuKernelSetAttribute - data["__cuKernelSetAttribute"] = <_cyb_intptr_t>__cuKernelSetAttribute + data["__cuKernelSetAttribute"] = <intptr_t>__cuKernelSetAttribute global __cuKernelSetCacheConfig - data["__cuKernelSetCacheConfig"] = <_cyb_intptr_t>__cuKernelSetCacheConfig + data["__cuKernelSetCacheConfig"] = <intptr_t>__cuKernelSetCacheConfig global __cuKernelGetName - data["__cuKernelGetName"] = <_cyb_intptr_t>__cuKernelGetName + data["__cuKernelGetName"] = <intptr_t>__cuKernelGetName global __cuKernelGetParamInfo - data["__cuKernelGetParamInfo"] = <_cyb_intptr_t>__cuKernelGetParamInfo + data["__cuKernelGetParamInfo"] = <intptr_t>__cuKernelGetParamInfo global __cuMemGetInfo_v2 - data["__cuMemGetInfo_v2"] = <_cyb_intptr_t>__cuMemGetInfo_v2 + data["__cuMemGetInfo_v2"] = <intptr_t>__cuMemGetInfo_v2 global __cuMemAlloc_v2 - data["__cuMemAlloc_v2"] = <_cyb_intptr_t>__cuMemAlloc_v2 + data["__cuMemAlloc_v2"] = <intptr_t>__cuMemAlloc_v2 global __cuMemAllocPitch_v2 - data["__cuMemAllocPitch_v2"] = <_cyb_intptr_t>__cuMemAllocPitch_v2 + data["__cuMemAllocPitch_v2"] = <intptr_t>__cuMemAllocPitch_v2 global __cuMemFree_v2 - data["__cuMemFree_v2"] = <_cyb_intptr_t>__cuMemFree_v2 + data["__cuMemFree_v2"] = <intptr_t>__cuMemFree_v2 global __cuMemGetAddressRange_v2 - data["__cuMemGetAddressRange_v2"] = <_cyb_intptr_t>__cuMemGetAddressRange_v2 + data["__cuMemGetAddressRange_v2"] = <intptr_t>__cuMemGetAddressRange_v2 global __cuMemAllocHost_v2 - data["__cuMemAllocHost_v2"] = <_cyb_intptr_t>__cuMemAllocHost_v2 + data["__cuMemAllocHost_v2"] = <intptr_t>__cuMemAllocHost_v2 global __cuMemFreeHost - data["__cuMemFreeHost"] = <_cyb_intptr_t>__cuMemFreeHost + data["__cuMemFreeHost"] = <intptr_t>__cuMemFreeHost global __cuMemHostAlloc - data["__cuMemHostAlloc"] = <_cyb_intptr_t>__cuMemHostAlloc + data["__cuMemHostAlloc"] = <intptr_t>__cuMemHostAlloc global __cuMemHostGetDevicePointer_v2 - data["__cuMemHostGetDevicePointer_v2"] = <_cyb_intptr_t>__cuMemHostGetDevicePointer_v2 + data["__cuMemHostGetDevicePointer_v2"] = <intptr_t>__cuMemHostGetDevicePointer_v2 global __cuMemHostGetFlags - data["__cuMemHostGetFlags"] = <_cyb_intptr_t>__cuMemHostGetFlags + data["__cuMemHostGetFlags"] = <intptr_t>__cuMemHostGetFlags global __cuMemAllocManaged - data["__cuMemAllocManaged"] = <_cyb_intptr_t>__cuMemAllocManaged + data["__cuMemAllocManaged"] = <intptr_t>__cuMemAllocManaged global __cuDeviceRegisterAsyncNotification - data["__cuDeviceRegisterAsyncNotification"] = <_cyb_intptr_t>__cuDeviceRegisterAsyncNotification + data["__cuDeviceRegisterAsyncNotification"] = <intptr_t>__cuDeviceRegisterAsyncNotification global __cuDeviceUnregisterAsyncNotification - data["__cuDeviceUnregisterAsyncNotification"] = <_cyb_intptr_t>__cuDeviceUnregisterAsyncNotification + data["__cuDeviceUnregisterAsyncNotification"] = <intptr_t>__cuDeviceUnregisterAsyncNotification global __cuDeviceGetByPCIBusId - data["__cuDeviceGetByPCIBusId"] = <_cyb_intptr_t>__cuDeviceGetByPCIBusId + data["__cuDeviceGetByPCIBusId"] = <intptr_t>__cuDeviceGetByPCIBusId global __cuDeviceGetPCIBusId - data["__cuDeviceGetPCIBusId"] = <_cyb_intptr_t>__cuDeviceGetPCIBusId + data["__cuDeviceGetPCIBusId"] = <intptr_t>__cuDeviceGetPCIBusId global __cuIpcGetEventHandle - data["__cuIpcGetEventHandle"] = <_cyb_intptr_t>__cuIpcGetEventHandle + data["__cuIpcGetEventHandle"] = <intptr_t>__cuIpcGetEventHandle global __cuIpcOpenEventHandle - data["__cuIpcOpenEventHandle"] = <_cyb_intptr_t>__cuIpcOpenEventHandle + data["__cuIpcOpenEventHandle"] = <intptr_t>__cuIpcOpenEventHandle global __cuIpcGetMemHandle - data["__cuIpcGetMemHandle"] = <_cyb_intptr_t>__cuIpcGetMemHandle + data["__cuIpcGetMemHandle"] = <intptr_t>__cuIpcGetMemHandle global __cuIpcOpenMemHandle_v2 - data["__cuIpcOpenMemHandle_v2"] = <_cyb_intptr_t>__cuIpcOpenMemHandle_v2 + data["__cuIpcOpenMemHandle_v2"] = <intptr_t>__cuIpcOpenMemHandle_v2 global __cuIpcCloseMemHandle - data["__cuIpcCloseMemHandle"] = <_cyb_intptr_t>__cuIpcCloseMemHandle + data["__cuIpcCloseMemHandle"] = <intptr_t>__cuIpcCloseMemHandle global __cuMemHostRegister_v2 - data["__cuMemHostRegister_v2"] = <_cyb_intptr_t>__cuMemHostRegister_v2 + data["__cuMemHostRegister_v2"] = <intptr_t>__cuMemHostRegister_v2 global __cuMemHostUnregister - data["__cuMemHostUnregister"] = <_cyb_intptr_t>__cuMemHostUnregister + data["__cuMemHostUnregister"] = <intptr_t>__cuMemHostUnregister global __cuMemcpy - data["__cuMemcpy"] = <_cyb_intptr_t>__cuMemcpy + data["__cuMemcpy"] = <intptr_t>__cuMemcpy global __cuMemcpyPeer - data["__cuMemcpyPeer"] = <_cyb_intptr_t>__cuMemcpyPeer + data["__cuMemcpyPeer"] = <intptr_t>__cuMemcpyPeer global __cuMemcpyHtoD_v2 - data["__cuMemcpyHtoD_v2"] = <_cyb_intptr_t>__cuMemcpyHtoD_v2 + data["__cuMemcpyHtoD_v2"] = <intptr_t>__cuMemcpyHtoD_v2 global __cuMemcpyDtoH_v2 - data["__cuMemcpyDtoH_v2"] = <_cyb_intptr_t>__cuMemcpyDtoH_v2 + data["__cuMemcpyDtoH_v2"] = <intptr_t>__cuMemcpyDtoH_v2 global __cuMemcpyDtoD_v2 - data["__cuMemcpyDtoD_v2"] = <_cyb_intptr_t>__cuMemcpyDtoD_v2 + data["__cuMemcpyDtoD_v2"] = <intptr_t>__cuMemcpyDtoD_v2 global __cuMemcpyDtoA_v2 - data["__cuMemcpyDtoA_v2"] = <_cyb_intptr_t>__cuMemcpyDtoA_v2 + data["__cuMemcpyDtoA_v2"] = <intptr_t>__cuMemcpyDtoA_v2 global __cuMemcpyAtoD_v2 - data["__cuMemcpyAtoD_v2"] = <_cyb_intptr_t>__cuMemcpyAtoD_v2 + data["__cuMemcpyAtoD_v2"] = <intptr_t>__cuMemcpyAtoD_v2 global __cuMemcpyHtoA_v2 - data["__cuMemcpyHtoA_v2"] = <_cyb_intptr_t>__cuMemcpyHtoA_v2 + data["__cuMemcpyHtoA_v2"] = <intptr_t>__cuMemcpyHtoA_v2 global __cuMemcpyAtoH_v2 - data["__cuMemcpyAtoH_v2"] = <_cyb_intptr_t>__cuMemcpyAtoH_v2 + data["__cuMemcpyAtoH_v2"] = <intptr_t>__cuMemcpyAtoH_v2 global __cuMemcpyAtoA_v2 - data["__cuMemcpyAtoA_v2"] = <_cyb_intptr_t>__cuMemcpyAtoA_v2 + data["__cuMemcpyAtoA_v2"] = <intptr_t>__cuMemcpyAtoA_v2 global __cuMemcpy2D_v2 - data["__cuMemcpy2D_v2"] = <_cyb_intptr_t>__cuMemcpy2D_v2 + data["__cuMemcpy2D_v2"] = <intptr_t>__cuMemcpy2D_v2 global __cuMemcpy2DUnaligned_v2 - data["__cuMemcpy2DUnaligned_v2"] = <_cyb_intptr_t>__cuMemcpy2DUnaligned_v2 + data["__cuMemcpy2DUnaligned_v2"] = <intptr_t>__cuMemcpy2DUnaligned_v2 global __cuMemcpy3D_v2 - data["__cuMemcpy3D_v2"] = <_cyb_intptr_t>__cuMemcpy3D_v2 + data["__cuMemcpy3D_v2"] = <intptr_t>__cuMemcpy3D_v2 global __cuMemcpy3DPeer - data["__cuMemcpy3DPeer"] = <_cyb_intptr_t>__cuMemcpy3DPeer + data["__cuMemcpy3DPeer"] = <intptr_t>__cuMemcpy3DPeer global __cuMemcpyAsync - data["__cuMemcpyAsync"] = <_cyb_intptr_t>__cuMemcpyAsync + data["__cuMemcpyAsync"] = <intptr_t>__cuMemcpyAsync global __cuMemcpyPeerAsync - data["__cuMemcpyPeerAsync"] = <_cyb_intptr_t>__cuMemcpyPeerAsync + data["__cuMemcpyPeerAsync"] = <intptr_t>__cuMemcpyPeerAsync global __cuMemcpyHtoDAsync_v2 - data["__cuMemcpyHtoDAsync_v2"] = <_cyb_intptr_t>__cuMemcpyHtoDAsync_v2 + data["__cuMemcpyHtoDAsync_v2"] = <intptr_t>__cuMemcpyHtoDAsync_v2 global __cuMemcpyDtoHAsync_v2 - data["__cuMemcpyDtoHAsync_v2"] = <_cyb_intptr_t>__cuMemcpyDtoHAsync_v2 + data["__cuMemcpyDtoHAsync_v2"] = <intptr_t>__cuMemcpyDtoHAsync_v2 global __cuMemcpyDtoDAsync_v2 - data["__cuMemcpyDtoDAsync_v2"] = <_cyb_intptr_t>__cuMemcpyDtoDAsync_v2 + data["__cuMemcpyDtoDAsync_v2"] = <intptr_t>__cuMemcpyDtoDAsync_v2 global __cuMemcpyHtoAAsync_v2 - data["__cuMemcpyHtoAAsync_v2"] = <_cyb_intptr_t>__cuMemcpyHtoAAsync_v2 + data["__cuMemcpyHtoAAsync_v2"] = <intptr_t>__cuMemcpyHtoAAsync_v2 global __cuMemcpyAtoHAsync_v2 - data["__cuMemcpyAtoHAsync_v2"] = <_cyb_intptr_t>__cuMemcpyAtoHAsync_v2 + data["__cuMemcpyAtoHAsync_v2"] = <intptr_t>__cuMemcpyAtoHAsync_v2 global __cuMemcpy2DAsync_v2 - data["__cuMemcpy2DAsync_v2"] = <_cyb_intptr_t>__cuMemcpy2DAsync_v2 + data["__cuMemcpy2DAsync_v2"] = <intptr_t>__cuMemcpy2DAsync_v2 global __cuMemcpy3DAsync_v2 - data["__cuMemcpy3DAsync_v2"] = <_cyb_intptr_t>__cuMemcpy3DAsync_v2 + data["__cuMemcpy3DAsync_v2"] = <intptr_t>__cuMemcpy3DAsync_v2 global __cuMemcpy3DPeerAsync - data["__cuMemcpy3DPeerAsync"] = <_cyb_intptr_t>__cuMemcpy3DPeerAsync + data["__cuMemcpy3DPeerAsync"] = <intptr_t>__cuMemcpy3DPeerAsync global __cuMemsetD8_v2 - data["__cuMemsetD8_v2"] = <_cyb_intptr_t>__cuMemsetD8_v2 + data["__cuMemsetD8_v2"] = <intptr_t>__cuMemsetD8_v2 global __cuMemsetD16_v2 - data["__cuMemsetD16_v2"] = <_cyb_intptr_t>__cuMemsetD16_v2 + data["__cuMemsetD16_v2"] = <intptr_t>__cuMemsetD16_v2 global __cuMemsetD32_v2 - data["__cuMemsetD32_v2"] = <_cyb_intptr_t>__cuMemsetD32_v2 + data["__cuMemsetD32_v2"] = <intptr_t>__cuMemsetD32_v2 global __cuMemsetD2D8_v2 - data["__cuMemsetD2D8_v2"] = <_cyb_intptr_t>__cuMemsetD2D8_v2 + data["__cuMemsetD2D8_v2"] = <intptr_t>__cuMemsetD2D8_v2 global __cuMemsetD2D16_v2 - data["__cuMemsetD2D16_v2"] = <_cyb_intptr_t>__cuMemsetD2D16_v2 + data["__cuMemsetD2D16_v2"] = <intptr_t>__cuMemsetD2D16_v2 global __cuMemsetD2D32_v2 - data["__cuMemsetD2D32_v2"] = <_cyb_intptr_t>__cuMemsetD2D32_v2 + data["__cuMemsetD2D32_v2"] = <intptr_t>__cuMemsetD2D32_v2 global __cuMemsetD8Async - data["__cuMemsetD8Async"] = <_cyb_intptr_t>__cuMemsetD8Async + data["__cuMemsetD8Async"] = <intptr_t>__cuMemsetD8Async global __cuMemsetD16Async - data["__cuMemsetD16Async"] = <_cyb_intptr_t>__cuMemsetD16Async + data["__cuMemsetD16Async"] = <intptr_t>__cuMemsetD16Async global __cuMemsetD32Async - data["__cuMemsetD32Async"] = <_cyb_intptr_t>__cuMemsetD32Async + data["__cuMemsetD32Async"] = <intptr_t>__cuMemsetD32Async global __cuMemsetD2D8Async - data["__cuMemsetD2D8Async"] = <_cyb_intptr_t>__cuMemsetD2D8Async + data["__cuMemsetD2D8Async"] = <intptr_t>__cuMemsetD2D8Async global __cuMemsetD2D16Async - data["__cuMemsetD2D16Async"] = <_cyb_intptr_t>__cuMemsetD2D16Async + data["__cuMemsetD2D16Async"] = <intptr_t>__cuMemsetD2D16Async global __cuMemsetD2D32Async - data["__cuMemsetD2D32Async"] = <_cyb_intptr_t>__cuMemsetD2D32Async + data["__cuMemsetD2D32Async"] = <intptr_t>__cuMemsetD2D32Async global __cuArrayCreate_v2 - data["__cuArrayCreate_v2"] = <_cyb_intptr_t>__cuArrayCreate_v2 + data["__cuArrayCreate_v2"] = <intptr_t>__cuArrayCreate_v2 global __cuArrayGetDescriptor_v2 - data["__cuArrayGetDescriptor_v2"] = <_cyb_intptr_t>__cuArrayGetDescriptor_v2 + data["__cuArrayGetDescriptor_v2"] = <intptr_t>__cuArrayGetDescriptor_v2 global __cuArrayGetSparseProperties - data["__cuArrayGetSparseProperties"] = <_cyb_intptr_t>__cuArrayGetSparseProperties + data["__cuArrayGetSparseProperties"] = <intptr_t>__cuArrayGetSparseProperties global __cuMipmappedArrayGetSparseProperties - data["__cuMipmappedArrayGetSparseProperties"] = <_cyb_intptr_t>__cuMipmappedArrayGetSparseProperties + data["__cuMipmappedArrayGetSparseProperties"] = <intptr_t>__cuMipmappedArrayGetSparseProperties global __cuArrayGetMemoryRequirements - data["__cuArrayGetMemoryRequirements"] = <_cyb_intptr_t>__cuArrayGetMemoryRequirements + data["__cuArrayGetMemoryRequirements"] = <intptr_t>__cuArrayGetMemoryRequirements global __cuMipmappedArrayGetMemoryRequirements - data["__cuMipmappedArrayGetMemoryRequirements"] = <_cyb_intptr_t>__cuMipmappedArrayGetMemoryRequirements + data["__cuMipmappedArrayGetMemoryRequirements"] = <intptr_t>__cuMipmappedArrayGetMemoryRequirements global __cuArrayGetPlane - data["__cuArrayGetPlane"] = <_cyb_intptr_t>__cuArrayGetPlane + data["__cuArrayGetPlane"] = <intptr_t>__cuArrayGetPlane global __cuArrayDestroy - data["__cuArrayDestroy"] = <_cyb_intptr_t>__cuArrayDestroy + data["__cuArrayDestroy"] = <intptr_t>__cuArrayDestroy global __cuArray3DCreate_v2 - data["__cuArray3DCreate_v2"] = <_cyb_intptr_t>__cuArray3DCreate_v2 + data["__cuArray3DCreate_v2"] = <intptr_t>__cuArray3DCreate_v2 global __cuArray3DGetDescriptor_v2 - data["__cuArray3DGetDescriptor_v2"] = <_cyb_intptr_t>__cuArray3DGetDescriptor_v2 + data["__cuArray3DGetDescriptor_v2"] = <intptr_t>__cuArray3DGetDescriptor_v2 global __cuMipmappedArrayCreate - data["__cuMipmappedArrayCreate"] = <_cyb_intptr_t>__cuMipmappedArrayCreate + data["__cuMipmappedArrayCreate"] = <intptr_t>__cuMipmappedArrayCreate global __cuMipmappedArrayGetLevel - data["__cuMipmappedArrayGetLevel"] = <_cyb_intptr_t>__cuMipmappedArrayGetLevel + data["__cuMipmappedArrayGetLevel"] = <intptr_t>__cuMipmappedArrayGetLevel global __cuMipmappedArrayDestroy - data["__cuMipmappedArrayDestroy"] = <_cyb_intptr_t>__cuMipmappedArrayDestroy + data["__cuMipmappedArrayDestroy"] = <intptr_t>__cuMipmappedArrayDestroy global __cuMemGetHandleForAddressRange - data["__cuMemGetHandleForAddressRange"] = <_cyb_intptr_t>__cuMemGetHandleForAddressRange + data["__cuMemGetHandleForAddressRange"] = <intptr_t>__cuMemGetHandleForAddressRange global __cuMemBatchDecompressAsync - data["__cuMemBatchDecompressAsync"] = <_cyb_intptr_t>__cuMemBatchDecompressAsync + data["__cuMemBatchDecompressAsync"] = <intptr_t>__cuMemBatchDecompressAsync global __cuMemAddressReserve - data["__cuMemAddressReserve"] = <_cyb_intptr_t>__cuMemAddressReserve + data["__cuMemAddressReserve"] = <intptr_t>__cuMemAddressReserve global __cuMemAddressFree - data["__cuMemAddressFree"] = <_cyb_intptr_t>__cuMemAddressFree + data["__cuMemAddressFree"] = <intptr_t>__cuMemAddressFree global __cuMemCreate - data["__cuMemCreate"] = <_cyb_intptr_t>__cuMemCreate + data["__cuMemCreate"] = <intptr_t>__cuMemCreate global __cuMemRelease - data["__cuMemRelease"] = <_cyb_intptr_t>__cuMemRelease + data["__cuMemRelease"] = <intptr_t>__cuMemRelease global __cuMemMap - data["__cuMemMap"] = <_cyb_intptr_t>__cuMemMap + data["__cuMemMap"] = <intptr_t>__cuMemMap global __cuMemMapArrayAsync - data["__cuMemMapArrayAsync"] = <_cyb_intptr_t>__cuMemMapArrayAsync + data["__cuMemMapArrayAsync"] = <intptr_t>__cuMemMapArrayAsync global __cuMemUnmap - data["__cuMemUnmap"] = <_cyb_intptr_t>__cuMemUnmap + data["__cuMemUnmap"] = <intptr_t>__cuMemUnmap global __cuMemSetAccess - data["__cuMemSetAccess"] = <_cyb_intptr_t>__cuMemSetAccess + data["__cuMemSetAccess"] = <intptr_t>__cuMemSetAccess global __cuMemGetAccess - data["__cuMemGetAccess"] = <_cyb_intptr_t>__cuMemGetAccess + data["__cuMemGetAccess"] = <intptr_t>__cuMemGetAccess global __cuMemExportToShareableHandle - data["__cuMemExportToShareableHandle"] = <_cyb_intptr_t>__cuMemExportToShareableHandle + data["__cuMemExportToShareableHandle"] = <intptr_t>__cuMemExportToShareableHandle global __cuMemImportFromShareableHandle - data["__cuMemImportFromShareableHandle"] = <_cyb_intptr_t>__cuMemImportFromShareableHandle + data["__cuMemImportFromShareableHandle"] = <intptr_t>__cuMemImportFromShareableHandle global __cuMemGetAllocationGranularity - data["__cuMemGetAllocationGranularity"] = <_cyb_intptr_t>__cuMemGetAllocationGranularity + data["__cuMemGetAllocationGranularity"] = <intptr_t>__cuMemGetAllocationGranularity global __cuMemGetAllocationPropertiesFromHandle - data["__cuMemGetAllocationPropertiesFromHandle"] = <_cyb_intptr_t>__cuMemGetAllocationPropertiesFromHandle + data["__cuMemGetAllocationPropertiesFromHandle"] = <intptr_t>__cuMemGetAllocationPropertiesFromHandle global __cuMemRetainAllocationHandle - data["__cuMemRetainAllocationHandle"] = <_cyb_intptr_t>__cuMemRetainAllocationHandle + data["__cuMemRetainAllocationHandle"] = <intptr_t>__cuMemRetainAllocationHandle global __cuMemFreeAsync - data["__cuMemFreeAsync"] = <_cyb_intptr_t>__cuMemFreeAsync + data["__cuMemFreeAsync"] = <intptr_t>__cuMemFreeAsync global __cuMemAllocAsync - data["__cuMemAllocAsync"] = <_cyb_intptr_t>__cuMemAllocAsync + data["__cuMemAllocAsync"] = <intptr_t>__cuMemAllocAsync global __cuMemPoolTrimTo - data["__cuMemPoolTrimTo"] = <_cyb_intptr_t>__cuMemPoolTrimTo + data["__cuMemPoolTrimTo"] = <intptr_t>__cuMemPoolTrimTo global __cuMemPoolSetAttribute - data["__cuMemPoolSetAttribute"] = <_cyb_intptr_t>__cuMemPoolSetAttribute + data["__cuMemPoolSetAttribute"] = <intptr_t>__cuMemPoolSetAttribute global __cuMemPoolGetAttribute - data["__cuMemPoolGetAttribute"] = <_cyb_intptr_t>__cuMemPoolGetAttribute + data["__cuMemPoolGetAttribute"] = <intptr_t>__cuMemPoolGetAttribute global __cuMemPoolSetAccess - data["__cuMemPoolSetAccess"] = <_cyb_intptr_t>__cuMemPoolSetAccess + data["__cuMemPoolSetAccess"] = <intptr_t>__cuMemPoolSetAccess global __cuMemPoolGetAccess - data["__cuMemPoolGetAccess"] = <_cyb_intptr_t>__cuMemPoolGetAccess + data["__cuMemPoolGetAccess"] = <intptr_t>__cuMemPoolGetAccess global __cuMemPoolCreate - data["__cuMemPoolCreate"] = <_cyb_intptr_t>__cuMemPoolCreate + data["__cuMemPoolCreate"] = <intptr_t>__cuMemPoolCreate global __cuMemPoolDestroy - data["__cuMemPoolDestroy"] = <_cyb_intptr_t>__cuMemPoolDestroy + data["__cuMemPoolDestroy"] = <intptr_t>__cuMemPoolDestroy global __cuMemAllocFromPoolAsync - data["__cuMemAllocFromPoolAsync"] = <_cyb_intptr_t>__cuMemAllocFromPoolAsync + data["__cuMemAllocFromPoolAsync"] = <intptr_t>__cuMemAllocFromPoolAsync global __cuMemPoolExportToShareableHandle - data["__cuMemPoolExportToShareableHandle"] = <_cyb_intptr_t>__cuMemPoolExportToShareableHandle + data["__cuMemPoolExportToShareableHandle"] = <intptr_t>__cuMemPoolExportToShareableHandle global __cuMemPoolImportFromShareableHandle - data["__cuMemPoolImportFromShareableHandle"] = <_cyb_intptr_t>__cuMemPoolImportFromShareableHandle + data["__cuMemPoolImportFromShareableHandle"] = <intptr_t>__cuMemPoolImportFromShareableHandle global __cuMemPoolExportPointer - data["__cuMemPoolExportPointer"] = <_cyb_intptr_t>__cuMemPoolExportPointer + data["__cuMemPoolExportPointer"] = <intptr_t>__cuMemPoolExportPointer global __cuMemPoolImportPointer - data["__cuMemPoolImportPointer"] = <_cyb_intptr_t>__cuMemPoolImportPointer + data["__cuMemPoolImportPointer"] = <intptr_t>__cuMemPoolImportPointer global __cuMulticastCreate - data["__cuMulticastCreate"] = <_cyb_intptr_t>__cuMulticastCreate + data["__cuMulticastCreate"] = <intptr_t>__cuMulticastCreate global __cuMulticastAddDevice - data["__cuMulticastAddDevice"] = <_cyb_intptr_t>__cuMulticastAddDevice + data["__cuMulticastAddDevice"] = <intptr_t>__cuMulticastAddDevice global __cuMulticastBindMem - data["__cuMulticastBindMem"] = <_cyb_intptr_t>__cuMulticastBindMem + data["__cuMulticastBindMem"] = <intptr_t>__cuMulticastBindMem global __cuMulticastBindAddr - data["__cuMulticastBindAddr"] = <_cyb_intptr_t>__cuMulticastBindAddr + data["__cuMulticastBindAddr"] = <intptr_t>__cuMulticastBindAddr global __cuMulticastUnbind - data["__cuMulticastUnbind"] = <_cyb_intptr_t>__cuMulticastUnbind + data["__cuMulticastUnbind"] = <intptr_t>__cuMulticastUnbind global __cuMulticastGetGranularity - data["__cuMulticastGetGranularity"] = <_cyb_intptr_t>__cuMulticastGetGranularity + data["__cuMulticastGetGranularity"] = <intptr_t>__cuMulticastGetGranularity global __cuPointerGetAttribute - data["__cuPointerGetAttribute"] = <_cyb_intptr_t>__cuPointerGetAttribute + data["__cuPointerGetAttribute"] = <intptr_t>__cuPointerGetAttribute global __cuMemPrefetchAsync_v2 - data["__cuMemPrefetchAsync_v2"] = <_cyb_intptr_t>__cuMemPrefetchAsync_v2 + data["__cuMemPrefetchAsync_v2"] = <intptr_t>__cuMemPrefetchAsync_v2 global __cuMemAdvise_v2 - data["__cuMemAdvise_v2"] = <_cyb_intptr_t>__cuMemAdvise_v2 + data["__cuMemAdvise_v2"] = <intptr_t>__cuMemAdvise_v2 global __cuMemRangeGetAttribute - data["__cuMemRangeGetAttribute"] = <_cyb_intptr_t>__cuMemRangeGetAttribute + data["__cuMemRangeGetAttribute"] = <intptr_t>__cuMemRangeGetAttribute global __cuMemRangeGetAttributes - data["__cuMemRangeGetAttributes"] = <_cyb_intptr_t>__cuMemRangeGetAttributes + data["__cuMemRangeGetAttributes"] = <intptr_t>__cuMemRangeGetAttributes global __cuPointerSetAttribute - data["__cuPointerSetAttribute"] = <_cyb_intptr_t>__cuPointerSetAttribute + data["__cuPointerSetAttribute"] = <intptr_t>__cuPointerSetAttribute global __cuPointerGetAttributes - data["__cuPointerGetAttributes"] = <_cyb_intptr_t>__cuPointerGetAttributes + data["__cuPointerGetAttributes"] = <intptr_t>__cuPointerGetAttributes global __cuStreamCreate - data["__cuStreamCreate"] = <_cyb_intptr_t>__cuStreamCreate + data["__cuStreamCreate"] = <intptr_t>__cuStreamCreate global __cuStreamCreateWithPriority - data["__cuStreamCreateWithPriority"] = <_cyb_intptr_t>__cuStreamCreateWithPriority + data["__cuStreamCreateWithPriority"] = <intptr_t>__cuStreamCreateWithPriority global __cuStreamGetPriority - data["__cuStreamGetPriority"] = <_cyb_intptr_t>__cuStreamGetPriority + data["__cuStreamGetPriority"] = <intptr_t>__cuStreamGetPriority global __cuStreamGetDevice - data["__cuStreamGetDevice"] = <_cyb_intptr_t>__cuStreamGetDevice + data["__cuStreamGetDevice"] = <intptr_t>__cuStreamGetDevice global __cuStreamGetFlags - data["__cuStreamGetFlags"] = <_cyb_intptr_t>__cuStreamGetFlags + data["__cuStreamGetFlags"] = <intptr_t>__cuStreamGetFlags global __cuStreamGetId - data["__cuStreamGetId"] = <_cyb_intptr_t>__cuStreamGetId + data["__cuStreamGetId"] = <intptr_t>__cuStreamGetId global __cuStreamGetCtx - data["__cuStreamGetCtx"] = <_cyb_intptr_t>__cuStreamGetCtx + data["__cuStreamGetCtx"] = <intptr_t>__cuStreamGetCtx global __cuStreamGetCtx_v2 - data["__cuStreamGetCtx_v2"] = <_cyb_intptr_t>__cuStreamGetCtx_v2 + data["__cuStreamGetCtx_v2"] = <intptr_t>__cuStreamGetCtx_v2 global __cuStreamWaitEvent - data["__cuStreamWaitEvent"] = <_cyb_intptr_t>__cuStreamWaitEvent + data["__cuStreamWaitEvent"] = <intptr_t>__cuStreamWaitEvent global __cuStreamAddCallback - data["__cuStreamAddCallback"] = <_cyb_intptr_t>__cuStreamAddCallback + data["__cuStreamAddCallback"] = <intptr_t>__cuStreamAddCallback global __cuStreamBeginCapture_v2 - data["__cuStreamBeginCapture_v2"] = <_cyb_intptr_t>__cuStreamBeginCapture_v2 + data["__cuStreamBeginCapture_v2"] = <intptr_t>__cuStreamBeginCapture_v2 global __cuStreamBeginCaptureToGraph - data["__cuStreamBeginCaptureToGraph"] = <_cyb_intptr_t>__cuStreamBeginCaptureToGraph + data["__cuStreamBeginCaptureToGraph"] = <intptr_t>__cuStreamBeginCaptureToGraph global __cuThreadExchangeStreamCaptureMode - data["__cuThreadExchangeStreamCaptureMode"] = <_cyb_intptr_t>__cuThreadExchangeStreamCaptureMode + data["__cuThreadExchangeStreamCaptureMode"] = <intptr_t>__cuThreadExchangeStreamCaptureMode global __cuStreamEndCapture - data["__cuStreamEndCapture"] = <_cyb_intptr_t>__cuStreamEndCapture + data["__cuStreamEndCapture"] = <intptr_t>__cuStreamEndCapture global __cuStreamIsCapturing - data["__cuStreamIsCapturing"] = <_cyb_intptr_t>__cuStreamIsCapturing + data["__cuStreamIsCapturing"] = <intptr_t>__cuStreamIsCapturing global __cuStreamGetCaptureInfo_v2 - data["__cuStreamGetCaptureInfo_v2"] = <_cyb_intptr_t>__cuStreamGetCaptureInfo_v2 + data["__cuStreamGetCaptureInfo_v2"] = <intptr_t>__cuStreamGetCaptureInfo_v2 global __cuStreamGetCaptureInfo_v3 - data["__cuStreamGetCaptureInfo_v3"] = <_cyb_intptr_t>__cuStreamGetCaptureInfo_v3 + data["__cuStreamGetCaptureInfo_v3"] = <intptr_t>__cuStreamGetCaptureInfo_v3 global __cuStreamUpdateCaptureDependencies_v2 - data["__cuStreamUpdateCaptureDependencies_v2"] = <_cyb_intptr_t>__cuStreamUpdateCaptureDependencies_v2 + data["__cuStreamUpdateCaptureDependencies_v2"] = <intptr_t>__cuStreamUpdateCaptureDependencies_v2 global __cuStreamAttachMemAsync - data["__cuStreamAttachMemAsync"] = <_cyb_intptr_t>__cuStreamAttachMemAsync + data["__cuStreamAttachMemAsync"] = <intptr_t>__cuStreamAttachMemAsync global __cuStreamQuery - data["__cuStreamQuery"] = <_cyb_intptr_t>__cuStreamQuery + data["__cuStreamQuery"] = <intptr_t>__cuStreamQuery global __cuStreamSynchronize - data["__cuStreamSynchronize"] = <_cyb_intptr_t>__cuStreamSynchronize + data["__cuStreamSynchronize"] = <intptr_t>__cuStreamSynchronize global __cuStreamDestroy_v2 - data["__cuStreamDestroy_v2"] = <_cyb_intptr_t>__cuStreamDestroy_v2 + data["__cuStreamDestroy_v2"] = <intptr_t>__cuStreamDestroy_v2 global __cuStreamCopyAttributes - data["__cuStreamCopyAttributes"] = <_cyb_intptr_t>__cuStreamCopyAttributes + data["__cuStreamCopyAttributes"] = <intptr_t>__cuStreamCopyAttributes global __cuStreamGetAttribute - data["__cuStreamGetAttribute"] = <_cyb_intptr_t>__cuStreamGetAttribute + data["__cuStreamGetAttribute"] = <intptr_t>__cuStreamGetAttribute global __cuStreamSetAttribute - data["__cuStreamSetAttribute"] = <_cyb_intptr_t>__cuStreamSetAttribute + data["__cuStreamSetAttribute"] = <intptr_t>__cuStreamSetAttribute global __cuEventCreate - data["__cuEventCreate"] = <_cyb_intptr_t>__cuEventCreate + data["__cuEventCreate"] = <intptr_t>__cuEventCreate global __cuEventRecord - data["__cuEventRecord"] = <_cyb_intptr_t>__cuEventRecord + data["__cuEventRecord"] = <intptr_t>__cuEventRecord global __cuEventRecordWithFlags - data["__cuEventRecordWithFlags"] = <_cyb_intptr_t>__cuEventRecordWithFlags + data["__cuEventRecordWithFlags"] = <intptr_t>__cuEventRecordWithFlags global __cuEventQuery - data["__cuEventQuery"] = <_cyb_intptr_t>__cuEventQuery + data["__cuEventQuery"] = <intptr_t>__cuEventQuery global __cuEventSynchronize - data["__cuEventSynchronize"] = <_cyb_intptr_t>__cuEventSynchronize + data["__cuEventSynchronize"] = <intptr_t>__cuEventSynchronize global __cuEventDestroy_v2 - data["__cuEventDestroy_v2"] = <_cyb_intptr_t>__cuEventDestroy_v2 + data["__cuEventDestroy_v2"] = <intptr_t>__cuEventDestroy_v2 global __cuEventElapsedTime_v2 - data["__cuEventElapsedTime_v2"] = <_cyb_intptr_t>__cuEventElapsedTime_v2 + data["__cuEventElapsedTime_v2"] = <intptr_t>__cuEventElapsedTime_v2 global __cuImportExternalMemory - data["__cuImportExternalMemory"] = <_cyb_intptr_t>__cuImportExternalMemory + data["__cuImportExternalMemory"] = <intptr_t>__cuImportExternalMemory global __cuExternalMemoryGetMappedBuffer - data["__cuExternalMemoryGetMappedBuffer"] = <_cyb_intptr_t>__cuExternalMemoryGetMappedBuffer + data["__cuExternalMemoryGetMappedBuffer"] = <intptr_t>__cuExternalMemoryGetMappedBuffer global __cuExternalMemoryGetMappedMipmappedArray - data["__cuExternalMemoryGetMappedMipmappedArray"] = <_cyb_intptr_t>__cuExternalMemoryGetMappedMipmappedArray + data["__cuExternalMemoryGetMappedMipmappedArray"] = <intptr_t>__cuExternalMemoryGetMappedMipmappedArray global __cuDestroyExternalMemory - data["__cuDestroyExternalMemory"] = <_cyb_intptr_t>__cuDestroyExternalMemory + data["__cuDestroyExternalMemory"] = <intptr_t>__cuDestroyExternalMemory global __cuImportExternalSemaphore - data["__cuImportExternalSemaphore"] = <_cyb_intptr_t>__cuImportExternalSemaphore + data["__cuImportExternalSemaphore"] = <intptr_t>__cuImportExternalSemaphore global __cuSignalExternalSemaphoresAsync - data["__cuSignalExternalSemaphoresAsync"] = <_cyb_intptr_t>__cuSignalExternalSemaphoresAsync + data["__cuSignalExternalSemaphoresAsync"] = <intptr_t>__cuSignalExternalSemaphoresAsync global __cuWaitExternalSemaphoresAsync - data["__cuWaitExternalSemaphoresAsync"] = <_cyb_intptr_t>__cuWaitExternalSemaphoresAsync + data["__cuWaitExternalSemaphoresAsync"] = <intptr_t>__cuWaitExternalSemaphoresAsync global __cuDestroyExternalSemaphore - data["__cuDestroyExternalSemaphore"] = <_cyb_intptr_t>__cuDestroyExternalSemaphore + data["__cuDestroyExternalSemaphore"] = <intptr_t>__cuDestroyExternalSemaphore global __cuStreamWaitValue32_v2 - data["__cuStreamWaitValue32_v2"] = <_cyb_intptr_t>__cuStreamWaitValue32_v2 + data["__cuStreamWaitValue32_v2"] = <intptr_t>__cuStreamWaitValue32_v2 global __cuStreamWaitValue64_v2 - data["__cuStreamWaitValue64_v2"] = <_cyb_intptr_t>__cuStreamWaitValue64_v2 + data["__cuStreamWaitValue64_v2"] = <intptr_t>__cuStreamWaitValue64_v2 global __cuStreamWriteValue32_v2 - data["__cuStreamWriteValue32_v2"] = <_cyb_intptr_t>__cuStreamWriteValue32_v2 + data["__cuStreamWriteValue32_v2"] = <intptr_t>__cuStreamWriteValue32_v2 global __cuStreamWriteValue64_v2 - data["__cuStreamWriteValue64_v2"] = <_cyb_intptr_t>__cuStreamWriteValue64_v2 + data["__cuStreamWriteValue64_v2"] = <intptr_t>__cuStreamWriteValue64_v2 global __cuStreamBatchMemOp_v2 - data["__cuStreamBatchMemOp_v2"] = <_cyb_intptr_t>__cuStreamBatchMemOp_v2 + data["__cuStreamBatchMemOp_v2"] = <intptr_t>__cuStreamBatchMemOp_v2 global __cuFuncGetAttribute - data["__cuFuncGetAttribute"] = <_cyb_intptr_t>__cuFuncGetAttribute + data["__cuFuncGetAttribute"] = <intptr_t>__cuFuncGetAttribute global __cuFuncSetAttribute - data["__cuFuncSetAttribute"] = <_cyb_intptr_t>__cuFuncSetAttribute + data["__cuFuncSetAttribute"] = <intptr_t>__cuFuncSetAttribute global __cuFuncSetCacheConfig - data["__cuFuncSetCacheConfig"] = <_cyb_intptr_t>__cuFuncSetCacheConfig + data["__cuFuncSetCacheConfig"] = <intptr_t>__cuFuncSetCacheConfig global __cuFuncGetModule - data["__cuFuncGetModule"] = <_cyb_intptr_t>__cuFuncGetModule + data["__cuFuncGetModule"] = <intptr_t>__cuFuncGetModule global __cuFuncGetName - data["__cuFuncGetName"] = <_cyb_intptr_t>__cuFuncGetName + data["__cuFuncGetName"] = <intptr_t>__cuFuncGetName global __cuFuncGetParamInfo - data["__cuFuncGetParamInfo"] = <_cyb_intptr_t>__cuFuncGetParamInfo + data["__cuFuncGetParamInfo"] = <intptr_t>__cuFuncGetParamInfo global __cuFuncIsLoaded - data["__cuFuncIsLoaded"] = <_cyb_intptr_t>__cuFuncIsLoaded + data["__cuFuncIsLoaded"] = <intptr_t>__cuFuncIsLoaded global __cuFuncLoad - data["__cuFuncLoad"] = <_cyb_intptr_t>__cuFuncLoad + data["__cuFuncLoad"] = <intptr_t>__cuFuncLoad global __cuLaunchKernel - data["__cuLaunchKernel"] = <_cyb_intptr_t>__cuLaunchKernel + data["__cuLaunchKernel"] = <intptr_t>__cuLaunchKernel global __cuLaunchKernelEx - data["__cuLaunchKernelEx"] = <_cyb_intptr_t>__cuLaunchKernelEx + data["__cuLaunchKernelEx"] = <intptr_t>__cuLaunchKernelEx global __cuLaunchCooperativeKernel - data["__cuLaunchCooperativeKernel"] = <_cyb_intptr_t>__cuLaunchCooperativeKernel + data["__cuLaunchCooperativeKernel"] = <intptr_t>__cuLaunchCooperativeKernel global __cuLaunchCooperativeKernelMultiDevice - data["__cuLaunchCooperativeKernelMultiDevice"] = <_cyb_intptr_t>__cuLaunchCooperativeKernelMultiDevice + data["__cuLaunchCooperativeKernelMultiDevice"] = <intptr_t>__cuLaunchCooperativeKernelMultiDevice global __cuLaunchHostFunc - data["__cuLaunchHostFunc"] = <_cyb_intptr_t>__cuLaunchHostFunc + data["__cuLaunchHostFunc"] = <intptr_t>__cuLaunchHostFunc global __cuFuncSetBlockShape - data["__cuFuncSetBlockShape"] = <_cyb_intptr_t>__cuFuncSetBlockShape + data["__cuFuncSetBlockShape"] = <intptr_t>__cuFuncSetBlockShape global __cuFuncSetSharedSize - data["__cuFuncSetSharedSize"] = <_cyb_intptr_t>__cuFuncSetSharedSize + data["__cuFuncSetSharedSize"] = <intptr_t>__cuFuncSetSharedSize global __cuParamSetSize - data["__cuParamSetSize"] = <_cyb_intptr_t>__cuParamSetSize + data["__cuParamSetSize"] = <intptr_t>__cuParamSetSize global __cuParamSeti - data["__cuParamSeti"] = <_cyb_intptr_t>__cuParamSeti + data["__cuParamSeti"] = <intptr_t>__cuParamSeti global __cuParamSetf - data["__cuParamSetf"] = <_cyb_intptr_t>__cuParamSetf + data["__cuParamSetf"] = <intptr_t>__cuParamSetf global __cuParamSetv - data["__cuParamSetv"] = <_cyb_intptr_t>__cuParamSetv + data["__cuParamSetv"] = <intptr_t>__cuParamSetv global __cuLaunch - data["__cuLaunch"] = <_cyb_intptr_t>__cuLaunch + data["__cuLaunch"] = <intptr_t>__cuLaunch global __cuLaunchGrid - data["__cuLaunchGrid"] = <_cyb_intptr_t>__cuLaunchGrid + data["__cuLaunchGrid"] = <intptr_t>__cuLaunchGrid global __cuLaunchGridAsync - data["__cuLaunchGridAsync"] = <_cyb_intptr_t>__cuLaunchGridAsync + data["__cuLaunchGridAsync"] = <intptr_t>__cuLaunchGridAsync global __cuParamSetTexRef - data["__cuParamSetTexRef"] = <_cyb_intptr_t>__cuParamSetTexRef + data["__cuParamSetTexRef"] = <intptr_t>__cuParamSetTexRef global __cuFuncSetSharedMemConfig - data["__cuFuncSetSharedMemConfig"] = <_cyb_intptr_t>__cuFuncSetSharedMemConfig + data["__cuFuncSetSharedMemConfig"] = <intptr_t>__cuFuncSetSharedMemConfig global __cuGraphCreate - data["__cuGraphCreate"] = <_cyb_intptr_t>__cuGraphCreate + data["__cuGraphCreate"] = <intptr_t>__cuGraphCreate global __cuGraphAddKernelNode_v2 - data["__cuGraphAddKernelNode_v2"] = <_cyb_intptr_t>__cuGraphAddKernelNode_v2 + data["__cuGraphAddKernelNode_v2"] = <intptr_t>__cuGraphAddKernelNode_v2 global __cuGraphKernelNodeGetParams_v2 - data["__cuGraphKernelNodeGetParams_v2"] = <_cyb_intptr_t>__cuGraphKernelNodeGetParams_v2 + data["__cuGraphKernelNodeGetParams_v2"] = <intptr_t>__cuGraphKernelNodeGetParams_v2 global __cuGraphKernelNodeSetParams_v2 - data["__cuGraphKernelNodeSetParams_v2"] = <_cyb_intptr_t>__cuGraphKernelNodeSetParams_v2 + data["__cuGraphKernelNodeSetParams_v2"] = <intptr_t>__cuGraphKernelNodeSetParams_v2 global __cuGraphAddMemcpyNode - data["__cuGraphAddMemcpyNode"] = <_cyb_intptr_t>__cuGraphAddMemcpyNode + data["__cuGraphAddMemcpyNode"] = <intptr_t>__cuGraphAddMemcpyNode global __cuGraphMemcpyNodeGetParams - data["__cuGraphMemcpyNodeGetParams"] = <_cyb_intptr_t>__cuGraphMemcpyNodeGetParams + data["__cuGraphMemcpyNodeGetParams"] = <intptr_t>__cuGraphMemcpyNodeGetParams global __cuGraphMemcpyNodeSetParams - data["__cuGraphMemcpyNodeSetParams"] = <_cyb_intptr_t>__cuGraphMemcpyNodeSetParams + data["__cuGraphMemcpyNodeSetParams"] = <intptr_t>__cuGraphMemcpyNodeSetParams global __cuGraphAddMemsetNode - data["__cuGraphAddMemsetNode"] = <_cyb_intptr_t>__cuGraphAddMemsetNode + data["__cuGraphAddMemsetNode"] = <intptr_t>__cuGraphAddMemsetNode global __cuGraphMemsetNodeGetParams - data["__cuGraphMemsetNodeGetParams"] = <_cyb_intptr_t>__cuGraphMemsetNodeGetParams + data["__cuGraphMemsetNodeGetParams"] = <intptr_t>__cuGraphMemsetNodeGetParams global __cuGraphMemsetNodeSetParams - data["__cuGraphMemsetNodeSetParams"] = <_cyb_intptr_t>__cuGraphMemsetNodeSetParams + data["__cuGraphMemsetNodeSetParams"] = <intptr_t>__cuGraphMemsetNodeSetParams global __cuGraphAddHostNode - data["__cuGraphAddHostNode"] = <_cyb_intptr_t>__cuGraphAddHostNode + data["__cuGraphAddHostNode"] = <intptr_t>__cuGraphAddHostNode global __cuGraphHostNodeGetParams - data["__cuGraphHostNodeGetParams"] = <_cyb_intptr_t>__cuGraphHostNodeGetParams + data["__cuGraphHostNodeGetParams"] = <intptr_t>__cuGraphHostNodeGetParams global __cuGraphHostNodeSetParams - data["__cuGraphHostNodeSetParams"] = <_cyb_intptr_t>__cuGraphHostNodeSetParams + data["__cuGraphHostNodeSetParams"] = <intptr_t>__cuGraphHostNodeSetParams global __cuGraphAddChildGraphNode - data["__cuGraphAddChildGraphNode"] = <_cyb_intptr_t>__cuGraphAddChildGraphNode + data["__cuGraphAddChildGraphNode"] = <intptr_t>__cuGraphAddChildGraphNode global __cuGraphChildGraphNodeGetGraph - data["__cuGraphChildGraphNodeGetGraph"] = <_cyb_intptr_t>__cuGraphChildGraphNodeGetGraph + data["__cuGraphChildGraphNodeGetGraph"] = <intptr_t>__cuGraphChildGraphNodeGetGraph global __cuGraphAddEmptyNode - data["__cuGraphAddEmptyNode"] = <_cyb_intptr_t>__cuGraphAddEmptyNode + data["__cuGraphAddEmptyNode"] = <intptr_t>__cuGraphAddEmptyNode global __cuGraphAddEventRecordNode - data["__cuGraphAddEventRecordNode"] = <_cyb_intptr_t>__cuGraphAddEventRecordNode + data["__cuGraphAddEventRecordNode"] = <intptr_t>__cuGraphAddEventRecordNode global __cuGraphEventRecordNodeGetEvent - data["__cuGraphEventRecordNodeGetEvent"] = <_cyb_intptr_t>__cuGraphEventRecordNodeGetEvent + data["__cuGraphEventRecordNodeGetEvent"] = <intptr_t>__cuGraphEventRecordNodeGetEvent global __cuGraphEventRecordNodeSetEvent - data["__cuGraphEventRecordNodeSetEvent"] = <_cyb_intptr_t>__cuGraphEventRecordNodeSetEvent + data["__cuGraphEventRecordNodeSetEvent"] = <intptr_t>__cuGraphEventRecordNodeSetEvent global __cuGraphAddEventWaitNode - data["__cuGraphAddEventWaitNode"] = <_cyb_intptr_t>__cuGraphAddEventWaitNode + data["__cuGraphAddEventWaitNode"] = <intptr_t>__cuGraphAddEventWaitNode global __cuGraphEventWaitNodeGetEvent - data["__cuGraphEventWaitNodeGetEvent"] = <_cyb_intptr_t>__cuGraphEventWaitNodeGetEvent + data["__cuGraphEventWaitNodeGetEvent"] = <intptr_t>__cuGraphEventWaitNodeGetEvent global __cuGraphEventWaitNodeSetEvent - data["__cuGraphEventWaitNodeSetEvent"] = <_cyb_intptr_t>__cuGraphEventWaitNodeSetEvent + data["__cuGraphEventWaitNodeSetEvent"] = <intptr_t>__cuGraphEventWaitNodeSetEvent global __cuGraphAddExternalSemaphoresSignalNode - data["__cuGraphAddExternalSemaphoresSignalNode"] = <_cyb_intptr_t>__cuGraphAddExternalSemaphoresSignalNode + data["__cuGraphAddExternalSemaphoresSignalNode"] = <intptr_t>__cuGraphAddExternalSemaphoresSignalNode global __cuGraphExternalSemaphoresSignalNodeGetParams - data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = <_cyb_intptr_t>__cuGraphExternalSemaphoresSignalNodeGetParams + data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = <intptr_t>__cuGraphExternalSemaphoresSignalNodeGetParams global __cuGraphExternalSemaphoresSignalNodeSetParams - data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = <_cyb_intptr_t>__cuGraphExternalSemaphoresSignalNodeSetParams + data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = <intptr_t>__cuGraphExternalSemaphoresSignalNodeSetParams global __cuGraphAddExternalSemaphoresWaitNode - data["__cuGraphAddExternalSemaphoresWaitNode"] = <_cyb_intptr_t>__cuGraphAddExternalSemaphoresWaitNode + data["__cuGraphAddExternalSemaphoresWaitNode"] = <intptr_t>__cuGraphAddExternalSemaphoresWaitNode global __cuGraphExternalSemaphoresWaitNodeGetParams - data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = <_cyb_intptr_t>__cuGraphExternalSemaphoresWaitNodeGetParams + data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = <intptr_t>__cuGraphExternalSemaphoresWaitNodeGetParams global __cuGraphExternalSemaphoresWaitNodeSetParams - data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = <_cyb_intptr_t>__cuGraphExternalSemaphoresWaitNodeSetParams + data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = <intptr_t>__cuGraphExternalSemaphoresWaitNodeSetParams global __cuGraphAddBatchMemOpNode - data["__cuGraphAddBatchMemOpNode"] = <_cyb_intptr_t>__cuGraphAddBatchMemOpNode + data["__cuGraphAddBatchMemOpNode"] = <intptr_t>__cuGraphAddBatchMemOpNode global __cuGraphBatchMemOpNodeGetParams - data["__cuGraphBatchMemOpNodeGetParams"] = <_cyb_intptr_t>__cuGraphBatchMemOpNodeGetParams + data["__cuGraphBatchMemOpNodeGetParams"] = <intptr_t>__cuGraphBatchMemOpNodeGetParams global __cuGraphBatchMemOpNodeSetParams - data["__cuGraphBatchMemOpNodeSetParams"] = <_cyb_intptr_t>__cuGraphBatchMemOpNodeSetParams + data["__cuGraphBatchMemOpNodeSetParams"] = <intptr_t>__cuGraphBatchMemOpNodeSetParams global __cuGraphExecBatchMemOpNodeSetParams - data["__cuGraphExecBatchMemOpNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecBatchMemOpNodeSetParams + data["__cuGraphExecBatchMemOpNodeSetParams"] = <intptr_t>__cuGraphExecBatchMemOpNodeSetParams global __cuGraphAddMemAllocNode - data["__cuGraphAddMemAllocNode"] = <_cyb_intptr_t>__cuGraphAddMemAllocNode + data["__cuGraphAddMemAllocNode"] = <intptr_t>__cuGraphAddMemAllocNode global __cuGraphMemAllocNodeGetParams - data["__cuGraphMemAllocNodeGetParams"] = <_cyb_intptr_t>__cuGraphMemAllocNodeGetParams + data["__cuGraphMemAllocNodeGetParams"] = <intptr_t>__cuGraphMemAllocNodeGetParams global __cuGraphAddMemFreeNode - data["__cuGraphAddMemFreeNode"] = <_cyb_intptr_t>__cuGraphAddMemFreeNode + data["__cuGraphAddMemFreeNode"] = <intptr_t>__cuGraphAddMemFreeNode global __cuGraphMemFreeNodeGetParams - data["__cuGraphMemFreeNodeGetParams"] = <_cyb_intptr_t>__cuGraphMemFreeNodeGetParams + data["__cuGraphMemFreeNodeGetParams"] = <intptr_t>__cuGraphMemFreeNodeGetParams global __cuDeviceGraphMemTrim - data["__cuDeviceGraphMemTrim"] = <_cyb_intptr_t>__cuDeviceGraphMemTrim + data["__cuDeviceGraphMemTrim"] = <intptr_t>__cuDeviceGraphMemTrim global __cuDeviceGetGraphMemAttribute - data["__cuDeviceGetGraphMemAttribute"] = <_cyb_intptr_t>__cuDeviceGetGraphMemAttribute + data["__cuDeviceGetGraphMemAttribute"] = <intptr_t>__cuDeviceGetGraphMemAttribute global __cuDeviceSetGraphMemAttribute - data["__cuDeviceSetGraphMemAttribute"] = <_cyb_intptr_t>__cuDeviceSetGraphMemAttribute + data["__cuDeviceSetGraphMemAttribute"] = <intptr_t>__cuDeviceSetGraphMemAttribute global __cuGraphClone - data["__cuGraphClone"] = <_cyb_intptr_t>__cuGraphClone + data["__cuGraphClone"] = <intptr_t>__cuGraphClone global __cuGraphNodeFindInClone - data["__cuGraphNodeFindInClone"] = <_cyb_intptr_t>__cuGraphNodeFindInClone + data["__cuGraphNodeFindInClone"] = <intptr_t>__cuGraphNodeFindInClone global __cuGraphNodeGetType - data["__cuGraphNodeGetType"] = <_cyb_intptr_t>__cuGraphNodeGetType + data["__cuGraphNodeGetType"] = <intptr_t>__cuGraphNodeGetType global __cuGraphGetNodes - data["__cuGraphGetNodes"] = <_cyb_intptr_t>__cuGraphGetNodes + data["__cuGraphGetNodes"] = <intptr_t>__cuGraphGetNodes global __cuGraphGetRootNodes - data["__cuGraphGetRootNodes"] = <_cyb_intptr_t>__cuGraphGetRootNodes + data["__cuGraphGetRootNodes"] = <intptr_t>__cuGraphGetRootNodes global __cuGraphGetEdges_v2 - data["__cuGraphGetEdges_v2"] = <_cyb_intptr_t>__cuGraphGetEdges_v2 + data["__cuGraphGetEdges_v2"] = <intptr_t>__cuGraphGetEdges_v2 global __cuGraphNodeGetDependencies_v2 - data["__cuGraphNodeGetDependencies_v2"] = <_cyb_intptr_t>__cuGraphNodeGetDependencies_v2 + data["__cuGraphNodeGetDependencies_v2"] = <intptr_t>__cuGraphNodeGetDependencies_v2 global __cuGraphNodeGetDependentNodes_v2 - data["__cuGraphNodeGetDependentNodes_v2"] = <_cyb_intptr_t>__cuGraphNodeGetDependentNodes_v2 + data["__cuGraphNodeGetDependentNodes_v2"] = <intptr_t>__cuGraphNodeGetDependentNodes_v2 global __cuGraphAddDependencies_v2 - data["__cuGraphAddDependencies_v2"] = <_cyb_intptr_t>__cuGraphAddDependencies_v2 + data["__cuGraphAddDependencies_v2"] = <intptr_t>__cuGraphAddDependencies_v2 global __cuGraphRemoveDependencies_v2 - data["__cuGraphRemoveDependencies_v2"] = <_cyb_intptr_t>__cuGraphRemoveDependencies_v2 + data["__cuGraphRemoveDependencies_v2"] = <intptr_t>__cuGraphRemoveDependencies_v2 global __cuGraphDestroyNode - data["__cuGraphDestroyNode"] = <_cyb_intptr_t>__cuGraphDestroyNode + data["__cuGraphDestroyNode"] = <intptr_t>__cuGraphDestroyNode global __cuGraphInstantiateWithFlags - data["__cuGraphInstantiateWithFlags"] = <_cyb_intptr_t>__cuGraphInstantiateWithFlags + data["__cuGraphInstantiateWithFlags"] = <intptr_t>__cuGraphInstantiateWithFlags global __cuGraphInstantiateWithParams - data["__cuGraphInstantiateWithParams"] = <_cyb_intptr_t>__cuGraphInstantiateWithParams + data["__cuGraphInstantiateWithParams"] = <intptr_t>__cuGraphInstantiateWithParams global __cuGraphExecGetFlags - data["__cuGraphExecGetFlags"] = <_cyb_intptr_t>__cuGraphExecGetFlags + data["__cuGraphExecGetFlags"] = <intptr_t>__cuGraphExecGetFlags global __cuGraphExecKernelNodeSetParams_v2 - data["__cuGraphExecKernelNodeSetParams_v2"] = <_cyb_intptr_t>__cuGraphExecKernelNodeSetParams_v2 + data["__cuGraphExecKernelNodeSetParams_v2"] = <intptr_t>__cuGraphExecKernelNodeSetParams_v2 global __cuGraphExecMemcpyNodeSetParams - data["__cuGraphExecMemcpyNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecMemcpyNodeSetParams + data["__cuGraphExecMemcpyNodeSetParams"] = <intptr_t>__cuGraphExecMemcpyNodeSetParams global __cuGraphExecMemsetNodeSetParams - data["__cuGraphExecMemsetNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecMemsetNodeSetParams + data["__cuGraphExecMemsetNodeSetParams"] = <intptr_t>__cuGraphExecMemsetNodeSetParams global __cuGraphExecHostNodeSetParams - data["__cuGraphExecHostNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecHostNodeSetParams + data["__cuGraphExecHostNodeSetParams"] = <intptr_t>__cuGraphExecHostNodeSetParams global __cuGraphExecChildGraphNodeSetParams - data["__cuGraphExecChildGraphNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecChildGraphNodeSetParams + data["__cuGraphExecChildGraphNodeSetParams"] = <intptr_t>__cuGraphExecChildGraphNodeSetParams global __cuGraphExecEventRecordNodeSetEvent - data["__cuGraphExecEventRecordNodeSetEvent"] = <_cyb_intptr_t>__cuGraphExecEventRecordNodeSetEvent + data["__cuGraphExecEventRecordNodeSetEvent"] = <intptr_t>__cuGraphExecEventRecordNodeSetEvent global __cuGraphExecEventWaitNodeSetEvent - data["__cuGraphExecEventWaitNodeSetEvent"] = <_cyb_intptr_t>__cuGraphExecEventWaitNodeSetEvent + data["__cuGraphExecEventWaitNodeSetEvent"] = <intptr_t>__cuGraphExecEventWaitNodeSetEvent global __cuGraphExecExternalSemaphoresSignalNodeSetParams - data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecExternalSemaphoresSignalNodeSetParams + data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = <intptr_t>__cuGraphExecExternalSemaphoresSignalNodeSetParams global __cuGraphExecExternalSemaphoresWaitNodeSetParams - data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecExternalSemaphoresWaitNodeSetParams + data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = <intptr_t>__cuGraphExecExternalSemaphoresWaitNodeSetParams global __cuGraphNodeSetEnabled - data["__cuGraphNodeSetEnabled"] = <_cyb_intptr_t>__cuGraphNodeSetEnabled + data["__cuGraphNodeSetEnabled"] = <intptr_t>__cuGraphNodeSetEnabled global __cuGraphNodeGetEnabled - data["__cuGraphNodeGetEnabled"] = <_cyb_intptr_t>__cuGraphNodeGetEnabled + data["__cuGraphNodeGetEnabled"] = <intptr_t>__cuGraphNodeGetEnabled global __cuGraphUpload - data["__cuGraphUpload"] = <_cyb_intptr_t>__cuGraphUpload + data["__cuGraphUpload"] = <intptr_t>__cuGraphUpload global __cuGraphLaunch - data["__cuGraphLaunch"] = <_cyb_intptr_t>__cuGraphLaunch + data["__cuGraphLaunch"] = <intptr_t>__cuGraphLaunch global __cuGraphExecDestroy - data["__cuGraphExecDestroy"] = <_cyb_intptr_t>__cuGraphExecDestroy + data["__cuGraphExecDestroy"] = <intptr_t>__cuGraphExecDestroy global __cuGraphDestroy - data["__cuGraphDestroy"] = <_cyb_intptr_t>__cuGraphDestroy + data["__cuGraphDestroy"] = <intptr_t>__cuGraphDestroy global __cuGraphExecUpdate_v2 - data["__cuGraphExecUpdate_v2"] = <_cyb_intptr_t>__cuGraphExecUpdate_v2 + data["__cuGraphExecUpdate_v2"] = <intptr_t>__cuGraphExecUpdate_v2 global __cuGraphKernelNodeCopyAttributes - data["__cuGraphKernelNodeCopyAttributes"] = <_cyb_intptr_t>__cuGraphKernelNodeCopyAttributes + data["__cuGraphKernelNodeCopyAttributes"] = <intptr_t>__cuGraphKernelNodeCopyAttributes global __cuGraphKernelNodeGetAttribute - data["__cuGraphKernelNodeGetAttribute"] = <_cyb_intptr_t>__cuGraphKernelNodeGetAttribute + data["__cuGraphKernelNodeGetAttribute"] = <intptr_t>__cuGraphKernelNodeGetAttribute global __cuGraphKernelNodeSetAttribute - data["__cuGraphKernelNodeSetAttribute"] = <_cyb_intptr_t>__cuGraphKernelNodeSetAttribute + data["__cuGraphKernelNodeSetAttribute"] = <intptr_t>__cuGraphKernelNodeSetAttribute global __cuGraphDebugDotPrint - data["__cuGraphDebugDotPrint"] = <_cyb_intptr_t>__cuGraphDebugDotPrint + data["__cuGraphDebugDotPrint"] = <intptr_t>__cuGraphDebugDotPrint global __cuUserObjectCreate - data["__cuUserObjectCreate"] = <_cyb_intptr_t>__cuUserObjectCreate + data["__cuUserObjectCreate"] = <intptr_t>__cuUserObjectCreate global __cuUserObjectRetain - data["__cuUserObjectRetain"] = <_cyb_intptr_t>__cuUserObjectRetain + data["__cuUserObjectRetain"] = <intptr_t>__cuUserObjectRetain global __cuUserObjectRelease - data["__cuUserObjectRelease"] = <_cyb_intptr_t>__cuUserObjectRelease + data["__cuUserObjectRelease"] = <intptr_t>__cuUserObjectRelease global __cuGraphRetainUserObject - data["__cuGraphRetainUserObject"] = <_cyb_intptr_t>__cuGraphRetainUserObject + data["__cuGraphRetainUserObject"] = <intptr_t>__cuGraphRetainUserObject global __cuGraphReleaseUserObject - data["__cuGraphReleaseUserObject"] = <_cyb_intptr_t>__cuGraphReleaseUserObject + data["__cuGraphReleaseUserObject"] = <intptr_t>__cuGraphReleaseUserObject global __cuGraphAddNode_v2 - data["__cuGraphAddNode_v2"] = <_cyb_intptr_t>__cuGraphAddNode_v2 + data["__cuGraphAddNode_v2"] = <intptr_t>__cuGraphAddNode_v2 global __cuGraphNodeSetParams - data["__cuGraphNodeSetParams"] = <_cyb_intptr_t>__cuGraphNodeSetParams + data["__cuGraphNodeSetParams"] = <intptr_t>__cuGraphNodeSetParams global __cuGraphExecNodeSetParams - data["__cuGraphExecNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecNodeSetParams + data["__cuGraphExecNodeSetParams"] = <intptr_t>__cuGraphExecNodeSetParams global __cuGraphConditionalHandleCreate - data["__cuGraphConditionalHandleCreate"] = <_cyb_intptr_t>__cuGraphConditionalHandleCreate + data["__cuGraphConditionalHandleCreate"] = <intptr_t>__cuGraphConditionalHandleCreate global __cuOccupancyMaxActiveBlocksPerMultiprocessor - data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = <_cyb_intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessor + data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = <intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessor global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = <_cyb_intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = <intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags global __cuOccupancyMaxPotentialBlockSize - data["__cuOccupancyMaxPotentialBlockSize"] = <_cyb_intptr_t>__cuOccupancyMaxPotentialBlockSize + data["__cuOccupancyMaxPotentialBlockSize"] = <intptr_t>__cuOccupancyMaxPotentialBlockSize global __cuOccupancyMaxPotentialBlockSizeWithFlags - data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = <_cyb_intptr_t>__cuOccupancyMaxPotentialBlockSizeWithFlags + data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = <intptr_t>__cuOccupancyMaxPotentialBlockSizeWithFlags global __cuOccupancyAvailableDynamicSMemPerBlock - data["__cuOccupancyAvailableDynamicSMemPerBlock"] = <_cyb_intptr_t>__cuOccupancyAvailableDynamicSMemPerBlock + data["__cuOccupancyAvailableDynamicSMemPerBlock"] = <intptr_t>__cuOccupancyAvailableDynamicSMemPerBlock global __cuOccupancyMaxPotentialClusterSize - data["__cuOccupancyMaxPotentialClusterSize"] = <_cyb_intptr_t>__cuOccupancyMaxPotentialClusterSize + data["__cuOccupancyMaxPotentialClusterSize"] = <intptr_t>__cuOccupancyMaxPotentialClusterSize global __cuOccupancyMaxActiveClusters - data["__cuOccupancyMaxActiveClusters"] = <_cyb_intptr_t>__cuOccupancyMaxActiveClusters + data["__cuOccupancyMaxActiveClusters"] = <intptr_t>__cuOccupancyMaxActiveClusters global __cuTexRefSetArray - data["__cuTexRefSetArray"] = <_cyb_intptr_t>__cuTexRefSetArray + data["__cuTexRefSetArray"] = <intptr_t>__cuTexRefSetArray global __cuTexRefSetMipmappedArray - data["__cuTexRefSetMipmappedArray"] = <_cyb_intptr_t>__cuTexRefSetMipmappedArray + data["__cuTexRefSetMipmappedArray"] = <intptr_t>__cuTexRefSetMipmappedArray global __cuTexRefSetAddress_v2 - data["__cuTexRefSetAddress_v2"] = <_cyb_intptr_t>__cuTexRefSetAddress_v2 + data["__cuTexRefSetAddress_v2"] = <intptr_t>__cuTexRefSetAddress_v2 global __cuTexRefSetAddress2D_v3 - data["__cuTexRefSetAddress2D_v3"] = <_cyb_intptr_t>__cuTexRefSetAddress2D_v3 + data["__cuTexRefSetAddress2D_v3"] = <intptr_t>__cuTexRefSetAddress2D_v3 global __cuTexRefSetFormat - data["__cuTexRefSetFormat"] = <_cyb_intptr_t>__cuTexRefSetFormat + data["__cuTexRefSetFormat"] = <intptr_t>__cuTexRefSetFormat global __cuTexRefSetAddressMode - data["__cuTexRefSetAddressMode"] = <_cyb_intptr_t>__cuTexRefSetAddressMode + data["__cuTexRefSetAddressMode"] = <intptr_t>__cuTexRefSetAddressMode global __cuTexRefSetFilterMode - data["__cuTexRefSetFilterMode"] = <_cyb_intptr_t>__cuTexRefSetFilterMode + data["__cuTexRefSetFilterMode"] = <intptr_t>__cuTexRefSetFilterMode global __cuTexRefSetMipmapFilterMode - data["__cuTexRefSetMipmapFilterMode"] = <_cyb_intptr_t>__cuTexRefSetMipmapFilterMode + data["__cuTexRefSetMipmapFilterMode"] = <intptr_t>__cuTexRefSetMipmapFilterMode global __cuTexRefSetMipmapLevelBias - data["__cuTexRefSetMipmapLevelBias"] = <_cyb_intptr_t>__cuTexRefSetMipmapLevelBias + data["__cuTexRefSetMipmapLevelBias"] = <intptr_t>__cuTexRefSetMipmapLevelBias global __cuTexRefSetMipmapLevelClamp - data["__cuTexRefSetMipmapLevelClamp"] = <_cyb_intptr_t>__cuTexRefSetMipmapLevelClamp + data["__cuTexRefSetMipmapLevelClamp"] = <intptr_t>__cuTexRefSetMipmapLevelClamp global __cuTexRefSetMaxAnisotropy - data["__cuTexRefSetMaxAnisotropy"] = <_cyb_intptr_t>__cuTexRefSetMaxAnisotropy + data["__cuTexRefSetMaxAnisotropy"] = <intptr_t>__cuTexRefSetMaxAnisotropy global __cuTexRefSetBorderColor - data["__cuTexRefSetBorderColor"] = <_cyb_intptr_t>__cuTexRefSetBorderColor + data["__cuTexRefSetBorderColor"] = <intptr_t>__cuTexRefSetBorderColor global __cuTexRefSetFlags - data["__cuTexRefSetFlags"] = <_cyb_intptr_t>__cuTexRefSetFlags + data["__cuTexRefSetFlags"] = <intptr_t>__cuTexRefSetFlags global __cuTexRefGetAddress_v2 - data["__cuTexRefGetAddress_v2"] = <_cyb_intptr_t>__cuTexRefGetAddress_v2 + data["__cuTexRefGetAddress_v2"] = <intptr_t>__cuTexRefGetAddress_v2 global __cuTexRefGetArray - data["__cuTexRefGetArray"] = <_cyb_intptr_t>__cuTexRefGetArray + data["__cuTexRefGetArray"] = <intptr_t>__cuTexRefGetArray global __cuTexRefGetMipmappedArray - data["__cuTexRefGetMipmappedArray"] = <_cyb_intptr_t>__cuTexRefGetMipmappedArray + data["__cuTexRefGetMipmappedArray"] = <intptr_t>__cuTexRefGetMipmappedArray global __cuTexRefGetAddressMode - data["__cuTexRefGetAddressMode"] = <_cyb_intptr_t>__cuTexRefGetAddressMode + data["__cuTexRefGetAddressMode"] = <intptr_t>__cuTexRefGetAddressMode global __cuTexRefGetFilterMode - data["__cuTexRefGetFilterMode"] = <_cyb_intptr_t>__cuTexRefGetFilterMode + data["__cuTexRefGetFilterMode"] = <intptr_t>__cuTexRefGetFilterMode global __cuTexRefGetFormat - data["__cuTexRefGetFormat"] = <_cyb_intptr_t>__cuTexRefGetFormat + data["__cuTexRefGetFormat"] = <intptr_t>__cuTexRefGetFormat global __cuTexRefGetMipmapFilterMode - data["__cuTexRefGetMipmapFilterMode"] = <_cyb_intptr_t>__cuTexRefGetMipmapFilterMode + data["__cuTexRefGetMipmapFilterMode"] = <intptr_t>__cuTexRefGetMipmapFilterMode global __cuTexRefGetMipmapLevelBias - data["__cuTexRefGetMipmapLevelBias"] = <_cyb_intptr_t>__cuTexRefGetMipmapLevelBias + data["__cuTexRefGetMipmapLevelBias"] = <intptr_t>__cuTexRefGetMipmapLevelBias global __cuTexRefGetMipmapLevelClamp - data["__cuTexRefGetMipmapLevelClamp"] = <_cyb_intptr_t>__cuTexRefGetMipmapLevelClamp + data["__cuTexRefGetMipmapLevelClamp"] = <intptr_t>__cuTexRefGetMipmapLevelClamp global __cuTexRefGetMaxAnisotropy - data["__cuTexRefGetMaxAnisotropy"] = <_cyb_intptr_t>__cuTexRefGetMaxAnisotropy + data["__cuTexRefGetMaxAnisotropy"] = <intptr_t>__cuTexRefGetMaxAnisotropy global __cuTexRefGetBorderColor - data["__cuTexRefGetBorderColor"] = <_cyb_intptr_t>__cuTexRefGetBorderColor + data["__cuTexRefGetBorderColor"] = <intptr_t>__cuTexRefGetBorderColor global __cuTexRefGetFlags - data["__cuTexRefGetFlags"] = <_cyb_intptr_t>__cuTexRefGetFlags + data["__cuTexRefGetFlags"] = <intptr_t>__cuTexRefGetFlags global __cuTexRefCreate - data["__cuTexRefCreate"] = <_cyb_intptr_t>__cuTexRefCreate + data["__cuTexRefCreate"] = <intptr_t>__cuTexRefCreate global __cuTexRefDestroy - data["__cuTexRefDestroy"] = <_cyb_intptr_t>__cuTexRefDestroy + data["__cuTexRefDestroy"] = <intptr_t>__cuTexRefDestroy global __cuSurfRefSetArray - data["__cuSurfRefSetArray"] = <_cyb_intptr_t>__cuSurfRefSetArray + data["__cuSurfRefSetArray"] = <intptr_t>__cuSurfRefSetArray global __cuSurfRefGetArray - data["__cuSurfRefGetArray"] = <_cyb_intptr_t>__cuSurfRefGetArray + data["__cuSurfRefGetArray"] = <intptr_t>__cuSurfRefGetArray global __cuTexObjectCreate - data["__cuTexObjectCreate"] = <_cyb_intptr_t>__cuTexObjectCreate + data["__cuTexObjectCreate"] = <intptr_t>__cuTexObjectCreate global __cuTexObjectDestroy - data["__cuTexObjectDestroy"] = <_cyb_intptr_t>__cuTexObjectDestroy + data["__cuTexObjectDestroy"] = <intptr_t>__cuTexObjectDestroy global __cuTexObjectGetResourceDesc - data["__cuTexObjectGetResourceDesc"] = <_cyb_intptr_t>__cuTexObjectGetResourceDesc + data["__cuTexObjectGetResourceDesc"] = <intptr_t>__cuTexObjectGetResourceDesc global __cuTexObjectGetTextureDesc - data["__cuTexObjectGetTextureDesc"] = <_cyb_intptr_t>__cuTexObjectGetTextureDesc + data["__cuTexObjectGetTextureDesc"] = <intptr_t>__cuTexObjectGetTextureDesc global __cuTexObjectGetResourceViewDesc - data["__cuTexObjectGetResourceViewDesc"] = <_cyb_intptr_t>__cuTexObjectGetResourceViewDesc + data["__cuTexObjectGetResourceViewDesc"] = <intptr_t>__cuTexObjectGetResourceViewDesc global __cuSurfObjectCreate - data["__cuSurfObjectCreate"] = <_cyb_intptr_t>__cuSurfObjectCreate + data["__cuSurfObjectCreate"] = <intptr_t>__cuSurfObjectCreate global __cuSurfObjectDestroy - data["__cuSurfObjectDestroy"] = <_cyb_intptr_t>__cuSurfObjectDestroy + data["__cuSurfObjectDestroy"] = <intptr_t>__cuSurfObjectDestroy global __cuSurfObjectGetResourceDesc - data["__cuSurfObjectGetResourceDesc"] = <_cyb_intptr_t>__cuSurfObjectGetResourceDesc + data["__cuSurfObjectGetResourceDesc"] = <intptr_t>__cuSurfObjectGetResourceDesc global __cuTensorMapEncodeTiled - data["__cuTensorMapEncodeTiled"] = <_cyb_intptr_t>__cuTensorMapEncodeTiled + data["__cuTensorMapEncodeTiled"] = <intptr_t>__cuTensorMapEncodeTiled global __cuTensorMapEncodeIm2col - data["__cuTensorMapEncodeIm2col"] = <_cyb_intptr_t>__cuTensorMapEncodeIm2col + data["__cuTensorMapEncodeIm2col"] = <intptr_t>__cuTensorMapEncodeIm2col global __cuTensorMapEncodeIm2colWide - data["__cuTensorMapEncodeIm2colWide"] = <_cyb_intptr_t>__cuTensorMapEncodeIm2colWide + data["__cuTensorMapEncodeIm2colWide"] = <intptr_t>__cuTensorMapEncodeIm2colWide global __cuTensorMapReplaceAddress - data["__cuTensorMapReplaceAddress"] = <_cyb_intptr_t>__cuTensorMapReplaceAddress + data["__cuTensorMapReplaceAddress"] = <intptr_t>__cuTensorMapReplaceAddress global __cuDeviceCanAccessPeer - data["__cuDeviceCanAccessPeer"] = <_cyb_intptr_t>__cuDeviceCanAccessPeer + data["__cuDeviceCanAccessPeer"] = <intptr_t>__cuDeviceCanAccessPeer global __cuCtxEnablePeerAccess - data["__cuCtxEnablePeerAccess"] = <_cyb_intptr_t>__cuCtxEnablePeerAccess + data["__cuCtxEnablePeerAccess"] = <intptr_t>__cuCtxEnablePeerAccess global __cuCtxDisablePeerAccess - data["__cuCtxDisablePeerAccess"] = <_cyb_intptr_t>__cuCtxDisablePeerAccess + data["__cuCtxDisablePeerAccess"] = <intptr_t>__cuCtxDisablePeerAccess global __cuDeviceGetP2PAttribute - data["__cuDeviceGetP2PAttribute"] = <_cyb_intptr_t>__cuDeviceGetP2PAttribute + data["__cuDeviceGetP2PAttribute"] = <intptr_t>__cuDeviceGetP2PAttribute global __cuGraphicsUnregisterResource - data["__cuGraphicsUnregisterResource"] = <_cyb_intptr_t>__cuGraphicsUnregisterResource + data["__cuGraphicsUnregisterResource"] = <intptr_t>__cuGraphicsUnregisterResource global __cuGraphicsSubResourceGetMappedArray - data["__cuGraphicsSubResourceGetMappedArray"] = <_cyb_intptr_t>__cuGraphicsSubResourceGetMappedArray + data["__cuGraphicsSubResourceGetMappedArray"] = <intptr_t>__cuGraphicsSubResourceGetMappedArray global __cuGraphicsResourceGetMappedMipmappedArray - data["__cuGraphicsResourceGetMappedMipmappedArray"] = <_cyb_intptr_t>__cuGraphicsResourceGetMappedMipmappedArray + data["__cuGraphicsResourceGetMappedMipmappedArray"] = <intptr_t>__cuGraphicsResourceGetMappedMipmappedArray global __cuGraphicsResourceGetMappedPointer_v2 - data["__cuGraphicsResourceGetMappedPointer_v2"] = <_cyb_intptr_t>__cuGraphicsResourceGetMappedPointer_v2 + data["__cuGraphicsResourceGetMappedPointer_v2"] = <intptr_t>__cuGraphicsResourceGetMappedPointer_v2 global __cuGraphicsResourceSetMapFlags_v2 - data["__cuGraphicsResourceSetMapFlags_v2"] = <_cyb_intptr_t>__cuGraphicsResourceSetMapFlags_v2 + data["__cuGraphicsResourceSetMapFlags_v2"] = <intptr_t>__cuGraphicsResourceSetMapFlags_v2 global __cuGraphicsMapResources - data["__cuGraphicsMapResources"] = <_cyb_intptr_t>__cuGraphicsMapResources + data["__cuGraphicsMapResources"] = <intptr_t>__cuGraphicsMapResources global __cuGraphicsUnmapResources - data["__cuGraphicsUnmapResources"] = <_cyb_intptr_t>__cuGraphicsUnmapResources + data["__cuGraphicsUnmapResources"] = <intptr_t>__cuGraphicsUnmapResources global __cuGetProcAddress_v2 - data["__cuGetProcAddress_v2"] = <_cyb_intptr_t>__cuGetProcAddress_v2 + data["__cuGetProcAddress_v2"] = <intptr_t>__cuGetProcAddress_v2 global __cuCoredumpGetAttribute - data["__cuCoredumpGetAttribute"] = <_cyb_intptr_t>__cuCoredumpGetAttribute + data["__cuCoredumpGetAttribute"] = <intptr_t>__cuCoredumpGetAttribute global __cuCoredumpGetAttributeGlobal - data["__cuCoredumpGetAttributeGlobal"] = <_cyb_intptr_t>__cuCoredumpGetAttributeGlobal + data["__cuCoredumpGetAttributeGlobal"] = <intptr_t>__cuCoredumpGetAttributeGlobal global __cuCoredumpSetAttribute - data["__cuCoredumpSetAttribute"] = <_cyb_intptr_t>__cuCoredumpSetAttribute + data["__cuCoredumpSetAttribute"] = <intptr_t>__cuCoredumpSetAttribute global __cuCoredumpSetAttributeGlobal - data["__cuCoredumpSetAttributeGlobal"] = <_cyb_intptr_t>__cuCoredumpSetAttributeGlobal + data["__cuCoredumpSetAttributeGlobal"] = <intptr_t>__cuCoredumpSetAttributeGlobal global __cuGetExportTable - data["__cuGetExportTable"] = <_cyb_intptr_t>__cuGetExportTable + data["__cuGetExportTable"] = <intptr_t>__cuGetExportTable global __cuGreenCtxCreate - data["__cuGreenCtxCreate"] = <_cyb_intptr_t>__cuGreenCtxCreate + data["__cuGreenCtxCreate"] = <intptr_t>__cuGreenCtxCreate global __cuGreenCtxDestroy - data["__cuGreenCtxDestroy"] = <_cyb_intptr_t>__cuGreenCtxDestroy + data["__cuGreenCtxDestroy"] = <intptr_t>__cuGreenCtxDestroy global __cuCtxFromGreenCtx - data["__cuCtxFromGreenCtx"] = <_cyb_intptr_t>__cuCtxFromGreenCtx + data["__cuCtxFromGreenCtx"] = <intptr_t>__cuCtxFromGreenCtx global __cuDeviceGetDevResource - data["__cuDeviceGetDevResource"] = <_cyb_intptr_t>__cuDeviceGetDevResource + data["__cuDeviceGetDevResource"] = <intptr_t>__cuDeviceGetDevResource global __cuCtxGetDevResource - data["__cuCtxGetDevResource"] = <_cyb_intptr_t>__cuCtxGetDevResource + data["__cuCtxGetDevResource"] = <intptr_t>__cuCtxGetDevResource global __cuGreenCtxGetDevResource - data["__cuGreenCtxGetDevResource"] = <_cyb_intptr_t>__cuGreenCtxGetDevResource + data["__cuGreenCtxGetDevResource"] = <intptr_t>__cuGreenCtxGetDevResource global __cuDevSmResourceSplitByCount - data["__cuDevSmResourceSplitByCount"] = <_cyb_intptr_t>__cuDevSmResourceSplitByCount + data["__cuDevSmResourceSplitByCount"] = <intptr_t>__cuDevSmResourceSplitByCount global __cuDevResourceGenerateDesc - data["__cuDevResourceGenerateDesc"] = <_cyb_intptr_t>__cuDevResourceGenerateDesc + data["__cuDevResourceGenerateDesc"] = <intptr_t>__cuDevResourceGenerateDesc global __cuGreenCtxRecordEvent - data["__cuGreenCtxRecordEvent"] = <_cyb_intptr_t>__cuGreenCtxRecordEvent + data["__cuGreenCtxRecordEvent"] = <intptr_t>__cuGreenCtxRecordEvent global __cuGreenCtxWaitEvent - data["__cuGreenCtxWaitEvent"] = <_cyb_intptr_t>__cuGreenCtxWaitEvent + data["__cuGreenCtxWaitEvent"] = <intptr_t>__cuGreenCtxWaitEvent global __cuStreamGetGreenCtx - data["__cuStreamGetGreenCtx"] = <_cyb_intptr_t>__cuStreamGetGreenCtx + data["__cuStreamGetGreenCtx"] = <intptr_t>__cuStreamGetGreenCtx global __cuGreenCtxStreamCreate - data["__cuGreenCtxStreamCreate"] = <_cyb_intptr_t>__cuGreenCtxStreamCreate + data["__cuGreenCtxStreamCreate"] = <intptr_t>__cuGreenCtxStreamCreate global __cuLogsRegisterCallback - data["__cuLogsRegisterCallback"] = <_cyb_intptr_t>__cuLogsRegisterCallback + data["__cuLogsRegisterCallback"] = <intptr_t>__cuLogsRegisterCallback global __cuLogsUnregisterCallback - data["__cuLogsUnregisterCallback"] = <_cyb_intptr_t>__cuLogsUnregisterCallback + data["__cuLogsUnregisterCallback"] = <intptr_t>__cuLogsUnregisterCallback global __cuLogsCurrent - data["__cuLogsCurrent"] = <_cyb_intptr_t>__cuLogsCurrent + data["__cuLogsCurrent"] = <intptr_t>__cuLogsCurrent global __cuLogsDumpToFile - data["__cuLogsDumpToFile"] = <_cyb_intptr_t>__cuLogsDumpToFile + data["__cuLogsDumpToFile"] = <intptr_t>__cuLogsDumpToFile global __cuLogsDumpToMemory - data["__cuLogsDumpToMemory"] = <_cyb_intptr_t>__cuLogsDumpToMemory + data["__cuLogsDumpToMemory"] = <intptr_t>__cuLogsDumpToMemory global __cuCheckpointProcessGetRestoreThreadId - data["__cuCheckpointProcessGetRestoreThreadId"] = <_cyb_intptr_t>__cuCheckpointProcessGetRestoreThreadId + data["__cuCheckpointProcessGetRestoreThreadId"] = <intptr_t>__cuCheckpointProcessGetRestoreThreadId global __cuCheckpointProcessGetState - data["__cuCheckpointProcessGetState"] = <_cyb_intptr_t>__cuCheckpointProcessGetState + data["__cuCheckpointProcessGetState"] = <intptr_t>__cuCheckpointProcessGetState global __cuCheckpointProcessLock - data["__cuCheckpointProcessLock"] = <_cyb_intptr_t>__cuCheckpointProcessLock + data["__cuCheckpointProcessLock"] = <intptr_t>__cuCheckpointProcessLock global __cuCheckpointProcessCheckpoint - data["__cuCheckpointProcessCheckpoint"] = <_cyb_intptr_t>__cuCheckpointProcessCheckpoint + data["__cuCheckpointProcessCheckpoint"] = <intptr_t>__cuCheckpointProcessCheckpoint global __cuCheckpointProcessRestore - data["__cuCheckpointProcessRestore"] = <_cyb_intptr_t>__cuCheckpointProcessRestore + data["__cuCheckpointProcessRestore"] = <intptr_t>__cuCheckpointProcessRestore global __cuCheckpointProcessUnlock - data["__cuCheckpointProcessUnlock"] = <_cyb_intptr_t>__cuCheckpointProcessUnlock + data["__cuCheckpointProcessUnlock"] = <intptr_t>__cuCheckpointProcessUnlock global __cuGraphicsEGLRegisterImage - data["__cuGraphicsEGLRegisterImage"] = <_cyb_intptr_t>__cuGraphicsEGLRegisterImage + data["__cuGraphicsEGLRegisterImage"] = <intptr_t>__cuGraphicsEGLRegisterImage global __cuEGLStreamConsumerConnect - data["__cuEGLStreamConsumerConnect"] = <_cyb_intptr_t>__cuEGLStreamConsumerConnect + data["__cuEGLStreamConsumerConnect"] = <intptr_t>__cuEGLStreamConsumerConnect global __cuEGLStreamConsumerConnectWithFlags - data["__cuEGLStreamConsumerConnectWithFlags"] = <_cyb_intptr_t>__cuEGLStreamConsumerConnectWithFlags + data["__cuEGLStreamConsumerConnectWithFlags"] = <intptr_t>__cuEGLStreamConsumerConnectWithFlags global __cuEGLStreamConsumerDisconnect - data["__cuEGLStreamConsumerDisconnect"] = <_cyb_intptr_t>__cuEGLStreamConsumerDisconnect + data["__cuEGLStreamConsumerDisconnect"] = <intptr_t>__cuEGLStreamConsumerDisconnect global __cuEGLStreamConsumerAcquireFrame - data["__cuEGLStreamConsumerAcquireFrame"] = <_cyb_intptr_t>__cuEGLStreamConsumerAcquireFrame + data["__cuEGLStreamConsumerAcquireFrame"] = <intptr_t>__cuEGLStreamConsumerAcquireFrame global __cuEGLStreamConsumerReleaseFrame - data["__cuEGLStreamConsumerReleaseFrame"] = <_cyb_intptr_t>__cuEGLStreamConsumerReleaseFrame + data["__cuEGLStreamConsumerReleaseFrame"] = <intptr_t>__cuEGLStreamConsumerReleaseFrame global __cuEGLStreamProducerConnect - data["__cuEGLStreamProducerConnect"] = <_cyb_intptr_t>__cuEGLStreamProducerConnect + data["__cuEGLStreamProducerConnect"] = <intptr_t>__cuEGLStreamProducerConnect global __cuEGLStreamProducerDisconnect - data["__cuEGLStreamProducerDisconnect"] = <_cyb_intptr_t>__cuEGLStreamProducerDisconnect + data["__cuEGLStreamProducerDisconnect"] = <intptr_t>__cuEGLStreamProducerDisconnect global __cuEGLStreamProducerPresentFrame - data["__cuEGLStreamProducerPresentFrame"] = <_cyb_intptr_t>__cuEGLStreamProducerPresentFrame + data["__cuEGLStreamProducerPresentFrame"] = <intptr_t>__cuEGLStreamProducerPresentFrame global __cuEGLStreamProducerReturnFrame - data["__cuEGLStreamProducerReturnFrame"] = <_cyb_intptr_t>__cuEGLStreamProducerReturnFrame + data["__cuEGLStreamProducerReturnFrame"] = <intptr_t>__cuEGLStreamProducerReturnFrame global __cuGraphicsResourceGetMappedEglFrame - data["__cuGraphicsResourceGetMappedEglFrame"] = <_cyb_intptr_t>__cuGraphicsResourceGetMappedEglFrame + data["__cuGraphicsResourceGetMappedEglFrame"] = <intptr_t>__cuGraphicsResourceGetMappedEglFrame global __cuEventCreateFromEGLSync - data["__cuEventCreateFromEGLSync"] = <_cyb_intptr_t>__cuEventCreateFromEGLSync + data["__cuEventCreateFromEGLSync"] = <intptr_t>__cuEventCreateFromEGLSync global __cuGraphicsGLRegisterBuffer - data["__cuGraphicsGLRegisterBuffer"] = <_cyb_intptr_t>__cuGraphicsGLRegisterBuffer + data["__cuGraphicsGLRegisterBuffer"] = <intptr_t>__cuGraphicsGLRegisterBuffer global __cuGraphicsGLRegisterImage - data["__cuGraphicsGLRegisterImage"] = <_cyb_intptr_t>__cuGraphicsGLRegisterImage + data["__cuGraphicsGLRegisterImage"] = <intptr_t>__cuGraphicsGLRegisterImage global __cuGLGetDevices_v2 - data["__cuGLGetDevices_v2"] = <_cyb_intptr_t>__cuGLGetDevices_v2 + data["__cuGLGetDevices_v2"] = <intptr_t>__cuGLGetDevices_v2 global __cuGLCtxCreate_v2 - data["__cuGLCtxCreate_v2"] = <_cyb_intptr_t>__cuGLCtxCreate_v2 + data["__cuGLCtxCreate_v2"] = <intptr_t>__cuGLCtxCreate_v2 global __cuGLInit - data["__cuGLInit"] = <_cyb_intptr_t>__cuGLInit + data["__cuGLInit"] = <intptr_t>__cuGLInit global __cuGLRegisterBufferObject - data["__cuGLRegisterBufferObject"] = <_cyb_intptr_t>__cuGLRegisterBufferObject + data["__cuGLRegisterBufferObject"] = <intptr_t>__cuGLRegisterBufferObject global __cuGLMapBufferObject_v2 - data["__cuGLMapBufferObject_v2"] = <_cyb_intptr_t>__cuGLMapBufferObject_v2 + data["__cuGLMapBufferObject_v2"] = <intptr_t>__cuGLMapBufferObject_v2 global __cuGLUnmapBufferObject - data["__cuGLUnmapBufferObject"] = <_cyb_intptr_t>__cuGLUnmapBufferObject + data["__cuGLUnmapBufferObject"] = <intptr_t>__cuGLUnmapBufferObject global __cuGLUnregisterBufferObject - data["__cuGLUnregisterBufferObject"] = <_cyb_intptr_t>__cuGLUnregisterBufferObject + data["__cuGLUnregisterBufferObject"] = <intptr_t>__cuGLUnregisterBufferObject global __cuGLSetBufferObjectMapFlags - data["__cuGLSetBufferObjectMapFlags"] = <_cyb_intptr_t>__cuGLSetBufferObjectMapFlags + data["__cuGLSetBufferObjectMapFlags"] = <intptr_t>__cuGLSetBufferObjectMapFlags global __cuGLMapBufferObjectAsync_v2 - data["__cuGLMapBufferObjectAsync_v2"] = <_cyb_intptr_t>__cuGLMapBufferObjectAsync_v2 + data["__cuGLMapBufferObjectAsync_v2"] = <intptr_t>__cuGLMapBufferObjectAsync_v2 global __cuGLUnmapBufferObjectAsync - data["__cuGLUnmapBufferObjectAsync"] = <_cyb_intptr_t>__cuGLUnmapBufferObjectAsync + data["__cuGLUnmapBufferObjectAsync"] = <intptr_t>__cuGLUnmapBufferObjectAsync global __cuProfilerInitialize - data["__cuProfilerInitialize"] = <_cyb_intptr_t>__cuProfilerInitialize + data["__cuProfilerInitialize"] = <intptr_t>__cuProfilerInitialize global __cuProfilerStart - data["__cuProfilerStart"] = <_cyb_intptr_t>__cuProfilerStart + data["__cuProfilerStart"] = <intptr_t>__cuProfilerStart global __cuProfilerStop - data["__cuProfilerStop"] = <_cyb_intptr_t>__cuProfilerStop + data["__cuProfilerStop"] = <intptr_t>__cuProfilerStop global __cuVDPAUGetDevice - data["__cuVDPAUGetDevice"] = <_cyb_intptr_t>__cuVDPAUGetDevice + data["__cuVDPAUGetDevice"] = <intptr_t>__cuVDPAUGetDevice global __cuVDPAUCtxCreate_v2 - data["__cuVDPAUCtxCreate_v2"] = <_cyb_intptr_t>__cuVDPAUCtxCreate_v2 + data["__cuVDPAUCtxCreate_v2"] = <intptr_t>__cuVDPAUCtxCreate_v2 global __cuGraphicsVDPAURegisterVideoSurface - data["__cuGraphicsVDPAURegisterVideoSurface"] = <_cyb_intptr_t>__cuGraphicsVDPAURegisterVideoSurface + data["__cuGraphicsVDPAURegisterVideoSurface"] = <intptr_t>__cuGraphicsVDPAURegisterVideoSurface global __cuGraphicsVDPAURegisterOutputSurface - data["__cuGraphicsVDPAURegisterOutputSurface"] = <_cyb_intptr_t>__cuGraphicsVDPAURegisterOutputSurface + data["__cuGraphicsVDPAURegisterOutputSurface"] = <intptr_t>__cuGraphicsVDPAURegisterOutputSurface global __cuDeviceGetHostAtomicCapabilities - data["__cuDeviceGetHostAtomicCapabilities"] = <_cyb_intptr_t>__cuDeviceGetHostAtomicCapabilities + data["__cuDeviceGetHostAtomicCapabilities"] = <intptr_t>__cuDeviceGetHostAtomicCapabilities global __cuCtxGetDevice_v2 - data["__cuCtxGetDevice_v2"] = <_cyb_intptr_t>__cuCtxGetDevice_v2 + data["__cuCtxGetDevice_v2"] = <intptr_t>__cuCtxGetDevice_v2 global __cuCtxSynchronize_v2 - data["__cuCtxSynchronize_v2"] = <_cyb_intptr_t>__cuCtxSynchronize_v2 + data["__cuCtxSynchronize_v2"] = <intptr_t>__cuCtxSynchronize_v2 global __cuMemcpyBatchAsync_v2 - data["__cuMemcpyBatchAsync_v2"] = <_cyb_intptr_t>__cuMemcpyBatchAsync_v2 + data["__cuMemcpyBatchAsync_v2"] = <intptr_t>__cuMemcpyBatchAsync_v2 global __cuMemcpy3DBatchAsync_v2 - data["__cuMemcpy3DBatchAsync_v2"] = <_cyb_intptr_t>__cuMemcpy3DBatchAsync_v2 + data["__cuMemcpy3DBatchAsync_v2"] = <intptr_t>__cuMemcpy3DBatchAsync_v2 global __cuMemGetDefaultMemPool - data["__cuMemGetDefaultMemPool"] = <_cyb_intptr_t>__cuMemGetDefaultMemPool + data["__cuMemGetDefaultMemPool"] = <intptr_t>__cuMemGetDefaultMemPool global __cuMemGetMemPool - data["__cuMemGetMemPool"] = <_cyb_intptr_t>__cuMemGetMemPool + data["__cuMemGetMemPool"] = <intptr_t>__cuMemGetMemPool global __cuMemSetMemPool - data["__cuMemSetMemPool"] = <_cyb_intptr_t>__cuMemSetMemPool + data["__cuMemSetMemPool"] = <intptr_t>__cuMemSetMemPool global __cuMemPrefetchBatchAsync - data["__cuMemPrefetchBatchAsync"] = <_cyb_intptr_t>__cuMemPrefetchBatchAsync + data["__cuMemPrefetchBatchAsync"] = <intptr_t>__cuMemPrefetchBatchAsync global __cuMemDiscardBatchAsync - data["__cuMemDiscardBatchAsync"] = <_cyb_intptr_t>__cuMemDiscardBatchAsync + data["__cuMemDiscardBatchAsync"] = <intptr_t>__cuMemDiscardBatchAsync global __cuMemDiscardAndPrefetchBatchAsync - data["__cuMemDiscardAndPrefetchBatchAsync"] = <_cyb_intptr_t>__cuMemDiscardAndPrefetchBatchAsync + data["__cuMemDiscardAndPrefetchBatchAsync"] = <intptr_t>__cuMemDiscardAndPrefetchBatchAsync global __cuDeviceGetP2PAtomicCapabilities - data["__cuDeviceGetP2PAtomicCapabilities"] = <_cyb_intptr_t>__cuDeviceGetP2PAtomicCapabilities + data["__cuDeviceGetP2PAtomicCapabilities"] = <intptr_t>__cuDeviceGetP2PAtomicCapabilities global __cuGreenCtxGetId - data["__cuGreenCtxGetId"] = <_cyb_intptr_t>__cuGreenCtxGetId + data["__cuGreenCtxGetId"] = <intptr_t>__cuGreenCtxGetId global __cuMulticastBindMem_v2 - data["__cuMulticastBindMem_v2"] = <_cyb_intptr_t>__cuMulticastBindMem_v2 + data["__cuMulticastBindMem_v2"] = <intptr_t>__cuMulticastBindMem_v2 global __cuMulticastBindAddr_v2 - data["__cuMulticastBindAddr_v2"] = <_cyb_intptr_t>__cuMulticastBindAddr_v2 + data["__cuMulticastBindAddr_v2"] = <intptr_t>__cuMulticastBindAddr_v2 global __cuGraphNodeGetContainingGraph - data["__cuGraphNodeGetContainingGraph"] = <_cyb_intptr_t>__cuGraphNodeGetContainingGraph + data["__cuGraphNodeGetContainingGraph"] = <intptr_t>__cuGraphNodeGetContainingGraph global __cuGraphNodeGetLocalId - data["__cuGraphNodeGetLocalId"] = <_cyb_intptr_t>__cuGraphNodeGetLocalId + data["__cuGraphNodeGetLocalId"] = <intptr_t>__cuGraphNodeGetLocalId global __cuGraphNodeGetToolsId - data["__cuGraphNodeGetToolsId"] = <_cyb_intptr_t>__cuGraphNodeGetToolsId + data["__cuGraphNodeGetToolsId"] = <intptr_t>__cuGraphNodeGetToolsId global __cuGraphGetId - data["__cuGraphGetId"] = <_cyb_intptr_t>__cuGraphGetId + data["__cuGraphGetId"] = <intptr_t>__cuGraphGetId global __cuGraphExecGetId - data["__cuGraphExecGetId"] = <_cyb_intptr_t>__cuGraphExecGetId + data["__cuGraphExecGetId"] = <intptr_t>__cuGraphExecGetId global __cuDevSmResourceSplit - data["__cuDevSmResourceSplit"] = <_cyb_intptr_t>__cuDevSmResourceSplit + data["__cuDevSmResourceSplit"] = <intptr_t>__cuDevSmResourceSplit global __cuStreamGetDevResource - data["__cuStreamGetDevResource"] = <_cyb_intptr_t>__cuStreamGetDevResource + data["__cuStreamGetDevResource"] = <intptr_t>__cuStreamGetDevResource global __cuKernelGetParamCount - data["__cuKernelGetParamCount"] = <_cyb_intptr_t>__cuKernelGetParamCount + data["__cuKernelGetParamCount"] = <intptr_t>__cuKernelGetParamCount global __cuMemcpyWithAttributesAsync - data["__cuMemcpyWithAttributesAsync"] = <_cyb_intptr_t>__cuMemcpyWithAttributesAsync + data["__cuMemcpyWithAttributesAsync"] = <intptr_t>__cuMemcpyWithAttributesAsync global __cuMemcpy3DWithAttributesAsync - data["__cuMemcpy3DWithAttributesAsync"] = <_cyb_intptr_t>__cuMemcpy3DWithAttributesAsync + data["__cuMemcpy3DWithAttributesAsync"] = <intptr_t>__cuMemcpy3DWithAttributesAsync global __cuStreamBeginCaptureToCig - data["__cuStreamBeginCaptureToCig"] = <_cyb_intptr_t>__cuStreamBeginCaptureToCig + data["__cuStreamBeginCaptureToCig"] = <intptr_t>__cuStreamBeginCaptureToCig global __cuStreamEndCaptureToCig - data["__cuStreamEndCaptureToCig"] = <_cyb_intptr_t>__cuStreamEndCaptureToCig + data["__cuStreamEndCaptureToCig"] = <intptr_t>__cuStreamEndCaptureToCig global __cuFuncGetParamCount - data["__cuFuncGetParamCount"] = <_cyb_intptr_t>__cuFuncGetParamCount + data["__cuFuncGetParamCount"] = <intptr_t>__cuFuncGetParamCount global __cuLaunchHostFunc_v2 - data["__cuLaunchHostFunc_v2"] = <_cyb_intptr_t>__cuLaunchHostFunc_v2 + data["__cuLaunchHostFunc_v2"] = <intptr_t>__cuLaunchHostFunc_v2 global __cuGraphNodeGetParams - data["__cuGraphNodeGetParams"] = <_cyb_intptr_t>__cuGraphNodeGetParams + data["__cuGraphNodeGetParams"] = <intptr_t>__cuGraphNodeGetParams global __cuCoredumpRegisterStartCallback - data["__cuCoredumpRegisterStartCallback"] = <_cyb_intptr_t>__cuCoredumpRegisterStartCallback + data["__cuCoredumpRegisterStartCallback"] = <intptr_t>__cuCoredumpRegisterStartCallback global __cuCoredumpRegisterCompleteCallback - data["__cuCoredumpRegisterCompleteCallback"] = <_cyb_intptr_t>__cuCoredumpRegisterCompleteCallback + data["__cuCoredumpRegisterCompleteCallback"] = <intptr_t>__cuCoredumpRegisterCompleteCallback global __cuCoredumpDeregisterStartCallback - data["__cuCoredumpDeregisterStartCallback"] = <_cyb_intptr_t>__cuCoredumpDeregisterStartCallback + data["__cuCoredumpDeregisterStartCallback"] = <intptr_t>__cuCoredumpDeregisterStartCallback global __cuCoredumpDeregisterCompleteCallback - data["__cuCoredumpDeregisterCompleteCallback"] = <_cyb_intptr_t>__cuCoredumpDeregisterCompleteCallback + data["__cuCoredumpDeregisterCompleteCallback"] = <intptr_t>__cuCoredumpDeregisterCompleteCallback global __cuLogicalEndpointIdReserve - data["__cuLogicalEndpointIdReserve"] = <_cyb_intptr_t>__cuLogicalEndpointIdReserve + data["__cuLogicalEndpointIdReserve"] = <intptr_t>__cuLogicalEndpointIdReserve global __cuLogicalEndpointIdRelease - data["__cuLogicalEndpointIdRelease"] = <_cyb_intptr_t>__cuLogicalEndpointIdRelease + data["__cuLogicalEndpointIdRelease"] = <intptr_t>__cuLogicalEndpointIdRelease global __cuLogicalEndpointCreate - data["__cuLogicalEndpointCreate"] = <_cyb_intptr_t>__cuLogicalEndpointCreate + data["__cuLogicalEndpointCreate"] = <intptr_t>__cuLogicalEndpointCreate global __cuLogicalEndpointAddDevice - data["__cuLogicalEndpointAddDevice"] = <_cyb_intptr_t>__cuLogicalEndpointAddDevice + data["__cuLogicalEndpointAddDevice"] = <intptr_t>__cuLogicalEndpointAddDevice global __cuLogicalEndpointDestroy - data["__cuLogicalEndpointDestroy"] = <_cyb_intptr_t>__cuLogicalEndpointDestroy + data["__cuLogicalEndpointDestroy"] = <intptr_t>__cuLogicalEndpointDestroy global __cuLogicalEndpointBindAddr - data["__cuLogicalEndpointBindAddr"] = <_cyb_intptr_t>__cuLogicalEndpointBindAddr + data["__cuLogicalEndpointBindAddr"] = <intptr_t>__cuLogicalEndpointBindAddr global __cuLogicalEndpointBindMem - data["__cuLogicalEndpointBindMem"] = <_cyb_intptr_t>__cuLogicalEndpointBindMem + data["__cuLogicalEndpointBindMem"] = <intptr_t>__cuLogicalEndpointBindMem global __cuLogicalEndpointUnbind - data["__cuLogicalEndpointUnbind"] = <_cyb_intptr_t>__cuLogicalEndpointUnbind + data["__cuLogicalEndpointUnbind"] = <intptr_t>__cuLogicalEndpointUnbind global __cuLogicalEndpointExport - data["__cuLogicalEndpointExport"] = <_cyb_intptr_t>__cuLogicalEndpointExport + data["__cuLogicalEndpointExport"] = <intptr_t>__cuLogicalEndpointExport global __cuLogicalEndpointImport - data["__cuLogicalEndpointImport"] = <_cyb_intptr_t>__cuLogicalEndpointImport + data["__cuLogicalEndpointImport"] = <intptr_t>__cuLogicalEndpointImport global __cuLogicalEndpointGetLimits - data["__cuLogicalEndpointGetLimits"] = <_cyb_intptr_t>__cuLogicalEndpointGetLimits + data["__cuLogicalEndpointGetLimits"] = <intptr_t>__cuLogicalEndpointGetLimits global __cuLogicalEndpointQuery - data["__cuLogicalEndpointQuery"] = <_cyb_intptr_t>__cuLogicalEndpointQuery + data["__cuLogicalEndpointQuery"] = <intptr_t>__cuLogicalEndpointQuery global __cuStreamBeginRecaptureToGraph - data["__cuStreamBeginRecaptureToGraph"] = <_cyb_intptr_t>__cuStreamBeginRecaptureToGraph + data["__cuStreamBeginRecaptureToGraph"] = <intptr_t>__cuStreamBeginRecaptureToGraph global __cuDeviceGetFabricClusterUuid - data["__cuDeviceGetFabricClusterUuid"] = <_cyb_intptr_t>__cuDeviceGetFabricClusterUuid + data["__cuDeviceGetFabricClusterUuid"] = <intptr_t>__cuDeviceGetFabricClusterUuid global __cuDeviceGetCliqueCount - data["__cuDeviceGetCliqueCount"] = <_cyb_intptr_t>__cuDeviceGetCliqueCount + data["__cuDeviceGetCliqueCount"] = <intptr_t>__cuDeviceGetCliqueCount global __cuDeviceGetCliqueInfo - data["__cuDeviceGetCliqueInfo"] = <_cyb_intptr_t>__cuDeviceGetCliqueInfo + data["__cuDeviceGetCliqueInfo"] = <intptr_t>__cuDeviceGetCliqueInfo global __cuMemGetLocationInfo - data["__cuMemGetLocationInfo"] = <_cyb_intptr_t>__cuMemGetLocationInfo + data["__cuMemGetLocationInfo"] = <intptr_t>__cuMemGetLocationInfo global __cuGraphAddNode_v3 - data["__cuGraphAddNode_v3"] = <_cyb_intptr_t>__cuGraphAddNode_v3 + data["__cuGraphAddNode_v3"] = <intptr_t>__cuGraphAddNode_v3 global __cuGraphNodeSetParams_v2 - data["__cuGraphNodeSetParams_v2"] = <_cyb_intptr_t>__cuGraphNodeSetParams_v2 + data["__cuGraphNodeSetParams_v2"] = <intptr_t>__cuGraphNodeSetParams_v2 global __cuCheckpointOperationComplete - data["__cuCheckpointOperationComplete"] = <_cyb_intptr_t>__cuCheckpointOperationComplete + data["__cuCheckpointOperationComplete"] = <intptr_t>__cuCheckpointOperationComplete _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx b/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx index 5bdc8edc360..c5a1db07768 100644 --- a/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=56597b55df27ab42b4557879c383d53e0cff68853d1802c993db0e9eb8a449c7 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f81fb19e0ada225c1596acd9484f5166c26f935f522d96dcf5618b5f8297911e # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,7 @@ cdef extern from "<windows.h>": ctypedef void* HMODULE void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport intptr_t from os import getenv as _cyb_getenv import threading as _cyb_threading @@ -2205,1576 +2205,1576 @@ cpdef dict _inspect_function_pointers(): _check_or_init_driver() cdef dict data = {} global __cuGetErrorString - data["__cuGetErrorString"] = <_cyb_intptr_t>__cuGetErrorString + data["__cuGetErrorString"] = <intptr_t>__cuGetErrorString global __cuGetErrorName - data["__cuGetErrorName"] = <_cyb_intptr_t>__cuGetErrorName + data["__cuGetErrorName"] = <intptr_t>__cuGetErrorName global __cuInit - data["__cuInit"] = <_cyb_intptr_t>__cuInit + data["__cuInit"] = <intptr_t>__cuInit global __cuDriverGetVersion - data["__cuDriverGetVersion"] = <_cyb_intptr_t>__cuDriverGetVersion + data["__cuDriverGetVersion"] = <intptr_t>__cuDriverGetVersion global __cuDeviceGet - data["__cuDeviceGet"] = <_cyb_intptr_t>__cuDeviceGet + data["__cuDeviceGet"] = <intptr_t>__cuDeviceGet global __cuDeviceGetCount - data["__cuDeviceGetCount"] = <_cyb_intptr_t>__cuDeviceGetCount + data["__cuDeviceGetCount"] = <intptr_t>__cuDeviceGetCount global __cuDeviceGetName - data["__cuDeviceGetName"] = <_cyb_intptr_t>__cuDeviceGetName + data["__cuDeviceGetName"] = <intptr_t>__cuDeviceGetName global __cuDeviceGetUuid_v2 - data["__cuDeviceGetUuid_v2"] = <_cyb_intptr_t>__cuDeviceGetUuid_v2 + data["__cuDeviceGetUuid_v2"] = <intptr_t>__cuDeviceGetUuid_v2 global __cuDeviceGetLuid - data["__cuDeviceGetLuid"] = <_cyb_intptr_t>__cuDeviceGetLuid + data["__cuDeviceGetLuid"] = <intptr_t>__cuDeviceGetLuid global __cuDeviceTotalMem_v2 - data["__cuDeviceTotalMem_v2"] = <_cyb_intptr_t>__cuDeviceTotalMem_v2 + data["__cuDeviceTotalMem_v2"] = <intptr_t>__cuDeviceTotalMem_v2 global __cuDeviceGetTexture1DLinearMaxWidth - data["__cuDeviceGetTexture1DLinearMaxWidth"] = <_cyb_intptr_t>__cuDeviceGetTexture1DLinearMaxWidth + data["__cuDeviceGetTexture1DLinearMaxWidth"] = <intptr_t>__cuDeviceGetTexture1DLinearMaxWidth global __cuDeviceGetAttribute - data["__cuDeviceGetAttribute"] = <_cyb_intptr_t>__cuDeviceGetAttribute + data["__cuDeviceGetAttribute"] = <intptr_t>__cuDeviceGetAttribute global __cuDeviceGetNvSciSyncAttributes - data["__cuDeviceGetNvSciSyncAttributes"] = <_cyb_intptr_t>__cuDeviceGetNvSciSyncAttributes + data["__cuDeviceGetNvSciSyncAttributes"] = <intptr_t>__cuDeviceGetNvSciSyncAttributes global __cuDeviceSetMemPool - data["__cuDeviceSetMemPool"] = <_cyb_intptr_t>__cuDeviceSetMemPool + data["__cuDeviceSetMemPool"] = <intptr_t>__cuDeviceSetMemPool global __cuDeviceGetMemPool - data["__cuDeviceGetMemPool"] = <_cyb_intptr_t>__cuDeviceGetMemPool + data["__cuDeviceGetMemPool"] = <intptr_t>__cuDeviceGetMemPool global __cuDeviceGetDefaultMemPool - data["__cuDeviceGetDefaultMemPool"] = <_cyb_intptr_t>__cuDeviceGetDefaultMemPool + data["__cuDeviceGetDefaultMemPool"] = <intptr_t>__cuDeviceGetDefaultMemPool global __cuDeviceGetExecAffinitySupport - data["__cuDeviceGetExecAffinitySupport"] = <_cyb_intptr_t>__cuDeviceGetExecAffinitySupport + data["__cuDeviceGetExecAffinitySupport"] = <intptr_t>__cuDeviceGetExecAffinitySupport global __cuFlushGPUDirectRDMAWrites - data["__cuFlushGPUDirectRDMAWrites"] = <_cyb_intptr_t>__cuFlushGPUDirectRDMAWrites + data["__cuFlushGPUDirectRDMAWrites"] = <intptr_t>__cuFlushGPUDirectRDMAWrites global __cuDeviceGetProperties - data["__cuDeviceGetProperties"] = <_cyb_intptr_t>__cuDeviceGetProperties + data["__cuDeviceGetProperties"] = <intptr_t>__cuDeviceGetProperties global __cuDeviceComputeCapability - data["__cuDeviceComputeCapability"] = <_cyb_intptr_t>__cuDeviceComputeCapability + data["__cuDeviceComputeCapability"] = <intptr_t>__cuDeviceComputeCapability global __cuDevicePrimaryCtxRetain - data["__cuDevicePrimaryCtxRetain"] = <_cyb_intptr_t>__cuDevicePrimaryCtxRetain + data["__cuDevicePrimaryCtxRetain"] = <intptr_t>__cuDevicePrimaryCtxRetain global __cuDevicePrimaryCtxRelease_v2 - data["__cuDevicePrimaryCtxRelease_v2"] = <_cyb_intptr_t>__cuDevicePrimaryCtxRelease_v2 + data["__cuDevicePrimaryCtxRelease_v2"] = <intptr_t>__cuDevicePrimaryCtxRelease_v2 global __cuDevicePrimaryCtxSetFlags_v2 - data["__cuDevicePrimaryCtxSetFlags_v2"] = <_cyb_intptr_t>__cuDevicePrimaryCtxSetFlags_v2 + data["__cuDevicePrimaryCtxSetFlags_v2"] = <intptr_t>__cuDevicePrimaryCtxSetFlags_v2 global __cuDevicePrimaryCtxGetState - data["__cuDevicePrimaryCtxGetState"] = <_cyb_intptr_t>__cuDevicePrimaryCtxGetState + data["__cuDevicePrimaryCtxGetState"] = <intptr_t>__cuDevicePrimaryCtxGetState global __cuDevicePrimaryCtxReset_v2 - data["__cuDevicePrimaryCtxReset_v2"] = <_cyb_intptr_t>__cuDevicePrimaryCtxReset_v2 + data["__cuDevicePrimaryCtxReset_v2"] = <intptr_t>__cuDevicePrimaryCtxReset_v2 global __cuCtxCreate_v2 - data["__cuCtxCreate_v2"] = <_cyb_intptr_t>__cuCtxCreate_v2 + data["__cuCtxCreate_v2"] = <intptr_t>__cuCtxCreate_v2 global __cuCtxCreate_v3 - data["__cuCtxCreate_v3"] = <_cyb_intptr_t>__cuCtxCreate_v3 + data["__cuCtxCreate_v3"] = <intptr_t>__cuCtxCreate_v3 global __cuCtxCreate_v4 - data["__cuCtxCreate_v4"] = <_cyb_intptr_t>__cuCtxCreate_v4 + data["__cuCtxCreate_v4"] = <intptr_t>__cuCtxCreate_v4 global __cuCtxDestroy_v2 - data["__cuCtxDestroy_v2"] = <_cyb_intptr_t>__cuCtxDestroy_v2 + data["__cuCtxDestroy_v2"] = <intptr_t>__cuCtxDestroy_v2 global __cuCtxPushCurrent_v2 - data["__cuCtxPushCurrent_v2"] = <_cyb_intptr_t>__cuCtxPushCurrent_v2 + data["__cuCtxPushCurrent_v2"] = <intptr_t>__cuCtxPushCurrent_v2 global __cuCtxPopCurrent_v2 - data["__cuCtxPopCurrent_v2"] = <_cyb_intptr_t>__cuCtxPopCurrent_v2 + data["__cuCtxPopCurrent_v2"] = <intptr_t>__cuCtxPopCurrent_v2 global __cuCtxSetCurrent - data["__cuCtxSetCurrent"] = <_cyb_intptr_t>__cuCtxSetCurrent + data["__cuCtxSetCurrent"] = <intptr_t>__cuCtxSetCurrent global __cuCtxGetCurrent - data["__cuCtxGetCurrent"] = <_cyb_intptr_t>__cuCtxGetCurrent + data["__cuCtxGetCurrent"] = <intptr_t>__cuCtxGetCurrent global __cuCtxGetDevice - data["__cuCtxGetDevice"] = <_cyb_intptr_t>__cuCtxGetDevice + data["__cuCtxGetDevice"] = <intptr_t>__cuCtxGetDevice global __cuCtxGetFlags - data["__cuCtxGetFlags"] = <_cyb_intptr_t>__cuCtxGetFlags + data["__cuCtxGetFlags"] = <intptr_t>__cuCtxGetFlags global __cuCtxSetFlags - data["__cuCtxSetFlags"] = <_cyb_intptr_t>__cuCtxSetFlags + data["__cuCtxSetFlags"] = <intptr_t>__cuCtxSetFlags global __cuCtxGetId - data["__cuCtxGetId"] = <_cyb_intptr_t>__cuCtxGetId + data["__cuCtxGetId"] = <intptr_t>__cuCtxGetId global __cuCtxSynchronize - data["__cuCtxSynchronize"] = <_cyb_intptr_t>__cuCtxSynchronize + data["__cuCtxSynchronize"] = <intptr_t>__cuCtxSynchronize global __cuCtxSetLimit - data["__cuCtxSetLimit"] = <_cyb_intptr_t>__cuCtxSetLimit + data["__cuCtxSetLimit"] = <intptr_t>__cuCtxSetLimit global __cuCtxGetLimit - data["__cuCtxGetLimit"] = <_cyb_intptr_t>__cuCtxGetLimit + data["__cuCtxGetLimit"] = <intptr_t>__cuCtxGetLimit global __cuCtxGetCacheConfig - data["__cuCtxGetCacheConfig"] = <_cyb_intptr_t>__cuCtxGetCacheConfig + data["__cuCtxGetCacheConfig"] = <intptr_t>__cuCtxGetCacheConfig global __cuCtxSetCacheConfig - data["__cuCtxSetCacheConfig"] = <_cyb_intptr_t>__cuCtxSetCacheConfig + data["__cuCtxSetCacheConfig"] = <intptr_t>__cuCtxSetCacheConfig global __cuCtxGetApiVersion - data["__cuCtxGetApiVersion"] = <_cyb_intptr_t>__cuCtxGetApiVersion + data["__cuCtxGetApiVersion"] = <intptr_t>__cuCtxGetApiVersion global __cuCtxGetStreamPriorityRange - data["__cuCtxGetStreamPriorityRange"] = <_cyb_intptr_t>__cuCtxGetStreamPriorityRange + data["__cuCtxGetStreamPriorityRange"] = <intptr_t>__cuCtxGetStreamPriorityRange global __cuCtxResetPersistingL2Cache - data["__cuCtxResetPersistingL2Cache"] = <_cyb_intptr_t>__cuCtxResetPersistingL2Cache + data["__cuCtxResetPersistingL2Cache"] = <intptr_t>__cuCtxResetPersistingL2Cache global __cuCtxGetExecAffinity - data["__cuCtxGetExecAffinity"] = <_cyb_intptr_t>__cuCtxGetExecAffinity + data["__cuCtxGetExecAffinity"] = <intptr_t>__cuCtxGetExecAffinity global __cuCtxRecordEvent - data["__cuCtxRecordEvent"] = <_cyb_intptr_t>__cuCtxRecordEvent + data["__cuCtxRecordEvent"] = <intptr_t>__cuCtxRecordEvent global __cuCtxWaitEvent - data["__cuCtxWaitEvent"] = <_cyb_intptr_t>__cuCtxWaitEvent + data["__cuCtxWaitEvent"] = <intptr_t>__cuCtxWaitEvent global __cuCtxAttach - data["__cuCtxAttach"] = <_cyb_intptr_t>__cuCtxAttach + data["__cuCtxAttach"] = <intptr_t>__cuCtxAttach global __cuCtxDetach - data["__cuCtxDetach"] = <_cyb_intptr_t>__cuCtxDetach + data["__cuCtxDetach"] = <intptr_t>__cuCtxDetach global __cuCtxGetSharedMemConfig - data["__cuCtxGetSharedMemConfig"] = <_cyb_intptr_t>__cuCtxGetSharedMemConfig + data["__cuCtxGetSharedMemConfig"] = <intptr_t>__cuCtxGetSharedMemConfig global __cuCtxSetSharedMemConfig - data["__cuCtxSetSharedMemConfig"] = <_cyb_intptr_t>__cuCtxSetSharedMemConfig + data["__cuCtxSetSharedMemConfig"] = <intptr_t>__cuCtxSetSharedMemConfig global __cuModuleLoad - data["__cuModuleLoad"] = <_cyb_intptr_t>__cuModuleLoad + data["__cuModuleLoad"] = <intptr_t>__cuModuleLoad global __cuModuleLoadData - data["__cuModuleLoadData"] = <_cyb_intptr_t>__cuModuleLoadData + data["__cuModuleLoadData"] = <intptr_t>__cuModuleLoadData global __cuModuleLoadDataEx - data["__cuModuleLoadDataEx"] = <_cyb_intptr_t>__cuModuleLoadDataEx + data["__cuModuleLoadDataEx"] = <intptr_t>__cuModuleLoadDataEx global __cuModuleLoadFatBinary - data["__cuModuleLoadFatBinary"] = <_cyb_intptr_t>__cuModuleLoadFatBinary + data["__cuModuleLoadFatBinary"] = <intptr_t>__cuModuleLoadFatBinary global __cuModuleUnload - data["__cuModuleUnload"] = <_cyb_intptr_t>__cuModuleUnload + data["__cuModuleUnload"] = <intptr_t>__cuModuleUnload global __cuModuleGetLoadingMode - data["__cuModuleGetLoadingMode"] = <_cyb_intptr_t>__cuModuleGetLoadingMode + data["__cuModuleGetLoadingMode"] = <intptr_t>__cuModuleGetLoadingMode global __cuModuleGetFunction - data["__cuModuleGetFunction"] = <_cyb_intptr_t>__cuModuleGetFunction + data["__cuModuleGetFunction"] = <intptr_t>__cuModuleGetFunction global __cuModuleGetFunctionCount - data["__cuModuleGetFunctionCount"] = <_cyb_intptr_t>__cuModuleGetFunctionCount + data["__cuModuleGetFunctionCount"] = <intptr_t>__cuModuleGetFunctionCount global __cuModuleEnumerateFunctions - data["__cuModuleEnumerateFunctions"] = <_cyb_intptr_t>__cuModuleEnumerateFunctions + data["__cuModuleEnumerateFunctions"] = <intptr_t>__cuModuleEnumerateFunctions global __cuModuleGetGlobal_v2 - data["__cuModuleGetGlobal_v2"] = <_cyb_intptr_t>__cuModuleGetGlobal_v2 + data["__cuModuleGetGlobal_v2"] = <intptr_t>__cuModuleGetGlobal_v2 global __cuLinkCreate_v2 - data["__cuLinkCreate_v2"] = <_cyb_intptr_t>__cuLinkCreate_v2 + data["__cuLinkCreate_v2"] = <intptr_t>__cuLinkCreate_v2 global __cuLinkAddData_v2 - data["__cuLinkAddData_v2"] = <_cyb_intptr_t>__cuLinkAddData_v2 + data["__cuLinkAddData_v2"] = <intptr_t>__cuLinkAddData_v2 global __cuLinkAddFile_v2 - data["__cuLinkAddFile_v2"] = <_cyb_intptr_t>__cuLinkAddFile_v2 + data["__cuLinkAddFile_v2"] = <intptr_t>__cuLinkAddFile_v2 global __cuLinkComplete - data["__cuLinkComplete"] = <_cyb_intptr_t>__cuLinkComplete + data["__cuLinkComplete"] = <intptr_t>__cuLinkComplete global __cuLinkDestroy - data["__cuLinkDestroy"] = <_cyb_intptr_t>__cuLinkDestroy + data["__cuLinkDestroy"] = <intptr_t>__cuLinkDestroy global __cuModuleGetTexRef - data["__cuModuleGetTexRef"] = <_cyb_intptr_t>__cuModuleGetTexRef + data["__cuModuleGetTexRef"] = <intptr_t>__cuModuleGetTexRef global __cuModuleGetSurfRef - data["__cuModuleGetSurfRef"] = <_cyb_intptr_t>__cuModuleGetSurfRef + data["__cuModuleGetSurfRef"] = <intptr_t>__cuModuleGetSurfRef global __cuLibraryLoadData - data["__cuLibraryLoadData"] = <_cyb_intptr_t>__cuLibraryLoadData + data["__cuLibraryLoadData"] = <intptr_t>__cuLibraryLoadData global __cuLibraryLoadFromFile - data["__cuLibraryLoadFromFile"] = <_cyb_intptr_t>__cuLibraryLoadFromFile + data["__cuLibraryLoadFromFile"] = <intptr_t>__cuLibraryLoadFromFile global __cuLibraryUnload - data["__cuLibraryUnload"] = <_cyb_intptr_t>__cuLibraryUnload + data["__cuLibraryUnload"] = <intptr_t>__cuLibraryUnload global __cuLibraryGetKernel - data["__cuLibraryGetKernel"] = <_cyb_intptr_t>__cuLibraryGetKernel + data["__cuLibraryGetKernel"] = <intptr_t>__cuLibraryGetKernel global __cuLibraryGetKernelCount - data["__cuLibraryGetKernelCount"] = <_cyb_intptr_t>__cuLibraryGetKernelCount + data["__cuLibraryGetKernelCount"] = <intptr_t>__cuLibraryGetKernelCount global __cuLibraryEnumerateKernels - data["__cuLibraryEnumerateKernels"] = <_cyb_intptr_t>__cuLibraryEnumerateKernels + data["__cuLibraryEnumerateKernels"] = <intptr_t>__cuLibraryEnumerateKernels global __cuLibraryGetModule - data["__cuLibraryGetModule"] = <_cyb_intptr_t>__cuLibraryGetModule + data["__cuLibraryGetModule"] = <intptr_t>__cuLibraryGetModule global __cuKernelGetFunction - data["__cuKernelGetFunction"] = <_cyb_intptr_t>__cuKernelGetFunction + data["__cuKernelGetFunction"] = <intptr_t>__cuKernelGetFunction global __cuKernelGetLibrary - data["__cuKernelGetLibrary"] = <_cyb_intptr_t>__cuKernelGetLibrary + data["__cuKernelGetLibrary"] = <intptr_t>__cuKernelGetLibrary global __cuLibraryGetGlobal - data["__cuLibraryGetGlobal"] = <_cyb_intptr_t>__cuLibraryGetGlobal + data["__cuLibraryGetGlobal"] = <intptr_t>__cuLibraryGetGlobal global __cuLibraryGetManaged - data["__cuLibraryGetManaged"] = <_cyb_intptr_t>__cuLibraryGetManaged + data["__cuLibraryGetManaged"] = <intptr_t>__cuLibraryGetManaged global __cuLibraryGetUnifiedFunction - data["__cuLibraryGetUnifiedFunction"] = <_cyb_intptr_t>__cuLibraryGetUnifiedFunction + data["__cuLibraryGetUnifiedFunction"] = <intptr_t>__cuLibraryGetUnifiedFunction global __cuKernelGetAttribute - data["__cuKernelGetAttribute"] = <_cyb_intptr_t>__cuKernelGetAttribute + data["__cuKernelGetAttribute"] = <intptr_t>__cuKernelGetAttribute global __cuKernelSetAttribute - data["__cuKernelSetAttribute"] = <_cyb_intptr_t>__cuKernelSetAttribute + data["__cuKernelSetAttribute"] = <intptr_t>__cuKernelSetAttribute global __cuKernelSetCacheConfig - data["__cuKernelSetCacheConfig"] = <_cyb_intptr_t>__cuKernelSetCacheConfig + data["__cuKernelSetCacheConfig"] = <intptr_t>__cuKernelSetCacheConfig global __cuKernelGetName - data["__cuKernelGetName"] = <_cyb_intptr_t>__cuKernelGetName + data["__cuKernelGetName"] = <intptr_t>__cuKernelGetName global __cuKernelGetParamInfo - data["__cuKernelGetParamInfo"] = <_cyb_intptr_t>__cuKernelGetParamInfo + data["__cuKernelGetParamInfo"] = <intptr_t>__cuKernelGetParamInfo global __cuMemGetInfo_v2 - data["__cuMemGetInfo_v2"] = <_cyb_intptr_t>__cuMemGetInfo_v2 + data["__cuMemGetInfo_v2"] = <intptr_t>__cuMemGetInfo_v2 global __cuMemAlloc_v2 - data["__cuMemAlloc_v2"] = <_cyb_intptr_t>__cuMemAlloc_v2 + data["__cuMemAlloc_v2"] = <intptr_t>__cuMemAlloc_v2 global __cuMemAllocPitch_v2 - data["__cuMemAllocPitch_v2"] = <_cyb_intptr_t>__cuMemAllocPitch_v2 + data["__cuMemAllocPitch_v2"] = <intptr_t>__cuMemAllocPitch_v2 global __cuMemFree_v2 - data["__cuMemFree_v2"] = <_cyb_intptr_t>__cuMemFree_v2 + data["__cuMemFree_v2"] = <intptr_t>__cuMemFree_v2 global __cuMemGetAddressRange_v2 - data["__cuMemGetAddressRange_v2"] = <_cyb_intptr_t>__cuMemGetAddressRange_v2 + data["__cuMemGetAddressRange_v2"] = <intptr_t>__cuMemGetAddressRange_v2 global __cuMemAllocHost_v2 - data["__cuMemAllocHost_v2"] = <_cyb_intptr_t>__cuMemAllocHost_v2 + data["__cuMemAllocHost_v2"] = <intptr_t>__cuMemAllocHost_v2 global __cuMemFreeHost - data["__cuMemFreeHost"] = <_cyb_intptr_t>__cuMemFreeHost + data["__cuMemFreeHost"] = <intptr_t>__cuMemFreeHost global __cuMemHostAlloc - data["__cuMemHostAlloc"] = <_cyb_intptr_t>__cuMemHostAlloc + data["__cuMemHostAlloc"] = <intptr_t>__cuMemHostAlloc global __cuMemHostGetDevicePointer_v2 - data["__cuMemHostGetDevicePointer_v2"] = <_cyb_intptr_t>__cuMemHostGetDevicePointer_v2 + data["__cuMemHostGetDevicePointer_v2"] = <intptr_t>__cuMemHostGetDevicePointer_v2 global __cuMemHostGetFlags - data["__cuMemHostGetFlags"] = <_cyb_intptr_t>__cuMemHostGetFlags + data["__cuMemHostGetFlags"] = <intptr_t>__cuMemHostGetFlags global __cuMemAllocManaged - data["__cuMemAllocManaged"] = <_cyb_intptr_t>__cuMemAllocManaged + data["__cuMemAllocManaged"] = <intptr_t>__cuMemAllocManaged global __cuDeviceRegisterAsyncNotification - data["__cuDeviceRegisterAsyncNotification"] = <_cyb_intptr_t>__cuDeviceRegisterAsyncNotification + data["__cuDeviceRegisterAsyncNotification"] = <intptr_t>__cuDeviceRegisterAsyncNotification global __cuDeviceUnregisterAsyncNotification - data["__cuDeviceUnregisterAsyncNotification"] = <_cyb_intptr_t>__cuDeviceUnregisterAsyncNotification + data["__cuDeviceUnregisterAsyncNotification"] = <intptr_t>__cuDeviceUnregisterAsyncNotification global __cuDeviceGetByPCIBusId - data["__cuDeviceGetByPCIBusId"] = <_cyb_intptr_t>__cuDeviceGetByPCIBusId + data["__cuDeviceGetByPCIBusId"] = <intptr_t>__cuDeviceGetByPCIBusId global __cuDeviceGetPCIBusId - data["__cuDeviceGetPCIBusId"] = <_cyb_intptr_t>__cuDeviceGetPCIBusId + data["__cuDeviceGetPCIBusId"] = <intptr_t>__cuDeviceGetPCIBusId global __cuIpcGetEventHandle - data["__cuIpcGetEventHandle"] = <_cyb_intptr_t>__cuIpcGetEventHandle + data["__cuIpcGetEventHandle"] = <intptr_t>__cuIpcGetEventHandle global __cuIpcOpenEventHandle - data["__cuIpcOpenEventHandle"] = <_cyb_intptr_t>__cuIpcOpenEventHandle + data["__cuIpcOpenEventHandle"] = <intptr_t>__cuIpcOpenEventHandle global __cuIpcGetMemHandle - data["__cuIpcGetMemHandle"] = <_cyb_intptr_t>__cuIpcGetMemHandle + data["__cuIpcGetMemHandle"] = <intptr_t>__cuIpcGetMemHandle global __cuIpcOpenMemHandle_v2 - data["__cuIpcOpenMemHandle_v2"] = <_cyb_intptr_t>__cuIpcOpenMemHandle_v2 + data["__cuIpcOpenMemHandle_v2"] = <intptr_t>__cuIpcOpenMemHandle_v2 global __cuIpcCloseMemHandle - data["__cuIpcCloseMemHandle"] = <_cyb_intptr_t>__cuIpcCloseMemHandle + data["__cuIpcCloseMemHandle"] = <intptr_t>__cuIpcCloseMemHandle global __cuMemHostRegister_v2 - data["__cuMemHostRegister_v2"] = <_cyb_intptr_t>__cuMemHostRegister_v2 + data["__cuMemHostRegister_v2"] = <intptr_t>__cuMemHostRegister_v2 global __cuMemHostUnregister - data["__cuMemHostUnregister"] = <_cyb_intptr_t>__cuMemHostUnregister + data["__cuMemHostUnregister"] = <intptr_t>__cuMemHostUnregister global __cuMemcpy - data["__cuMemcpy"] = <_cyb_intptr_t>__cuMemcpy + data["__cuMemcpy"] = <intptr_t>__cuMemcpy global __cuMemcpyPeer - data["__cuMemcpyPeer"] = <_cyb_intptr_t>__cuMemcpyPeer + data["__cuMemcpyPeer"] = <intptr_t>__cuMemcpyPeer global __cuMemcpyHtoD_v2 - data["__cuMemcpyHtoD_v2"] = <_cyb_intptr_t>__cuMemcpyHtoD_v2 + data["__cuMemcpyHtoD_v2"] = <intptr_t>__cuMemcpyHtoD_v2 global __cuMemcpyDtoH_v2 - data["__cuMemcpyDtoH_v2"] = <_cyb_intptr_t>__cuMemcpyDtoH_v2 + data["__cuMemcpyDtoH_v2"] = <intptr_t>__cuMemcpyDtoH_v2 global __cuMemcpyDtoD_v2 - data["__cuMemcpyDtoD_v2"] = <_cyb_intptr_t>__cuMemcpyDtoD_v2 + data["__cuMemcpyDtoD_v2"] = <intptr_t>__cuMemcpyDtoD_v2 global __cuMemcpyDtoA_v2 - data["__cuMemcpyDtoA_v2"] = <_cyb_intptr_t>__cuMemcpyDtoA_v2 + data["__cuMemcpyDtoA_v2"] = <intptr_t>__cuMemcpyDtoA_v2 global __cuMemcpyAtoD_v2 - data["__cuMemcpyAtoD_v2"] = <_cyb_intptr_t>__cuMemcpyAtoD_v2 + data["__cuMemcpyAtoD_v2"] = <intptr_t>__cuMemcpyAtoD_v2 global __cuMemcpyHtoA_v2 - data["__cuMemcpyHtoA_v2"] = <_cyb_intptr_t>__cuMemcpyHtoA_v2 + data["__cuMemcpyHtoA_v2"] = <intptr_t>__cuMemcpyHtoA_v2 global __cuMemcpyAtoH_v2 - data["__cuMemcpyAtoH_v2"] = <_cyb_intptr_t>__cuMemcpyAtoH_v2 + data["__cuMemcpyAtoH_v2"] = <intptr_t>__cuMemcpyAtoH_v2 global __cuMemcpyAtoA_v2 - data["__cuMemcpyAtoA_v2"] = <_cyb_intptr_t>__cuMemcpyAtoA_v2 + data["__cuMemcpyAtoA_v2"] = <intptr_t>__cuMemcpyAtoA_v2 global __cuMemcpy2D_v2 - data["__cuMemcpy2D_v2"] = <_cyb_intptr_t>__cuMemcpy2D_v2 + data["__cuMemcpy2D_v2"] = <intptr_t>__cuMemcpy2D_v2 global __cuMemcpy2DUnaligned_v2 - data["__cuMemcpy2DUnaligned_v2"] = <_cyb_intptr_t>__cuMemcpy2DUnaligned_v2 + data["__cuMemcpy2DUnaligned_v2"] = <intptr_t>__cuMemcpy2DUnaligned_v2 global __cuMemcpy3D_v2 - data["__cuMemcpy3D_v2"] = <_cyb_intptr_t>__cuMemcpy3D_v2 + data["__cuMemcpy3D_v2"] = <intptr_t>__cuMemcpy3D_v2 global __cuMemcpy3DPeer - data["__cuMemcpy3DPeer"] = <_cyb_intptr_t>__cuMemcpy3DPeer + data["__cuMemcpy3DPeer"] = <intptr_t>__cuMemcpy3DPeer global __cuMemcpyAsync - data["__cuMemcpyAsync"] = <_cyb_intptr_t>__cuMemcpyAsync + data["__cuMemcpyAsync"] = <intptr_t>__cuMemcpyAsync global __cuMemcpyPeerAsync - data["__cuMemcpyPeerAsync"] = <_cyb_intptr_t>__cuMemcpyPeerAsync + data["__cuMemcpyPeerAsync"] = <intptr_t>__cuMemcpyPeerAsync global __cuMemcpyHtoDAsync_v2 - data["__cuMemcpyHtoDAsync_v2"] = <_cyb_intptr_t>__cuMemcpyHtoDAsync_v2 + data["__cuMemcpyHtoDAsync_v2"] = <intptr_t>__cuMemcpyHtoDAsync_v2 global __cuMemcpyDtoHAsync_v2 - data["__cuMemcpyDtoHAsync_v2"] = <_cyb_intptr_t>__cuMemcpyDtoHAsync_v2 + data["__cuMemcpyDtoHAsync_v2"] = <intptr_t>__cuMemcpyDtoHAsync_v2 global __cuMemcpyDtoDAsync_v2 - data["__cuMemcpyDtoDAsync_v2"] = <_cyb_intptr_t>__cuMemcpyDtoDAsync_v2 + data["__cuMemcpyDtoDAsync_v2"] = <intptr_t>__cuMemcpyDtoDAsync_v2 global __cuMemcpyHtoAAsync_v2 - data["__cuMemcpyHtoAAsync_v2"] = <_cyb_intptr_t>__cuMemcpyHtoAAsync_v2 + data["__cuMemcpyHtoAAsync_v2"] = <intptr_t>__cuMemcpyHtoAAsync_v2 global __cuMemcpyAtoHAsync_v2 - data["__cuMemcpyAtoHAsync_v2"] = <_cyb_intptr_t>__cuMemcpyAtoHAsync_v2 + data["__cuMemcpyAtoHAsync_v2"] = <intptr_t>__cuMemcpyAtoHAsync_v2 global __cuMemcpy2DAsync_v2 - data["__cuMemcpy2DAsync_v2"] = <_cyb_intptr_t>__cuMemcpy2DAsync_v2 + data["__cuMemcpy2DAsync_v2"] = <intptr_t>__cuMemcpy2DAsync_v2 global __cuMemcpy3DAsync_v2 - data["__cuMemcpy3DAsync_v2"] = <_cyb_intptr_t>__cuMemcpy3DAsync_v2 + data["__cuMemcpy3DAsync_v2"] = <intptr_t>__cuMemcpy3DAsync_v2 global __cuMemcpy3DPeerAsync - data["__cuMemcpy3DPeerAsync"] = <_cyb_intptr_t>__cuMemcpy3DPeerAsync + data["__cuMemcpy3DPeerAsync"] = <intptr_t>__cuMemcpy3DPeerAsync global __cuMemsetD8_v2 - data["__cuMemsetD8_v2"] = <_cyb_intptr_t>__cuMemsetD8_v2 + data["__cuMemsetD8_v2"] = <intptr_t>__cuMemsetD8_v2 global __cuMemsetD16_v2 - data["__cuMemsetD16_v2"] = <_cyb_intptr_t>__cuMemsetD16_v2 + data["__cuMemsetD16_v2"] = <intptr_t>__cuMemsetD16_v2 global __cuMemsetD32_v2 - data["__cuMemsetD32_v2"] = <_cyb_intptr_t>__cuMemsetD32_v2 + data["__cuMemsetD32_v2"] = <intptr_t>__cuMemsetD32_v2 global __cuMemsetD2D8_v2 - data["__cuMemsetD2D8_v2"] = <_cyb_intptr_t>__cuMemsetD2D8_v2 + data["__cuMemsetD2D8_v2"] = <intptr_t>__cuMemsetD2D8_v2 global __cuMemsetD2D16_v2 - data["__cuMemsetD2D16_v2"] = <_cyb_intptr_t>__cuMemsetD2D16_v2 + data["__cuMemsetD2D16_v2"] = <intptr_t>__cuMemsetD2D16_v2 global __cuMemsetD2D32_v2 - data["__cuMemsetD2D32_v2"] = <_cyb_intptr_t>__cuMemsetD2D32_v2 + data["__cuMemsetD2D32_v2"] = <intptr_t>__cuMemsetD2D32_v2 global __cuMemsetD8Async - data["__cuMemsetD8Async"] = <_cyb_intptr_t>__cuMemsetD8Async + data["__cuMemsetD8Async"] = <intptr_t>__cuMemsetD8Async global __cuMemsetD16Async - data["__cuMemsetD16Async"] = <_cyb_intptr_t>__cuMemsetD16Async + data["__cuMemsetD16Async"] = <intptr_t>__cuMemsetD16Async global __cuMemsetD32Async - data["__cuMemsetD32Async"] = <_cyb_intptr_t>__cuMemsetD32Async + data["__cuMemsetD32Async"] = <intptr_t>__cuMemsetD32Async global __cuMemsetD2D8Async - data["__cuMemsetD2D8Async"] = <_cyb_intptr_t>__cuMemsetD2D8Async + data["__cuMemsetD2D8Async"] = <intptr_t>__cuMemsetD2D8Async global __cuMemsetD2D16Async - data["__cuMemsetD2D16Async"] = <_cyb_intptr_t>__cuMemsetD2D16Async + data["__cuMemsetD2D16Async"] = <intptr_t>__cuMemsetD2D16Async global __cuMemsetD2D32Async - data["__cuMemsetD2D32Async"] = <_cyb_intptr_t>__cuMemsetD2D32Async + data["__cuMemsetD2D32Async"] = <intptr_t>__cuMemsetD2D32Async global __cuArrayCreate_v2 - data["__cuArrayCreate_v2"] = <_cyb_intptr_t>__cuArrayCreate_v2 + data["__cuArrayCreate_v2"] = <intptr_t>__cuArrayCreate_v2 global __cuArrayGetDescriptor_v2 - data["__cuArrayGetDescriptor_v2"] = <_cyb_intptr_t>__cuArrayGetDescriptor_v2 + data["__cuArrayGetDescriptor_v2"] = <intptr_t>__cuArrayGetDescriptor_v2 global __cuArrayGetSparseProperties - data["__cuArrayGetSparseProperties"] = <_cyb_intptr_t>__cuArrayGetSparseProperties + data["__cuArrayGetSparseProperties"] = <intptr_t>__cuArrayGetSparseProperties global __cuMipmappedArrayGetSparseProperties - data["__cuMipmappedArrayGetSparseProperties"] = <_cyb_intptr_t>__cuMipmappedArrayGetSparseProperties + data["__cuMipmappedArrayGetSparseProperties"] = <intptr_t>__cuMipmappedArrayGetSparseProperties global __cuArrayGetMemoryRequirements - data["__cuArrayGetMemoryRequirements"] = <_cyb_intptr_t>__cuArrayGetMemoryRequirements + data["__cuArrayGetMemoryRequirements"] = <intptr_t>__cuArrayGetMemoryRequirements global __cuMipmappedArrayGetMemoryRequirements - data["__cuMipmappedArrayGetMemoryRequirements"] = <_cyb_intptr_t>__cuMipmappedArrayGetMemoryRequirements + data["__cuMipmappedArrayGetMemoryRequirements"] = <intptr_t>__cuMipmappedArrayGetMemoryRequirements global __cuArrayGetPlane - data["__cuArrayGetPlane"] = <_cyb_intptr_t>__cuArrayGetPlane + data["__cuArrayGetPlane"] = <intptr_t>__cuArrayGetPlane global __cuArrayDestroy - data["__cuArrayDestroy"] = <_cyb_intptr_t>__cuArrayDestroy + data["__cuArrayDestroy"] = <intptr_t>__cuArrayDestroy global __cuArray3DCreate_v2 - data["__cuArray3DCreate_v2"] = <_cyb_intptr_t>__cuArray3DCreate_v2 + data["__cuArray3DCreate_v2"] = <intptr_t>__cuArray3DCreate_v2 global __cuArray3DGetDescriptor_v2 - data["__cuArray3DGetDescriptor_v2"] = <_cyb_intptr_t>__cuArray3DGetDescriptor_v2 + data["__cuArray3DGetDescriptor_v2"] = <intptr_t>__cuArray3DGetDescriptor_v2 global __cuMipmappedArrayCreate - data["__cuMipmappedArrayCreate"] = <_cyb_intptr_t>__cuMipmappedArrayCreate + data["__cuMipmappedArrayCreate"] = <intptr_t>__cuMipmappedArrayCreate global __cuMipmappedArrayGetLevel - data["__cuMipmappedArrayGetLevel"] = <_cyb_intptr_t>__cuMipmappedArrayGetLevel + data["__cuMipmappedArrayGetLevel"] = <intptr_t>__cuMipmappedArrayGetLevel global __cuMipmappedArrayDestroy - data["__cuMipmappedArrayDestroy"] = <_cyb_intptr_t>__cuMipmappedArrayDestroy + data["__cuMipmappedArrayDestroy"] = <intptr_t>__cuMipmappedArrayDestroy global __cuMemGetHandleForAddressRange - data["__cuMemGetHandleForAddressRange"] = <_cyb_intptr_t>__cuMemGetHandleForAddressRange + data["__cuMemGetHandleForAddressRange"] = <intptr_t>__cuMemGetHandleForAddressRange global __cuMemBatchDecompressAsync - data["__cuMemBatchDecompressAsync"] = <_cyb_intptr_t>__cuMemBatchDecompressAsync + data["__cuMemBatchDecompressAsync"] = <intptr_t>__cuMemBatchDecompressAsync global __cuMemAddressReserve - data["__cuMemAddressReserve"] = <_cyb_intptr_t>__cuMemAddressReserve + data["__cuMemAddressReserve"] = <intptr_t>__cuMemAddressReserve global __cuMemAddressFree - data["__cuMemAddressFree"] = <_cyb_intptr_t>__cuMemAddressFree + data["__cuMemAddressFree"] = <intptr_t>__cuMemAddressFree global __cuMemCreate - data["__cuMemCreate"] = <_cyb_intptr_t>__cuMemCreate + data["__cuMemCreate"] = <intptr_t>__cuMemCreate global __cuMemRelease - data["__cuMemRelease"] = <_cyb_intptr_t>__cuMemRelease + data["__cuMemRelease"] = <intptr_t>__cuMemRelease global __cuMemMap - data["__cuMemMap"] = <_cyb_intptr_t>__cuMemMap + data["__cuMemMap"] = <intptr_t>__cuMemMap global __cuMemMapArrayAsync - data["__cuMemMapArrayAsync"] = <_cyb_intptr_t>__cuMemMapArrayAsync + data["__cuMemMapArrayAsync"] = <intptr_t>__cuMemMapArrayAsync global __cuMemUnmap - data["__cuMemUnmap"] = <_cyb_intptr_t>__cuMemUnmap + data["__cuMemUnmap"] = <intptr_t>__cuMemUnmap global __cuMemSetAccess - data["__cuMemSetAccess"] = <_cyb_intptr_t>__cuMemSetAccess + data["__cuMemSetAccess"] = <intptr_t>__cuMemSetAccess global __cuMemGetAccess - data["__cuMemGetAccess"] = <_cyb_intptr_t>__cuMemGetAccess + data["__cuMemGetAccess"] = <intptr_t>__cuMemGetAccess global __cuMemExportToShareableHandle - data["__cuMemExportToShareableHandle"] = <_cyb_intptr_t>__cuMemExportToShareableHandle + data["__cuMemExportToShareableHandle"] = <intptr_t>__cuMemExportToShareableHandle global __cuMemImportFromShareableHandle - data["__cuMemImportFromShareableHandle"] = <_cyb_intptr_t>__cuMemImportFromShareableHandle + data["__cuMemImportFromShareableHandle"] = <intptr_t>__cuMemImportFromShareableHandle global __cuMemGetAllocationGranularity - data["__cuMemGetAllocationGranularity"] = <_cyb_intptr_t>__cuMemGetAllocationGranularity + data["__cuMemGetAllocationGranularity"] = <intptr_t>__cuMemGetAllocationGranularity global __cuMemGetAllocationPropertiesFromHandle - data["__cuMemGetAllocationPropertiesFromHandle"] = <_cyb_intptr_t>__cuMemGetAllocationPropertiesFromHandle + data["__cuMemGetAllocationPropertiesFromHandle"] = <intptr_t>__cuMemGetAllocationPropertiesFromHandle global __cuMemRetainAllocationHandle - data["__cuMemRetainAllocationHandle"] = <_cyb_intptr_t>__cuMemRetainAllocationHandle + data["__cuMemRetainAllocationHandle"] = <intptr_t>__cuMemRetainAllocationHandle global __cuMemFreeAsync - data["__cuMemFreeAsync"] = <_cyb_intptr_t>__cuMemFreeAsync + data["__cuMemFreeAsync"] = <intptr_t>__cuMemFreeAsync global __cuMemAllocAsync - data["__cuMemAllocAsync"] = <_cyb_intptr_t>__cuMemAllocAsync + data["__cuMemAllocAsync"] = <intptr_t>__cuMemAllocAsync global __cuMemPoolTrimTo - data["__cuMemPoolTrimTo"] = <_cyb_intptr_t>__cuMemPoolTrimTo + data["__cuMemPoolTrimTo"] = <intptr_t>__cuMemPoolTrimTo global __cuMemPoolSetAttribute - data["__cuMemPoolSetAttribute"] = <_cyb_intptr_t>__cuMemPoolSetAttribute + data["__cuMemPoolSetAttribute"] = <intptr_t>__cuMemPoolSetAttribute global __cuMemPoolGetAttribute - data["__cuMemPoolGetAttribute"] = <_cyb_intptr_t>__cuMemPoolGetAttribute + data["__cuMemPoolGetAttribute"] = <intptr_t>__cuMemPoolGetAttribute global __cuMemPoolSetAccess - data["__cuMemPoolSetAccess"] = <_cyb_intptr_t>__cuMemPoolSetAccess + data["__cuMemPoolSetAccess"] = <intptr_t>__cuMemPoolSetAccess global __cuMemPoolGetAccess - data["__cuMemPoolGetAccess"] = <_cyb_intptr_t>__cuMemPoolGetAccess + data["__cuMemPoolGetAccess"] = <intptr_t>__cuMemPoolGetAccess global __cuMemPoolCreate - data["__cuMemPoolCreate"] = <_cyb_intptr_t>__cuMemPoolCreate + data["__cuMemPoolCreate"] = <intptr_t>__cuMemPoolCreate global __cuMemPoolDestroy - data["__cuMemPoolDestroy"] = <_cyb_intptr_t>__cuMemPoolDestroy + data["__cuMemPoolDestroy"] = <intptr_t>__cuMemPoolDestroy global __cuMemAllocFromPoolAsync - data["__cuMemAllocFromPoolAsync"] = <_cyb_intptr_t>__cuMemAllocFromPoolAsync + data["__cuMemAllocFromPoolAsync"] = <intptr_t>__cuMemAllocFromPoolAsync global __cuMemPoolExportToShareableHandle - data["__cuMemPoolExportToShareableHandle"] = <_cyb_intptr_t>__cuMemPoolExportToShareableHandle + data["__cuMemPoolExportToShareableHandle"] = <intptr_t>__cuMemPoolExportToShareableHandle global __cuMemPoolImportFromShareableHandle - data["__cuMemPoolImportFromShareableHandle"] = <_cyb_intptr_t>__cuMemPoolImportFromShareableHandle + data["__cuMemPoolImportFromShareableHandle"] = <intptr_t>__cuMemPoolImportFromShareableHandle global __cuMemPoolExportPointer - data["__cuMemPoolExportPointer"] = <_cyb_intptr_t>__cuMemPoolExportPointer + data["__cuMemPoolExportPointer"] = <intptr_t>__cuMemPoolExportPointer global __cuMemPoolImportPointer - data["__cuMemPoolImportPointer"] = <_cyb_intptr_t>__cuMemPoolImportPointer + data["__cuMemPoolImportPointer"] = <intptr_t>__cuMemPoolImportPointer global __cuMulticastCreate - data["__cuMulticastCreate"] = <_cyb_intptr_t>__cuMulticastCreate + data["__cuMulticastCreate"] = <intptr_t>__cuMulticastCreate global __cuMulticastAddDevice - data["__cuMulticastAddDevice"] = <_cyb_intptr_t>__cuMulticastAddDevice + data["__cuMulticastAddDevice"] = <intptr_t>__cuMulticastAddDevice global __cuMulticastBindMem - data["__cuMulticastBindMem"] = <_cyb_intptr_t>__cuMulticastBindMem + data["__cuMulticastBindMem"] = <intptr_t>__cuMulticastBindMem global __cuMulticastBindAddr - data["__cuMulticastBindAddr"] = <_cyb_intptr_t>__cuMulticastBindAddr + data["__cuMulticastBindAddr"] = <intptr_t>__cuMulticastBindAddr global __cuMulticastUnbind - data["__cuMulticastUnbind"] = <_cyb_intptr_t>__cuMulticastUnbind + data["__cuMulticastUnbind"] = <intptr_t>__cuMulticastUnbind global __cuMulticastGetGranularity - data["__cuMulticastGetGranularity"] = <_cyb_intptr_t>__cuMulticastGetGranularity + data["__cuMulticastGetGranularity"] = <intptr_t>__cuMulticastGetGranularity global __cuPointerGetAttribute - data["__cuPointerGetAttribute"] = <_cyb_intptr_t>__cuPointerGetAttribute + data["__cuPointerGetAttribute"] = <intptr_t>__cuPointerGetAttribute global __cuMemPrefetchAsync_v2 - data["__cuMemPrefetchAsync_v2"] = <_cyb_intptr_t>__cuMemPrefetchAsync_v2 + data["__cuMemPrefetchAsync_v2"] = <intptr_t>__cuMemPrefetchAsync_v2 global __cuMemAdvise_v2 - data["__cuMemAdvise_v2"] = <_cyb_intptr_t>__cuMemAdvise_v2 + data["__cuMemAdvise_v2"] = <intptr_t>__cuMemAdvise_v2 global __cuMemRangeGetAttribute - data["__cuMemRangeGetAttribute"] = <_cyb_intptr_t>__cuMemRangeGetAttribute + data["__cuMemRangeGetAttribute"] = <intptr_t>__cuMemRangeGetAttribute global __cuMemRangeGetAttributes - data["__cuMemRangeGetAttributes"] = <_cyb_intptr_t>__cuMemRangeGetAttributes + data["__cuMemRangeGetAttributes"] = <intptr_t>__cuMemRangeGetAttributes global __cuPointerSetAttribute - data["__cuPointerSetAttribute"] = <_cyb_intptr_t>__cuPointerSetAttribute + data["__cuPointerSetAttribute"] = <intptr_t>__cuPointerSetAttribute global __cuPointerGetAttributes - data["__cuPointerGetAttributes"] = <_cyb_intptr_t>__cuPointerGetAttributes + data["__cuPointerGetAttributes"] = <intptr_t>__cuPointerGetAttributes global __cuStreamCreate - data["__cuStreamCreate"] = <_cyb_intptr_t>__cuStreamCreate + data["__cuStreamCreate"] = <intptr_t>__cuStreamCreate global __cuStreamCreateWithPriority - data["__cuStreamCreateWithPriority"] = <_cyb_intptr_t>__cuStreamCreateWithPriority + data["__cuStreamCreateWithPriority"] = <intptr_t>__cuStreamCreateWithPriority global __cuStreamGetPriority - data["__cuStreamGetPriority"] = <_cyb_intptr_t>__cuStreamGetPriority + data["__cuStreamGetPriority"] = <intptr_t>__cuStreamGetPriority global __cuStreamGetDevice - data["__cuStreamGetDevice"] = <_cyb_intptr_t>__cuStreamGetDevice + data["__cuStreamGetDevice"] = <intptr_t>__cuStreamGetDevice global __cuStreamGetFlags - data["__cuStreamGetFlags"] = <_cyb_intptr_t>__cuStreamGetFlags + data["__cuStreamGetFlags"] = <intptr_t>__cuStreamGetFlags global __cuStreamGetId - data["__cuStreamGetId"] = <_cyb_intptr_t>__cuStreamGetId + data["__cuStreamGetId"] = <intptr_t>__cuStreamGetId global __cuStreamGetCtx - data["__cuStreamGetCtx"] = <_cyb_intptr_t>__cuStreamGetCtx + data["__cuStreamGetCtx"] = <intptr_t>__cuStreamGetCtx global __cuStreamGetCtx_v2 - data["__cuStreamGetCtx_v2"] = <_cyb_intptr_t>__cuStreamGetCtx_v2 + data["__cuStreamGetCtx_v2"] = <intptr_t>__cuStreamGetCtx_v2 global __cuStreamWaitEvent - data["__cuStreamWaitEvent"] = <_cyb_intptr_t>__cuStreamWaitEvent + data["__cuStreamWaitEvent"] = <intptr_t>__cuStreamWaitEvent global __cuStreamAddCallback - data["__cuStreamAddCallback"] = <_cyb_intptr_t>__cuStreamAddCallback + data["__cuStreamAddCallback"] = <intptr_t>__cuStreamAddCallback global __cuStreamBeginCapture_v2 - data["__cuStreamBeginCapture_v2"] = <_cyb_intptr_t>__cuStreamBeginCapture_v2 + data["__cuStreamBeginCapture_v2"] = <intptr_t>__cuStreamBeginCapture_v2 global __cuStreamBeginCaptureToGraph - data["__cuStreamBeginCaptureToGraph"] = <_cyb_intptr_t>__cuStreamBeginCaptureToGraph + data["__cuStreamBeginCaptureToGraph"] = <intptr_t>__cuStreamBeginCaptureToGraph global __cuThreadExchangeStreamCaptureMode - data["__cuThreadExchangeStreamCaptureMode"] = <_cyb_intptr_t>__cuThreadExchangeStreamCaptureMode + data["__cuThreadExchangeStreamCaptureMode"] = <intptr_t>__cuThreadExchangeStreamCaptureMode global __cuStreamEndCapture - data["__cuStreamEndCapture"] = <_cyb_intptr_t>__cuStreamEndCapture + data["__cuStreamEndCapture"] = <intptr_t>__cuStreamEndCapture global __cuStreamIsCapturing - data["__cuStreamIsCapturing"] = <_cyb_intptr_t>__cuStreamIsCapturing + data["__cuStreamIsCapturing"] = <intptr_t>__cuStreamIsCapturing global __cuStreamGetCaptureInfo_v2 - data["__cuStreamGetCaptureInfo_v2"] = <_cyb_intptr_t>__cuStreamGetCaptureInfo_v2 + data["__cuStreamGetCaptureInfo_v2"] = <intptr_t>__cuStreamGetCaptureInfo_v2 global __cuStreamGetCaptureInfo_v3 - data["__cuStreamGetCaptureInfo_v3"] = <_cyb_intptr_t>__cuStreamGetCaptureInfo_v3 + data["__cuStreamGetCaptureInfo_v3"] = <intptr_t>__cuStreamGetCaptureInfo_v3 global __cuStreamUpdateCaptureDependencies_v2 - data["__cuStreamUpdateCaptureDependencies_v2"] = <_cyb_intptr_t>__cuStreamUpdateCaptureDependencies_v2 + data["__cuStreamUpdateCaptureDependencies_v2"] = <intptr_t>__cuStreamUpdateCaptureDependencies_v2 global __cuStreamAttachMemAsync - data["__cuStreamAttachMemAsync"] = <_cyb_intptr_t>__cuStreamAttachMemAsync + data["__cuStreamAttachMemAsync"] = <intptr_t>__cuStreamAttachMemAsync global __cuStreamQuery - data["__cuStreamQuery"] = <_cyb_intptr_t>__cuStreamQuery + data["__cuStreamQuery"] = <intptr_t>__cuStreamQuery global __cuStreamSynchronize - data["__cuStreamSynchronize"] = <_cyb_intptr_t>__cuStreamSynchronize + data["__cuStreamSynchronize"] = <intptr_t>__cuStreamSynchronize global __cuStreamDestroy_v2 - data["__cuStreamDestroy_v2"] = <_cyb_intptr_t>__cuStreamDestroy_v2 + data["__cuStreamDestroy_v2"] = <intptr_t>__cuStreamDestroy_v2 global __cuStreamCopyAttributes - data["__cuStreamCopyAttributes"] = <_cyb_intptr_t>__cuStreamCopyAttributes + data["__cuStreamCopyAttributes"] = <intptr_t>__cuStreamCopyAttributes global __cuStreamGetAttribute - data["__cuStreamGetAttribute"] = <_cyb_intptr_t>__cuStreamGetAttribute + data["__cuStreamGetAttribute"] = <intptr_t>__cuStreamGetAttribute global __cuStreamSetAttribute - data["__cuStreamSetAttribute"] = <_cyb_intptr_t>__cuStreamSetAttribute + data["__cuStreamSetAttribute"] = <intptr_t>__cuStreamSetAttribute global __cuEventCreate - data["__cuEventCreate"] = <_cyb_intptr_t>__cuEventCreate + data["__cuEventCreate"] = <intptr_t>__cuEventCreate global __cuEventRecord - data["__cuEventRecord"] = <_cyb_intptr_t>__cuEventRecord + data["__cuEventRecord"] = <intptr_t>__cuEventRecord global __cuEventRecordWithFlags - data["__cuEventRecordWithFlags"] = <_cyb_intptr_t>__cuEventRecordWithFlags + data["__cuEventRecordWithFlags"] = <intptr_t>__cuEventRecordWithFlags global __cuEventQuery - data["__cuEventQuery"] = <_cyb_intptr_t>__cuEventQuery + data["__cuEventQuery"] = <intptr_t>__cuEventQuery global __cuEventSynchronize - data["__cuEventSynchronize"] = <_cyb_intptr_t>__cuEventSynchronize + data["__cuEventSynchronize"] = <intptr_t>__cuEventSynchronize global __cuEventDestroy_v2 - data["__cuEventDestroy_v2"] = <_cyb_intptr_t>__cuEventDestroy_v2 + data["__cuEventDestroy_v2"] = <intptr_t>__cuEventDestroy_v2 global __cuEventElapsedTime_v2 - data["__cuEventElapsedTime_v2"] = <_cyb_intptr_t>__cuEventElapsedTime_v2 + data["__cuEventElapsedTime_v2"] = <intptr_t>__cuEventElapsedTime_v2 global __cuImportExternalMemory - data["__cuImportExternalMemory"] = <_cyb_intptr_t>__cuImportExternalMemory + data["__cuImportExternalMemory"] = <intptr_t>__cuImportExternalMemory global __cuExternalMemoryGetMappedBuffer - data["__cuExternalMemoryGetMappedBuffer"] = <_cyb_intptr_t>__cuExternalMemoryGetMappedBuffer + data["__cuExternalMemoryGetMappedBuffer"] = <intptr_t>__cuExternalMemoryGetMappedBuffer global __cuExternalMemoryGetMappedMipmappedArray - data["__cuExternalMemoryGetMappedMipmappedArray"] = <_cyb_intptr_t>__cuExternalMemoryGetMappedMipmappedArray + data["__cuExternalMemoryGetMappedMipmappedArray"] = <intptr_t>__cuExternalMemoryGetMappedMipmappedArray global __cuDestroyExternalMemory - data["__cuDestroyExternalMemory"] = <_cyb_intptr_t>__cuDestroyExternalMemory + data["__cuDestroyExternalMemory"] = <intptr_t>__cuDestroyExternalMemory global __cuImportExternalSemaphore - data["__cuImportExternalSemaphore"] = <_cyb_intptr_t>__cuImportExternalSemaphore + data["__cuImportExternalSemaphore"] = <intptr_t>__cuImportExternalSemaphore global __cuSignalExternalSemaphoresAsync - data["__cuSignalExternalSemaphoresAsync"] = <_cyb_intptr_t>__cuSignalExternalSemaphoresAsync + data["__cuSignalExternalSemaphoresAsync"] = <intptr_t>__cuSignalExternalSemaphoresAsync global __cuWaitExternalSemaphoresAsync - data["__cuWaitExternalSemaphoresAsync"] = <_cyb_intptr_t>__cuWaitExternalSemaphoresAsync + data["__cuWaitExternalSemaphoresAsync"] = <intptr_t>__cuWaitExternalSemaphoresAsync global __cuDestroyExternalSemaphore - data["__cuDestroyExternalSemaphore"] = <_cyb_intptr_t>__cuDestroyExternalSemaphore + data["__cuDestroyExternalSemaphore"] = <intptr_t>__cuDestroyExternalSemaphore global __cuStreamWaitValue32_v2 - data["__cuStreamWaitValue32_v2"] = <_cyb_intptr_t>__cuStreamWaitValue32_v2 + data["__cuStreamWaitValue32_v2"] = <intptr_t>__cuStreamWaitValue32_v2 global __cuStreamWaitValue64_v2 - data["__cuStreamWaitValue64_v2"] = <_cyb_intptr_t>__cuStreamWaitValue64_v2 + data["__cuStreamWaitValue64_v2"] = <intptr_t>__cuStreamWaitValue64_v2 global __cuStreamWriteValue32_v2 - data["__cuStreamWriteValue32_v2"] = <_cyb_intptr_t>__cuStreamWriteValue32_v2 + data["__cuStreamWriteValue32_v2"] = <intptr_t>__cuStreamWriteValue32_v2 global __cuStreamWriteValue64_v2 - data["__cuStreamWriteValue64_v2"] = <_cyb_intptr_t>__cuStreamWriteValue64_v2 + data["__cuStreamWriteValue64_v2"] = <intptr_t>__cuStreamWriteValue64_v2 global __cuStreamBatchMemOp_v2 - data["__cuStreamBatchMemOp_v2"] = <_cyb_intptr_t>__cuStreamBatchMemOp_v2 + data["__cuStreamBatchMemOp_v2"] = <intptr_t>__cuStreamBatchMemOp_v2 global __cuFuncGetAttribute - data["__cuFuncGetAttribute"] = <_cyb_intptr_t>__cuFuncGetAttribute + data["__cuFuncGetAttribute"] = <intptr_t>__cuFuncGetAttribute global __cuFuncSetAttribute - data["__cuFuncSetAttribute"] = <_cyb_intptr_t>__cuFuncSetAttribute + data["__cuFuncSetAttribute"] = <intptr_t>__cuFuncSetAttribute global __cuFuncSetCacheConfig - data["__cuFuncSetCacheConfig"] = <_cyb_intptr_t>__cuFuncSetCacheConfig + data["__cuFuncSetCacheConfig"] = <intptr_t>__cuFuncSetCacheConfig global __cuFuncGetModule - data["__cuFuncGetModule"] = <_cyb_intptr_t>__cuFuncGetModule + data["__cuFuncGetModule"] = <intptr_t>__cuFuncGetModule global __cuFuncGetName - data["__cuFuncGetName"] = <_cyb_intptr_t>__cuFuncGetName + data["__cuFuncGetName"] = <intptr_t>__cuFuncGetName global __cuFuncGetParamInfo - data["__cuFuncGetParamInfo"] = <_cyb_intptr_t>__cuFuncGetParamInfo + data["__cuFuncGetParamInfo"] = <intptr_t>__cuFuncGetParamInfo global __cuFuncIsLoaded - data["__cuFuncIsLoaded"] = <_cyb_intptr_t>__cuFuncIsLoaded + data["__cuFuncIsLoaded"] = <intptr_t>__cuFuncIsLoaded global __cuFuncLoad - data["__cuFuncLoad"] = <_cyb_intptr_t>__cuFuncLoad + data["__cuFuncLoad"] = <intptr_t>__cuFuncLoad global __cuLaunchKernel - data["__cuLaunchKernel"] = <_cyb_intptr_t>__cuLaunchKernel + data["__cuLaunchKernel"] = <intptr_t>__cuLaunchKernel global __cuLaunchKernelEx - data["__cuLaunchKernelEx"] = <_cyb_intptr_t>__cuLaunchKernelEx + data["__cuLaunchKernelEx"] = <intptr_t>__cuLaunchKernelEx global __cuLaunchCooperativeKernel - data["__cuLaunchCooperativeKernel"] = <_cyb_intptr_t>__cuLaunchCooperativeKernel + data["__cuLaunchCooperativeKernel"] = <intptr_t>__cuLaunchCooperativeKernel global __cuLaunchCooperativeKernelMultiDevice - data["__cuLaunchCooperativeKernelMultiDevice"] = <_cyb_intptr_t>__cuLaunchCooperativeKernelMultiDevice + data["__cuLaunchCooperativeKernelMultiDevice"] = <intptr_t>__cuLaunchCooperativeKernelMultiDevice global __cuLaunchHostFunc - data["__cuLaunchHostFunc"] = <_cyb_intptr_t>__cuLaunchHostFunc + data["__cuLaunchHostFunc"] = <intptr_t>__cuLaunchHostFunc global __cuFuncSetBlockShape - data["__cuFuncSetBlockShape"] = <_cyb_intptr_t>__cuFuncSetBlockShape + data["__cuFuncSetBlockShape"] = <intptr_t>__cuFuncSetBlockShape global __cuFuncSetSharedSize - data["__cuFuncSetSharedSize"] = <_cyb_intptr_t>__cuFuncSetSharedSize + data["__cuFuncSetSharedSize"] = <intptr_t>__cuFuncSetSharedSize global __cuParamSetSize - data["__cuParamSetSize"] = <_cyb_intptr_t>__cuParamSetSize + data["__cuParamSetSize"] = <intptr_t>__cuParamSetSize global __cuParamSeti - data["__cuParamSeti"] = <_cyb_intptr_t>__cuParamSeti + data["__cuParamSeti"] = <intptr_t>__cuParamSeti global __cuParamSetf - data["__cuParamSetf"] = <_cyb_intptr_t>__cuParamSetf + data["__cuParamSetf"] = <intptr_t>__cuParamSetf global __cuParamSetv - data["__cuParamSetv"] = <_cyb_intptr_t>__cuParamSetv + data["__cuParamSetv"] = <intptr_t>__cuParamSetv global __cuLaunch - data["__cuLaunch"] = <_cyb_intptr_t>__cuLaunch + data["__cuLaunch"] = <intptr_t>__cuLaunch global __cuLaunchGrid - data["__cuLaunchGrid"] = <_cyb_intptr_t>__cuLaunchGrid + data["__cuLaunchGrid"] = <intptr_t>__cuLaunchGrid global __cuLaunchGridAsync - data["__cuLaunchGridAsync"] = <_cyb_intptr_t>__cuLaunchGridAsync + data["__cuLaunchGridAsync"] = <intptr_t>__cuLaunchGridAsync global __cuParamSetTexRef - data["__cuParamSetTexRef"] = <_cyb_intptr_t>__cuParamSetTexRef + data["__cuParamSetTexRef"] = <intptr_t>__cuParamSetTexRef global __cuFuncSetSharedMemConfig - data["__cuFuncSetSharedMemConfig"] = <_cyb_intptr_t>__cuFuncSetSharedMemConfig + data["__cuFuncSetSharedMemConfig"] = <intptr_t>__cuFuncSetSharedMemConfig global __cuGraphCreate - data["__cuGraphCreate"] = <_cyb_intptr_t>__cuGraphCreate + data["__cuGraphCreate"] = <intptr_t>__cuGraphCreate global __cuGraphAddKernelNode_v2 - data["__cuGraphAddKernelNode_v2"] = <_cyb_intptr_t>__cuGraphAddKernelNode_v2 + data["__cuGraphAddKernelNode_v2"] = <intptr_t>__cuGraphAddKernelNode_v2 global __cuGraphKernelNodeGetParams_v2 - data["__cuGraphKernelNodeGetParams_v2"] = <_cyb_intptr_t>__cuGraphKernelNodeGetParams_v2 + data["__cuGraphKernelNodeGetParams_v2"] = <intptr_t>__cuGraphKernelNodeGetParams_v2 global __cuGraphKernelNodeSetParams_v2 - data["__cuGraphKernelNodeSetParams_v2"] = <_cyb_intptr_t>__cuGraphKernelNodeSetParams_v2 + data["__cuGraphKernelNodeSetParams_v2"] = <intptr_t>__cuGraphKernelNodeSetParams_v2 global __cuGraphAddMemcpyNode - data["__cuGraphAddMemcpyNode"] = <_cyb_intptr_t>__cuGraphAddMemcpyNode + data["__cuGraphAddMemcpyNode"] = <intptr_t>__cuGraphAddMemcpyNode global __cuGraphMemcpyNodeGetParams - data["__cuGraphMemcpyNodeGetParams"] = <_cyb_intptr_t>__cuGraphMemcpyNodeGetParams + data["__cuGraphMemcpyNodeGetParams"] = <intptr_t>__cuGraphMemcpyNodeGetParams global __cuGraphMemcpyNodeSetParams - data["__cuGraphMemcpyNodeSetParams"] = <_cyb_intptr_t>__cuGraphMemcpyNodeSetParams + data["__cuGraphMemcpyNodeSetParams"] = <intptr_t>__cuGraphMemcpyNodeSetParams global __cuGraphAddMemsetNode - data["__cuGraphAddMemsetNode"] = <_cyb_intptr_t>__cuGraphAddMemsetNode + data["__cuGraphAddMemsetNode"] = <intptr_t>__cuGraphAddMemsetNode global __cuGraphMemsetNodeGetParams - data["__cuGraphMemsetNodeGetParams"] = <_cyb_intptr_t>__cuGraphMemsetNodeGetParams + data["__cuGraphMemsetNodeGetParams"] = <intptr_t>__cuGraphMemsetNodeGetParams global __cuGraphMemsetNodeSetParams - data["__cuGraphMemsetNodeSetParams"] = <_cyb_intptr_t>__cuGraphMemsetNodeSetParams + data["__cuGraphMemsetNodeSetParams"] = <intptr_t>__cuGraphMemsetNodeSetParams global __cuGraphAddHostNode - data["__cuGraphAddHostNode"] = <_cyb_intptr_t>__cuGraphAddHostNode + data["__cuGraphAddHostNode"] = <intptr_t>__cuGraphAddHostNode global __cuGraphHostNodeGetParams - data["__cuGraphHostNodeGetParams"] = <_cyb_intptr_t>__cuGraphHostNodeGetParams + data["__cuGraphHostNodeGetParams"] = <intptr_t>__cuGraphHostNodeGetParams global __cuGraphHostNodeSetParams - data["__cuGraphHostNodeSetParams"] = <_cyb_intptr_t>__cuGraphHostNodeSetParams + data["__cuGraphHostNodeSetParams"] = <intptr_t>__cuGraphHostNodeSetParams global __cuGraphAddChildGraphNode - data["__cuGraphAddChildGraphNode"] = <_cyb_intptr_t>__cuGraphAddChildGraphNode + data["__cuGraphAddChildGraphNode"] = <intptr_t>__cuGraphAddChildGraphNode global __cuGraphChildGraphNodeGetGraph - data["__cuGraphChildGraphNodeGetGraph"] = <_cyb_intptr_t>__cuGraphChildGraphNodeGetGraph + data["__cuGraphChildGraphNodeGetGraph"] = <intptr_t>__cuGraphChildGraphNodeGetGraph global __cuGraphAddEmptyNode - data["__cuGraphAddEmptyNode"] = <_cyb_intptr_t>__cuGraphAddEmptyNode + data["__cuGraphAddEmptyNode"] = <intptr_t>__cuGraphAddEmptyNode global __cuGraphAddEventRecordNode - data["__cuGraphAddEventRecordNode"] = <_cyb_intptr_t>__cuGraphAddEventRecordNode + data["__cuGraphAddEventRecordNode"] = <intptr_t>__cuGraphAddEventRecordNode global __cuGraphEventRecordNodeGetEvent - data["__cuGraphEventRecordNodeGetEvent"] = <_cyb_intptr_t>__cuGraphEventRecordNodeGetEvent + data["__cuGraphEventRecordNodeGetEvent"] = <intptr_t>__cuGraphEventRecordNodeGetEvent global __cuGraphEventRecordNodeSetEvent - data["__cuGraphEventRecordNodeSetEvent"] = <_cyb_intptr_t>__cuGraphEventRecordNodeSetEvent + data["__cuGraphEventRecordNodeSetEvent"] = <intptr_t>__cuGraphEventRecordNodeSetEvent global __cuGraphAddEventWaitNode - data["__cuGraphAddEventWaitNode"] = <_cyb_intptr_t>__cuGraphAddEventWaitNode + data["__cuGraphAddEventWaitNode"] = <intptr_t>__cuGraphAddEventWaitNode global __cuGraphEventWaitNodeGetEvent - data["__cuGraphEventWaitNodeGetEvent"] = <_cyb_intptr_t>__cuGraphEventWaitNodeGetEvent + data["__cuGraphEventWaitNodeGetEvent"] = <intptr_t>__cuGraphEventWaitNodeGetEvent global __cuGraphEventWaitNodeSetEvent - data["__cuGraphEventWaitNodeSetEvent"] = <_cyb_intptr_t>__cuGraphEventWaitNodeSetEvent + data["__cuGraphEventWaitNodeSetEvent"] = <intptr_t>__cuGraphEventWaitNodeSetEvent global __cuGraphAddExternalSemaphoresSignalNode - data["__cuGraphAddExternalSemaphoresSignalNode"] = <_cyb_intptr_t>__cuGraphAddExternalSemaphoresSignalNode + data["__cuGraphAddExternalSemaphoresSignalNode"] = <intptr_t>__cuGraphAddExternalSemaphoresSignalNode global __cuGraphExternalSemaphoresSignalNodeGetParams - data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = <_cyb_intptr_t>__cuGraphExternalSemaphoresSignalNodeGetParams + data["__cuGraphExternalSemaphoresSignalNodeGetParams"] = <intptr_t>__cuGraphExternalSemaphoresSignalNodeGetParams global __cuGraphExternalSemaphoresSignalNodeSetParams - data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = <_cyb_intptr_t>__cuGraphExternalSemaphoresSignalNodeSetParams + data["__cuGraphExternalSemaphoresSignalNodeSetParams"] = <intptr_t>__cuGraphExternalSemaphoresSignalNodeSetParams global __cuGraphAddExternalSemaphoresWaitNode - data["__cuGraphAddExternalSemaphoresWaitNode"] = <_cyb_intptr_t>__cuGraphAddExternalSemaphoresWaitNode + data["__cuGraphAddExternalSemaphoresWaitNode"] = <intptr_t>__cuGraphAddExternalSemaphoresWaitNode global __cuGraphExternalSemaphoresWaitNodeGetParams - data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = <_cyb_intptr_t>__cuGraphExternalSemaphoresWaitNodeGetParams + data["__cuGraphExternalSemaphoresWaitNodeGetParams"] = <intptr_t>__cuGraphExternalSemaphoresWaitNodeGetParams global __cuGraphExternalSemaphoresWaitNodeSetParams - data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = <_cyb_intptr_t>__cuGraphExternalSemaphoresWaitNodeSetParams + data["__cuGraphExternalSemaphoresWaitNodeSetParams"] = <intptr_t>__cuGraphExternalSemaphoresWaitNodeSetParams global __cuGraphAddBatchMemOpNode - data["__cuGraphAddBatchMemOpNode"] = <_cyb_intptr_t>__cuGraphAddBatchMemOpNode + data["__cuGraphAddBatchMemOpNode"] = <intptr_t>__cuGraphAddBatchMemOpNode global __cuGraphBatchMemOpNodeGetParams - data["__cuGraphBatchMemOpNodeGetParams"] = <_cyb_intptr_t>__cuGraphBatchMemOpNodeGetParams + data["__cuGraphBatchMemOpNodeGetParams"] = <intptr_t>__cuGraphBatchMemOpNodeGetParams global __cuGraphBatchMemOpNodeSetParams - data["__cuGraphBatchMemOpNodeSetParams"] = <_cyb_intptr_t>__cuGraphBatchMemOpNodeSetParams + data["__cuGraphBatchMemOpNodeSetParams"] = <intptr_t>__cuGraphBatchMemOpNodeSetParams global __cuGraphExecBatchMemOpNodeSetParams - data["__cuGraphExecBatchMemOpNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecBatchMemOpNodeSetParams + data["__cuGraphExecBatchMemOpNodeSetParams"] = <intptr_t>__cuGraphExecBatchMemOpNodeSetParams global __cuGraphAddMemAllocNode - data["__cuGraphAddMemAllocNode"] = <_cyb_intptr_t>__cuGraphAddMemAllocNode + data["__cuGraphAddMemAllocNode"] = <intptr_t>__cuGraphAddMemAllocNode global __cuGraphMemAllocNodeGetParams - data["__cuGraphMemAllocNodeGetParams"] = <_cyb_intptr_t>__cuGraphMemAllocNodeGetParams + data["__cuGraphMemAllocNodeGetParams"] = <intptr_t>__cuGraphMemAllocNodeGetParams global __cuGraphAddMemFreeNode - data["__cuGraphAddMemFreeNode"] = <_cyb_intptr_t>__cuGraphAddMemFreeNode + data["__cuGraphAddMemFreeNode"] = <intptr_t>__cuGraphAddMemFreeNode global __cuGraphMemFreeNodeGetParams - data["__cuGraphMemFreeNodeGetParams"] = <_cyb_intptr_t>__cuGraphMemFreeNodeGetParams + data["__cuGraphMemFreeNodeGetParams"] = <intptr_t>__cuGraphMemFreeNodeGetParams global __cuDeviceGraphMemTrim - data["__cuDeviceGraphMemTrim"] = <_cyb_intptr_t>__cuDeviceGraphMemTrim + data["__cuDeviceGraphMemTrim"] = <intptr_t>__cuDeviceGraphMemTrim global __cuDeviceGetGraphMemAttribute - data["__cuDeviceGetGraphMemAttribute"] = <_cyb_intptr_t>__cuDeviceGetGraphMemAttribute + data["__cuDeviceGetGraphMemAttribute"] = <intptr_t>__cuDeviceGetGraphMemAttribute global __cuDeviceSetGraphMemAttribute - data["__cuDeviceSetGraphMemAttribute"] = <_cyb_intptr_t>__cuDeviceSetGraphMemAttribute + data["__cuDeviceSetGraphMemAttribute"] = <intptr_t>__cuDeviceSetGraphMemAttribute global __cuGraphClone - data["__cuGraphClone"] = <_cyb_intptr_t>__cuGraphClone + data["__cuGraphClone"] = <intptr_t>__cuGraphClone global __cuGraphNodeFindInClone - data["__cuGraphNodeFindInClone"] = <_cyb_intptr_t>__cuGraphNodeFindInClone + data["__cuGraphNodeFindInClone"] = <intptr_t>__cuGraphNodeFindInClone global __cuGraphNodeGetType - data["__cuGraphNodeGetType"] = <_cyb_intptr_t>__cuGraphNodeGetType + data["__cuGraphNodeGetType"] = <intptr_t>__cuGraphNodeGetType global __cuGraphGetNodes - data["__cuGraphGetNodes"] = <_cyb_intptr_t>__cuGraphGetNodes + data["__cuGraphGetNodes"] = <intptr_t>__cuGraphGetNodes global __cuGraphGetRootNodes - data["__cuGraphGetRootNodes"] = <_cyb_intptr_t>__cuGraphGetRootNodes + data["__cuGraphGetRootNodes"] = <intptr_t>__cuGraphGetRootNodes global __cuGraphGetEdges_v2 - data["__cuGraphGetEdges_v2"] = <_cyb_intptr_t>__cuGraphGetEdges_v2 + data["__cuGraphGetEdges_v2"] = <intptr_t>__cuGraphGetEdges_v2 global __cuGraphNodeGetDependencies_v2 - data["__cuGraphNodeGetDependencies_v2"] = <_cyb_intptr_t>__cuGraphNodeGetDependencies_v2 + data["__cuGraphNodeGetDependencies_v2"] = <intptr_t>__cuGraphNodeGetDependencies_v2 global __cuGraphNodeGetDependentNodes_v2 - data["__cuGraphNodeGetDependentNodes_v2"] = <_cyb_intptr_t>__cuGraphNodeGetDependentNodes_v2 + data["__cuGraphNodeGetDependentNodes_v2"] = <intptr_t>__cuGraphNodeGetDependentNodes_v2 global __cuGraphAddDependencies_v2 - data["__cuGraphAddDependencies_v2"] = <_cyb_intptr_t>__cuGraphAddDependencies_v2 + data["__cuGraphAddDependencies_v2"] = <intptr_t>__cuGraphAddDependencies_v2 global __cuGraphRemoveDependencies_v2 - data["__cuGraphRemoveDependencies_v2"] = <_cyb_intptr_t>__cuGraphRemoveDependencies_v2 + data["__cuGraphRemoveDependencies_v2"] = <intptr_t>__cuGraphRemoveDependencies_v2 global __cuGraphDestroyNode - data["__cuGraphDestroyNode"] = <_cyb_intptr_t>__cuGraphDestroyNode + data["__cuGraphDestroyNode"] = <intptr_t>__cuGraphDestroyNode global __cuGraphInstantiateWithFlags - data["__cuGraphInstantiateWithFlags"] = <_cyb_intptr_t>__cuGraphInstantiateWithFlags + data["__cuGraphInstantiateWithFlags"] = <intptr_t>__cuGraphInstantiateWithFlags global __cuGraphInstantiateWithParams - data["__cuGraphInstantiateWithParams"] = <_cyb_intptr_t>__cuGraphInstantiateWithParams + data["__cuGraphInstantiateWithParams"] = <intptr_t>__cuGraphInstantiateWithParams global __cuGraphExecGetFlags - data["__cuGraphExecGetFlags"] = <_cyb_intptr_t>__cuGraphExecGetFlags + data["__cuGraphExecGetFlags"] = <intptr_t>__cuGraphExecGetFlags global __cuGraphExecKernelNodeSetParams_v2 - data["__cuGraphExecKernelNodeSetParams_v2"] = <_cyb_intptr_t>__cuGraphExecKernelNodeSetParams_v2 + data["__cuGraphExecKernelNodeSetParams_v2"] = <intptr_t>__cuGraphExecKernelNodeSetParams_v2 global __cuGraphExecMemcpyNodeSetParams - data["__cuGraphExecMemcpyNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecMemcpyNodeSetParams + data["__cuGraphExecMemcpyNodeSetParams"] = <intptr_t>__cuGraphExecMemcpyNodeSetParams global __cuGraphExecMemsetNodeSetParams - data["__cuGraphExecMemsetNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecMemsetNodeSetParams + data["__cuGraphExecMemsetNodeSetParams"] = <intptr_t>__cuGraphExecMemsetNodeSetParams global __cuGraphExecHostNodeSetParams - data["__cuGraphExecHostNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecHostNodeSetParams + data["__cuGraphExecHostNodeSetParams"] = <intptr_t>__cuGraphExecHostNodeSetParams global __cuGraphExecChildGraphNodeSetParams - data["__cuGraphExecChildGraphNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecChildGraphNodeSetParams + data["__cuGraphExecChildGraphNodeSetParams"] = <intptr_t>__cuGraphExecChildGraphNodeSetParams global __cuGraphExecEventRecordNodeSetEvent - data["__cuGraphExecEventRecordNodeSetEvent"] = <_cyb_intptr_t>__cuGraphExecEventRecordNodeSetEvent + data["__cuGraphExecEventRecordNodeSetEvent"] = <intptr_t>__cuGraphExecEventRecordNodeSetEvent global __cuGraphExecEventWaitNodeSetEvent - data["__cuGraphExecEventWaitNodeSetEvent"] = <_cyb_intptr_t>__cuGraphExecEventWaitNodeSetEvent + data["__cuGraphExecEventWaitNodeSetEvent"] = <intptr_t>__cuGraphExecEventWaitNodeSetEvent global __cuGraphExecExternalSemaphoresSignalNodeSetParams - data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecExternalSemaphoresSignalNodeSetParams + data["__cuGraphExecExternalSemaphoresSignalNodeSetParams"] = <intptr_t>__cuGraphExecExternalSemaphoresSignalNodeSetParams global __cuGraphExecExternalSemaphoresWaitNodeSetParams - data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecExternalSemaphoresWaitNodeSetParams + data["__cuGraphExecExternalSemaphoresWaitNodeSetParams"] = <intptr_t>__cuGraphExecExternalSemaphoresWaitNodeSetParams global __cuGraphNodeSetEnabled - data["__cuGraphNodeSetEnabled"] = <_cyb_intptr_t>__cuGraphNodeSetEnabled + data["__cuGraphNodeSetEnabled"] = <intptr_t>__cuGraphNodeSetEnabled global __cuGraphNodeGetEnabled - data["__cuGraphNodeGetEnabled"] = <_cyb_intptr_t>__cuGraphNodeGetEnabled + data["__cuGraphNodeGetEnabled"] = <intptr_t>__cuGraphNodeGetEnabled global __cuGraphUpload - data["__cuGraphUpload"] = <_cyb_intptr_t>__cuGraphUpload + data["__cuGraphUpload"] = <intptr_t>__cuGraphUpload global __cuGraphLaunch - data["__cuGraphLaunch"] = <_cyb_intptr_t>__cuGraphLaunch + data["__cuGraphLaunch"] = <intptr_t>__cuGraphLaunch global __cuGraphExecDestroy - data["__cuGraphExecDestroy"] = <_cyb_intptr_t>__cuGraphExecDestroy + data["__cuGraphExecDestroy"] = <intptr_t>__cuGraphExecDestroy global __cuGraphDestroy - data["__cuGraphDestroy"] = <_cyb_intptr_t>__cuGraphDestroy + data["__cuGraphDestroy"] = <intptr_t>__cuGraphDestroy global __cuGraphExecUpdate_v2 - data["__cuGraphExecUpdate_v2"] = <_cyb_intptr_t>__cuGraphExecUpdate_v2 + data["__cuGraphExecUpdate_v2"] = <intptr_t>__cuGraphExecUpdate_v2 global __cuGraphKernelNodeCopyAttributes - data["__cuGraphKernelNodeCopyAttributes"] = <_cyb_intptr_t>__cuGraphKernelNodeCopyAttributes + data["__cuGraphKernelNodeCopyAttributes"] = <intptr_t>__cuGraphKernelNodeCopyAttributes global __cuGraphKernelNodeGetAttribute - data["__cuGraphKernelNodeGetAttribute"] = <_cyb_intptr_t>__cuGraphKernelNodeGetAttribute + data["__cuGraphKernelNodeGetAttribute"] = <intptr_t>__cuGraphKernelNodeGetAttribute global __cuGraphKernelNodeSetAttribute - data["__cuGraphKernelNodeSetAttribute"] = <_cyb_intptr_t>__cuGraphKernelNodeSetAttribute + data["__cuGraphKernelNodeSetAttribute"] = <intptr_t>__cuGraphKernelNodeSetAttribute global __cuGraphDebugDotPrint - data["__cuGraphDebugDotPrint"] = <_cyb_intptr_t>__cuGraphDebugDotPrint + data["__cuGraphDebugDotPrint"] = <intptr_t>__cuGraphDebugDotPrint global __cuUserObjectCreate - data["__cuUserObjectCreate"] = <_cyb_intptr_t>__cuUserObjectCreate + data["__cuUserObjectCreate"] = <intptr_t>__cuUserObjectCreate global __cuUserObjectRetain - data["__cuUserObjectRetain"] = <_cyb_intptr_t>__cuUserObjectRetain + data["__cuUserObjectRetain"] = <intptr_t>__cuUserObjectRetain global __cuUserObjectRelease - data["__cuUserObjectRelease"] = <_cyb_intptr_t>__cuUserObjectRelease + data["__cuUserObjectRelease"] = <intptr_t>__cuUserObjectRelease global __cuGraphRetainUserObject - data["__cuGraphRetainUserObject"] = <_cyb_intptr_t>__cuGraphRetainUserObject + data["__cuGraphRetainUserObject"] = <intptr_t>__cuGraphRetainUserObject global __cuGraphReleaseUserObject - data["__cuGraphReleaseUserObject"] = <_cyb_intptr_t>__cuGraphReleaseUserObject + data["__cuGraphReleaseUserObject"] = <intptr_t>__cuGraphReleaseUserObject global __cuGraphAddNode_v2 - data["__cuGraphAddNode_v2"] = <_cyb_intptr_t>__cuGraphAddNode_v2 + data["__cuGraphAddNode_v2"] = <intptr_t>__cuGraphAddNode_v2 global __cuGraphNodeSetParams - data["__cuGraphNodeSetParams"] = <_cyb_intptr_t>__cuGraphNodeSetParams + data["__cuGraphNodeSetParams"] = <intptr_t>__cuGraphNodeSetParams global __cuGraphExecNodeSetParams - data["__cuGraphExecNodeSetParams"] = <_cyb_intptr_t>__cuGraphExecNodeSetParams + data["__cuGraphExecNodeSetParams"] = <intptr_t>__cuGraphExecNodeSetParams global __cuGraphConditionalHandleCreate - data["__cuGraphConditionalHandleCreate"] = <_cyb_intptr_t>__cuGraphConditionalHandleCreate + data["__cuGraphConditionalHandleCreate"] = <intptr_t>__cuGraphConditionalHandleCreate global __cuOccupancyMaxActiveBlocksPerMultiprocessor - data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = <_cyb_intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessor + data["__cuOccupancyMaxActiveBlocksPerMultiprocessor"] = <intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessor global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = <_cyb_intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + data["__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags"] = <intptr_t>__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags global __cuOccupancyMaxPotentialBlockSize - data["__cuOccupancyMaxPotentialBlockSize"] = <_cyb_intptr_t>__cuOccupancyMaxPotentialBlockSize + data["__cuOccupancyMaxPotentialBlockSize"] = <intptr_t>__cuOccupancyMaxPotentialBlockSize global __cuOccupancyMaxPotentialBlockSizeWithFlags - data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = <_cyb_intptr_t>__cuOccupancyMaxPotentialBlockSizeWithFlags + data["__cuOccupancyMaxPotentialBlockSizeWithFlags"] = <intptr_t>__cuOccupancyMaxPotentialBlockSizeWithFlags global __cuOccupancyAvailableDynamicSMemPerBlock - data["__cuOccupancyAvailableDynamicSMemPerBlock"] = <_cyb_intptr_t>__cuOccupancyAvailableDynamicSMemPerBlock + data["__cuOccupancyAvailableDynamicSMemPerBlock"] = <intptr_t>__cuOccupancyAvailableDynamicSMemPerBlock global __cuOccupancyMaxPotentialClusterSize - data["__cuOccupancyMaxPotentialClusterSize"] = <_cyb_intptr_t>__cuOccupancyMaxPotentialClusterSize + data["__cuOccupancyMaxPotentialClusterSize"] = <intptr_t>__cuOccupancyMaxPotentialClusterSize global __cuOccupancyMaxActiveClusters - data["__cuOccupancyMaxActiveClusters"] = <_cyb_intptr_t>__cuOccupancyMaxActiveClusters + data["__cuOccupancyMaxActiveClusters"] = <intptr_t>__cuOccupancyMaxActiveClusters global __cuTexRefSetArray - data["__cuTexRefSetArray"] = <_cyb_intptr_t>__cuTexRefSetArray + data["__cuTexRefSetArray"] = <intptr_t>__cuTexRefSetArray global __cuTexRefSetMipmappedArray - data["__cuTexRefSetMipmappedArray"] = <_cyb_intptr_t>__cuTexRefSetMipmappedArray + data["__cuTexRefSetMipmappedArray"] = <intptr_t>__cuTexRefSetMipmappedArray global __cuTexRefSetAddress_v2 - data["__cuTexRefSetAddress_v2"] = <_cyb_intptr_t>__cuTexRefSetAddress_v2 + data["__cuTexRefSetAddress_v2"] = <intptr_t>__cuTexRefSetAddress_v2 global __cuTexRefSetAddress2D_v3 - data["__cuTexRefSetAddress2D_v3"] = <_cyb_intptr_t>__cuTexRefSetAddress2D_v3 + data["__cuTexRefSetAddress2D_v3"] = <intptr_t>__cuTexRefSetAddress2D_v3 global __cuTexRefSetFormat - data["__cuTexRefSetFormat"] = <_cyb_intptr_t>__cuTexRefSetFormat + data["__cuTexRefSetFormat"] = <intptr_t>__cuTexRefSetFormat global __cuTexRefSetAddressMode - data["__cuTexRefSetAddressMode"] = <_cyb_intptr_t>__cuTexRefSetAddressMode + data["__cuTexRefSetAddressMode"] = <intptr_t>__cuTexRefSetAddressMode global __cuTexRefSetFilterMode - data["__cuTexRefSetFilterMode"] = <_cyb_intptr_t>__cuTexRefSetFilterMode + data["__cuTexRefSetFilterMode"] = <intptr_t>__cuTexRefSetFilterMode global __cuTexRefSetMipmapFilterMode - data["__cuTexRefSetMipmapFilterMode"] = <_cyb_intptr_t>__cuTexRefSetMipmapFilterMode + data["__cuTexRefSetMipmapFilterMode"] = <intptr_t>__cuTexRefSetMipmapFilterMode global __cuTexRefSetMipmapLevelBias - data["__cuTexRefSetMipmapLevelBias"] = <_cyb_intptr_t>__cuTexRefSetMipmapLevelBias + data["__cuTexRefSetMipmapLevelBias"] = <intptr_t>__cuTexRefSetMipmapLevelBias global __cuTexRefSetMipmapLevelClamp - data["__cuTexRefSetMipmapLevelClamp"] = <_cyb_intptr_t>__cuTexRefSetMipmapLevelClamp + data["__cuTexRefSetMipmapLevelClamp"] = <intptr_t>__cuTexRefSetMipmapLevelClamp global __cuTexRefSetMaxAnisotropy - data["__cuTexRefSetMaxAnisotropy"] = <_cyb_intptr_t>__cuTexRefSetMaxAnisotropy + data["__cuTexRefSetMaxAnisotropy"] = <intptr_t>__cuTexRefSetMaxAnisotropy global __cuTexRefSetBorderColor - data["__cuTexRefSetBorderColor"] = <_cyb_intptr_t>__cuTexRefSetBorderColor + data["__cuTexRefSetBorderColor"] = <intptr_t>__cuTexRefSetBorderColor global __cuTexRefSetFlags - data["__cuTexRefSetFlags"] = <_cyb_intptr_t>__cuTexRefSetFlags + data["__cuTexRefSetFlags"] = <intptr_t>__cuTexRefSetFlags global __cuTexRefGetAddress_v2 - data["__cuTexRefGetAddress_v2"] = <_cyb_intptr_t>__cuTexRefGetAddress_v2 + data["__cuTexRefGetAddress_v2"] = <intptr_t>__cuTexRefGetAddress_v2 global __cuTexRefGetArray - data["__cuTexRefGetArray"] = <_cyb_intptr_t>__cuTexRefGetArray + data["__cuTexRefGetArray"] = <intptr_t>__cuTexRefGetArray global __cuTexRefGetMipmappedArray - data["__cuTexRefGetMipmappedArray"] = <_cyb_intptr_t>__cuTexRefGetMipmappedArray + data["__cuTexRefGetMipmappedArray"] = <intptr_t>__cuTexRefGetMipmappedArray global __cuTexRefGetAddressMode - data["__cuTexRefGetAddressMode"] = <_cyb_intptr_t>__cuTexRefGetAddressMode + data["__cuTexRefGetAddressMode"] = <intptr_t>__cuTexRefGetAddressMode global __cuTexRefGetFilterMode - data["__cuTexRefGetFilterMode"] = <_cyb_intptr_t>__cuTexRefGetFilterMode + data["__cuTexRefGetFilterMode"] = <intptr_t>__cuTexRefGetFilterMode global __cuTexRefGetFormat - data["__cuTexRefGetFormat"] = <_cyb_intptr_t>__cuTexRefGetFormat + data["__cuTexRefGetFormat"] = <intptr_t>__cuTexRefGetFormat global __cuTexRefGetMipmapFilterMode - data["__cuTexRefGetMipmapFilterMode"] = <_cyb_intptr_t>__cuTexRefGetMipmapFilterMode + data["__cuTexRefGetMipmapFilterMode"] = <intptr_t>__cuTexRefGetMipmapFilterMode global __cuTexRefGetMipmapLevelBias - data["__cuTexRefGetMipmapLevelBias"] = <_cyb_intptr_t>__cuTexRefGetMipmapLevelBias + data["__cuTexRefGetMipmapLevelBias"] = <intptr_t>__cuTexRefGetMipmapLevelBias global __cuTexRefGetMipmapLevelClamp - data["__cuTexRefGetMipmapLevelClamp"] = <_cyb_intptr_t>__cuTexRefGetMipmapLevelClamp + data["__cuTexRefGetMipmapLevelClamp"] = <intptr_t>__cuTexRefGetMipmapLevelClamp global __cuTexRefGetMaxAnisotropy - data["__cuTexRefGetMaxAnisotropy"] = <_cyb_intptr_t>__cuTexRefGetMaxAnisotropy + data["__cuTexRefGetMaxAnisotropy"] = <intptr_t>__cuTexRefGetMaxAnisotropy global __cuTexRefGetBorderColor - data["__cuTexRefGetBorderColor"] = <_cyb_intptr_t>__cuTexRefGetBorderColor + data["__cuTexRefGetBorderColor"] = <intptr_t>__cuTexRefGetBorderColor global __cuTexRefGetFlags - data["__cuTexRefGetFlags"] = <_cyb_intptr_t>__cuTexRefGetFlags + data["__cuTexRefGetFlags"] = <intptr_t>__cuTexRefGetFlags global __cuTexRefCreate - data["__cuTexRefCreate"] = <_cyb_intptr_t>__cuTexRefCreate + data["__cuTexRefCreate"] = <intptr_t>__cuTexRefCreate global __cuTexRefDestroy - data["__cuTexRefDestroy"] = <_cyb_intptr_t>__cuTexRefDestroy + data["__cuTexRefDestroy"] = <intptr_t>__cuTexRefDestroy global __cuSurfRefSetArray - data["__cuSurfRefSetArray"] = <_cyb_intptr_t>__cuSurfRefSetArray + data["__cuSurfRefSetArray"] = <intptr_t>__cuSurfRefSetArray global __cuSurfRefGetArray - data["__cuSurfRefGetArray"] = <_cyb_intptr_t>__cuSurfRefGetArray + data["__cuSurfRefGetArray"] = <intptr_t>__cuSurfRefGetArray global __cuTexObjectCreate - data["__cuTexObjectCreate"] = <_cyb_intptr_t>__cuTexObjectCreate + data["__cuTexObjectCreate"] = <intptr_t>__cuTexObjectCreate global __cuTexObjectDestroy - data["__cuTexObjectDestroy"] = <_cyb_intptr_t>__cuTexObjectDestroy + data["__cuTexObjectDestroy"] = <intptr_t>__cuTexObjectDestroy global __cuTexObjectGetResourceDesc - data["__cuTexObjectGetResourceDesc"] = <_cyb_intptr_t>__cuTexObjectGetResourceDesc + data["__cuTexObjectGetResourceDesc"] = <intptr_t>__cuTexObjectGetResourceDesc global __cuTexObjectGetTextureDesc - data["__cuTexObjectGetTextureDesc"] = <_cyb_intptr_t>__cuTexObjectGetTextureDesc + data["__cuTexObjectGetTextureDesc"] = <intptr_t>__cuTexObjectGetTextureDesc global __cuTexObjectGetResourceViewDesc - data["__cuTexObjectGetResourceViewDesc"] = <_cyb_intptr_t>__cuTexObjectGetResourceViewDesc + data["__cuTexObjectGetResourceViewDesc"] = <intptr_t>__cuTexObjectGetResourceViewDesc global __cuSurfObjectCreate - data["__cuSurfObjectCreate"] = <_cyb_intptr_t>__cuSurfObjectCreate + data["__cuSurfObjectCreate"] = <intptr_t>__cuSurfObjectCreate global __cuSurfObjectDestroy - data["__cuSurfObjectDestroy"] = <_cyb_intptr_t>__cuSurfObjectDestroy + data["__cuSurfObjectDestroy"] = <intptr_t>__cuSurfObjectDestroy global __cuSurfObjectGetResourceDesc - data["__cuSurfObjectGetResourceDesc"] = <_cyb_intptr_t>__cuSurfObjectGetResourceDesc + data["__cuSurfObjectGetResourceDesc"] = <intptr_t>__cuSurfObjectGetResourceDesc global __cuTensorMapEncodeTiled - data["__cuTensorMapEncodeTiled"] = <_cyb_intptr_t>__cuTensorMapEncodeTiled + data["__cuTensorMapEncodeTiled"] = <intptr_t>__cuTensorMapEncodeTiled global __cuTensorMapEncodeIm2col - data["__cuTensorMapEncodeIm2col"] = <_cyb_intptr_t>__cuTensorMapEncodeIm2col + data["__cuTensorMapEncodeIm2col"] = <intptr_t>__cuTensorMapEncodeIm2col global __cuTensorMapEncodeIm2colWide - data["__cuTensorMapEncodeIm2colWide"] = <_cyb_intptr_t>__cuTensorMapEncodeIm2colWide + data["__cuTensorMapEncodeIm2colWide"] = <intptr_t>__cuTensorMapEncodeIm2colWide global __cuTensorMapReplaceAddress - data["__cuTensorMapReplaceAddress"] = <_cyb_intptr_t>__cuTensorMapReplaceAddress + data["__cuTensorMapReplaceAddress"] = <intptr_t>__cuTensorMapReplaceAddress global __cuDeviceCanAccessPeer - data["__cuDeviceCanAccessPeer"] = <_cyb_intptr_t>__cuDeviceCanAccessPeer + data["__cuDeviceCanAccessPeer"] = <intptr_t>__cuDeviceCanAccessPeer global __cuCtxEnablePeerAccess - data["__cuCtxEnablePeerAccess"] = <_cyb_intptr_t>__cuCtxEnablePeerAccess + data["__cuCtxEnablePeerAccess"] = <intptr_t>__cuCtxEnablePeerAccess global __cuCtxDisablePeerAccess - data["__cuCtxDisablePeerAccess"] = <_cyb_intptr_t>__cuCtxDisablePeerAccess + data["__cuCtxDisablePeerAccess"] = <intptr_t>__cuCtxDisablePeerAccess global __cuDeviceGetP2PAttribute - data["__cuDeviceGetP2PAttribute"] = <_cyb_intptr_t>__cuDeviceGetP2PAttribute + data["__cuDeviceGetP2PAttribute"] = <intptr_t>__cuDeviceGetP2PAttribute global __cuGraphicsUnregisterResource - data["__cuGraphicsUnregisterResource"] = <_cyb_intptr_t>__cuGraphicsUnregisterResource + data["__cuGraphicsUnregisterResource"] = <intptr_t>__cuGraphicsUnregisterResource global __cuGraphicsSubResourceGetMappedArray - data["__cuGraphicsSubResourceGetMappedArray"] = <_cyb_intptr_t>__cuGraphicsSubResourceGetMappedArray + data["__cuGraphicsSubResourceGetMappedArray"] = <intptr_t>__cuGraphicsSubResourceGetMappedArray global __cuGraphicsResourceGetMappedMipmappedArray - data["__cuGraphicsResourceGetMappedMipmappedArray"] = <_cyb_intptr_t>__cuGraphicsResourceGetMappedMipmappedArray + data["__cuGraphicsResourceGetMappedMipmappedArray"] = <intptr_t>__cuGraphicsResourceGetMappedMipmappedArray global __cuGraphicsResourceGetMappedPointer_v2 - data["__cuGraphicsResourceGetMappedPointer_v2"] = <_cyb_intptr_t>__cuGraphicsResourceGetMappedPointer_v2 + data["__cuGraphicsResourceGetMappedPointer_v2"] = <intptr_t>__cuGraphicsResourceGetMappedPointer_v2 global __cuGraphicsResourceSetMapFlags_v2 - data["__cuGraphicsResourceSetMapFlags_v2"] = <_cyb_intptr_t>__cuGraphicsResourceSetMapFlags_v2 + data["__cuGraphicsResourceSetMapFlags_v2"] = <intptr_t>__cuGraphicsResourceSetMapFlags_v2 global __cuGraphicsMapResources - data["__cuGraphicsMapResources"] = <_cyb_intptr_t>__cuGraphicsMapResources + data["__cuGraphicsMapResources"] = <intptr_t>__cuGraphicsMapResources global __cuGraphicsUnmapResources - data["__cuGraphicsUnmapResources"] = <_cyb_intptr_t>__cuGraphicsUnmapResources + data["__cuGraphicsUnmapResources"] = <intptr_t>__cuGraphicsUnmapResources global __cuGetProcAddress_v2 - data["__cuGetProcAddress_v2"] = <_cyb_intptr_t>__cuGetProcAddress_v2 + data["__cuGetProcAddress_v2"] = <intptr_t>__cuGetProcAddress_v2 global __cuCoredumpGetAttribute - data["__cuCoredumpGetAttribute"] = <_cyb_intptr_t>__cuCoredumpGetAttribute + data["__cuCoredumpGetAttribute"] = <intptr_t>__cuCoredumpGetAttribute global __cuCoredumpGetAttributeGlobal - data["__cuCoredumpGetAttributeGlobal"] = <_cyb_intptr_t>__cuCoredumpGetAttributeGlobal + data["__cuCoredumpGetAttributeGlobal"] = <intptr_t>__cuCoredumpGetAttributeGlobal global __cuCoredumpSetAttribute - data["__cuCoredumpSetAttribute"] = <_cyb_intptr_t>__cuCoredumpSetAttribute + data["__cuCoredumpSetAttribute"] = <intptr_t>__cuCoredumpSetAttribute global __cuCoredumpSetAttributeGlobal - data["__cuCoredumpSetAttributeGlobal"] = <_cyb_intptr_t>__cuCoredumpSetAttributeGlobal + data["__cuCoredumpSetAttributeGlobal"] = <intptr_t>__cuCoredumpSetAttributeGlobal global __cuGetExportTable - data["__cuGetExportTable"] = <_cyb_intptr_t>__cuGetExportTable + data["__cuGetExportTable"] = <intptr_t>__cuGetExportTable global __cuGreenCtxCreate - data["__cuGreenCtxCreate"] = <_cyb_intptr_t>__cuGreenCtxCreate + data["__cuGreenCtxCreate"] = <intptr_t>__cuGreenCtxCreate global __cuGreenCtxDestroy - data["__cuGreenCtxDestroy"] = <_cyb_intptr_t>__cuGreenCtxDestroy + data["__cuGreenCtxDestroy"] = <intptr_t>__cuGreenCtxDestroy global __cuCtxFromGreenCtx - data["__cuCtxFromGreenCtx"] = <_cyb_intptr_t>__cuCtxFromGreenCtx + data["__cuCtxFromGreenCtx"] = <intptr_t>__cuCtxFromGreenCtx global __cuDeviceGetDevResource - data["__cuDeviceGetDevResource"] = <_cyb_intptr_t>__cuDeviceGetDevResource + data["__cuDeviceGetDevResource"] = <intptr_t>__cuDeviceGetDevResource global __cuCtxGetDevResource - data["__cuCtxGetDevResource"] = <_cyb_intptr_t>__cuCtxGetDevResource + data["__cuCtxGetDevResource"] = <intptr_t>__cuCtxGetDevResource global __cuGreenCtxGetDevResource - data["__cuGreenCtxGetDevResource"] = <_cyb_intptr_t>__cuGreenCtxGetDevResource + data["__cuGreenCtxGetDevResource"] = <intptr_t>__cuGreenCtxGetDevResource global __cuDevSmResourceSplitByCount - data["__cuDevSmResourceSplitByCount"] = <_cyb_intptr_t>__cuDevSmResourceSplitByCount + data["__cuDevSmResourceSplitByCount"] = <intptr_t>__cuDevSmResourceSplitByCount global __cuDevResourceGenerateDesc - data["__cuDevResourceGenerateDesc"] = <_cyb_intptr_t>__cuDevResourceGenerateDesc + data["__cuDevResourceGenerateDesc"] = <intptr_t>__cuDevResourceGenerateDesc global __cuGreenCtxRecordEvent - data["__cuGreenCtxRecordEvent"] = <_cyb_intptr_t>__cuGreenCtxRecordEvent + data["__cuGreenCtxRecordEvent"] = <intptr_t>__cuGreenCtxRecordEvent global __cuGreenCtxWaitEvent - data["__cuGreenCtxWaitEvent"] = <_cyb_intptr_t>__cuGreenCtxWaitEvent + data["__cuGreenCtxWaitEvent"] = <intptr_t>__cuGreenCtxWaitEvent global __cuStreamGetGreenCtx - data["__cuStreamGetGreenCtx"] = <_cyb_intptr_t>__cuStreamGetGreenCtx + data["__cuStreamGetGreenCtx"] = <intptr_t>__cuStreamGetGreenCtx global __cuGreenCtxStreamCreate - data["__cuGreenCtxStreamCreate"] = <_cyb_intptr_t>__cuGreenCtxStreamCreate + data["__cuGreenCtxStreamCreate"] = <intptr_t>__cuGreenCtxStreamCreate global __cuLogsRegisterCallback - data["__cuLogsRegisterCallback"] = <_cyb_intptr_t>__cuLogsRegisterCallback + data["__cuLogsRegisterCallback"] = <intptr_t>__cuLogsRegisterCallback global __cuLogsUnregisterCallback - data["__cuLogsUnregisterCallback"] = <_cyb_intptr_t>__cuLogsUnregisterCallback + data["__cuLogsUnregisterCallback"] = <intptr_t>__cuLogsUnregisterCallback global __cuLogsCurrent - data["__cuLogsCurrent"] = <_cyb_intptr_t>__cuLogsCurrent + data["__cuLogsCurrent"] = <intptr_t>__cuLogsCurrent global __cuLogsDumpToFile - data["__cuLogsDumpToFile"] = <_cyb_intptr_t>__cuLogsDumpToFile + data["__cuLogsDumpToFile"] = <intptr_t>__cuLogsDumpToFile global __cuLogsDumpToMemory - data["__cuLogsDumpToMemory"] = <_cyb_intptr_t>__cuLogsDumpToMemory + data["__cuLogsDumpToMemory"] = <intptr_t>__cuLogsDumpToMemory global __cuCheckpointProcessGetRestoreThreadId - data["__cuCheckpointProcessGetRestoreThreadId"] = <_cyb_intptr_t>__cuCheckpointProcessGetRestoreThreadId + data["__cuCheckpointProcessGetRestoreThreadId"] = <intptr_t>__cuCheckpointProcessGetRestoreThreadId global __cuCheckpointProcessGetState - data["__cuCheckpointProcessGetState"] = <_cyb_intptr_t>__cuCheckpointProcessGetState + data["__cuCheckpointProcessGetState"] = <intptr_t>__cuCheckpointProcessGetState global __cuCheckpointProcessLock - data["__cuCheckpointProcessLock"] = <_cyb_intptr_t>__cuCheckpointProcessLock + data["__cuCheckpointProcessLock"] = <intptr_t>__cuCheckpointProcessLock global __cuCheckpointProcessCheckpoint - data["__cuCheckpointProcessCheckpoint"] = <_cyb_intptr_t>__cuCheckpointProcessCheckpoint + data["__cuCheckpointProcessCheckpoint"] = <intptr_t>__cuCheckpointProcessCheckpoint global __cuCheckpointProcessRestore - data["__cuCheckpointProcessRestore"] = <_cyb_intptr_t>__cuCheckpointProcessRestore + data["__cuCheckpointProcessRestore"] = <intptr_t>__cuCheckpointProcessRestore global __cuCheckpointProcessUnlock - data["__cuCheckpointProcessUnlock"] = <_cyb_intptr_t>__cuCheckpointProcessUnlock + data["__cuCheckpointProcessUnlock"] = <intptr_t>__cuCheckpointProcessUnlock global __cuGraphicsEGLRegisterImage - data["__cuGraphicsEGLRegisterImage"] = <_cyb_intptr_t>__cuGraphicsEGLRegisterImage + data["__cuGraphicsEGLRegisterImage"] = <intptr_t>__cuGraphicsEGLRegisterImage global __cuEGLStreamConsumerConnect - data["__cuEGLStreamConsumerConnect"] = <_cyb_intptr_t>__cuEGLStreamConsumerConnect + data["__cuEGLStreamConsumerConnect"] = <intptr_t>__cuEGLStreamConsumerConnect global __cuEGLStreamConsumerConnectWithFlags - data["__cuEGLStreamConsumerConnectWithFlags"] = <_cyb_intptr_t>__cuEGLStreamConsumerConnectWithFlags + data["__cuEGLStreamConsumerConnectWithFlags"] = <intptr_t>__cuEGLStreamConsumerConnectWithFlags global __cuEGLStreamConsumerDisconnect - data["__cuEGLStreamConsumerDisconnect"] = <_cyb_intptr_t>__cuEGLStreamConsumerDisconnect + data["__cuEGLStreamConsumerDisconnect"] = <intptr_t>__cuEGLStreamConsumerDisconnect global __cuEGLStreamConsumerAcquireFrame - data["__cuEGLStreamConsumerAcquireFrame"] = <_cyb_intptr_t>__cuEGLStreamConsumerAcquireFrame + data["__cuEGLStreamConsumerAcquireFrame"] = <intptr_t>__cuEGLStreamConsumerAcquireFrame global __cuEGLStreamConsumerReleaseFrame - data["__cuEGLStreamConsumerReleaseFrame"] = <_cyb_intptr_t>__cuEGLStreamConsumerReleaseFrame + data["__cuEGLStreamConsumerReleaseFrame"] = <intptr_t>__cuEGLStreamConsumerReleaseFrame global __cuEGLStreamProducerConnect - data["__cuEGLStreamProducerConnect"] = <_cyb_intptr_t>__cuEGLStreamProducerConnect + data["__cuEGLStreamProducerConnect"] = <intptr_t>__cuEGLStreamProducerConnect global __cuEGLStreamProducerDisconnect - data["__cuEGLStreamProducerDisconnect"] = <_cyb_intptr_t>__cuEGLStreamProducerDisconnect + data["__cuEGLStreamProducerDisconnect"] = <intptr_t>__cuEGLStreamProducerDisconnect global __cuEGLStreamProducerPresentFrame - data["__cuEGLStreamProducerPresentFrame"] = <_cyb_intptr_t>__cuEGLStreamProducerPresentFrame + data["__cuEGLStreamProducerPresentFrame"] = <intptr_t>__cuEGLStreamProducerPresentFrame global __cuEGLStreamProducerReturnFrame - data["__cuEGLStreamProducerReturnFrame"] = <_cyb_intptr_t>__cuEGLStreamProducerReturnFrame + data["__cuEGLStreamProducerReturnFrame"] = <intptr_t>__cuEGLStreamProducerReturnFrame global __cuGraphicsResourceGetMappedEglFrame - data["__cuGraphicsResourceGetMappedEglFrame"] = <_cyb_intptr_t>__cuGraphicsResourceGetMappedEglFrame + data["__cuGraphicsResourceGetMappedEglFrame"] = <intptr_t>__cuGraphicsResourceGetMappedEglFrame global __cuEventCreateFromEGLSync - data["__cuEventCreateFromEGLSync"] = <_cyb_intptr_t>__cuEventCreateFromEGLSync + data["__cuEventCreateFromEGLSync"] = <intptr_t>__cuEventCreateFromEGLSync global __cuGraphicsGLRegisterBuffer - data["__cuGraphicsGLRegisterBuffer"] = <_cyb_intptr_t>__cuGraphicsGLRegisterBuffer + data["__cuGraphicsGLRegisterBuffer"] = <intptr_t>__cuGraphicsGLRegisterBuffer global __cuGraphicsGLRegisterImage - data["__cuGraphicsGLRegisterImage"] = <_cyb_intptr_t>__cuGraphicsGLRegisterImage + data["__cuGraphicsGLRegisterImage"] = <intptr_t>__cuGraphicsGLRegisterImage global __cuGLGetDevices_v2 - data["__cuGLGetDevices_v2"] = <_cyb_intptr_t>__cuGLGetDevices_v2 + data["__cuGLGetDevices_v2"] = <intptr_t>__cuGLGetDevices_v2 global __cuGLCtxCreate_v2 - data["__cuGLCtxCreate_v2"] = <_cyb_intptr_t>__cuGLCtxCreate_v2 + data["__cuGLCtxCreate_v2"] = <intptr_t>__cuGLCtxCreate_v2 global __cuGLInit - data["__cuGLInit"] = <_cyb_intptr_t>__cuGLInit + data["__cuGLInit"] = <intptr_t>__cuGLInit global __cuGLRegisterBufferObject - data["__cuGLRegisterBufferObject"] = <_cyb_intptr_t>__cuGLRegisterBufferObject + data["__cuGLRegisterBufferObject"] = <intptr_t>__cuGLRegisterBufferObject global __cuGLMapBufferObject_v2 - data["__cuGLMapBufferObject_v2"] = <_cyb_intptr_t>__cuGLMapBufferObject_v2 + data["__cuGLMapBufferObject_v2"] = <intptr_t>__cuGLMapBufferObject_v2 global __cuGLUnmapBufferObject - data["__cuGLUnmapBufferObject"] = <_cyb_intptr_t>__cuGLUnmapBufferObject + data["__cuGLUnmapBufferObject"] = <intptr_t>__cuGLUnmapBufferObject global __cuGLUnregisterBufferObject - data["__cuGLUnregisterBufferObject"] = <_cyb_intptr_t>__cuGLUnregisterBufferObject + data["__cuGLUnregisterBufferObject"] = <intptr_t>__cuGLUnregisterBufferObject global __cuGLSetBufferObjectMapFlags - data["__cuGLSetBufferObjectMapFlags"] = <_cyb_intptr_t>__cuGLSetBufferObjectMapFlags + data["__cuGLSetBufferObjectMapFlags"] = <intptr_t>__cuGLSetBufferObjectMapFlags global __cuGLMapBufferObjectAsync_v2 - data["__cuGLMapBufferObjectAsync_v2"] = <_cyb_intptr_t>__cuGLMapBufferObjectAsync_v2 + data["__cuGLMapBufferObjectAsync_v2"] = <intptr_t>__cuGLMapBufferObjectAsync_v2 global __cuGLUnmapBufferObjectAsync - data["__cuGLUnmapBufferObjectAsync"] = <_cyb_intptr_t>__cuGLUnmapBufferObjectAsync + data["__cuGLUnmapBufferObjectAsync"] = <intptr_t>__cuGLUnmapBufferObjectAsync global __cuProfilerInitialize - data["__cuProfilerInitialize"] = <_cyb_intptr_t>__cuProfilerInitialize + data["__cuProfilerInitialize"] = <intptr_t>__cuProfilerInitialize global __cuProfilerStart - data["__cuProfilerStart"] = <_cyb_intptr_t>__cuProfilerStart + data["__cuProfilerStart"] = <intptr_t>__cuProfilerStart global __cuProfilerStop - data["__cuProfilerStop"] = <_cyb_intptr_t>__cuProfilerStop + data["__cuProfilerStop"] = <intptr_t>__cuProfilerStop global __cuVDPAUGetDevice - data["__cuVDPAUGetDevice"] = <_cyb_intptr_t>__cuVDPAUGetDevice + data["__cuVDPAUGetDevice"] = <intptr_t>__cuVDPAUGetDevice global __cuVDPAUCtxCreate_v2 - data["__cuVDPAUCtxCreate_v2"] = <_cyb_intptr_t>__cuVDPAUCtxCreate_v2 + data["__cuVDPAUCtxCreate_v2"] = <intptr_t>__cuVDPAUCtxCreate_v2 global __cuGraphicsVDPAURegisterVideoSurface - data["__cuGraphicsVDPAURegisterVideoSurface"] = <_cyb_intptr_t>__cuGraphicsVDPAURegisterVideoSurface + data["__cuGraphicsVDPAURegisterVideoSurface"] = <intptr_t>__cuGraphicsVDPAURegisterVideoSurface global __cuGraphicsVDPAURegisterOutputSurface - data["__cuGraphicsVDPAURegisterOutputSurface"] = <_cyb_intptr_t>__cuGraphicsVDPAURegisterOutputSurface + data["__cuGraphicsVDPAURegisterOutputSurface"] = <intptr_t>__cuGraphicsVDPAURegisterOutputSurface global __cuDeviceGetHostAtomicCapabilities - data["__cuDeviceGetHostAtomicCapabilities"] = <_cyb_intptr_t>__cuDeviceGetHostAtomicCapabilities + data["__cuDeviceGetHostAtomicCapabilities"] = <intptr_t>__cuDeviceGetHostAtomicCapabilities global __cuCtxGetDevice_v2 - data["__cuCtxGetDevice_v2"] = <_cyb_intptr_t>__cuCtxGetDevice_v2 + data["__cuCtxGetDevice_v2"] = <intptr_t>__cuCtxGetDevice_v2 global __cuCtxSynchronize_v2 - data["__cuCtxSynchronize_v2"] = <_cyb_intptr_t>__cuCtxSynchronize_v2 + data["__cuCtxSynchronize_v2"] = <intptr_t>__cuCtxSynchronize_v2 global __cuMemcpyBatchAsync_v2 - data["__cuMemcpyBatchAsync_v2"] = <_cyb_intptr_t>__cuMemcpyBatchAsync_v2 + data["__cuMemcpyBatchAsync_v2"] = <intptr_t>__cuMemcpyBatchAsync_v2 global __cuMemcpy3DBatchAsync_v2 - data["__cuMemcpy3DBatchAsync_v2"] = <_cyb_intptr_t>__cuMemcpy3DBatchAsync_v2 + data["__cuMemcpy3DBatchAsync_v2"] = <intptr_t>__cuMemcpy3DBatchAsync_v2 global __cuMemGetDefaultMemPool - data["__cuMemGetDefaultMemPool"] = <_cyb_intptr_t>__cuMemGetDefaultMemPool + data["__cuMemGetDefaultMemPool"] = <intptr_t>__cuMemGetDefaultMemPool global __cuMemGetMemPool - data["__cuMemGetMemPool"] = <_cyb_intptr_t>__cuMemGetMemPool + data["__cuMemGetMemPool"] = <intptr_t>__cuMemGetMemPool global __cuMemSetMemPool - data["__cuMemSetMemPool"] = <_cyb_intptr_t>__cuMemSetMemPool + data["__cuMemSetMemPool"] = <intptr_t>__cuMemSetMemPool global __cuMemPrefetchBatchAsync - data["__cuMemPrefetchBatchAsync"] = <_cyb_intptr_t>__cuMemPrefetchBatchAsync + data["__cuMemPrefetchBatchAsync"] = <intptr_t>__cuMemPrefetchBatchAsync global __cuMemDiscardBatchAsync - data["__cuMemDiscardBatchAsync"] = <_cyb_intptr_t>__cuMemDiscardBatchAsync + data["__cuMemDiscardBatchAsync"] = <intptr_t>__cuMemDiscardBatchAsync global __cuMemDiscardAndPrefetchBatchAsync - data["__cuMemDiscardAndPrefetchBatchAsync"] = <_cyb_intptr_t>__cuMemDiscardAndPrefetchBatchAsync + data["__cuMemDiscardAndPrefetchBatchAsync"] = <intptr_t>__cuMemDiscardAndPrefetchBatchAsync global __cuDeviceGetP2PAtomicCapabilities - data["__cuDeviceGetP2PAtomicCapabilities"] = <_cyb_intptr_t>__cuDeviceGetP2PAtomicCapabilities + data["__cuDeviceGetP2PAtomicCapabilities"] = <intptr_t>__cuDeviceGetP2PAtomicCapabilities global __cuGreenCtxGetId - data["__cuGreenCtxGetId"] = <_cyb_intptr_t>__cuGreenCtxGetId + data["__cuGreenCtxGetId"] = <intptr_t>__cuGreenCtxGetId global __cuMulticastBindMem_v2 - data["__cuMulticastBindMem_v2"] = <_cyb_intptr_t>__cuMulticastBindMem_v2 + data["__cuMulticastBindMem_v2"] = <intptr_t>__cuMulticastBindMem_v2 global __cuMulticastBindAddr_v2 - data["__cuMulticastBindAddr_v2"] = <_cyb_intptr_t>__cuMulticastBindAddr_v2 + data["__cuMulticastBindAddr_v2"] = <intptr_t>__cuMulticastBindAddr_v2 global __cuGraphNodeGetContainingGraph - data["__cuGraphNodeGetContainingGraph"] = <_cyb_intptr_t>__cuGraphNodeGetContainingGraph + data["__cuGraphNodeGetContainingGraph"] = <intptr_t>__cuGraphNodeGetContainingGraph global __cuGraphNodeGetLocalId - data["__cuGraphNodeGetLocalId"] = <_cyb_intptr_t>__cuGraphNodeGetLocalId + data["__cuGraphNodeGetLocalId"] = <intptr_t>__cuGraphNodeGetLocalId global __cuGraphNodeGetToolsId - data["__cuGraphNodeGetToolsId"] = <_cyb_intptr_t>__cuGraphNodeGetToolsId + data["__cuGraphNodeGetToolsId"] = <intptr_t>__cuGraphNodeGetToolsId global __cuGraphGetId - data["__cuGraphGetId"] = <_cyb_intptr_t>__cuGraphGetId + data["__cuGraphGetId"] = <intptr_t>__cuGraphGetId global __cuGraphExecGetId - data["__cuGraphExecGetId"] = <_cyb_intptr_t>__cuGraphExecGetId + data["__cuGraphExecGetId"] = <intptr_t>__cuGraphExecGetId global __cuDevSmResourceSplit - data["__cuDevSmResourceSplit"] = <_cyb_intptr_t>__cuDevSmResourceSplit + data["__cuDevSmResourceSplit"] = <intptr_t>__cuDevSmResourceSplit global __cuStreamGetDevResource - data["__cuStreamGetDevResource"] = <_cyb_intptr_t>__cuStreamGetDevResource + data["__cuStreamGetDevResource"] = <intptr_t>__cuStreamGetDevResource global __cuKernelGetParamCount - data["__cuKernelGetParamCount"] = <_cyb_intptr_t>__cuKernelGetParamCount + data["__cuKernelGetParamCount"] = <intptr_t>__cuKernelGetParamCount global __cuMemcpyWithAttributesAsync - data["__cuMemcpyWithAttributesAsync"] = <_cyb_intptr_t>__cuMemcpyWithAttributesAsync + data["__cuMemcpyWithAttributesAsync"] = <intptr_t>__cuMemcpyWithAttributesAsync global __cuMemcpy3DWithAttributesAsync - data["__cuMemcpy3DWithAttributesAsync"] = <_cyb_intptr_t>__cuMemcpy3DWithAttributesAsync + data["__cuMemcpy3DWithAttributesAsync"] = <intptr_t>__cuMemcpy3DWithAttributesAsync global __cuStreamBeginCaptureToCig - data["__cuStreamBeginCaptureToCig"] = <_cyb_intptr_t>__cuStreamBeginCaptureToCig + data["__cuStreamBeginCaptureToCig"] = <intptr_t>__cuStreamBeginCaptureToCig global __cuStreamEndCaptureToCig - data["__cuStreamEndCaptureToCig"] = <_cyb_intptr_t>__cuStreamEndCaptureToCig + data["__cuStreamEndCaptureToCig"] = <intptr_t>__cuStreamEndCaptureToCig global __cuFuncGetParamCount - data["__cuFuncGetParamCount"] = <_cyb_intptr_t>__cuFuncGetParamCount + data["__cuFuncGetParamCount"] = <intptr_t>__cuFuncGetParamCount global __cuLaunchHostFunc_v2 - data["__cuLaunchHostFunc_v2"] = <_cyb_intptr_t>__cuLaunchHostFunc_v2 + data["__cuLaunchHostFunc_v2"] = <intptr_t>__cuLaunchHostFunc_v2 global __cuGraphNodeGetParams - data["__cuGraphNodeGetParams"] = <_cyb_intptr_t>__cuGraphNodeGetParams + data["__cuGraphNodeGetParams"] = <intptr_t>__cuGraphNodeGetParams global __cuCoredumpRegisterStartCallback - data["__cuCoredumpRegisterStartCallback"] = <_cyb_intptr_t>__cuCoredumpRegisterStartCallback + data["__cuCoredumpRegisterStartCallback"] = <intptr_t>__cuCoredumpRegisterStartCallback global __cuCoredumpRegisterCompleteCallback - data["__cuCoredumpRegisterCompleteCallback"] = <_cyb_intptr_t>__cuCoredumpRegisterCompleteCallback + data["__cuCoredumpRegisterCompleteCallback"] = <intptr_t>__cuCoredumpRegisterCompleteCallback global __cuCoredumpDeregisterStartCallback - data["__cuCoredumpDeregisterStartCallback"] = <_cyb_intptr_t>__cuCoredumpDeregisterStartCallback + data["__cuCoredumpDeregisterStartCallback"] = <intptr_t>__cuCoredumpDeregisterStartCallback global __cuCoredumpDeregisterCompleteCallback - data["__cuCoredumpDeregisterCompleteCallback"] = <_cyb_intptr_t>__cuCoredumpDeregisterCompleteCallback + data["__cuCoredumpDeregisterCompleteCallback"] = <intptr_t>__cuCoredumpDeregisterCompleteCallback global __cuLogicalEndpointIdReserve - data["__cuLogicalEndpointIdReserve"] = <_cyb_intptr_t>__cuLogicalEndpointIdReserve + data["__cuLogicalEndpointIdReserve"] = <intptr_t>__cuLogicalEndpointIdReserve global __cuLogicalEndpointIdRelease - data["__cuLogicalEndpointIdRelease"] = <_cyb_intptr_t>__cuLogicalEndpointIdRelease + data["__cuLogicalEndpointIdRelease"] = <intptr_t>__cuLogicalEndpointIdRelease global __cuLogicalEndpointCreate - data["__cuLogicalEndpointCreate"] = <_cyb_intptr_t>__cuLogicalEndpointCreate + data["__cuLogicalEndpointCreate"] = <intptr_t>__cuLogicalEndpointCreate global __cuLogicalEndpointAddDevice - data["__cuLogicalEndpointAddDevice"] = <_cyb_intptr_t>__cuLogicalEndpointAddDevice + data["__cuLogicalEndpointAddDevice"] = <intptr_t>__cuLogicalEndpointAddDevice global __cuLogicalEndpointDestroy - data["__cuLogicalEndpointDestroy"] = <_cyb_intptr_t>__cuLogicalEndpointDestroy + data["__cuLogicalEndpointDestroy"] = <intptr_t>__cuLogicalEndpointDestroy global __cuLogicalEndpointBindAddr - data["__cuLogicalEndpointBindAddr"] = <_cyb_intptr_t>__cuLogicalEndpointBindAddr + data["__cuLogicalEndpointBindAddr"] = <intptr_t>__cuLogicalEndpointBindAddr global __cuLogicalEndpointBindMem - data["__cuLogicalEndpointBindMem"] = <_cyb_intptr_t>__cuLogicalEndpointBindMem + data["__cuLogicalEndpointBindMem"] = <intptr_t>__cuLogicalEndpointBindMem global __cuLogicalEndpointUnbind - data["__cuLogicalEndpointUnbind"] = <_cyb_intptr_t>__cuLogicalEndpointUnbind + data["__cuLogicalEndpointUnbind"] = <intptr_t>__cuLogicalEndpointUnbind global __cuLogicalEndpointExport - data["__cuLogicalEndpointExport"] = <_cyb_intptr_t>__cuLogicalEndpointExport + data["__cuLogicalEndpointExport"] = <intptr_t>__cuLogicalEndpointExport global __cuLogicalEndpointImport - data["__cuLogicalEndpointImport"] = <_cyb_intptr_t>__cuLogicalEndpointImport + data["__cuLogicalEndpointImport"] = <intptr_t>__cuLogicalEndpointImport global __cuLogicalEndpointGetLimits - data["__cuLogicalEndpointGetLimits"] = <_cyb_intptr_t>__cuLogicalEndpointGetLimits + data["__cuLogicalEndpointGetLimits"] = <intptr_t>__cuLogicalEndpointGetLimits global __cuLogicalEndpointQuery - data["__cuLogicalEndpointQuery"] = <_cyb_intptr_t>__cuLogicalEndpointQuery + data["__cuLogicalEndpointQuery"] = <intptr_t>__cuLogicalEndpointQuery global __cuStreamBeginRecaptureToGraph - data["__cuStreamBeginRecaptureToGraph"] = <_cyb_intptr_t>__cuStreamBeginRecaptureToGraph + data["__cuStreamBeginRecaptureToGraph"] = <intptr_t>__cuStreamBeginRecaptureToGraph global __cuDeviceGetFabricClusterUuid - data["__cuDeviceGetFabricClusterUuid"] = <_cyb_intptr_t>__cuDeviceGetFabricClusterUuid + data["__cuDeviceGetFabricClusterUuid"] = <intptr_t>__cuDeviceGetFabricClusterUuid global __cuDeviceGetCliqueCount - data["__cuDeviceGetCliqueCount"] = <_cyb_intptr_t>__cuDeviceGetCliqueCount + data["__cuDeviceGetCliqueCount"] = <intptr_t>__cuDeviceGetCliqueCount global __cuDeviceGetCliqueInfo - data["__cuDeviceGetCliqueInfo"] = <_cyb_intptr_t>__cuDeviceGetCliqueInfo + data["__cuDeviceGetCliqueInfo"] = <intptr_t>__cuDeviceGetCliqueInfo global __cuMemGetLocationInfo - data["__cuMemGetLocationInfo"] = <_cyb_intptr_t>__cuMemGetLocationInfo + data["__cuMemGetLocationInfo"] = <intptr_t>__cuMemGetLocationInfo global __cuGraphAddNode_v3 - data["__cuGraphAddNode_v3"] = <_cyb_intptr_t>__cuGraphAddNode_v3 + data["__cuGraphAddNode_v3"] = <intptr_t>__cuGraphAddNode_v3 global __cuGraphNodeSetParams_v2 - data["__cuGraphNodeSetParams_v2"] = <_cyb_intptr_t>__cuGraphNodeSetParams_v2 + data["__cuGraphNodeSetParams_v2"] = <intptr_t>__cuGraphNodeSetParams_v2 global __cuCheckpointOperationComplete - data["__cuCheckpointOperationComplete"] = <_cyb_intptr_t>__cuCheckpointOperationComplete + data["__cuCheckpointOperationComplete"] = <intptr_t>__cuCheckpointOperationComplete _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx index 09cefc0c8f9..75b3e0f0318 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.4.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5351e00f0cca82ccf833f27a4729a538b46110830393e49526539505d0fbe1e9 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fadf16eb0438f5de3a2f7630ac890066716952b8f0c9656148ee0b1928a9f167 # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,7 @@ cdef extern from "<dlfcn.h>": void* _cyb_dlsym "dlsym"(void*, const char*) nogil const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport intptr_t import threading as _cyb_threading @@ -186,40 +186,40 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvfatbin() cdef dict data = {} global __nvFatbinGetErrorString - data["__nvFatbinGetErrorString"] = <_cyb_intptr_t>__nvFatbinGetErrorString + data["__nvFatbinGetErrorString"] = <intptr_t>__nvFatbinGetErrorString global __nvFatbinCreate - data["__nvFatbinCreate"] = <_cyb_intptr_t>__nvFatbinCreate + data["__nvFatbinCreate"] = <intptr_t>__nvFatbinCreate global __nvFatbinDestroy - data["__nvFatbinDestroy"] = <_cyb_intptr_t>__nvFatbinDestroy + data["__nvFatbinDestroy"] = <intptr_t>__nvFatbinDestroy global __nvFatbinAddPTX - data["__nvFatbinAddPTX"] = <_cyb_intptr_t>__nvFatbinAddPTX + data["__nvFatbinAddPTX"] = <intptr_t>__nvFatbinAddPTX global __nvFatbinAddCubin - data["__nvFatbinAddCubin"] = <_cyb_intptr_t>__nvFatbinAddCubin + data["__nvFatbinAddCubin"] = <intptr_t>__nvFatbinAddCubin global __nvFatbinAddLTOIR - data["__nvFatbinAddLTOIR"] = <_cyb_intptr_t>__nvFatbinAddLTOIR + data["__nvFatbinAddLTOIR"] = <intptr_t>__nvFatbinAddLTOIR global __nvFatbinSize - data["__nvFatbinSize"] = <_cyb_intptr_t>__nvFatbinSize + data["__nvFatbinSize"] = <intptr_t>__nvFatbinSize global __nvFatbinGet - data["__nvFatbinGet"] = <_cyb_intptr_t>__nvFatbinGet + data["__nvFatbinGet"] = <intptr_t>__nvFatbinGet global __nvFatbinVersion - data["__nvFatbinVersion"] = <_cyb_intptr_t>__nvFatbinVersion + data["__nvFatbinVersion"] = <intptr_t>__nvFatbinVersion global __nvFatbinAddIndex - data["__nvFatbinAddIndex"] = <_cyb_intptr_t>__nvFatbinAddIndex + data["__nvFatbinAddIndex"] = <intptr_t>__nvFatbinAddIndex global __nvFatbinAddReloc - data["__nvFatbinAddReloc"] = <_cyb_intptr_t>__nvFatbinAddReloc + data["__nvFatbinAddReloc"] = <intptr_t>__nvFatbinAddReloc global __nvFatbinAddTileIR - data["__nvFatbinAddTileIR"] = <_cyb_intptr_t>__nvFatbinAddTileIR + data["__nvFatbinAddTileIR"] = <intptr_t>__nvFatbinAddTileIR _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx index e0abd202bbe..4992bf673bf 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.4.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=91a09cd316df7848a0f2c3fba5e516a6e94749e3259b0fbd6f57e9b9873fce55 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cc0423037f7d52a9e232562afbe97749dc86c0cdae28640a1c94bd250ad5ecfe # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,10 @@ cdef extern from "<windows.h>": ctypedef void* HMODULE void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport ( + intptr_t, + uintptr_t, +) import threading as _cyb_threading @@ -138,40 +141,40 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvfatbin() cdef dict data = {} global __nvFatbinGetErrorString - data["__nvFatbinGetErrorString"] = <_cyb_intptr_t>__nvFatbinGetErrorString + data["__nvFatbinGetErrorString"] = <intptr_t>__nvFatbinGetErrorString global __nvFatbinCreate - data["__nvFatbinCreate"] = <_cyb_intptr_t>__nvFatbinCreate + data["__nvFatbinCreate"] = <intptr_t>__nvFatbinCreate global __nvFatbinDestroy - data["__nvFatbinDestroy"] = <_cyb_intptr_t>__nvFatbinDestroy + data["__nvFatbinDestroy"] = <intptr_t>__nvFatbinDestroy global __nvFatbinAddPTX - data["__nvFatbinAddPTX"] = <_cyb_intptr_t>__nvFatbinAddPTX + data["__nvFatbinAddPTX"] = <intptr_t>__nvFatbinAddPTX global __nvFatbinAddCubin - data["__nvFatbinAddCubin"] = <_cyb_intptr_t>__nvFatbinAddCubin + data["__nvFatbinAddCubin"] = <intptr_t>__nvFatbinAddCubin global __nvFatbinAddLTOIR - data["__nvFatbinAddLTOIR"] = <_cyb_intptr_t>__nvFatbinAddLTOIR + data["__nvFatbinAddLTOIR"] = <intptr_t>__nvFatbinAddLTOIR global __nvFatbinSize - data["__nvFatbinSize"] = <_cyb_intptr_t>__nvFatbinSize + data["__nvFatbinSize"] = <intptr_t>__nvFatbinSize global __nvFatbinGet - data["__nvFatbinGet"] = <_cyb_intptr_t>__nvFatbinGet + data["__nvFatbinGet"] = <intptr_t>__nvFatbinGet global __nvFatbinVersion - data["__nvFatbinVersion"] = <_cyb_intptr_t>__nvFatbinVersion + data["__nvFatbinVersion"] = <intptr_t>__nvFatbinVersion global __nvFatbinAddIndex - data["__nvFatbinAddIndex"] = <_cyb_intptr_t>__nvFatbinAddIndex + data["__nvFatbinAddIndex"] = <intptr_t>__nvFatbinAddIndex global __nvFatbinAddReloc - data["__nvFatbinAddReloc"] = <_cyb_intptr_t>__nvFatbinAddReloc + data["__nvFatbinAddReloc"] = <intptr_t>__nvFatbinAddReloc global __nvFatbinAddTileIR - data["__nvFatbinAddTileIR"] = <_cyb_intptr_t>__nvFatbinAddTileIR + data["__nvFatbinAddTileIR"] = <intptr_t>__nvFatbinAddTileIR _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd index 21d527a3c16..961ff3d5a5f 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd @@ -3,9 +3,17 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=05522f152eb6cf5e4b8fc2c0bd25362366a36c9d3c976321ba0155ba330c6209 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3e1f6ec58cb4b29e88525e739f1d3db206da5c337a8ec26f06320e9674d2f979 + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport uint32_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + from ..cynvjitlink cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index 7458f5b88e8..67e48c340a8 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=539829faeb71eb1d20a60f5e4ad835826eee873b96694b6db8809b9b904bc7b8 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e158103a4665c0761ccda489c9850866bdb7729095e6c776a88a78b51c2111c4 # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,10 @@ cdef extern from "<dlfcn.h>": void* _cyb_dlsym "dlsym"(void*, const char*) nogil const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport ( + intptr_t, + uint32_t, +) import threading as _cyb_threading @@ -218,52 +221,52 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvjitlink() cdef dict data = {} global __nvJitLinkCreate - data["__nvJitLinkCreate"] = <_cyb_intptr_t>__nvJitLinkCreate + data["__nvJitLinkCreate"] = <intptr_t>__nvJitLinkCreate global __nvJitLinkDestroy - data["__nvJitLinkDestroy"] = <_cyb_intptr_t>__nvJitLinkDestroy + data["__nvJitLinkDestroy"] = <intptr_t>__nvJitLinkDestroy global __nvJitLinkAddData - data["__nvJitLinkAddData"] = <_cyb_intptr_t>__nvJitLinkAddData + data["__nvJitLinkAddData"] = <intptr_t>__nvJitLinkAddData global __nvJitLinkAddFile - data["__nvJitLinkAddFile"] = <_cyb_intptr_t>__nvJitLinkAddFile + data["__nvJitLinkAddFile"] = <intptr_t>__nvJitLinkAddFile global __nvJitLinkComplete - data["__nvJitLinkComplete"] = <_cyb_intptr_t>__nvJitLinkComplete + data["__nvJitLinkComplete"] = <intptr_t>__nvJitLinkComplete global __nvJitLinkGetLinkedCubinSize - data["__nvJitLinkGetLinkedCubinSize"] = <_cyb_intptr_t>__nvJitLinkGetLinkedCubinSize + data["__nvJitLinkGetLinkedCubinSize"] = <intptr_t>__nvJitLinkGetLinkedCubinSize global __nvJitLinkGetLinkedCubin - data["__nvJitLinkGetLinkedCubin"] = <_cyb_intptr_t>__nvJitLinkGetLinkedCubin + data["__nvJitLinkGetLinkedCubin"] = <intptr_t>__nvJitLinkGetLinkedCubin global __nvJitLinkGetLinkedPtxSize - data["__nvJitLinkGetLinkedPtxSize"] = <_cyb_intptr_t>__nvJitLinkGetLinkedPtxSize + data["__nvJitLinkGetLinkedPtxSize"] = <intptr_t>__nvJitLinkGetLinkedPtxSize global __nvJitLinkGetLinkedPtx - data["__nvJitLinkGetLinkedPtx"] = <_cyb_intptr_t>__nvJitLinkGetLinkedPtx + data["__nvJitLinkGetLinkedPtx"] = <intptr_t>__nvJitLinkGetLinkedPtx global __nvJitLinkGetErrorLogSize - data["__nvJitLinkGetErrorLogSize"] = <_cyb_intptr_t>__nvJitLinkGetErrorLogSize + data["__nvJitLinkGetErrorLogSize"] = <intptr_t>__nvJitLinkGetErrorLogSize global __nvJitLinkGetErrorLog - data["__nvJitLinkGetErrorLog"] = <_cyb_intptr_t>__nvJitLinkGetErrorLog + data["__nvJitLinkGetErrorLog"] = <intptr_t>__nvJitLinkGetErrorLog global __nvJitLinkGetInfoLogSize - data["__nvJitLinkGetInfoLogSize"] = <_cyb_intptr_t>__nvJitLinkGetInfoLogSize + data["__nvJitLinkGetInfoLogSize"] = <intptr_t>__nvJitLinkGetInfoLogSize global __nvJitLinkGetInfoLog - data["__nvJitLinkGetInfoLog"] = <_cyb_intptr_t>__nvJitLinkGetInfoLog + data["__nvJitLinkGetInfoLog"] = <intptr_t>__nvJitLinkGetInfoLog global __nvJitLinkVersion - data["__nvJitLinkVersion"] = <_cyb_intptr_t>__nvJitLinkVersion + data["__nvJitLinkVersion"] = <intptr_t>__nvJitLinkVersion global __nvJitLinkGetLinkedLTOIRSize - data["__nvJitLinkGetLinkedLTOIRSize"] = <_cyb_intptr_t>__nvJitLinkGetLinkedLTOIRSize + data["__nvJitLinkGetLinkedLTOIRSize"] = <intptr_t>__nvJitLinkGetLinkedLTOIRSize global __nvJitLinkGetLinkedLTOIR - data["__nvJitLinkGetLinkedLTOIR"] = <_cyb_intptr_t>__nvJitLinkGetLinkedLTOIR + data["__nvJitLinkGetLinkedLTOIR"] = <intptr_t>__nvJitLinkGetLinkedLTOIR _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 9e279570c8d..9f67f750f3d 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d90e50b8ffd6f1d66aa26e5a0d38b9e3a3c7a801114de8feabe626d622d50f81 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=aba925fa52cf3b835f062b3c99d60fe59165d177075696a46f0f7c4b42ead221 # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,11 @@ cdef extern from "<windows.h>": ctypedef void* HMODULE void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport ( + intptr_t, + uint32_t, + uintptr_t, +) import threading as _cyb_threading @@ -154,52 +158,52 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvjitlink() cdef dict data = {} global __nvJitLinkCreate - data["__nvJitLinkCreate"] = <_cyb_intptr_t>__nvJitLinkCreate + data["__nvJitLinkCreate"] = <intptr_t>__nvJitLinkCreate global __nvJitLinkDestroy - data["__nvJitLinkDestroy"] = <_cyb_intptr_t>__nvJitLinkDestroy + data["__nvJitLinkDestroy"] = <intptr_t>__nvJitLinkDestroy global __nvJitLinkAddData - data["__nvJitLinkAddData"] = <_cyb_intptr_t>__nvJitLinkAddData + data["__nvJitLinkAddData"] = <intptr_t>__nvJitLinkAddData global __nvJitLinkAddFile - data["__nvJitLinkAddFile"] = <_cyb_intptr_t>__nvJitLinkAddFile + data["__nvJitLinkAddFile"] = <intptr_t>__nvJitLinkAddFile global __nvJitLinkComplete - data["__nvJitLinkComplete"] = <_cyb_intptr_t>__nvJitLinkComplete + data["__nvJitLinkComplete"] = <intptr_t>__nvJitLinkComplete global __nvJitLinkGetLinkedCubinSize - data["__nvJitLinkGetLinkedCubinSize"] = <_cyb_intptr_t>__nvJitLinkGetLinkedCubinSize + data["__nvJitLinkGetLinkedCubinSize"] = <intptr_t>__nvJitLinkGetLinkedCubinSize global __nvJitLinkGetLinkedCubin - data["__nvJitLinkGetLinkedCubin"] = <_cyb_intptr_t>__nvJitLinkGetLinkedCubin + data["__nvJitLinkGetLinkedCubin"] = <intptr_t>__nvJitLinkGetLinkedCubin global __nvJitLinkGetLinkedPtxSize - data["__nvJitLinkGetLinkedPtxSize"] = <_cyb_intptr_t>__nvJitLinkGetLinkedPtxSize + data["__nvJitLinkGetLinkedPtxSize"] = <intptr_t>__nvJitLinkGetLinkedPtxSize global __nvJitLinkGetLinkedPtx - data["__nvJitLinkGetLinkedPtx"] = <_cyb_intptr_t>__nvJitLinkGetLinkedPtx + data["__nvJitLinkGetLinkedPtx"] = <intptr_t>__nvJitLinkGetLinkedPtx global __nvJitLinkGetErrorLogSize - data["__nvJitLinkGetErrorLogSize"] = <_cyb_intptr_t>__nvJitLinkGetErrorLogSize + data["__nvJitLinkGetErrorLogSize"] = <intptr_t>__nvJitLinkGetErrorLogSize global __nvJitLinkGetErrorLog - data["__nvJitLinkGetErrorLog"] = <_cyb_intptr_t>__nvJitLinkGetErrorLog + data["__nvJitLinkGetErrorLog"] = <intptr_t>__nvJitLinkGetErrorLog global __nvJitLinkGetInfoLogSize - data["__nvJitLinkGetInfoLogSize"] = <_cyb_intptr_t>__nvJitLinkGetInfoLogSize + data["__nvJitLinkGetInfoLogSize"] = <intptr_t>__nvJitLinkGetInfoLogSize global __nvJitLinkGetInfoLog - data["__nvJitLinkGetInfoLog"] = <_cyb_intptr_t>__nvJitLinkGetInfoLog + data["__nvJitLinkGetInfoLog"] = <intptr_t>__nvJitLinkGetInfoLog global __nvJitLinkVersion - data["__nvJitLinkVersion"] = <_cyb_intptr_t>__nvJitLinkVersion + data["__nvJitLinkVersion"] = <intptr_t>__nvJitLinkVersion global __nvJitLinkGetLinkedLTOIRSize - data["__nvJitLinkGetLinkedLTOIRSize"] = <_cyb_intptr_t>__nvJitLinkGetLinkedLTOIRSize + data["__nvJitLinkGetLinkedLTOIRSize"] = <intptr_t>__nvJitLinkGetLinkedLTOIRSize global __nvJitLinkGetLinkedLTOIR - data["__nvJitLinkGetLinkedLTOIR"] = <_cyb_intptr_t>__nvJitLinkGetLinkedLTOIR + data["__nvJitLinkGetLinkedLTOIR"] = <intptr_t>__nvJitLinkGetLinkedLTOIR _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx index c61714f77dd..1f487e492ee 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=735d5128e04ed65d3517e4315b5c05f9f1731c2f4dd00460925bb30f7090f6f5 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0087568b9b3f0b61ae1648aa3f7c9f3f3f72791a06b94797834eb6c1072a676d # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,7 @@ cdef extern from "<dlfcn.h>": void* _cyb_dlsym "dlsym"(void*, const char*) nogil const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport intptr_t import threading as _cyb_threading @@ -3050,1114 +3050,1114 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvml() cdef dict data = {} global __nvmlInit_v2 - data["__nvmlInit_v2"] = <_cyb_intptr_t>__nvmlInit_v2 + data["__nvmlInit_v2"] = <intptr_t>__nvmlInit_v2 global __nvmlInitWithFlags - data["__nvmlInitWithFlags"] = <_cyb_intptr_t>__nvmlInitWithFlags + data["__nvmlInitWithFlags"] = <intptr_t>__nvmlInitWithFlags global __nvmlShutdown - data["__nvmlShutdown"] = <_cyb_intptr_t>__nvmlShutdown + data["__nvmlShutdown"] = <intptr_t>__nvmlShutdown global __nvmlErrorString - data["__nvmlErrorString"] = <_cyb_intptr_t>__nvmlErrorString + data["__nvmlErrorString"] = <intptr_t>__nvmlErrorString global __nvmlSystemGetDriverVersion - data["__nvmlSystemGetDriverVersion"] = <_cyb_intptr_t>__nvmlSystemGetDriverVersion + data["__nvmlSystemGetDriverVersion"] = <intptr_t>__nvmlSystemGetDriverVersion global __nvmlSystemGetNVMLVersion - data["__nvmlSystemGetNVMLVersion"] = <_cyb_intptr_t>__nvmlSystemGetNVMLVersion + data["__nvmlSystemGetNVMLVersion"] = <intptr_t>__nvmlSystemGetNVMLVersion global __nvmlSystemGetCudaDriverVersion - data["__nvmlSystemGetCudaDriverVersion"] = <_cyb_intptr_t>__nvmlSystemGetCudaDriverVersion + data["__nvmlSystemGetCudaDriverVersion"] = <intptr_t>__nvmlSystemGetCudaDriverVersion global __nvmlSystemGetCudaDriverVersion_v2 - data["__nvmlSystemGetCudaDriverVersion_v2"] = <_cyb_intptr_t>__nvmlSystemGetCudaDriverVersion_v2 + data["__nvmlSystemGetCudaDriverVersion_v2"] = <intptr_t>__nvmlSystemGetCudaDriverVersion_v2 global __nvmlSystemGetProcessName - data["__nvmlSystemGetProcessName"] = <_cyb_intptr_t>__nvmlSystemGetProcessName + data["__nvmlSystemGetProcessName"] = <intptr_t>__nvmlSystemGetProcessName global __nvmlSystemGetHicVersion - data["__nvmlSystemGetHicVersion"] = <_cyb_intptr_t>__nvmlSystemGetHicVersion + data["__nvmlSystemGetHicVersion"] = <intptr_t>__nvmlSystemGetHicVersion global __nvmlSystemGetTopologyGpuSet - data["__nvmlSystemGetTopologyGpuSet"] = <_cyb_intptr_t>__nvmlSystemGetTopologyGpuSet + data["__nvmlSystemGetTopologyGpuSet"] = <intptr_t>__nvmlSystemGetTopologyGpuSet global __nvmlSystemGetDriverBranch - data["__nvmlSystemGetDriverBranch"] = <_cyb_intptr_t>__nvmlSystemGetDriverBranch + data["__nvmlSystemGetDriverBranch"] = <intptr_t>__nvmlSystemGetDriverBranch global __nvmlUnitGetCount - data["__nvmlUnitGetCount"] = <_cyb_intptr_t>__nvmlUnitGetCount + data["__nvmlUnitGetCount"] = <intptr_t>__nvmlUnitGetCount global __nvmlUnitGetHandleByIndex - data["__nvmlUnitGetHandleByIndex"] = <_cyb_intptr_t>__nvmlUnitGetHandleByIndex + data["__nvmlUnitGetHandleByIndex"] = <intptr_t>__nvmlUnitGetHandleByIndex global __nvmlUnitGetUnitInfo - data["__nvmlUnitGetUnitInfo"] = <_cyb_intptr_t>__nvmlUnitGetUnitInfo + data["__nvmlUnitGetUnitInfo"] = <intptr_t>__nvmlUnitGetUnitInfo global __nvmlUnitGetLedState - data["__nvmlUnitGetLedState"] = <_cyb_intptr_t>__nvmlUnitGetLedState + data["__nvmlUnitGetLedState"] = <intptr_t>__nvmlUnitGetLedState global __nvmlUnitGetPsuInfo - data["__nvmlUnitGetPsuInfo"] = <_cyb_intptr_t>__nvmlUnitGetPsuInfo + data["__nvmlUnitGetPsuInfo"] = <intptr_t>__nvmlUnitGetPsuInfo global __nvmlUnitGetTemperature - data["__nvmlUnitGetTemperature"] = <_cyb_intptr_t>__nvmlUnitGetTemperature + data["__nvmlUnitGetTemperature"] = <intptr_t>__nvmlUnitGetTemperature global __nvmlUnitGetFanSpeedInfo - data["__nvmlUnitGetFanSpeedInfo"] = <_cyb_intptr_t>__nvmlUnitGetFanSpeedInfo + data["__nvmlUnitGetFanSpeedInfo"] = <intptr_t>__nvmlUnitGetFanSpeedInfo global __nvmlUnitGetDevices - data["__nvmlUnitGetDevices"] = <_cyb_intptr_t>__nvmlUnitGetDevices + data["__nvmlUnitGetDevices"] = <intptr_t>__nvmlUnitGetDevices global __nvmlDeviceGetCount_v2 - data["__nvmlDeviceGetCount_v2"] = <_cyb_intptr_t>__nvmlDeviceGetCount_v2 + data["__nvmlDeviceGetCount_v2"] = <intptr_t>__nvmlDeviceGetCount_v2 global __nvmlDeviceGetAttributes_v2 - data["__nvmlDeviceGetAttributes_v2"] = <_cyb_intptr_t>__nvmlDeviceGetAttributes_v2 + data["__nvmlDeviceGetAttributes_v2"] = <intptr_t>__nvmlDeviceGetAttributes_v2 global __nvmlDeviceGetHandleByIndex_v2 - data["__nvmlDeviceGetHandleByIndex_v2"] = <_cyb_intptr_t>__nvmlDeviceGetHandleByIndex_v2 + data["__nvmlDeviceGetHandleByIndex_v2"] = <intptr_t>__nvmlDeviceGetHandleByIndex_v2 global __nvmlDeviceGetHandleBySerial - data["__nvmlDeviceGetHandleBySerial"] = <_cyb_intptr_t>__nvmlDeviceGetHandleBySerial + data["__nvmlDeviceGetHandleBySerial"] = <intptr_t>__nvmlDeviceGetHandleBySerial global __nvmlDeviceGetHandleByUUID - data["__nvmlDeviceGetHandleByUUID"] = <_cyb_intptr_t>__nvmlDeviceGetHandleByUUID + data["__nvmlDeviceGetHandleByUUID"] = <intptr_t>__nvmlDeviceGetHandleByUUID global __nvmlDeviceGetHandleByUUIDV - data["__nvmlDeviceGetHandleByUUIDV"] = <_cyb_intptr_t>__nvmlDeviceGetHandleByUUIDV + data["__nvmlDeviceGetHandleByUUIDV"] = <intptr_t>__nvmlDeviceGetHandleByUUIDV global __nvmlDeviceGetHandleByPciBusId_v2 - data["__nvmlDeviceGetHandleByPciBusId_v2"] = <_cyb_intptr_t>__nvmlDeviceGetHandleByPciBusId_v2 + data["__nvmlDeviceGetHandleByPciBusId_v2"] = <intptr_t>__nvmlDeviceGetHandleByPciBusId_v2 global __nvmlDeviceGetName - data["__nvmlDeviceGetName"] = <_cyb_intptr_t>__nvmlDeviceGetName + data["__nvmlDeviceGetName"] = <intptr_t>__nvmlDeviceGetName global __nvmlDeviceGetBrand - data["__nvmlDeviceGetBrand"] = <_cyb_intptr_t>__nvmlDeviceGetBrand + data["__nvmlDeviceGetBrand"] = <intptr_t>__nvmlDeviceGetBrand global __nvmlDeviceGetIndex - data["__nvmlDeviceGetIndex"] = <_cyb_intptr_t>__nvmlDeviceGetIndex + data["__nvmlDeviceGetIndex"] = <intptr_t>__nvmlDeviceGetIndex global __nvmlDeviceGetSerial - data["__nvmlDeviceGetSerial"] = <_cyb_intptr_t>__nvmlDeviceGetSerial + data["__nvmlDeviceGetSerial"] = <intptr_t>__nvmlDeviceGetSerial global __nvmlDeviceGetModuleId - data["__nvmlDeviceGetModuleId"] = <_cyb_intptr_t>__nvmlDeviceGetModuleId + data["__nvmlDeviceGetModuleId"] = <intptr_t>__nvmlDeviceGetModuleId global __nvmlDeviceGetC2cModeInfoV - data["__nvmlDeviceGetC2cModeInfoV"] = <_cyb_intptr_t>__nvmlDeviceGetC2cModeInfoV + data["__nvmlDeviceGetC2cModeInfoV"] = <intptr_t>__nvmlDeviceGetC2cModeInfoV global __nvmlDeviceGetMemoryAffinity - data["__nvmlDeviceGetMemoryAffinity"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryAffinity + data["__nvmlDeviceGetMemoryAffinity"] = <intptr_t>__nvmlDeviceGetMemoryAffinity global __nvmlDeviceGetCpuAffinityWithinScope - data["__nvmlDeviceGetCpuAffinityWithinScope"] = <_cyb_intptr_t>__nvmlDeviceGetCpuAffinityWithinScope + data["__nvmlDeviceGetCpuAffinityWithinScope"] = <intptr_t>__nvmlDeviceGetCpuAffinityWithinScope global __nvmlDeviceGetCpuAffinity - data["__nvmlDeviceGetCpuAffinity"] = <_cyb_intptr_t>__nvmlDeviceGetCpuAffinity + data["__nvmlDeviceGetCpuAffinity"] = <intptr_t>__nvmlDeviceGetCpuAffinity global __nvmlDeviceSetCpuAffinity - data["__nvmlDeviceSetCpuAffinity"] = <_cyb_intptr_t>__nvmlDeviceSetCpuAffinity + data["__nvmlDeviceSetCpuAffinity"] = <intptr_t>__nvmlDeviceSetCpuAffinity global __nvmlDeviceClearCpuAffinity - data["__nvmlDeviceClearCpuAffinity"] = <_cyb_intptr_t>__nvmlDeviceClearCpuAffinity + data["__nvmlDeviceClearCpuAffinity"] = <intptr_t>__nvmlDeviceClearCpuAffinity global __nvmlDeviceGetNumaNodeId - data["__nvmlDeviceGetNumaNodeId"] = <_cyb_intptr_t>__nvmlDeviceGetNumaNodeId + data["__nvmlDeviceGetNumaNodeId"] = <intptr_t>__nvmlDeviceGetNumaNodeId global __nvmlDeviceGetTopologyCommonAncestor - data["__nvmlDeviceGetTopologyCommonAncestor"] = <_cyb_intptr_t>__nvmlDeviceGetTopologyCommonAncestor + data["__nvmlDeviceGetTopologyCommonAncestor"] = <intptr_t>__nvmlDeviceGetTopologyCommonAncestor global __nvmlDeviceGetTopologyNearestGpus - data["__nvmlDeviceGetTopologyNearestGpus"] = <_cyb_intptr_t>__nvmlDeviceGetTopologyNearestGpus + data["__nvmlDeviceGetTopologyNearestGpus"] = <intptr_t>__nvmlDeviceGetTopologyNearestGpus global __nvmlDeviceGetP2PStatus - data["__nvmlDeviceGetP2PStatus"] = <_cyb_intptr_t>__nvmlDeviceGetP2PStatus + data["__nvmlDeviceGetP2PStatus"] = <intptr_t>__nvmlDeviceGetP2PStatus global __nvmlDeviceGetUUID - data["__nvmlDeviceGetUUID"] = <_cyb_intptr_t>__nvmlDeviceGetUUID + data["__nvmlDeviceGetUUID"] = <intptr_t>__nvmlDeviceGetUUID global __nvmlDeviceGetMinorNumber - data["__nvmlDeviceGetMinorNumber"] = <_cyb_intptr_t>__nvmlDeviceGetMinorNumber + data["__nvmlDeviceGetMinorNumber"] = <intptr_t>__nvmlDeviceGetMinorNumber global __nvmlDeviceGetBoardPartNumber - data["__nvmlDeviceGetBoardPartNumber"] = <_cyb_intptr_t>__nvmlDeviceGetBoardPartNumber + data["__nvmlDeviceGetBoardPartNumber"] = <intptr_t>__nvmlDeviceGetBoardPartNumber global __nvmlDeviceGetInforomVersion - data["__nvmlDeviceGetInforomVersion"] = <_cyb_intptr_t>__nvmlDeviceGetInforomVersion + data["__nvmlDeviceGetInforomVersion"] = <intptr_t>__nvmlDeviceGetInforomVersion global __nvmlDeviceGetInforomImageVersion - data["__nvmlDeviceGetInforomImageVersion"] = <_cyb_intptr_t>__nvmlDeviceGetInforomImageVersion + data["__nvmlDeviceGetInforomImageVersion"] = <intptr_t>__nvmlDeviceGetInforomImageVersion global __nvmlDeviceGetInforomConfigurationChecksum - data["__nvmlDeviceGetInforomConfigurationChecksum"] = <_cyb_intptr_t>__nvmlDeviceGetInforomConfigurationChecksum + data["__nvmlDeviceGetInforomConfigurationChecksum"] = <intptr_t>__nvmlDeviceGetInforomConfigurationChecksum global __nvmlDeviceValidateInforom - data["__nvmlDeviceValidateInforom"] = <_cyb_intptr_t>__nvmlDeviceValidateInforom + data["__nvmlDeviceValidateInforom"] = <intptr_t>__nvmlDeviceValidateInforom global __nvmlDeviceGetLastBBXFlushTime - data["__nvmlDeviceGetLastBBXFlushTime"] = <_cyb_intptr_t>__nvmlDeviceGetLastBBXFlushTime + data["__nvmlDeviceGetLastBBXFlushTime"] = <intptr_t>__nvmlDeviceGetLastBBXFlushTime global __nvmlDeviceGetDisplayMode - data["__nvmlDeviceGetDisplayMode"] = <_cyb_intptr_t>__nvmlDeviceGetDisplayMode + data["__nvmlDeviceGetDisplayMode"] = <intptr_t>__nvmlDeviceGetDisplayMode global __nvmlDeviceGetDisplayActive - data["__nvmlDeviceGetDisplayActive"] = <_cyb_intptr_t>__nvmlDeviceGetDisplayActive + data["__nvmlDeviceGetDisplayActive"] = <intptr_t>__nvmlDeviceGetDisplayActive global __nvmlDeviceGetPersistenceMode - data["__nvmlDeviceGetPersistenceMode"] = <_cyb_intptr_t>__nvmlDeviceGetPersistenceMode + data["__nvmlDeviceGetPersistenceMode"] = <intptr_t>__nvmlDeviceGetPersistenceMode global __nvmlDeviceGetPciInfoExt - data["__nvmlDeviceGetPciInfoExt"] = <_cyb_intptr_t>__nvmlDeviceGetPciInfoExt + data["__nvmlDeviceGetPciInfoExt"] = <intptr_t>__nvmlDeviceGetPciInfoExt global __nvmlDeviceGetPciInfo_v3 - data["__nvmlDeviceGetPciInfo_v3"] = <_cyb_intptr_t>__nvmlDeviceGetPciInfo_v3 + data["__nvmlDeviceGetPciInfo_v3"] = <intptr_t>__nvmlDeviceGetPciInfo_v3 global __nvmlDeviceGetMaxPcieLinkGeneration - data["__nvmlDeviceGetMaxPcieLinkGeneration"] = <_cyb_intptr_t>__nvmlDeviceGetMaxPcieLinkGeneration + data["__nvmlDeviceGetMaxPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetMaxPcieLinkGeneration global __nvmlDeviceGetGpuMaxPcieLinkGeneration - data["__nvmlDeviceGetGpuMaxPcieLinkGeneration"] = <_cyb_intptr_t>__nvmlDeviceGetGpuMaxPcieLinkGeneration + data["__nvmlDeviceGetGpuMaxPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetGpuMaxPcieLinkGeneration global __nvmlDeviceGetMaxPcieLinkWidth - data["__nvmlDeviceGetMaxPcieLinkWidth"] = <_cyb_intptr_t>__nvmlDeviceGetMaxPcieLinkWidth + data["__nvmlDeviceGetMaxPcieLinkWidth"] = <intptr_t>__nvmlDeviceGetMaxPcieLinkWidth global __nvmlDeviceGetCurrPcieLinkGeneration - data["__nvmlDeviceGetCurrPcieLinkGeneration"] = <_cyb_intptr_t>__nvmlDeviceGetCurrPcieLinkGeneration + data["__nvmlDeviceGetCurrPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetCurrPcieLinkGeneration global __nvmlDeviceGetCurrPcieLinkWidth - data["__nvmlDeviceGetCurrPcieLinkWidth"] = <_cyb_intptr_t>__nvmlDeviceGetCurrPcieLinkWidth + data["__nvmlDeviceGetCurrPcieLinkWidth"] = <intptr_t>__nvmlDeviceGetCurrPcieLinkWidth global __nvmlDeviceGetPcieThroughput - data["__nvmlDeviceGetPcieThroughput"] = <_cyb_intptr_t>__nvmlDeviceGetPcieThroughput + data["__nvmlDeviceGetPcieThroughput"] = <intptr_t>__nvmlDeviceGetPcieThroughput global __nvmlDeviceGetPcieReplayCounter - data["__nvmlDeviceGetPcieReplayCounter"] = <_cyb_intptr_t>__nvmlDeviceGetPcieReplayCounter + data["__nvmlDeviceGetPcieReplayCounter"] = <intptr_t>__nvmlDeviceGetPcieReplayCounter global __nvmlDeviceGetClockInfo - data["__nvmlDeviceGetClockInfo"] = <_cyb_intptr_t>__nvmlDeviceGetClockInfo + data["__nvmlDeviceGetClockInfo"] = <intptr_t>__nvmlDeviceGetClockInfo global __nvmlDeviceGetMaxClockInfo - data["__nvmlDeviceGetMaxClockInfo"] = <_cyb_intptr_t>__nvmlDeviceGetMaxClockInfo + data["__nvmlDeviceGetMaxClockInfo"] = <intptr_t>__nvmlDeviceGetMaxClockInfo global __nvmlDeviceGetGpcClkVfOffset - data["__nvmlDeviceGetGpcClkVfOffset"] = <_cyb_intptr_t>__nvmlDeviceGetGpcClkVfOffset + data["__nvmlDeviceGetGpcClkVfOffset"] = <intptr_t>__nvmlDeviceGetGpcClkVfOffset global __nvmlDeviceGetClock - data["__nvmlDeviceGetClock"] = <_cyb_intptr_t>__nvmlDeviceGetClock + data["__nvmlDeviceGetClock"] = <intptr_t>__nvmlDeviceGetClock global __nvmlDeviceGetMaxCustomerBoostClock - data["__nvmlDeviceGetMaxCustomerBoostClock"] = <_cyb_intptr_t>__nvmlDeviceGetMaxCustomerBoostClock + data["__nvmlDeviceGetMaxCustomerBoostClock"] = <intptr_t>__nvmlDeviceGetMaxCustomerBoostClock global __nvmlDeviceGetSupportedMemoryClocks - data["__nvmlDeviceGetSupportedMemoryClocks"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedMemoryClocks + data["__nvmlDeviceGetSupportedMemoryClocks"] = <intptr_t>__nvmlDeviceGetSupportedMemoryClocks global __nvmlDeviceGetSupportedGraphicsClocks - data["__nvmlDeviceGetSupportedGraphicsClocks"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedGraphicsClocks + data["__nvmlDeviceGetSupportedGraphicsClocks"] = <intptr_t>__nvmlDeviceGetSupportedGraphicsClocks global __nvmlDeviceGetAutoBoostedClocksEnabled - data["__nvmlDeviceGetAutoBoostedClocksEnabled"] = <_cyb_intptr_t>__nvmlDeviceGetAutoBoostedClocksEnabled + data["__nvmlDeviceGetAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceGetAutoBoostedClocksEnabled global __nvmlDeviceGetFanSpeed - data["__nvmlDeviceGetFanSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetFanSpeed + data["__nvmlDeviceGetFanSpeed"] = <intptr_t>__nvmlDeviceGetFanSpeed global __nvmlDeviceGetFanSpeed_v2 - data["__nvmlDeviceGetFanSpeed_v2"] = <_cyb_intptr_t>__nvmlDeviceGetFanSpeed_v2 + data["__nvmlDeviceGetFanSpeed_v2"] = <intptr_t>__nvmlDeviceGetFanSpeed_v2 global __nvmlDeviceGetFanSpeedRPM - data["__nvmlDeviceGetFanSpeedRPM"] = <_cyb_intptr_t>__nvmlDeviceGetFanSpeedRPM + data["__nvmlDeviceGetFanSpeedRPM"] = <intptr_t>__nvmlDeviceGetFanSpeedRPM global __nvmlDeviceGetTargetFanSpeed - data["__nvmlDeviceGetTargetFanSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetTargetFanSpeed + data["__nvmlDeviceGetTargetFanSpeed"] = <intptr_t>__nvmlDeviceGetTargetFanSpeed global __nvmlDeviceGetMinMaxFanSpeed - data["__nvmlDeviceGetMinMaxFanSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetMinMaxFanSpeed + data["__nvmlDeviceGetMinMaxFanSpeed"] = <intptr_t>__nvmlDeviceGetMinMaxFanSpeed global __nvmlDeviceGetFanControlPolicy_v2 - data["__nvmlDeviceGetFanControlPolicy_v2"] = <_cyb_intptr_t>__nvmlDeviceGetFanControlPolicy_v2 + data["__nvmlDeviceGetFanControlPolicy_v2"] = <intptr_t>__nvmlDeviceGetFanControlPolicy_v2 global __nvmlDeviceGetNumFans - data["__nvmlDeviceGetNumFans"] = <_cyb_intptr_t>__nvmlDeviceGetNumFans + data["__nvmlDeviceGetNumFans"] = <intptr_t>__nvmlDeviceGetNumFans global __nvmlDeviceGetCoolerInfo - data["__nvmlDeviceGetCoolerInfo"] = <_cyb_intptr_t>__nvmlDeviceGetCoolerInfo + data["__nvmlDeviceGetCoolerInfo"] = <intptr_t>__nvmlDeviceGetCoolerInfo global __nvmlDeviceGetTemperatureV - data["__nvmlDeviceGetTemperatureV"] = <_cyb_intptr_t>__nvmlDeviceGetTemperatureV + data["__nvmlDeviceGetTemperatureV"] = <intptr_t>__nvmlDeviceGetTemperatureV global __nvmlDeviceGetTemperatureThreshold - data["__nvmlDeviceGetTemperatureThreshold"] = <_cyb_intptr_t>__nvmlDeviceGetTemperatureThreshold + data["__nvmlDeviceGetTemperatureThreshold"] = <intptr_t>__nvmlDeviceGetTemperatureThreshold global __nvmlDeviceGetMarginTemperature - data["__nvmlDeviceGetMarginTemperature"] = <_cyb_intptr_t>__nvmlDeviceGetMarginTemperature + data["__nvmlDeviceGetMarginTemperature"] = <intptr_t>__nvmlDeviceGetMarginTemperature global __nvmlDeviceGetThermalSettings - data["__nvmlDeviceGetThermalSettings"] = <_cyb_intptr_t>__nvmlDeviceGetThermalSettings + data["__nvmlDeviceGetThermalSettings"] = <intptr_t>__nvmlDeviceGetThermalSettings global __nvmlDeviceGetPerformanceState - data["__nvmlDeviceGetPerformanceState"] = <_cyb_intptr_t>__nvmlDeviceGetPerformanceState + data["__nvmlDeviceGetPerformanceState"] = <intptr_t>__nvmlDeviceGetPerformanceState global __nvmlDeviceGetCurrentClocksEventReasons - data["__nvmlDeviceGetCurrentClocksEventReasons"] = <_cyb_intptr_t>__nvmlDeviceGetCurrentClocksEventReasons + data["__nvmlDeviceGetCurrentClocksEventReasons"] = <intptr_t>__nvmlDeviceGetCurrentClocksEventReasons global __nvmlDeviceGetSupportedClocksEventReasons - data["__nvmlDeviceGetSupportedClocksEventReasons"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedClocksEventReasons + data["__nvmlDeviceGetSupportedClocksEventReasons"] = <intptr_t>__nvmlDeviceGetSupportedClocksEventReasons global __nvmlDeviceGetPowerState - data["__nvmlDeviceGetPowerState"] = <_cyb_intptr_t>__nvmlDeviceGetPowerState + data["__nvmlDeviceGetPowerState"] = <intptr_t>__nvmlDeviceGetPowerState global __nvmlDeviceGetDynamicPstatesInfo - data["__nvmlDeviceGetDynamicPstatesInfo"] = <_cyb_intptr_t>__nvmlDeviceGetDynamicPstatesInfo + data["__nvmlDeviceGetDynamicPstatesInfo"] = <intptr_t>__nvmlDeviceGetDynamicPstatesInfo global __nvmlDeviceGetMemClkVfOffset - data["__nvmlDeviceGetMemClkVfOffset"] = <_cyb_intptr_t>__nvmlDeviceGetMemClkVfOffset + data["__nvmlDeviceGetMemClkVfOffset"] = <intptr_t>__nvmlDeviceGetMemClkVfOffset global __nvmlDeviceGetMinMaxClockOfPState - data["__nvmlDeviceGetMinMaxClockOfPState"] = <_cyb_intptr_t>__nvmlDeviceGetMinMaxClockOfPState + data["__nvmlDeviceGetMinMaxClockOfPState"] = <intptr_t>__nvmlDeviceGetMinMaxClockOfPState global __nvmlDeviceGetSupportedPerformanceStates - data["__nvmlDeviceGetSupportedPerformanceStates"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedPerformanceStates + data["__nvmlDeviceGetSupportedPerformanceStates"] = <intptr_t>__nvmlDeviceGetSupportedPerformanceStates global __nvmlDeviceGetGpcClkMinMaxVfOffset - data["__nvmlDeviceGetGpcClkMinMaxVfOffset"] = <_cyb_intptr_t>__nvmlDeviceGetGpcClkMinMaxVfOffset + data["__nvmlDeviceGetGpcClkMinMaxVfOffset"] = <intptr_t>__nvmlDeviceGetGpcClkMinMaxVfOffset global __nvmlDeviceGetMemClkMinMaxVfOffset - data["__nvmlDeviceGetMemClkMinMaxVfOffset"] = <_cyb_intptr_t>__nvmlDeviceGetMemClkMinMaxVfOffset + data["__nvmlDeviceGetMemClkMinMaxVfOffset"] = <intptr_t>__nvmlDeviceGetMemClkMinMaxVfOffset global __nvmlDeviceGetClockOffsets - data["__nvmlDeviceGetClockOffsets"] = <_cyb_intptr_t>__nvmlDeviceGetClockOffsets + data["__nvmlDeviceGetClockOffsets"] = <intptr_t>__nvmlDeviceGetClockOffsets global __nvmlDeviceSetClockOffsets - data["__nvmlDeviceSetClockOffsets"] = <_cyb_intptr_t>__nvmlDeviceSetClockOffsets + data["__nvmlDeviceSetClockOffsets"] = <intptr_t>__nvmlDeviceSetClockOffsets global __nvmlDeviceGetPerformanceModes - data["__nvmlDeviceGetPerformanceModes"] = <_cyb_intptr_t>__nvmlDeviceGetPerformanceModes + data["__nvmlDeviceGetPerformanceModes"] = <intptr_t>__nvmlDeviceGetPerformanceModes global __nvmlDeviceGetCurrentClockFreqs - data["__nvmlDeviceGetCurrentClockFreqs"] = <_cyb_intptr_t>__nvmlDeviceGetCurrentClockFreqs + data["__nvmlDeviceGetCurrentClockFreqs"] = <intptr_t>__nvmlDeviceGetCurrentClockFreqs global __nvmlDeviceGetPowerManagementLimit - data["__nvmlDeviceGetPowerManagementLimit"] = <_cyb_intptr_t>__nvmlDeviceGetPowerManagementLimit + data["__nvmlDeviceGetPowerManagementLimit"] = <intptr_t>__nvmlDeviceGetPowerManagementLimit global __nvmlDeviceGetPowerManagementLimitConstraints - data["__nvmlDeviceGetPowerManagementLimitConstraints"] = <_cyb_intptr_t>__nvmlDeviceGetPowerManagementLimitConstraints + data["__nvmlDeviceGetPowerManagementLimitConstraints"] = <intptr_t>__nvmlDeviceGetPowerManagementLimitConstraints global __nvmlDeviceGetPowerManagementDefaultLimit - data["__nvmlDeviceGetPowerManagementDefaultLimit"] = <_cyb_intptr_t>__nvmlDeviceGetPowerManagementDefaultLimit + data["__nvmlDeviceGetPowerManagementDefaultLimit"] = <intptr_t>__nvmlDeviceGetPowerManagementDefaultLimit global __nvmlDeviceGetPowerUsage - data["__nvmlDeviceGetPowerUsage"] = <_cyb_intptr_t>__nvmlDeviceGetPowerUsage + data["__nvmlDeviceGetPowerUsage"] = <intptr_t>__nvmlDeviceGetPowerUsage global __nvmlDeviceGetTotalEnergyConsumption - data["__nvmlDeviceGetTotalEnergyConsumption"] = <_cyb_intptr_t>__nvmlDeviceGetTotalEnergyConsumption + data["__nvmlDeviceGetTotalEnergyConsumption"] = <intptr_t>__nvmlDeviceGetTotalEnergyConsumption global __nvmlDeviceGetEnforcedPowerLimit - data["__nvmlDeviceGetEnforcedPowerLimit"] = <_cyb_intptr_t>__nvmlDeviceGetEnforcedPowerLimit + data["__nvmlDeviceGetEnforcedPowerLimit"] = <intptr_t>__nvmlDeviceGetEnforcedPowerLimit global __nvmlDeviceGetGpuOperationMode - data["__nvmlDeviceGetGpuOperationMode"] = <_cyb_intptr_t>__nvmlDeviceGetGpuOperationMode + data["__nvmlDeviceGetGpuOperationMode"] = <intptr_t>__nvmlDeviceGetGpuOperationMode global __nvmlDeviceGetMemoryInfo_v2 - data["__nvmlDeviceGetMemoryInfo_v2"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryInfo_v2 + data["__nvmlDeviceGetMemoryInfo_v2"] = <intptr_t>__nvmlDeviceGetMemoryInfo_v2 global __nvmlDeviceGetComputeMode - data["__nvmlDeviceGetComputeMode"] = <_cyb_intptr_t>__nvmlDeviceGetComputeMode + data["__nvmlDeviceGetComputeMode"] = <intptr_t>__nvmlDeviceGetComputeMode global __nvmlDeviceGetCudaComputeCapability - data["__nvmlDeviceGetCudaComputeCapability"] = <_cyb_intptr_t>__nvmlDeviceGetCudaComputeCapability + data["__nvmlDeviceGetCudaComputeCapability"] = <intptr_t>__nvmlDeviceGetCudaComputeCapability global __nvmlDeviceGetDramEncryptionMode - data["__nvmlDeviceGetDramEncryptionMode"] = <_cyb_intptr_t>__nvmlDeviceGetDramEncryptionMode + data["__nvmlDeviceGetDramEncryptionMode"] = <intptr_t>__nvmlDeviceGetDramEncryptionMode global __nvmlDeviceSetDramEncryptionMode - data["__nvmlDeviceSetDramEncryptionMode"] = <_cyb_intptr_t>__nvmlDeviceSetDramEncryptionMode + data["__nvmlDeviceSetDramEncryptionMode"] = <intptr_t>__nvmlDeviceSetDramEncryptionMode global __nvmlDeviceGetEccMode - data["__nvmlDeviceGetEccMode"] = <_cyb_intptr_t>__nvmlDeviceGetEccMode + data["__nvmlDeviceGetEccMode"] = <intptr_t>__nvmlDeviceGetEccMode global __nvmlDeviceGetDefaultEccMode - data["__nvmlDeviceGetDefaultEccMode"] = <_cyb_intptr_t>__nvmlDeviceGetDefaultEccMode + data["__nvmlDeviceGetDefaultEccMode"] = <intptr_t>__nvmlDeviceGetDefaultEccMode global __nvmlDeviceGetBoardId - data["__nvmlDeviceGetBoardId"] = <_cyb_intptr_t>__nvmlDeviceGetBoardId + data["__nvmlDeviceGetBoardId"] = <intptr_t>__nvmlDeviceGetBoardId global __nvmlDeviceGetMultiGpuBoard - data["__nvmlDeviceGetMultiGpuBoard"] = <_cyb_intptr_t>__nvmlDeviceGetMultiGpuBoard + data["__nvmlDeviceGetMultiGpuBoard"] = <intptr_t>__nvmlDeviceGetMultiGpuBoard global __nvmlDeviceGetTotalEccErrors - data["__nvmlDeviceGetTotalEccErrors"] = <_cyb_intptr_t>__nvmlDeviceGetTotalEccErrors + data["__nvmlDeviceGetTotalEccErrors"] = <intptr_t>__nvmlDeviceGetTotalEccErrors global __nvmlDeviceGetMemoryErrorCounter - data["__nvmlDeviceGetMemoryErrorCounter"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryErrorCounter + data["__nvmlDeviceGetMemoryErrorCounter"] = <intptr_t>__nvmlDeviceGetMemoryErrorCounter global __nvmlDeviceGetUtilizationRates - data["__nvmlDeviceGetUtilizationRates"] = <_cyb_intptr_t>__nvmlDeviceGetUtilizationRates + data["__nvmlDeviceGetUtilizationRates"] = <intptr_t>__nvmlDeviceGetUtilizationRates global __nvmlDeviceGetEncoderUtilization - data["__nvmlDeviceGetEncoderUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetEncoderUtilization + data["__nvmlDeviceGetEncoderUtilization"] = <intptr_t>__nvmlDeviceGetEncoderUtilization global __nvmlDeviceGetEncoderCapacity - data["__nvmlDeviceGetEncoderCapacity"] = <_cyb_intptr_t>__nvmlDeviceGetEncoderCapacity + data["__nvmlDeviceGetEncoderCapacity"] = <intptr_t>__nvmlDeviceGetEncoderCapacity global __nvmlDeviceGetEncoderStats - data["__nvmlDeviceGetEncoderStats"] = <_cyb_intptr_t>__nvmlDeviceGetEncoderStats + data["__nvmlDeviceGetEncoderStats"] = <intptr_t>__nvmlDeviceGetEncoderStats global __nvmlDeviceGetEncoderSessions - data["__nvmlDeviceGetEncoderSessions"] = <_cyb_intptr_t>__nvmlDeviceGetEncoderSessions + data["__nvmlDeviceGetEncoderSessions"] = <intptr_t>__nvmlDeviceGetEncoderSessions global __nvmlDeviceGetDecoderUtilization - data["__nvmlDeviceGetDecoderUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetDecoderUtilization + data["__nvmlDeviceGetDecoderUtilization"] = <intptr_t>__nvmlDeviceGetDecoderUtilization global __nvmlDeviceGetJpgUtilization - data["__nvmlDeviceGetJpgUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetJpgUtilization + data["__nvmlDeviceGetJpgUtilization"] = <intptr_t>__nvmlDeviceGetJpgUtilization global __nvmlDeviceGetOfaUtilization - data["__nvmlDeviceGetOfaUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetOfaUtilization + data["__nvmlDeviceGetOfaUtilization"] = <intptr_t>__nvmlDeviceGetOfaUtilization global __nvmlDeviceGetFBCStats - data["__nvmlDeviceGetFBCStats"] = <_cyb_intptr_t>__nvmlDeviceGetFBCStats + data["__nvmlDeviceGetFBCStats"] = <intptr_t>__nvmlDeviceGetFBCStats global __nvmlDeviceGetFBCSessions - data["__nvmlDeviceGetFBCSessions"] = <_cyb_intptr_t>__nvmlDeviceGetFBCSessions + data["__nvmlDeviceGetFBCSessions"] = <intptr_t>__nvmlDeviceGetFBCSessions global __nvmlDeviceGetDriverModel_v2 - data["__nvmlDeviceGetDriverModel_v2"] = <_cyb_intptr_t>__nvmlDeviceGetDriverModel_v2 + data["__nvmlDeviceGetDriverModel_v2"] = <intptr_t>__nvmlDeviceGetDriverModel_v2 global __nvmlDeviceGetVbiosVersion - data["__nvmlDeviceGetVbiosVersion"] = <_cyb_intptr_t>__nvmlDeviceGetVbiosVersion + data["__nvmlDeviceGetVbiosVersion"] = <intptr_t>__nvmlDeviceGetVbiosVersion global __nvmlDeviceGetBridgeChipInfo - data["__nvmlDeviceGetBridgeChipInfo"] = <_cyb_intptr_t>__nvmlDeviceGetBridgeChipInfo + data["__nvmlDeviceGetBridgeChipInfo"] = <intptr_t>__nvmlDeviceGetBridgeChipInfo global __nvmlDeviceGetComputeRunningProcesses_v3 - data["__nvmlDeviceGetComputeRunningProcesses_v3"] = <_cyb_intptr_t>__nvmlDeviceGetComputeRunningProcesses_v3 + data["__nvmlDeviceGetComputeRunningProcesses_v3"] = <intptr_t>__nvmlDeviceGetComputeRunningProcesses_v3 global __nvmlDeviceGetGraphicsRunningProcesses_v3 - data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = <_cyb_intptr_t>__nvmlDeviceGetGraphicsRunningProcesses_v3 + data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = <intptr_t>__nvmlDeviceGetGraphicsRunningProcesses_v3 global __nvmlDeviceGetMPSComputeRunningProcesses_v3 - data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = <_cyb_intptr_t>__nvmlDeviceGetMPSComputeRunningProcesses_v3 + data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = <intptr_t>__nvmlDeviceGetMPSComputeRunningProcesses_v3 global __nvmlDeviceGetRunningProcessDetailList - data["__nvmlDeviceGetRunningProcessDetailList"] = <_cyb_intptr_t>__nvmlDeviceGetRunningProcessDetailList + data["__nvmlDeviceGetRunningProcessDetailList"] = <intptr_t>__nvmlDeviceGetRunningProcessDetailList global __nvmlDeviceOnSameBoard - data["__nvmlDeviceOnSameBoard"] = <_cyb_intptr_t>__nvmlDeviceOnSameBoard + data["__nvmlDeviceOnSameBoard"] = <intptr_t>__nvmlDeviceOnSameBoard global __nvmlDeviceGetAPIRestriction - data["__nvmlDeviceGetAPIRestriction"] = <_cyb_intptr_t>__nvmlDeviceGetAPIRestriction + data["__nvmlDeviceGetAPIRestriction"] = <intptr_t>__nvmlDeviceGetAPIRestriction global __nvmlDeviceGetSamples - data["__nvmlDeviceGetSamples"] = <_cyb_intptr_t>__nvmlDeviceGetSamples + data["__nvmlDeviceGetSamples"] = <intptr_t>__nvmlDeviceGetSamples global __nvmlDeviceGetBAR1MemoryInfo - data["__nvmlDeviceGetBAR1MemoryInfo"] = <_cyb_intptr_t>__nvmlDeviceGetBAR1MemoryInfo + data["__nvmlDeviceGetBAR1MemoryInfo"] = <intptr_t>__nvmlDeviceGetBAR1MemoryInfo global __nvmlDeviceGetIrqNum - data["__nvmlDeviceGetIrqNum"] = <_cyb_intptr_t>__nvmlDeviceGetIrqNum + data["__nvmlDeviceGetIrqNum"] = <intptr_t>__nvmlDeviceGetIrqNum global __nvmlDeviceGetNumGpuCores - data["__nvmlDeviceGetNumGpuCores"] = <_cyb_intptr_t>__nvmlDeviceGetNumGpuCores + data["__nvmlDeviceGetNumGpuCores"] = <intptr_t>__nvmlDeviceGetNumGpuCores global __nvmlDeviceGetPowerSource - data["__nvmlDeviceGetPowerSource"] = <_cyb_intptr_t>__nvmlDeviceGetPowerSource + data["__nvmlDeviceGetPowerSource"] = <intptr_t>__nvmlDeviceGetPowerSource global __nvmlDeviceGetMemoryBusWidth - data["__nvmlDeviceGetMemoryBusWidth"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryBusWidth + data["__nvmlDeviceGetMemoryBusWidth"] = <intptr_t>__nvmlDeviceGetMemoryBusWidth global __nvmlDeviceGetPcieLinkMaxSpeed - data["__nvmlDeviceGetPcieLinkMaxSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetPcieLinkMaxSpeed + data["__nvmlDeviceGetPcieLinkMaxSpeed"] = <intptr_t>__nvmlDeviceGetPcieLinkMaxSpeed global __nvmlDeviceGetPcieSpeed - data["__nvmlDeviceGetPcieSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetPcieSpeed + data["__nvmlDeviceGetPcieSpeed"] = <intptr_t>__nvmlDeviceGetPcieSpeed global __nvmlDeviceGetAdaptiveClockInfoStatus - data["__nvmlDeviceGetAdaptiveClockInfoStatus"] = <_cyb_intptr_t>__nvmlDeviceGetAdaptiveClockInfoStatus + data["__nvmlDeviceGetAdaptiveClockInfoStatus"] = <intptr_t>__nvmlDeviceGetAdaptiveClockInfoStatus global __nvmlDeviceGetBusType - data["__nvmlDeviceGetBusType"] = <_cyb_intptr_t>__nvmlDeviceGetBusType + data["__nvmlDeviceGetBusType"] = <intptr_t>__nvmlDeviceGetBusType global __nvmlDeviceGetGpuFabricInfoV - data["__nvmlDeviceGetGpuFabricInfoV"] = <_cyb_intptr_t>__nvmlDeviceGetGpuFabricInfoV + data["__nvmlDeviceGetGpuFabricInfoV"] = <intptr_t>__nvmlDeviceGetGpuFabricInfoV global __nvmlSystemGetConfComputeCapabilities - data["__nvmlSystemGetConfComputeCapabilities"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeCapabilities + data["__nvmlSystemGetConfComputeCapabilities"] = <intptr_t>__nvmlSystemGetConfComputeCapabilities global __nvmlSystemGetConfComputeState - data["__nvmlSystemGetConfComputeState"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeState + data["__nvmlSystemGetConfComputeState"] = <intptr_t>__nvmlSystemGetConfComputeState global __nvmlDeviceGetConfComputeMemSizeInfo - data["__nvmlDeviceGetConfComputeMemSizeInfo"] = <_cyb_intptr_t>__nvmlDeviceGetConfComputeMemSizeInfo + data["__nvmlDeviceGetConfComputeMemSizeInfo"] = <intptr_t>__nvmlDeviceGetConfComputeMemSizeInfo global __nvmlSystemGetConfComputeGpusReadyState - data["__nvmlSystemGetConfComputeGpusReadyState"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeGpusReadyState + data["__nvmlSystemGetConfComputeGpusReadyState"] = <intptr_t>__nvmlSystemGetConfComputeGpusReadyState global __nvmlDeviceGetConfComputeProtectedMemoryUsage - data["__nvmlDeviceGetConfComputeProtectedMemoryUsage"] = <_cyb_intptr_t>__nvmlDeviceGetConfComputeProtectedMemoryUsage + data["__nvmlDeviceGetConfComputeProtectedMemoryUsage"] = <intptr_t>__nvmlDeviceGetConfComputeProtectedMemoryUsage global __nvmlDeviceGetConfComputeGpuCertificate - data["__nvmlDeviceGetConfComputeGpuCertificate"] = <_cyb_intptr_t>__nvmlDeviceGetConfComputeGpuCertificate + data["__nvmlDeviceGetConfComputeGpuCertificate"] = <intptr_t>__nvmlDeviceGetConfComputeGpuCertificate global __nvmlDeviceGetConfComputeGpuAttestationReport - data["__nvmlDeviceGetConfComputeGpuAttestationReport"] = <_cyb_intptr_t>__nvmlDeviceGetConfComputeGpuAttestationReport + data["__nvmlDeviceGetConfComputeGpuAttestationReport"] = <intptr_t>__nvmlDeviceGetConfComputeGpuAttestationReport global __nvmlSystemGetConfComputeKeyRotationThresholdInfo - data["__nvmlSystemGetConfComputeKeyRotationThresholdInfo"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeKeyRotationThresholdInfo + data["__nvmlSystemGetConfComputeKeyRotationThresholdInfo"] = <intptr_t>__nvmlSystemGetConfComputeKeyRotationThresholdInfo global __nvmlDeviceSetConfComputeUnprotectedMemSize - data["__nvmlDeviceSetConfComputeUnprotectedMemSize"] = <_cyb_intptr_t>__nvmlDeviceSetConfComputeUnprotectedMemSize + data["__nvmlDeviceSetConfComputeUnprotectedMemSize"] = <intptr_t>__nvmlDeviceSetConfComputeUnprotectedMemSize global __nvmlSystemSetConfComputeGpusReadyState - data["__nvmlSystemSetConfComputeGpusReadyState"] = <_cyb_intptr_t>__nvmlSystemSetConfComputeGpusReadyState + data["__nvmlSystemSetConfComputeGpusReadyState"] = <intptr_t>__nvmlSystemSetConfComputeGpusReadyState global __nvmlSystemSetConfComputeKeyRotationThresholdInfo - data["__nvmlSystemSetConfComputeKeyRotationThresholdInfo"] = <_cyb_intptr_t>__nvmlSystemSetConfComputeKeyRotationThresholdInfo + data["__nvmlSystemSetConfComputeKeyRotationThresholdInfo"] = <intptr_t>__nvmlSystemSetConfComputeKeyRotationThresholdInfo global __nvmlSystemGetConfComputeSettings - data["__nvmlSystemGetConfComputeSettings"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeSettings + data["__nvmlSystemGetConfComputeSettings"] = <intptr_t>__nvmlSystemGetConfComputeSettings global __nvmlDeviceGetGspFirmwareVersion - data["__nvmlDeviceGetGspFirmwareVersion"] = <_cyb_intptr_t>__nvmlDeviceGetGspFirmwareVersion + data["__nvmlDeviceGetGspFirmwareVersion"] = <intptr_t>__nvmlDeviceGetGspFirmwareVersion global __nvmlDeviceGetGspFirmwareMode - data["__nvmlDeviceGetGspFirmwareMode"] = <_cyb_intptr_t>__nvmlDeviceGetGspFirmwareMode + data["__nvmlDeviceGetGspFirmwareMode"] = <intptr_t>__nvmlDeviceGetGspFirmwareMode global __nvmlDeviceGetSramEccErrorStatus - data["__nvmlDeviceGetSramEccErrorStatus"] = <_cyb_intptr_t>__nvmlDeviceGetSramEccErrorStatus + data["__nvmlDeviceGetSramEccErrorStatus"] = <intptr_t>__nvmlDeviceGetSramEccErrorStatus global __nvmlDeviceGetAccountingMode - data["__nvmlDeviceGetAccountingMode"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingMode + data["__nvmlDeviceGetAccountingMode"] = <intptr_t>__nvmlDeviceGetAccountingMode global __nvmlDeviceGetAccountingStats - data["__nvmlDeviceGetAccountingStats"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingStats + data["__nvmlDeviceGetAccountingStats"] = <intptr_t>__nvmlDeviceGetAccountingStats global __nvmlDeviceGetAccountingPids - data["__nvmlDeviceGetAccountingPids"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingPids + data["__nvmlDeviceGetAccountingPids"] = <intptr_t>__nvmlDeviceGetAccountingPids global __nvmlDeviceGetAccountingBufferSize - data["__nvmlDeviceGetAccountingBufferSize"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingBufferSize + data["__nvmlDeviceGetAccountingBufferSize"] = <intptr_t>__nvmlDeviceGetAccountingBufferSize global __nvmlDeviceGetRetiredPages - data["__nvmlDeviceGetRetiredPages"] = <_cyb_intptr_t>__nvmlDeviceGetRetiredPages + data["__nvmlDeviceGetRetiredPages"] = <intptr_t>__nvmlDeviceGetRetiredPages global __nvmlDeviceGetRetiredPages_v2 - data["__nvmlDeviceGetRetiredPages_v2"] = <_cyb_intptr_t>__nvmlDeviceGetRetiredPages_v2 + data["__nvmlDeviceGetRetiredPages_v2"] = <intptr_t>__nvmlDeviceGetRetiredPages_v2 global __nvmlDeviceGetRetiredPagesPendingStatus - data["__nvmlDeviceGetRetiredPagesPendingStatus"] = <_cyb_intptr_t>__nvmlDeviceGetRetiredPagesPendingStatus + data["__nvmlDeviceGetRetiredPagesPendingStatus"] = <intptr_t>__nvmlDeviceGetRetiredPagesPendingStatus global __nvmlDeviceGetRemappedRows - data["__nvmlDeviceGetRemappedRows"] = <_cyb_intptr_t>__nvmlDeviceGetRemappedRows + data["__nvmlDeviceGetRemappedRows"] = <intptr_t>__nvmlDeviceGetRemappedRows global __nvmlDeviceGetRowRemapperHistogram - data["__nvmlDeviceGetRowRemapperHistogram"] = <_cyb_intptr_t>__nvmlDeviceGetRowRemapperHistogram + data["__nvmlDeviceGetRowRemapperHistogram"] = <intptr_t>__nvmlDeviceGetRowRemapperHistogram global __nvmlDeviceGetArchitecture - data["__nvmlDeviceGetArchitecture"] = <_cyb_intptr_t>__nvmlDeviceGetArchitecture + data["__nvmlDeviceGetArchitecture"] = <intptr_t>__nvmlDeviceGetArchitecture global __nvmlDeviceGetClkMonStatus - data["__nvmlDeviceGetClkMonStatus"] = <_cyb_intptr_t>__nvmlDeviceGetClkMonStatus + data["__nvmlDeviceGetClkMonStatus"] = <intptr_t>__nvmlDeviceGetClkMonStatus global __nvmlDeviceGetProcessUtilization - data["__nvmlDeviceGetProcessUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetProcessUtilization + data["__nvmlDeviceGetProcessUtilization"] = <intptr_t>__nvmlDeviceGetProcessUtilization global __nvmlDeviceGetProcessesUtilizationInfo - data["__nvmlDeviceGetProcessesUtilizationInfo"] = <_cyb_intptr_t>__nvmlDeviceGetProcessesUtilizationInfo + data["__nvmlDeviceGetProcessesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetProcessesUtilizationInfo global __nvmlDeviceGetPlatformInfo - data["__nvmlDeviceGetPlatformInfo"] = <_cyb_intptr_t>__nvmlDeviceGetPlatformInfo + data["__nvmlDeviceGetPlatformInfo"] = <intptr_t>__nvmlDeviceGetPlatformInfo global __nvmlUnitSetLedState - data["__nvmlUnitSetLedState"] = <_cyb_intptr_t>__nvmlUnitSetLedState + data["__nvmlUnitSetLedState"] = <intptr_t>__nvmlUnitSetLedState global __nvmlDeviceSetPersistenceMode - data["__nvmlDeviceSetPersistenceMode"] = <_cyb_intptr_t>__nvmlDeviceSetPersistenceMode + data["__nvmlDeviceSetPersistenceMode"] = <intptr_t>__nvmlDeviceSetPersistenceMode global __nvmlDeviceSetComputeMode - data["__nvmlDeviceSetComputeMode"] = <_cyb_intptr_t>__nvmlDeviceSetComputeMode + data["__nvmlDeviceSetComputeMode"] = <intptr_t>__nvmlDeviceSetComputeMode global __nvmlDeviceSetEccMode - data["__nvmlDeviceSetEccMode"] = <_cyb_intptr_t>__nvmlDeviceSetEccMode + data["__nvmlDeviceSetEccMode"] = <intptr_t>__nvmlDeviceSetEccMode global __nvmlDeviceClearEccErrorCounts - data["__nvmlDeviceClearEccErrorCounts"] = <_cyb_intptr_t>__nvmlDeviceClearEccErrorCounts + data["__nvmlDeviceClearEccErrorCounts"] = <intptr_t>__nvmlDeviceClearEccErrorCounts global __nvmlDeviceSetDriverModel - data["__nvmlDeviceSetDriverModel"] = <_cyb_intptr_t>__nvmlDeviceSetDriverModel + data["__nvmlDeviceSetDriverModel"] = <intptr_t>__nvmlDeviceSetDriverModel global __nvmlDeviceSetGpuLockedClocks - data["__nvmlDeviceSetGpuLockedClocks"] = <_cyb_intptr_t>__nvmlDeviceSetGpuLockedClocks + data["__nvmlDeviceSetGpuLockedClocks"] = <intptr_t>__nvmlDeviceSetGpuLockedClocks global __nvmlDeviceResetGpuLockedClocks - data["__nvmlDeviceResetGpuLockedClocks"] = <_cyb_intptr_t>__nvmlDeviceResetGpuLockedClocks + data["__nvmlDeviceResetGpuLockedClocks"] = <intptr_t>__nvmlDeviceResetGpuLockedClocks global __nvmlDeviceSetMemoryLockedClocks - data["__nvmlDeviceSetMemoryLockedClocks"] = <_cyb_intptr_t>__nvmlDeviceSetMemoryLockedClocks + data["__nvmlDeviceSetMemoryLockedClocks"] = <intptr_t>__nvmlDeviceSetMemoryLockedClocks global __nvmlDeviceResetMemoryLockedClocks - data["__nvmlDeviceResetMemoryLockedClocks"] = <_cyb_intptr_t>__nvmlDeviceResetMemoryLockedClocks + data["__nvmlDeviceResetMemoryLockedClocks"] = <intptr_t>__nvmlDeviceResetMemoryLockedClocks global __nvmlDeviceSetAutoBoostedClocksEnabled - data["__nvmlDeviceSetAutoBoostedClocksEnabled"] = <_cyb_intptr_t>__nvmlDeviceSetAutoBoostedClocksEnabled + data["__nvmlDeviceSetAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceSetAutoBoostedClocksEnabled global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled - data["__nvmlDeviceSetDefaultAutoBoostedClocksEnabled"] = <_cyb_intptr_t>__nvmlDeviceSetDefaultAutoBoostedClocksEnabled + data["__nvmlDeviceSetDefaultAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceSetDefaultAutoBoostedClocksEnabled global __nvmlDeviceSetDefaultFanSpeed_v2 - data["__nvmlDeviceSetDefaultFanSpeed_v2"] = <_cyb_intptr_t>__nvmlDeviceSetDefaultFanSpeed_v2 + data["__nvmlDeviceSetDefaultFanSpeed_v2"] = <intptr_t>__nvmlDeviceSetDefaultFanSpeed_v2 global __nvmlDeviceSetFanControlPolicy - data["__nvmlDeviceSetFanControlPolicy"] = <_cyb_intptr_t>__nvmlDeviceSetFanControlPolicy + data["__nvmlDeviceSetFanControlPolicy"] = <intptr_t>__nvmlDeviceSetFanControlPolicy global __nvmlDeviceSetTemperatureThreshold - data["__nvmlDeviceSetTemperatureThreshold"] = <_cyb_intptr_t>__nvmlDeviceSetTemperatureThreshold + data["__nvmlDeviceSetTemperatureThreshold"] = <intptr_t>__nvmlDeviceSetTemperatureThreshold global __nvmlDeviceSetGpuOperationMode - data["__nvmlDeviceSetGpuOperationMode"] = <_cyb_intptr_t>__nvmlDeviceSetGpuOperationMode + data["__nvmlDeviceSetGpuOperationMode"] = <intptr_t>__nvmlDeviceSetGpuOperationMode global __nvmlDeviceSetAPIRestriction - data["__nvmlDeviceSetAPIRestriction"] = <_cyb_intptr_t>__nvmlDeviceSetAPIRestriction + data["__nvmlDeviceSetAPIRestriction"] = <intptr_t>__nvmlDeviceSetAPIRestriction global __nvmlDeviceSetFanSpeed_v2 - data["__nvmlDeviceSetFanSpeed_v2"] = <_cyb_intptr_t>__nvmlDeviceSetFanSpeed_v2 + data["__nvmlDeviceSetFanSpeed_v2"] = <intptr_t>__nvmlDeviceSetFanSpeed_v2 global __nvmlDeviceSetAccountingMode - data["__nvmlDeviceSetAccountingMode"] = <_cyb_intptr_t>__nvmlDeviceSetAccountingMode + data["__nvmlDeviceSetAccountingMode"] = <intptr_t>__nvmlDeviceSetAccountingMode global __nvmlDeviceClearAccountingPids - data["__nvmlDeviceClearAccountingPids"] = <_cyb_intptr_t>__nvmlDeviceClearAccountingPids + data["__nvmlDeviceClearAccountingPids"] = <intptr_t>__nvmlDeviceClearAccountingPids global __nvmlDeviceSetPowerManagementLimit_v2 - data["__nvmlDeviceSetPowerManagementLimit_v2"] = <_cyb_intptr_t>__nvmlDeviceSetPowerManagementLimit_v2 + data["__nvmlDeviceSetPowerManagementLimit_v2"] = <intptr_t>__nvmlDeviceSetPowerManagementLimit_v2 global __nvmlDeviceGetNvLinkState - data["__nvmlDeviceGetNvLinkState"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkState + data["__nvmlDeviceGetNvLinkState"] = <intptr_t>__nvmlDeviceGetNvLinkState global __nvmlDeviceGetNvLinkVersion - data["__nvmlDeviceGetNvLinkVersion"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkVersion + data["__nvmlDeviceGetNvLinkVersion"] = <intptr_t>__nvmlDeviceGetNvLinkVersion global __nvmlDeviceGetNvLinkCapability - data["__nvmlDeviceGetNvLinkCapability"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkCapability + data["__nvmlDeviceGetNvLinkCapability"] = <intptr_t>__nvmlDeviceGetNvLinkCapability global __nvmlDeviceGetNvLinkRemotePciInfo_v2 - data["__nvmlDeviceGetNvLinkRemotePciInfo_v2"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkRemotePciInfo_v2 + data["__nvmlDeviceGetNvLinkRemotePciInfo_v2"] = <intptr_t>__nvmlDeviceGetNvLinkRemotePciInfo_v2 global __nvmlDeviceGetNvLinkErrorCounter - data["__nvmlDeviceGetNvLinkErrorCounter"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkErrorCounter + data["__nvmlDeviceGetNvLinkErrorCounter"] = <intptr_t>__nvmlDeviceGetNvLinkErrorCounter global __nvmlDeviceResetNvLinkErrorCounters - data["__nvmlDeviceResetNvLinkErrorCounters"] = <_cyb_intptr_t>__nvmlDeviceResetNvLinkErrorCounters + data["__nvmlDeviceResetNvLinkErrorCounters"] = <intptr_t>__nvmlDeviceResetNvLinkErrorCounters global __nvmlDeviceGetNvLinkRemoteDeviceType - data["__nvmlDeviceGetNvLinkRemoteDeviceType"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkRemoteDeviceType + data["__nvmlDeviceGetNvLinkRemoteDeviceType"] = <intptr_t>__nvmlDeviceGetNvLinkRemoteDeviceType global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold - data["__nvmlDeviceSetNvLinkDeviceLowPowerThreshold"] = <_cyb_intptr_t>__nvmlDeviceSetNvLinkDeviceLowPowerThreshold + data["__nvmlDeviceSetNvLinkDeviceLowPowerThreshold"] = <intptr_t>__nvmlDeviceSetNvLinkDeviceLowPowerThreshold global __nvmlSystemSetNvlinkBwMode - data["__nvmlSystemSetNvlinkBwMode"] = <_cyb_intptr_t>__nvmlSystemSetNvlinkBwMode + data["__nvmlSystemSetNvlinkBwMode"] = <intptr_t>__nvmlSystemSetNvlinkBwMode global __nvmlSystemGetNvlinkBwMode - data["__nvmlSystemGetNvlinkBwMode"] = <_cyb_intptr_t>__nvmlSystemGetNvlinkBwMode + data["__nvmlSystemGetNvlinkBwMode"] = <intptr_t>__nvmlSystemGetNvlinkBwMode global __nvmlDeviceGetNvlinkSupportedBwModes - data["__nvmlDeviceGetNvlinkSupportedBwModes"] = <_cyb_intptr_t>__nvmlDeviceGetNvlinkSupportedBwModes + data["__nvmlDeviceGetNvlinkSupportedBwModes"] = <intptr_t>__nvmlDeviceGetNvlinkSupportedBwModes global __nvmlDeviceGetNvlinkBwMode - data["__nvmlDeviceGetNvlinkBwMode"] = <_cyb_intptr_t>__nvmlDeviceGetNvlinkBwMode + data["__nvmlDeviceGetNvlinkBwMode"] = <intptr_t>__nvmlDeviceGetNvlinkBwMode global __nvmlDeviceSetNvlinkBwMode - data["__nvmlDeviceSetNvlinkBwMode"] = <_cyb_intptr_t>__nvmlDeviceSetNvlinkBwMode + data["__nvmlDeviceSetNvlinkBwMode"] = <intptr_t>__nvmlDeviceSetNvlinkBwMode global __nvmlEventSetCreate - data["__nvmlEventSetCreate"] = <_cyb_intptr_t>__nvmlEventSetCreate + data["__nvmlEventSetCreate"] = <intptr_t>__nvmlEventSetCreate global __nvmlDeviceRegisterEvents - data["__nvmlDeviceRegisterEvents"] = <_cyb_intptr_t>__nvmlDeviceRegisterEvents + data["__nvmlDeviceRegisterEvents"] = <intptr_t>__nvmlDeviceRegisterEvents global __nvmlDeviceGetSupportedEventTypes - data["__nvmlDeviceGetSupportedEventTypes"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedEventTypes + data["__nvmlDeviceGetSupportedEventTypes"] = <intptr_t>__nvmlDeviceGetSupportedEventTypes global __nvmlEventSetWait_v2 - data["__nvmlEventSetWait_v2"] = <_cyb_intptr_t>__nvmlEventSetWait_v2 + data["__nvmlEventSetWait_v2"] = <intptr_t>__nvmlEventSetWait_v2 global __nvmlEventSetFree - data["__nvmlEventSetFree"] = <_cyb_intptr_t>__nvmlEventSetFree + data["__nvmlEventSetFree"] = <intptr_t>__nvmlEventSetFree global __nvmlSystemEventSetCreate - data["__nvmlSystemEventSetCreate"] = <_cyb_intptr_t>__nvmlSystemEventSetCreate + data["__nvmlSystemEventSetCreate"] = <intptr_t>__nvmlSystemEventSetCreate global __nvmlSystemEventSetFree - data["__nvmlSystemEventSetFree"] = <_cyb_intptr_t>__nvmlSystemEventSetFree + data["__nvmlSystemEventSetFree"] = <intptr_t>__nvmlSystemEventSetFree global __nvmlSystemRegisterEvents - data["__nvmlSystemRegisterEvents"] = <_cyb_intptr_t>__nvmlSystemRegisterEvents + data["__nvmlSystemRegisterEvents"] = <intptr_t>__nvmlSystemRegisterEvents global __nvmlSystemEventSetWait - data["__nvmlSystemEventSetWait"] = <_cyb_intptr_t>__nvmlSystemEventSetWait + data["__nvmlSystemEventSetWait"] = <intptr_t>__nvmlSystemEventSetWait global __nvmlDeviceModifyDrainState - data["__nvmlDeviceModifyDrainState"] = <_cyb_intptr_t>__nvmlDeviceModifyDrainState + data["__nvmlDeviceModifyDrainState"] = <intptr_t>__nvmlDeviceModifyDrainState global __nvmlDeviceQueryDrainState - data["__nvmlDeviceQueryDrainState"] = <_cyb_intptr_t>__nvmlDeviceQueryDrainState + data["__nvmlDeviceQueryDrainState"] = <intptr_t>__nvmlDeviceQueryDrainState global __nvmlDeviceRemoveGpu_v2 - data["__nvmlDeviceRemoveGpu_v2"] = <_cyb_intptr_t>__nvmlDeviceRemoveGpu_v2 + data["__nvmlDeviceRemoveGpu_v2"] = <intptr_t>__nvmlDeviceRemoveGpu_v2 global __nvmlDeviceDiscoverGpus - data["__nvmlDeviceDiscoverGpus"] = <_cyb_intptr_t>__nvmlDeviceDiscoverGpus + data["__nvmlDeviceDiscoverGpus"] = <intptr_t>__nvmlDeviceDiscoverGpus global __nvmlDeviceGetFieldValues - data["__nvmlDeviceGetFieldValues"] = <_cyb_intptr_t>__nvmlDeviceGetFieldValues + data["__nvmlDeviceGetFieldValues"] = <intptr_t>__nvmlDeviceGetFieldValues global __nvmlDeviceClearFieldValues - data["__nvmlDeviceClearFieldValues"] = <_cyb_intptr_t>__nvmlDeviceClearFieldValues + data["__nvmlDeviceClearFieldValues"] = <intptr_t>__nvmlDeviceClearFieldValues global __nvmlDeviceGetVirtualizationMode - data["__nvmlDeviceGetVirtualizationMode"] = <_cyb_intptr_t>__nvmlDeviceGetVirtualizationMode + data["__nvmlDeviceGetVirtualizationMode"] = <intptr_t>__nvmlDeviceGetVirtualizationMode global __nvmlDeviceGetHostVgpuMode - data["__nvmlDeviceGetHostVgpuMode"] = <_cyb_intptr_t>__nvmlDeviceGetHostVgpuMode + data["__nvmlDeviceGetHostVgpuMode"] = <intptr_t>__nvmlDeviceGetHostVgpuMode global __nvmlDeviceSetVirtualizationMode - data["__nvmlDeviceSetVirtualizationMode"] = <_cyb_intptr_t>__nvmlDeviceSetVirtualizationMode + data["__nvmlDeviceSetVirtualizationMode"] = <intptr_t>__nvmlDeviceSetVirtualizationMode global __nvmlDeviceGetVgpuHeterogeneousMode - data["__nvmlDeviceGetVgpuHeterogeneousMode"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuHeterogeneousMode + data["__nvmlDeviceGetVgpuHeterogeneousMode"] = <intptr_t>__nvmlDeviceGetVgpuHeterogeneousMode global __nvmlDeviceSetVgpuHeterogeneousMode - data["__nvmlDeviceSetVgpuHeterogeneousMode"] = <_cyb_intptr_t>__nvmlDeviceSetVgpuHeterogeneousMode + data["__nvmlDeviceSetVgpuHeterogeneousMode"] = <intptr_t>__nvmlDeviceSetVgpuHeterogeneousMode global __nvmlVgpuInstanceGetPlacementId - data["__nvmlVgpuInstanceGetPlacementId"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetPlacementId + data["__nvmlVgpuInstanceGetPlacementId"] = <intptr_t>__nvmlVgpuInstanceGetPlacementId global __nvmlDeviceGetVgpuTypeSupportedPlacements - data["__nvmlDeviceGetVgpuTypeSupportedPlacements"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuTypeSupportedPlacements + data["__nvmlDeviceGetVgpuTypeSupportedPlacements"] = <intptr_t>__nvmlDeviceGetVgpuTypeSupportedPlacements global __nvmlDeviceGetVgpuTypeCreatablePlacements - data["__nvmlDeviceGetVgpuTypeCreatablePlacements"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuTypeCreatablePlacements + data["__nvmlDeviceGetVgpuTypeCreatablePlacements"] = <intptr_t>__nvmlDeviceGetVgpuTypeCreatablePlacements global __nvmlVgpuTypeGetGspHeapSize - data["__nvmlVgpuTypeGetGspHeapSize"] = <_cyb_intptr_t>__nvmlVgpuTypeGetGspHeapSize + data["__nvmlVgpuTypeGetGspHeapSize"] = <intptr_t>__nvmlVgpuTypeGetGspHeapSize global __nvmlVgpuTypeGetFbReservation - data["__nvmlVgpuTypeGetFbReservation"] = <_cyb_intptr_t>__nvmlVgpuTypeGetFbReservation + data["__nvmlVgpuTypeGetFbReservation"] = <intptr_t>__nvmlVgpuTypeGetFbReservation global __nvmlVgpuInstanceGetRuntimeStateSize - data["__nvmlVgpuInstanceGetRuntimeStateSize"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetRuntimeStateSize + data["__nvmlVgpuInstanceGetRuntimeStateSize"] = <intptr_t>__nvmlVgpuInstanceGetRuntimeStateSize global __nvmlDeviceSetVgpuCapabilities - data["__nvmlDeviceSetVgpuCapabilities"] = <_cyb_intptr_t>__nvmlDeviceSetVgpuCapabilities + data["__nvmlDeviceSetVgpuCapabilities"] = <intptr_t>__nvmlDeviceSetVgpuCapabilities global __nvmlDeviceGetGridLicensableFeatures_v4 - data["__nvmlDeviceGetGridLicensableFeatures_v4"] = <_cyb_intptr_t>__nvmlDeviceGetGridLicensableFeatures_v4 + data["__nvmlDeviceGetGridLicensableFeatures_v4"] = <intptr_t>__nvmlDeviceGetGridLicensableFeatures_v4 global __nvmlGetVgpuDriverCapabilities - data["__nvmlGetVgpuDriverCapabilities"] = <_cyb_intptr_t>__nvmlGetVgpuDriverCapabilities + data["__nvmlGetVgpuDriverCapabilities"] = <intptr_t>__nvmlGetVgpuDriverCapabilities global __nvmlDeviceGetVgpuCapabilities - data["__nvmlDeviceGetVgpuCapabilities"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuCapabilities + data["__nvmlDeviceGetVgpuCapabilities"] = <intptr_t>__nvmlDeviceGetVgpuCapabilities global __nvmlDeviceGetSupportedVgpus - data["__nvmlDeviceGetSupportedVgpus"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedVgpus + data["__nvmlDeviceGetSupportedVgpus"] = <intptr_t>__nvmlDeviceGetSupportedVgpus global __nvmlDeviceGetCreatableVgpus - data["__nvmlDeviceGetCreatableVgpus"] = <_cyb_intptr_t>__nvmlDeviceGetCreatableVgpus + data["__nvmlDeviceGetCreatableVgpus"] = <intptr_t>__nvmlDeviceGetCreatableVgpus global __nvmlVgpuTypeGetClass - data["__nvmlVgpuTypeGetClass"] = <_cyb_intptr_t>__nvmlVgpuTypeGetClass + data["__nvmlVgpuTypeGetClass"] = <intptr_t>__nvmlVgpuTypeGetClass global __nvmlVgpuTypeGetName - data["__nvmlVgpuTypeGetName"] = <_cyb_intptr_t>__nvmlVgpuTypeGetName + data["__nvmlVgpuTypeGetName"] = <intptr_t>__nvmlVgpuTypeGetName global __nvmlVgpuTypeGetGpuInstanceProfileId - data["__nvmlVgpuTypeGetGpuInstanceProfileId"] = <_cyb_intptr_t>__nvmlVgpuTypeGetGpuInstanceProfileId + data["__nvmlVgpuTypeGetGpuInstanceProfileId"] = <intptr_t>__nvmlVgpuTypeGetGpuInstanceProfileId global __nvmlVgpuTypeGetDeviceID - data["__nvmlVgpuTypeGetDeviceID"] = <_cyb_intptr_t>__nvmlVgpuTypeGetDeviceID + data["__nvmlVgpuTypeGetDeviceID"] = <intptr_t>__nvmlVgpuTypeGetDeviceID global __nvmlVgpuTypeGetFramebufferSize - data["__nvmlVgpuTypeGetFramebufferSize"] = <_cyb_intptr_t>__nvmlVgpuTypeGetFramebufferSize + data["__nvmlVgpuTypeGetFramebufferSize"] = <intptr_t>__nvmlVgpuTypeGetFramebufferSize global __nvmlVgpuTypeGetNumDisplayHeads - data["__nvmlVgpuTypeGetNumDisplayHeads"] = <_cyb_intptr_t>__nvmlVgpuTypeGetNumDisplayHeads + data["__nvmlVgpuTypeGetNumDisplayHeads"] = <intptr_t>__nvmlVgpuTypeGetNumDisplayHeads global __nvmlVgpuTypeGetResolution - data["__nvmlVgpuTypeGetResolution"] = <_cyb_intptr_t>__nvmlVgpuTypeGetResolution + data["__nvmlVgpuTypeGetResolution"] = <intptr_t>__nvmlVgpuTypeGetResolution global __nvmlVgpuTypeGetLicense - data["__nvmlVgpuTypeGetLicense"] = <_cyb_intptr_t>__nvmlVgpuTypeGetLicense + data["__nvmlVgpuTypeGetLicense"] = <intptr_t>__nvmlVgpuTypeGetLicense global __nvmlVgpuTypeGetFrameRateLimit - data["__nvmlVgpuTypeGetFrameRateLimit"] = <_cyb_intptr_t>__nvmlVgpuTypeGetFrameRateLimit + data["__nvmlVgpuTypeGetFrameRateLimit"] = <intptr_t>__nvmlVgpuTypeGetFrameRateLimit global __nvmlVgpuTypeGetMaxInstances - data["__nvmlVgpuTypeGetMaxInstances"] = <_cyb_intptr_t>__nvmlVgpuTypeGetMaxInstances + data["__nvmlVgpuTypeGetMaxInstances"] = <intptr_t>__nvmlVgpuTypeGetMaxInstances global __nvmlVgpuTypeGetMaxInstancesPerVm - data["__nvmlVgpuTypeGetMaxInstancesPerVm"] = <_cyb_intptr_t>__nvmlVgpuTypeGetMaxInstancesPerVm + data["__nvmlVgpuTypeGetMaxInstancesPerVm"] = <intptr_t>__nvmlVgpuTypeGetMaxInstancesPerVm global __nvmlVgpuTypeGetBAR1Info - data["__nvmlVgpuTypeGetBAR1Info"] = <_cyb_intptr_t>__nvmlVgpuTypeGetBAR1Info + data["__nvmlVgpuTypeGetBAR1Info"] = <intptr_t>__nvmlVgpuTypeGetBAR1Info global __nvmlDeviceGetActiveVgpus - data["__nvmlDeviceGetActiveVgpus"] = <_cyb_intptr_t>__nvmlDeviceGetActiveVgpus + data["__nvmlDeviceGetActiveVgpus"] = <intptr_t>__nvmlDeviceGetActiveVgpus global __nvmlVgpuInstanceGetVmID - data["__nvmlVgpuInstanceGetVmID"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetVmID + data["__nvmlVgpuInstanceGetVmID"] = <intptr_t>__nvmlVgpuInstanceGetVmID global __nvmlVgpuInstanceGetUUID - data["__nvmlVgpuInstanceGetUUID"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetUUID + data["__nvmlVgpuInstanceGetUUID"] = <intptr_t>__nvmlVgpuInstanceGetUUID global __nvmlVgpuInstanceGetVmDriverVersion - data["__nvmlVgpuInstanceGetVmDriverVersion"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetVmDriverVersion + data["__nvmlVgpuInstanceGetVmDriverVersion"] = <intptr_t>__nvmlVgpuInstanceGetVmDriverVersion global __nvmlVgpuInstanceGetFbUsage - data["__nvmlVgpuInstanceGetFbUsage"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetFbUsage + data["__nvmlVgpuInstanceGetFbUsage"] = <intptr_t>__nvmlVgpuInstanceGetFbUsage global __nvmlVgpuInstanceGetLicenseStatus - data["__nvmlVgpuInstanceGetLicenseStatus"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetLicenseStatus + data["__nvmlVgpuInstanceGetLicenseStatus"] = <intptr_t>__nvmlVgpuInstanceGetLicenseStatus global __nvmlVgpuInstanceGetType - data["__nvmlVgpuInstanceGetType"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetType + data["__nvmlVgpuInstanceGetType"] = <intptr_t>__nvmlVgpuInstanceGetType global __nvmlVgpuInstanceGetFrameRateLimit - data["__nvmlVgpuInstanceGetFrameRateLimit"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetFrameRateLimit + data["__nvmlVgpuInstanceGetFrameRateLimit"] = <intptr_t>__nvmlVgpuInstanceGetFrameRateLimit global __nvmlVgpuInstanceGetEccMode - data["__nvmlVgpuInstanceGetEccMode"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetEccMode + data["__nvmlVgpuInstanceGetEccMode"] = <intptr_t>__nvmlVgpuInstanceGetEccMode global __nvmlVgpuInstanceGetEncoderCapacity - data["__nvmlVgpuInstanceGetEncoderCapacity"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetEncoderCapacity + data["__nvmlVgpuInstanceGetEncoderCapacity"] = <intptr_t>__nvmlVgpuInstanceGetEncoderCapacity global __nvmlVgpuInstanceSetEncoderCapacity - data["__nvmlVgpuInstanceSetEncoderCapacity"] = <_cyb_intptr_t>__nvmlVgpuInstanceSetEncoderCapacity + data["__nvmlVgpuInstanceSetEncoderCapacity"] = <intptr_t>__nvmlVgpuInstanceSetEncoderCapacity global __nvmlVgpuInstanceGetEncoderStats - data["__nvmlVgpuInstanceGetEncoderStats"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetEncoderStats + data["__nvmlVgpuInstanceGetEncoderStats"] = <intptr_t>__nvmlVgpuInstanceGetEncoderStats global __nvmlVgpuInstanceGetEncoderSessions - data["__nvmlVgpuInstanceGetEncoderSessions"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetEncoderSessions + data["__nvmlVgpuInstanceGetEncoderSessions"] = <intptr_t>__nvmlVgpuInstanceGetEncoderSessions global __nvmlVgpuInstanceGetFBCStats - data["__nvmlVgpuInstanceGetFBCStats"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetFBCStats + data["__nvmlVgpuInstanceGetFBCStats"] = <intptr_t>__nvmlVgpuInstanceGetFBCStats global __nvmlVgpuInstanceGetFBCSessions - data["__nvmlVgpuInstanceGetFBCSessions"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetFBCSessions + data["__nvmlVgpuInstanceGetFBCSessions"] = <intptr_t>__nvmlVgpuInstanceGetFBCSessions global __nvmlVgpuInstanceGetGpuInstanceId - data["__nvmlVgpuInstanceGetGpuInstanceId"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetGpuInstanceId + data["__nvmlVgpuInstanceGetGpuInstanceId"] = <intptr_t>__nvmlVgpuInstanceGetGpuInstanceId global __nvmlVgpuInstanceGetGpuPciId - data["__nvmlVgpuInstanceGetGpuPciId"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetGpuPciId + data["__nvmlVgpuInstanceGetGpuPciId"] = <intptr_t>__nvmlVgpuInstanceGetGpuPciId global __nvmlVgpuTypeGetCapabilities - data["__nvmlVgpuTypeGetCapabilities"] = <_cyb_intptr_t>__nvmlVgpuTypeGetCapabilities + data["__nvmlVgpuTypeGetCapabilities"] = <intptr_t>__nvmlVgpuTypeGetCapabilities global __nvmlVgpuInstanceGetMdevUUID - data["__nvmlVgpuInstanceGetMdevUUID"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetMdevUUID + data["__nvmlVgpuInstanceGetMdevUUID"] = <intptr_t>__nvmlVgpuInstanceGetMdevUUID global __nvmlGpuInstanceGetCreatableVgpus - data["__nvmlGpuInstanceGetCreatableVgpus"] = <_cyb_intptr_t>__nvmlGpuInstanceGetCreatableVgpus + data["__nvmlGpuInstanceGetCreatableVgpus"] = <intptr_t>__nvmlGpuInstanceGetCreatableVgpus global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance - data["__nvmlVgpuTypeGetMaxInstancesPerGpuInstance"] = <_cyb_intptr_t>__nvmlVgpuTypeGetMaxInstancesPerGpuInstance + data["__nvmlVgpuTypeGetMaxInstancesPerGpuInstance"] = <intptr_t>__nvmlVgpuTypeGetMaxInstancesPerGpuInstance global __nvmlGpuInstanceGetActiveVgpus - data["__nvmlGpuInstanceGetActiveVgpus"] = <_cyb_intptr_t>__nvmlGpuInstanceGetActiveVgpus + data["__nvmlGpuInstanceGetActiveVgpus"] = <intptr_t>__nvmlGpuInstanceGetActiveVgpus global __nvmlGpuInstanceSetVgpuSchedulerState - data["__nvmlGpuInstanceSetVgpuSchedulerState"] = <_cyb_intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState + data["__nvmlGpuInstanceSetVgpuSchedulerState"] = <intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState global __nvmlGpuInstanceGetVgpuSchedulerState - data["__nvmlGpuInstanceGetVgpuSchedulerState"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState + data["__nvmlGpuInstanceGetVgpuSchedulerState"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState global __nvmlGpuInstanceGetVgpuSchedulerLog - data["__nvmlGpuInstanceGetVgpuSchedulerLog"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog + data["__nvmlGpuInstanceGetVgpuSchedulerLog"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements - data["__nvmlGpuInstanceGetVgpuTypeCreatablePlacements"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuTypeCreatablePlacements + data["__nvmlGpuInstanceGetVgpuTypeCreatablePlacements"] = <intptr_t>__nvmlGpuInstanceGetVgpuTypeCreatablePlacements global __nvmlGpuInstanceGetVgpuHeterogeneousMode - data["__nvmlGpuInstanceGetVgpuHeterogeneousMode"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuHeterogeneousMode + data["__nvmlGpuInstanceGetVgpuHeterogeneousMode"] = <intptr_t>__nvmlGpuInstanceGetVgpuHeterogeneousMode global __nvmlGpuInstanceSetVgpuHeterogeneousMode - data["__nvmlGpuInstanceSetVgpuHeterogeneousMode"] = <_cyb_intptr_t>__nvmlGpuInstanceSetVgpuHeterogeneousMode + data["__nvmlGpuInstanceSetVgpuHeterogeneousMode"] = <intptr_t>__nvmlGpuInstanceSetVgpuHeterogeneousMode global __nvmlVgpuInstanceGetMetadata - data["__nvmlVgpuInstanceGetMetadata"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetMetadata + data["__nvmlVgpuInstanceGetMetadata"] = <intptr_t>__nvmlVgpuInstanceGetMetadata global __nvmlDeviceGetVgpuMetadata - data["__nvmlDeviceGetVgpuMetadata"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuMetadata + data["__nvmlDeviceGetVgpuMetadata"] = <intptr_t>__nvmlDeviceGetVgpuMetadata global __nvmlGetVgpuCompatibility - data["__nvmlGetVgpuCompatibility"] = <_cyb_intptr_t>__nvmlGetVgpuCompatibility + data["__nvmlGetVgpuCompatibility"] = <intptr_t>__nvmlGetVgpuCompatibility global __nvmlDeviceGetPgpuMetadataString - data["__nvmlDeviceGetPgpuMetadataString"] = <_cyb_intptr_t>__nvmlDeviceGetPgpuMetadataString + data["__nvmlDeviceGetPgpuMetadataString"] = <intptr_t>__nvmlDeviceGetPgpuMetadataString global __nvmlDeviceGetVgpuSchedulerLog - data["__nvmlDeviceGetVgpuSchedulerLog"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerLog + data["__nvmlDeviceGetVgpuSchedulerLog"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerLog global __nvmlDeviceGetVgpuSchedulerState - data["__nvmlDeviceGetVgpuSchedulerState"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerState + data["__nvmlDeviceGetVgpuSchedulerState"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerState global __nvmlDeviceGetVgpuSchedulerCapabilities - data["__nvmlDeviceGetVgpuSchedulerCapabilities"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerCapabilities + data["__nvmlDeviceGetVgpuSchedulerCapabilities"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerCapabilities global __nvmlDeviceSetVgpuSchedulerState - data["__nvmlDeviceSetVgpuSchedulerState"] = <_cyb_intptr_t>__nvmlDeviceSetVgpuSchedulerState + data["__nvmlDeviceSetVgpuSchedulerState"] = <intptr_t>__nvmlDeviceSetVgpuSchedulerState global __nvmlGetVgpuVersion - data["__nvmlGetVgpuVersion"] = <_cyb_intptr_t>__nvmlGetVgpuVersion + data["__nvmlGetVgpuVersion"] = <intptr_t>__nvmlGetVgpuVersion global __nvmlSetVgpuVersion - data["__nvmlSetVgpuVersion"] = <_cyb_intptr_t>__nvmlSetVgpuVersion + data["__nvmlSetVgpuVersion"] = <intptr_t>__nvmlSetVgpuVersion global __nvmlDeviceGetVgpuUtilization - data["__nvmlDeviceGetVgpuUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuUtilization + data["__nvmlDeviceGetVgpuUtilization"] = <intptr_t>__nvmlDeviceGetVgpuUtilization global __nvmlDeviceGetVgpuInstancesUtilizationInfo - data["__nvmlDeviceGetVgpuInstancesUtilizationInfo"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuInstancesUtilizationInfo + data["__nvmlDeviceGetVgpuInstancesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetVgpuInstancesUtilizationInfo global __nvmlDeviceGetVgpuProcessUtilization - data["__nvmlDeviceGetVgpuProcessUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuProcessUtilization + data["__nvmlDeviceGetVgpuProcessUtilization"] = <intptr_t>__nvmlDeviceGetVgpuProcessUtilization global __nvmlDeviceGetVgpuProcessesUtilizationInfo - data["__nvmlDeviceGetVgpuProcessesUtilizationInfo"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuProcessesUtilizationInfo + data["__nvmlDeviceGetVgpuProcessesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetVgpuProcessesUtilizationInfo global __nvmlVgpuInstanceGetAccountingMode - data["__nvmlVgpuInstanceGetAccountingMode"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetAccountingMode + data["__nvmlVgpuInstanceGetAccountingMode"] = <intptr_t>__nvmlVgpuInstanceGetAccountingMode global __nvmlVgpuInstanceGetAccountingPids - data["__nvmlVgpuInstanceGetAccountingPids"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetAccountingPids + data["__nvmlVgpuInstanceGetAccountingPids"] = <intptr_t>__nvmlVgpuInstanceGetAccountingPids global __nvmlVgpuInstanceGetAccountingStats - data["__nvmlVgpuInstanceGetAccountingStats"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetAccountingStats + data["__nvmlVgpuInstanceGetAccountingStats"] = <intptr_t>__nvmlVgpuInstanceGetAccountingStats global __nvmlVgpuInstanceClearAccountingPids - data["__nvmlVgpuInstanceClearAccountingPids"] = <_cyb_intptr_t>__nvmlVgpuInstanceClearAccountingPids + data["__nvmlVgpuInstanceClearAccountingPids"] = <intptr_t>__nvmlVgpuInstanceClearAccountingPids global __nvmlVgpuInstanceGetLicenseInfo_v2 - data["__nvmlVgpuInstanceGetLicenseInfo_v2"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetLicenseInfo_v2 + data["__nvmlVgpuInstanceGetLicenseInfo_v2"] = <intptr_t>__nvmlVgpuInstanceGetLicenseInfo_v2 global __nvmlGetExcludedDeviceCount - data["__nvmlGetExcludedDeviceCount"] = <_cyb_intptr_t>__nvmlGetExcludedDeviceCount + data["__nvmlGetExcludedDeviceCount"] = <intptr_t>__nvmlGetExcludedDeviceCount global __nvmlGetExcludedDeviceInfoByIndex - data["__nvmlGetExcludedDeviceInfoByIndex"] = <_cyb_intptr_t>__nvmlGetExcludedDeviceInfoByIndex + data["__nvmlGetExcludedDeviceInfoByIndex"] = <intptr_t>__nvmlGetExcludedDeviceInfoByIndex global __nvmlDeviceSetMigMode - data["__nvmlDeviceSetMigMode"] = <_cyb_intptr_t>__nvmlDeviceSetMigMode + data["__nvmlDeviceSetMigMode"] = <intptr_t>__nvmlDeviceSetMigMode global __nvmlDeviceGetMigMode - data["__nvmlDeviceGetMigMode"] = <_cyb_intptr_t>__nvmlDeviceGetMigMode + data["__nvmlDeviceGetMigMode"] = <intptr_t>__nvmlDeviceGetMigMode global __nvmlDeviceGetGpuInstanceProfileInfoV - data["__nvmlDeviceGetGpuInstanceProfileInfoV"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoV + data["__nvmlDeviceGetGpuInstanceProfileInfoV"] = <intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoV global __nvmlDeviceGetGpuInstancePossiblePlacements_v2 - data["__nvmlDeviceGetGpuInstancePossiblePlacements_v2"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstancePossiblePlacements_v2 + data["__nvmlDeviceGetGpuInstancePossiblePlacements_v2"] = <intptr_t>__nvmlDeviceGetGpuInstancePossiblePlacements_v2 global __nvmlDeviceGetGpuInstanceRemainingCapacity - data["__nvmlDeviceGetGpuInstanceRemainingCapacity"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceRemainingCapacity + data["__nvmlDeviceGetGpuInstanceRemainingCapacity"] = <intptr_t>__nvmlDeviceGetGpuInstanceRemainingCapacity global __nvmlDeviceCreateGpuInstance - data["__nvmlDeviceCreateGpuInstance"] = <_cyb_intptr_t>__nvmlDeviceCreateGpuInstance + data["__nvmlDeviceCreateGpuInstance"] = <intptr_t>__nvmlDeviceCreateGpuInstance global __nvmlDeviceCreateGpuInstanceWithPlacement - data["__nvmlDeviceCreateGpuInstanceWithPlacement"] = <_cyb_intptr_t>__nvmlDeviceCreateGpuInstanceWithPlacement + data["__nvmlDeviceCreateGpuInstanceWithPlacement"] = <intptr_t>__nvmlDeviceCreateGpuInstanceWithPlacement global __nvmlGpuInstanceDestroy - data["__nvmlGpuInstanceDestroy"] = <_cyb_intptr_t>__nvmlGpuInstanceDestroy + data["__nvmlGpuInstanceDestroy"] = <intptr_t>__nvmlGpuInstanceDestroy global __nvmlDeviceGetGpuInstances - data["__nvmlDeviceGetGpuInstances"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstances + data["__nvmlDeviceGetGpuInstances"] = <intptr_t>__nvmlDeviceGetGpuInstances global __nvmlDeviceGetGpuInstanceById - data["__nvmlDeviceGetGpuInstanceById"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceById + data["__nvmlDeviceGetGpuInstanceById"] = <intptr_t>__nvmlDeviceGetGpuInstanceById global __nvmlGpuInstanceGetInfo - data["__nvmlGpuInstanceGetInfo"] = <_cyb_intptr_t>__nvmlGpuInstanceGetInfo + data["__nvmlGpuInstanceGetInfo"] = <intptr_t>__nvmlGpuInstanceGetInfo global __nvmlGpuInstanceGetComputeInstanceProfileInfoV - data["__nvmlGpuInstanceGetComputeInstanceProfileInfoV"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstanceProfileInfoV + data["__nvmlGpuInstanceGetComputeInstanceProfileInfoV"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceProfileInfoV global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity - data["__nvmlGpuInstanceGetComputeInstanceRemainingCapacity"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstanceRemainingCapacity + data["__nvmlGpuInstanceGetComputeInstanceRemainingCapacity"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceRemainingCapacity global __nvmlGpuInstanceGetComputeInstancePossiblePlacements - data["__nvmlGpuInstanceGetComputeInstancePossiblePlacements"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstancePossiblePlacements + data["__nvmlGpuInstanceGetComputeInstancePossiblePlacements"] = <intptr_t>__nvmlGpuInstanceGetComputeInstancePossiblePlacements global __nvmlGpuInstanceCreateComputeInstance - data["__nvmlGpuInstanceCreateComputeInstance"] = <_cyb_intptr_t>__nvmlGpuInstanceCreateComputeInstance + data["__nvmlGpuInstanceCreateComputeInstance"] = <intptr_t>__nvmlGpuInstanceCreateComputeInstance global __nvmlGpuInstanceCreateComputeInstanceWithPlacement - data["__nvmlGpuInstanceCreateComputeInstanceWithPlacement"] = <_cyb_intptr_t>__nvmlGpuInstanceCreateComputeInstanceWithPlacement + data["__nvmlGpuInstanceCreateComputeInstanceWithPlacement"] = <intptr_t>__nvmlGpuInstanceCreateComputeInstanceWithPlacement global __nvmlComputeInstanceDestroy - data["__nvmlComputeInstanceDestroy"] = <_cyb_intptr_t>__nvmlComputeInstanceDestroy + data["__nvmlComputeInstanceDestroy"] = <intptr_t>__nvmlComputeInstanceDestroy global __nvmlGpuInstanceGetComputeInstances - data["__nvmlGpuInstanceGetComputeInstances"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstances + data["__nvmlGpuInstanceGetComputeInstances"] = <intptr_t>__nvmlGpuInstanceGetComputeInstances global __nvmlGpuInstanceGetComputeInstanceById - data["__nvmlGpuInstanceGetComputeInstanceById"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstanceById + data["__nvmlGpuInstanceGetComputeInstanceById"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceById global __nvmlComputeInstanceGetInfo_v2 - data["__nvmlComputeInstanceGetInfo_v2"] = <_cyb_intptr_t>__nvmlComputeInstanceGetInfo_v2 + data["__nvmlComputeInstanceGetInfo_v2"] = <intptr_t>__nvmlComputeInstanceGetInfo_v2 global __nvmlDeviceIsMigDeviceHandle - data["__nvmlDeviceIsMigDeviceHandle"] = <_cyb_intptr_t>__nvmlDeviceIsMigDeviceHandle + data["__nvmlDeviceIsMigDeviceHandle"] = <intptr_t>__nvmlDeviceIsMigDeviceHandle global __nvmlDeviceGetGpuInstanceId - data["__nvmlDeviceGetGpuInstanceId"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceId + data["__nvmlDeviceGetGpuInstanceId"] = <intptr_t>__nvmlDeviceGetGpuInstanceId global __nvmlDeviceGetComputeInstanceId - data["__nvmlDeviceGetComputeInstanceId"] = <_cyb_intptr_t>__nvmlDeviceGetComputeInstanceId + data["__nvmlDeviceGetComputeInstanceId"] = <intptr_t>__nvmlDeviceGetComputeInstanceId global __nvmlDeviceGetMaxMigDeviceCount - data["__nvmlDeviceGetMaxMigDeviceCount"] = <_cyb_intptr_t>__nvmlDeviceGetMaxMigDeviceCount + data["__nvmlDeviceGetMaxMigDeviceCount"] = <intptr_t>__nvmlDeviceGetMaxMigDeviceCount global __nvmlDeviceGetMigDeviceHandleByIndex - data["__nvmlDeviceGetMigDeviceHandleByIndex"] = <_cyb_intptr_t>__nvmlDeviceGetMigDeviceHandleByIndex + data["__nvmlDeviceGetMigDeviceHandleByIndex"] = <intptr_t>__nvmlDeviceGetMigDeviceHandleByIndex global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle - data["__nvmlDeviceGetDeviceHandleFromMigDeviceHandle"] = <_cyb_intptr_t>__nvmlDeviceGetDeviceHandleFromMigDeviceHandle + data["__nvmlDeviceGetDeviceHandleFromMigDeviceHandle"] = <intptr_t>__nvmlDeviceGetDeviceHandleFromMigDeviceHandle global __nvmlDeviceGetCapabilities - data["__nvmlDeviceGetCapabilities"] = <_cyb_intptr_t>__nvmlDeviceGetCapabilities + data["__nvmlDeviceGetCapabilities"] = <intptr_t>__nvmlDeviceGetCapabilities global __nvmlDevicePowerSmoothingActivatePresetProfile - data["__nvmlDevicePowerSmoothingActivatePresetProfile"] = <_cyb_intptr_t>__nvmlDevicePowerSmoothingActivatePresetProfile + data["__nvmlDevicePowerSmoothingActivatePresetProfile"] = <intptr_t>__nvmlDevicePowerSmoothingActivatePresetProfile global __nvmlDevicePowerSmoothingUpdatePresetProfileParam - data["__nvmlDevicePowerSmoothingUpdatePresetProfileParam"] = <_cyb_intptr_t>__nvmlDevicePowerSmoothingUpdatePresetProfileParam + data["__nvmlDevicePowerSmoothingUpdatePresetProfileParam"] = <intptr_t>__nvmlDevicePowerSmoothingUpdatePresetProfileParam global __nvmlDevicePowerSmoothingSetState - data["__nvmlDevicePowerSmoothingSetState"] = <_cyb_intptr_t>__nvmlDevicePowerSmoothingSetState + data["__nvmlDevicePowerSmoothingSetState"] = <intptr_t>__nvmlDevicePowerSmoothingSetState global __nvmlDeviceGetAddressingMode - data["__nvmlDeviceGetAddressingMode"] = <_cyb_intptr_t>__nvmlDeviceGetAddressingMode + data["__nvmlDeviceGetAddressingMode"] = <intptr_t>__nvmlDeviceGetAddressingMode global __nvmlDeviceGetRepairStatus - data["__nvmlDeviceGetRepairStatus"] = <_cyb_intptr_t>__nvmlDeviceGetRepairStatus + data["__nvmlDeviceGetRepairStatus"] = <intptr_t>__nvmlDeviceGetRepairStatus global __nvmlDeviceGetPowerMizerMode_v1 - data["__nvmlDeviceGetPowerMizerMode_v1"] = <_cyb_intptr_t>__nvmlDeviceGetPowerMizerMode_v1 + data["__nvmlDeviceGetPowerMizerMode_v1"] = <intptr_t>__nvmlDeviceGetPowerMizerMode_v1 global __nvmlDeviceSetPowerMizerMode_v1 - data["__nvmlDeviceSetPowerMizerMode_v1"] = <_cyb_intptr_t>__nvmlDeviceSetPowerMizerMode_v1 + data["__nvmlDeviceSetPowerMizerMode_v1"] = <intptr_t>__nvmlDeviceSetPowerMizerMode_v1 global __nvmlDeviceGetPdi - data["__nvmlDeviceGetPdi"] = <_cyb_intptr_t>__nvmlDeviceGetPdi + data["__nvmlDeviceGetPdi"] = <intptr_t>__nvmlDeviceGetPdi global __nvmlDeviceSetHostname_v1 - data["__nvmlDeviceSetHostname_v1"] = <_cyb_intptr_t>__nvmlDeviceSetHostname_v1 + data["__nvmlDeviceSetHostname_v1"] = <intptr_t>__nvmlDeviceSetHostname_v1 global __nvmlDeviceGetHostname_v1 - data["__nvmlDeviceGetHostname_v1"] = <_cyb_intptr_t>__nvmlDeviceGetHostname_v1 + data["__nvmlDeviceGetHostname_v1"] = <intptr_t>__nvmlDeviceGetHostname_v1 global __nvmlDeviceGetNvLinkInfo - data["__nvmlDeviceGetNvLinkInfo"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkInfo + data["__nvmlDeviceGetNvLinkInfo"] = <intptr_t>__nvmlDeviceGetNvLinkInfo global __nvmlDeviceReadWritePRM_v1 - data["__nvmlDeviceReadWritePRM_v1"] = <_cyb_intptr_t>__nvmlDeviceReadWritePRM_v1 + data["__nvmlDeviceReadWritePRM_v1"] = <intptr_t>__nvmlDeviceReadWritePRM_v1 global __nvmlDeviceGetGpuInstanceProfileInfoByIdV - data["__nvmlDeviceGetGpuInstanceProfileInfoByIdV"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoByIdV + data["__nvmlDeviceGetGpuInstanceProfileInfoByIdV"] = <intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoByIdV global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts - data["__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts"] = <_cyb_intptr_t>__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + data["__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts"] = <intptr_t>__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts global __nvmlDeviceGetUnrepairableMemoryFlag_v1 - data["__nvmlDeviceGetUnrepairableMemoryFlag_v1"] = <_cyb_intptr_t>__nvmlDeviceGetUnrepairableMemoryFlag_v1 + data["__nvmlDeviceGetUnrepairableMemoryFlag_v1"] = <intptr_t>__nvmlDeviceGetUnrepairableMemoryFlag_v1 global __nvmlDeviceReadPRMCounters_v1 - data["__nvmlDeviceReadPRMCounters_v1"] = <_cyb_intptr_t>__nvmlDeviceReadPRMCounters_v1 + data["__nvmlDeviceReadPRMCounters_v1"] = <intptr_t>__nvmlDeviceReadPRMCounters_v1 global __nvmlDeviceSetRusdSettings_v1 - data["__nvmlDeviceSetRusdSettings_v1"] = <_cyb_intptr_t>__nvmlDeviceSetRusdSettings_v1 + data["__nvmlDeviceSetRusdSettings_v1"] = <intptr_t>__nvmlDeviceSetRusdSettings_v1 global __nvmlDeviceVgpuForceGspUnload - data["__nvmlDeviceVgpuForceGspUnload"] = <_cyb_intptr_t>__nvmlDeviceVgpuForceGspUnload + data["__nvmlDeviceVgpuForceGspUnload"] = <intptr_t>__nvmlDeviceVgpuForceGspUnload global __nvmlDeviceGetVgpuSchedulerState_v2 - data["__nvmlDeviceGetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerState_v2 + data["__nvmlDeviceGetVgpuSchedulerState_v2"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerState_v2 global __nvmlGpuInstanceGetVgpuSchedulerState_v2 - data["__nvmlGpuInstanceGetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerState_v2"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState_v2 global __nvmlDeviceGetVgpuSchedulerLog_v2 - data["__nvmlDeviceGetVgpuSchedulerLog_v2"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerLog_v2 + data["__nvmlDeviceGetVgpuSchedulerLog_v2"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerLog_v2 global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 - data["__nvmlGpuInstanceGetVgpuSchedulerLog_v2"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerLog_v2"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog_v2 global __nvmlDeviceSetVgpuSchedulerState_v2 - data["__nvmlDeviceSetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlDeviceSetVgpuSchedulerState_v2 + data["__nvmlDeviceSetVgpuSchedulerState_v2"] = <intptr_t>__nvmlDeviceSetVgpuSchedulerState_v2 global __nvmlGpuInstanceSetVgpuSchedulerState_v2 - data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = <intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState_v2 global __nvmlSystemGetCPER_v1 - data["__nvmlSystemGetCPER_v1"] = <_cyb_intptr_t>__nvmlSystemGetCPER_v1 + data["__nvmlSystemGetCPER_v1"] = <intptr_t>__nvmlSystemGetCPER_v1 global __nvmlDeviceGetBBXTimeData_v1 - data["__nvmlDeviceGetBBXTimeData_v1"] = <_cyb_intptr_t>__nvmlDeviceGetBBXTimeData_v1 + data["__nvmlDeviceGetBBXTimeData_v1"] = <intptr_t>__nvmlDeviceGetBBXTimeData_v1 global __nvmlDeviceGetAccountingStats_v2 - data["__nvmlDeviceGetAccountingStats_v2"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingStats_v2 + data["__nvmlDeviceGetAccountingStats_v2"] = <intptr_t>__nvmlDeviceGetAccountingStats_v2 global __nvmlDeviceGetRemappedRows_v2 - data["__nvmlDeviceGetRemappedRows_v2"] = <_cyb_intptr_t>__nvmlDeviceGetRemappedRows_v2 + data["__nvmlDeviceGetRemappedRows_v2"] = <intptr_t>__nvmlDeviceGetRemappedRows_v2 global __nvmlDeviceSetAdaptiveTgpMode_v1 - data["__nvmlDeviceSetAdaptiveTgpMode_v1"] = <_cyb_intptr_t>__nvmlDeviceSetAdaptiveTgpMode_v1 + data["__nvmlDeviceSetAdaptiveTgpMode_v1"] = <intptr_t>__nvmlDeviceSetAdaptiveTgpMode_v1 global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 - data["__nvmlDeviceGetAdaptiveTgpModeInfo_v1"] = <_cyb_intptr_t>__nvmlDeviceGetAdaptiveTgpModeInfo_v1 + data["__nvmlDeviceGetAdaptiveTgpModeInfo_v1"] = <intptr_t>__nvmlDeviceGetAdaptiveTgpModeInfo_v1 global __nvmlDeviceSetMemoryLimits_v1 - data["__nvmlDeviceSetMemoryLimits_v1"] = <_cyb_intptr_t>__nvmlDeviceSetMemoryLimits_v1 + data["__nvmlDeviceSetMemoryLimits_v1"] = <intptr_t>__nvmlDeviceSetMemoryLimits_v1 global __nvmlDeviceGetMemoryLimits_v1 - data["__nvmlDeviceGetMemoryLimits_v1"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryLimits_v1 + data["__nvmlDeviceGetMemoryLimits_v1"] = <intptr_t>__nvmlDeviceGetMemoryLimits_v1 global __nvmlDeviceGetGpuFabricInfo_v4 - data["__nvmlDeviceGetGpuFabricInfo_v4"] = <_cyb_intptr_t>__nvmlDeviceGetGpuFabricInfo_v4 + data["__nvmlDeviceGetGpuFabricInfo_v4"] = <intptr_t>__nvmlDeviceGetGpuFabricInfo_v4 global __nvmlDevicePerfMetricsGetSamples_v1 - data["__nvmlDevicePerfMetricsGetSamples_v1"] = <_cyb_intptr_t>__nvmlDevicePerfMetricsGetSamples_v1 + data["__nvmlDevicePerfMetricsGetSamples_v1"] = <intptr_t>__nvmlDevicePerfMetricsGetSamples_v1 global __nvmlDeviceSetNvlinkBwModeAsync_v1 - data["__nvmlDeviceSetNvlinkBwModeAsync_v1"] = <_cyb_intptr_t>__nvmlDeviceSetNvlinkBwModeAsync_v1 + data["__nvmlDeviceSetNvlinkBwModeAsync_v1"] = <intptr_t>__nvmlDeviceSetNvlinkBwModeAsync_v1 global __nvmlDeviceGetNvLinkTelemetrySamples_v1 - data["__nvmlDeviceGetNvLinkTelemetrySamples_v1"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkTelemetrySamples_v1 + data["__nvmlDeviceGetNvLinkTelemetrySamples_v1"] = <intptr_t>__nvmlDeviceGetNvLinkTelemetrySamples_v1 global __nvmlEventSetRegisterGpuOperationalEvents_v1 - data["__nvmlEventSetRegisterGpuOperationalEvents_v1"] = <_cyb_intptr_t>__nvmlEventSetRegisterGpuOperationalEvents_v1 + data["__nvmlEventSetRegisterGpuOperationalEvents_v1"] = <intptr_t>__nvmlEventSetRegisterGpuOperationalEvents_v1 global __nvmlEventSetWait_v3 - data["__nvmlEventSetWait_v3"] = <_cyb_intptr_t>__nvmlEventSetWait_v3 + data["__nvmlEventSetWait_v3"] = <intptr_t>__nvmlEventSetWait_v3 global __nvmlEventSetGetContextCount_v1 - data["__nvmlEventSetGetContextCount_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextCount_v1 + data["__nvmlEventSetGetContextCount_v1"] = <intptr_t>__nvmlEventSetGetContextCount_v1 global __nvmlEventSetGetContextInfo_v1 - data["__nvmlEventSetGetContextInfo_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextInfo_v1 + data["__nvmlEventSetGetContextInfo_v1"] = <intptr_t>__nvmlEventSetGetContextInfo_v1 global __nvmlEventSetGetContextData_v1 - data["__nvmlEventSetGetContextData_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextData_v1 + data["__nvmlEventSetGetContextData_v1"] = <intptr_t>__nvmlEventSetGetContextData_v1 global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 - data["__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1"] = <_cyb_intptr_t>__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + data["__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1"] = <intptr_t>__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 global __nvmlDeviceGetBankRemapperStatus_v1 - data["__nvmlDeviceGetBankRemapperStatus_v1"] = <_cyb_intptr_t>__nvmlDeviceGetBankRemapperStatus_v1 + data["__nvmlDeviceGetBankRemapperStatus_v1"] = <intptr_t>__nvmlDeviceGetBankRemapperStatus_v1 _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx index 7b851e1aa4e..b46526faf3c 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=10e6cb1d192514ece92e863cbebdde5c60b94cdc58d27a8c2e4cf9af1a27c968 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f8ac1d1064f1a58e57afc40dda00cd9d33f82f2cb25ca246244019324d14e1aa # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,10 @@ cdef extern from "<windows.h>": ctypedef void* HMODULE void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport ( + intptr_t, + uintptr_t, +) import threading as _cyb_threading @@ -1570,1114 +1573,1114 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvml() cdef dict data = {} global __nvmlInit_v2 - data["__nvmlInit_v2"] = <_cyb_intptr_t>__nvmlInit_v2 + data["__nvmlInit_v2"] = <intptr_t>__nvmlInit_v2 global __nvmlInitWithFlags - data["__nvmlInitWithFlags"] = <_cyb_intptr_t>__nvmlInitWithFlags + data["__nvmlInitWithFlags"] = <intptr_t>__nvmlInitWithFlags global __nvmlShutdown - data["__nvmlShutdown"] = <_cyb_intptr_t>__nvmlShutdown + data["__nvmlShutdown"] = <intptr_t>__nvmlShutdown global __nvmlErrorString - data["__nvmlErrorString"] = <_cyb_intptr_t>__nvmlErrorString + data["__nvmlErrorString"] = <intptr_t>__nvmlErrorString global __nvmlSystemGetDriverVersion - data["__nvmlSystemGetDriverVersion"] = <_cyb_intptr_t>__nvmlSystemGetDriverVersion + data["__nvmlSystemGetDriverVersion"] = <intptr_t>__nvmlSystemGetDriverVersion global __nvmlSystemGetNVMLVersion - data["__nvmlSystemGetNVMLVersion"] = <_cyb_intptr_t>__nvmlSystemGetNVMLVersion + data["__nvmlSystemGetNVMLVersion"] = <intptr_t>__nvmlSystemGetNVMLVersion global __nvmlSystemGetCudaDriverVersion - data["__nvmlSystemGetCudaDriverVersion"] = <_cyb_intptr_t>__nvmlSystemGetCudaDriverVersion + data["__nvmlSystemGetCudaDriverVersion"] = <intptr_t>__nvmlSystemGetCudaDriverVersion global __nvmlSystemGetCudaDriverVersion_v2 - data["__nvmlSystemGetCudaDriverVersion_v2"] = <_cyb_intptr_t>__nvmlSystemGetCudaDriverVersion_v2 + data["__nvmlSystemGetCudaDriverVersion_v2"] = <intptr_t>__nvmlSystemGetCudaDriverVersion_v2 global __nvmlSystemGetProcessName - data["__nvmlSystemGetProcessName"] = <_cyb_intptr_t>__nvmlSystemGetProcessName + data["__nvmlSystemGetProcessName"] = <intptr_t>__nvmlSystemGetProcessName global __nvmlSystemGetHicVersion - data["__nvmlSystemGetHicVersion"] = <_cyb_intptr_t>__nvmlSystemGetHicVersion + data["__nvmlSystemGetHicVersion"] = <intptr_t>__nvmlSystemGetHicVersion global __nvmlSystemGetTopologyGpuSet - data["__nvmlSystemGetTopologyGpuSet"] = <_cyb_intptr_t>__nvmlSystemGetTopologyGpuSet + data["__nvmlSystemGetTopologyGpuSet"] = <intptr_t>__nvmlSystemGetTopologyGpuSet global __nvmlSystemGetDriverBranch - data["__nvmlSystemGetDriverBranch"] = <_cyb_intptr_t>__nvmlSystemGetDriverBranch + data["__nvmlSystemGetDriverBranch"] = <intptr_t>__nvmlSystemGetDriverBranch global __nvmlUnitGetCount - data["__nvmlUnitGetCount"] = <_cyb_intptr_t>__nvmlUnitGetCount + data["__nvmlUnitGetCount"] = <intptr_t>__nvmlUnitGetCount global __nvmlUnitGetHandleByIndex - data["__nvmlUnitGetHandleByIndex"] = <_cyb_intptr_t>__nvmlUnitGetHandleByIndex + data["__nvmlUnitGetHandleByIndex"] = <intptr_t>__nvmlUnitGetHandleByIndex global __nvmlUnitGetUnitInfo - data["__nvmlUnitGetUnitInfo"] = <_cyb_intptr_t>__nvmlUnitGetUnitInfo + data["__nvmlUnitGetUnitInfo"] = <intptr_t>__nvmlUnitGetUnitInfo global __nvmlUnitGetLedState - data["__nvmlUnitGetLedState"] = <_cyb_intptr_t>__nvmlUnitGetLedState + data["__nvmlUnitGetLedState"] = <intptr_t>__nvmlUnitGetLedState global __nvmlUnitGetPsuInfo - data["__nvmlUnitGetPsuInfo"] = <_cyb_intptr_t>__nvmlUnitGetPsuInfo + data["__nvmlUnitGetPsuInfo"] = <intptr_t>__nvmlUnitGetPsuInfo global __nvmlUnitGetTemperature - data["__nvmlUnitGetTemperature"] = <_cyb_intptr_t>__nvmlUnitGetTemperature + data["__nvmlUnitGetTemperature"] = <intptr_t>__nvmlUnitGetTemperature global __nvmlUnitGetFanSpeedInfo - data["__nvmlUnitGetFanSpeedInfo"] = <_cyb_intptr_t>__nvmlUnitGetFanSpeedInfo + data["__nvmlUnitGetFanSpeedInfo"] = <intptr_t>__nvmlUnitGetFanSpeedInfo global __nvmlUnitGetDevices - data["__nvmlUnitGetDevices"] = <_cyb_intptr_t>__nvmlUnitGetDevices + data["__nvmlUnitGetDevices"] = <intptr_t>__nvmlUnitGetDevices global __nvmlDeviceGetCount_v2 - data["__nvmlDeviceGetCount_v2"] = <_cyb_intptr_t>__nvmlDeviceGetCount_v2 + data["__nvmlDeviceGetCount_v2"] = <intptr_t>__nvmlDeviceGetCount_v2 global __nvmlDeviceGetAttributes_v2 - data["__nvmlDeviceGetAttributes_v2"] = <_cyb_intptr_t>__nvmlDeviceGetAttributes_v2 + data["__nvmlDeviceGetAttributes_v2"] = <intptr_t>__nvmlDeviceGetAttributes_v2 global __nvmlDeviceGetHandleByIndex_v2 - data["__nvmlDeviceGetHandleByIndex_v2"] = <_cyb_intptr_t>__nvmlDeviceGetHandleByIndex_v2 + data["__nvmlDeviceGetHandleByIndex_v2"] = <intptr_t>__nvmlDeviceGetHandleByIndex_v2 global __nvmlDeviceGetHandleBySerial - data["__nvmlDeviceGetHandleBySerial"] = <_cyb_intptr_t>__nvmlDeviceGetHandleBySerial + data["__nvmlDeviceGetHandleBySerial"] = <intptr_t>__nvmlDeviceGetHandleBySerial global __nvmlDeviceGetHandleByUUID - data["__nvmlDeviceGetHandleByUUID"] = <_cyb_intptr_t>__nvmlDeviceGetHandleByUUID + data["__nvmlDeviceGetHandleByUUID"] = <intptr_t>__nvmlDeviceGetHandleByUUID global __nvmlDeviceGetHandleByUUIDV - data["__nvmlDeviceGetHandleByUUIDV"] = <_cyb_intptr_t>__nvmlDeviceGetHandleByUUIDV + data["__nvmlDeviceGetHandleByUUIDV"] = <intptr_t>__nvmlDeviceGetHandleByUUIDV global __nvmlDeviceGetHandleByPciBusId_v2 - data["__nvmlDeviceGetHandleByPciBusId_v2"] = <_cyb_intptr_t>__nvmlDeviceGetHandleByPciBusId_v2 + data["__nvmlDeviceGetHandleByPciBusId_v2"] = <intptr_t>__nvmlDeviceGetHandleByPciBusId_v2 global __nvmlDeviceGetName - data["__nvmlDeviceGetName"] = <_cyb_intptr_t>__nvmlDeviceGetName + data["__nvmlDeviceGetName"] = <intptr_t>__nvmlDeviceGetName global __nvmlDeviceGetBrand - data["__nvmlDeviceGetBrand"] = <_cyb_intptr_t>__nvmlDeviceGetBrand + data["__nvmlDeviceGetBrand"] = <intptr_t>__nvmlDeviceGetBrand global __nvmlDeviceGetIndex - data["__nvmlDeviceGetIndex"] = <_cyb_intptr_t>__nvmlDeviceGetIndex + data["__nvmlDeviceGetIndex"] = <intptr_t>__nvmlDeviceGetIndex global __nvmlDeviceGetSerial - data["__nvmlDeviceGetSerial"] = <_cyb_intptr_t>__nvmlDeviceGetSerial + data["__nvmlDeviceGetSerial"] = <intptr_t>__nvmlDeviceGetSerial global __nvmlDeviceGetModuleId - data["__nvmlDeviceGetModuleId"] = <_cyb_intptr_t>__nvmlDeviceGetModuleId + data["__nvmlDeviceGetModuleId"] = <intptr_t>__nvmlDeviceGetModuleId global __nvmlDeviceGetC2cModeInfoV - data["__nvmlDeviceGetC2cModeInfoV"] = <_cyb_intptr_t>__nvmlDeviceGetC2cModeInfoV + data["__nvmlDeviceGetC2cModeInfoV"] = <intptr_t>__nvmlDeviceGetC2cModeInfoV global __nvmlDeviceGetMemoryAffinity - data["__nvmlDeviceGetMemoryAffinity"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryAffinity + data["__nvmlDeviceGetMemoryAffinity"] = <intptr_t>__nvmlDeviceGetMemoryAffinity global __nvmlDeviceGetCpuAffinityWithinScope - data["__nvmlDeviceGetCpuAffinityWithinScope"] = <_cyb_intptr_t>__nvmlDeviceGetCpuAffinityWithinScope + data["__nvmlDeviceGetCpuAffinityWithinScope"] = <intptr_t>__nvmlDeviceGetCpuAffinityWithinScope global __nvmlDeviceGetCpuAffinity - data["__nvmlDeviceGetCpuAffinity"] = <_cyb_intptr_t>__nvmlDeviceGetCpuAffinity + data["__nvmlDeviceGetCpuAffinity"] = <intptr_t>__nvmlDeviceGetCpuAffinity global __nvmlDeviceSetCpuAffinity - data["__nvmlDeviceSetCpuAffinity"] = <_cyb_intptr_t>__nvmlDeviceSetCpuAffinity + data["__nvmlDeviceSetCpuAffinity"] = <intptr_t>__nvmlDeviceSetCpuAffinity global __nvmlDeviceClearCpuAffinity - data["__nvmlDeviceClearCpuAffinity"] = <_cyb_intptr_t>__nvmlDeviceClearCpuAffinity + data["__nvmlDeviceClearCpuAffinity"] = <intptr_t>__nvmlDeviceClearCpuAffinity global __nvmlDeviceGetNumaNodeId - data["__nvmlDeviceGetNumaNodeId"] = <_cyb_intptr_t>__nvmlDeviceGetNumaNodeId + data["__nvmlDeviceGetNumaNodeId"] = <intptr_t>__nvmlDeviceGetNumaNodeId global __nvmlDeviceGetTopologyCommonAncestor - data["__nvmlDeviceGetTopologyCommonAncestor"] = <_cyb_intptr_t>__nvmlDeviceGetTopologyCommonAncestor + data["__nvmlDeviceGetTopologyCommonAncestor"] = <intptr_t>__nvmlDeviceGetTopologyCommonAncestor global __nvmlDeviceGetTopologyNearestGpus - data["__nvmlDeviceGetTopologyNearestGpus"] = <_cyb_intptr_t>__nvmlDeviceGetTopologyNearestGpus + data["__nvmlDeviceGetTopologyNearestGpus"] = <intptr_t>__nvmlDeviceGetTopologyNearestGpus global __nvmlDeviceGetP2PStatus - data["__nvmlDeviceGetP2PStatus"] = <_cyb_intptr_t>__nvmlDeviceGetP2PStatus + data["__nvmlDeviceGetP2PStatus"] = <intptr_t>__nvmlDeviceGetP2PStatus global __nvmlDeviceGetUUID - data["__nvmlDeviceGetUUID"] = <_cyb_intptr_t>__nvmlDeviceGetUUID + data["__nvmlDeviceGetUUID"] = <intptr_t>__nvmlDeviceGetUUID global __nvmlDeviceGetMinorNumber - data["__nvmlDeviceGetMinorNumber"] = <_cyb_intptr_t>__nvmlDeviceGetMinorNumber + data["__nvmlDeviceGetMinorNumber"] = <intptr_t>__nvmlDeviceGetMinorNumber global __nvmlDeviceGetBoardPartNumber - data["__nvmlDeviceGetBoardPartNumber"] = <_cyb_intptr_t>__nvmlDeviceGetBoardPartNumber + data["__nvmlDeviceGetBoardPartNumber"] = <intptr_t>__nvmlDeviceGetBoardPartNumber global __nvmlDeviceGetInforomVersion - data["__nvmlDeviceGetInforomVersion"] = <_cyb_intptr_t>__nvmlDeviceGetInforomVersion + data["__nvmlDeviceGetInforomVersion"] = <intptr_t>__nvmlDeviceGetInforomVersion global __nvmlDeviceGetInforomImageVersion - data["__nvmlDeviceGetInforomImageVersion"] = <_cyb_intptr_t>__nvmlDeviceGetInforomImageVersion + data["__nvmlDeviceGetInforomImageVersion"] = <intptr_t>__nvmlDeviceGetInforomImageVersion global __nvmlDeviceGetInforomConfigurationChecksum - data["__nvmlDeviceGetInforomConfigurationChecksum"] = <_cyb_intptr_t>__nvmlDeviceGetInforomConfigurationChecksum + data["__nvmlDeviceGetInforomConfigurationChecksum"] = <intptr_t>__nvmlDeviceGetInforomConfigurationChecksum global __nvmlDeviceValidateInforom - data["__nvmlDeviceValidateInforom"] = <_cyb_intptr_t>__nvmlDeviceValidateInforom + data["__nvmlDeviceValidateInforom"] = <intptr_t>__nvmlDeviceValidateInforom global __nvmlDeviceGetLastBBXFlushTime - data["__nvmlDeviceGetLastBBXFlushTime"] = <_cyb_intptr_t>__nvmlDeviceGetLastBBXFlushTime + data["__nvmlDeviceGetLastBBXFlushTime"] = <intptr_t>__nvmlDeviceGetLastBBXFlushTime global __nvmlDeviceGetDisplayMode - data["__nvmlDeviceGetDisplayMode"] = <_cyb_intptr_t>__nvmlDeviceGetDisplayMode + data["__nvmlDeviceGetDisplayMode"] = <intptr_t>__nvmlDeviceGetDisplayMode global __nvmlDeviceGetDisplayActive - data["__nvmlDeviceGetDisplayActive"] = <_cyb_intptr_t>__nvmlDeviceGetDisplayActive + data["__nvmlDeviceGetDisplayActive"] = <intptr_t>__nvmlDeviceGetDisplayActive global __nvmlDeviceGetPersistenceMode - data["__nvmlDeviceGetPersistenceMode"] = <_cyb_intptr_t>__nvmlDeviceGetPersistenceMode + data["__nvmlDeviceGetPersistenceMode"] = <intptr_t>__nvmlDeviceGetPersistenceMode global __nvmlDeviceGetPciInfoExt - data["__nvmlDeviceGetPciInfoExt"] = <_cyb_intptr_t>__nvmlDeviceGetPciInfoExt + data["__nvmlDeviceGetPciInfoExt"] = <intptr_t>__nvmlDeviceGetPciInfoExt global __nvmlDeviceGetPciInfo_v3 - data["__nvmlDeviceGetPciInfo_v3"] = <_cyb_intptr_t>__nvmlDeviceGetPciInfo_v3 + data["__nvmlDeviceGetPciInfo_v3"] = <intptr_t>__nvmlDeviceGetPciInfo_v3 global __nvmlDeviceGetMaxPcieLinkGeneration - data["__nvmlDeviceGetMaxPcieLinkGeneration"] = <_cyb_intptr_t>__nvmlDeviceGetMaxPcieLinkGeneration + data["__nvmlDeviceGetMaxPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetMaxPcieLinkGeneration global __nvmlDeviceGetGpuMaxPcieLinkGeneration - data["__nvmlDeviceGetGpuMaxPcieLinkGeneration"] = <_cyb_intptr_t>__nvmlDeviceGetGpuMaxPcieLinkGeneration + data["__nvmlDeviceGetGpuMaxPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetGpuMaxPcieLinkGeneration global __nvmlDeviceGetMaxPcieLinkWidth - data["__nvmlDeviceGetMaxPcieLinkWidth"] = <_cyb_intptr_t>__nvmlDeviceGetMaxPcieLinkWidth + data["__nvmlDeviceGetMaxPcieLinkWidth"] = <intptr_t>__nvmlDeviceGetMaxPcieLinkWidth global __nvmlDeviceGetCurrPcieLinkGeneration - data["__nvmlDeviceGetCurrPcieLinkGeneration"] = <_cyb_intptr_t>__nvmlDeviceGetCurrPcieLinkGeneration + data["__nvmlDeviceGetCurrPcieLinkGeneration"] = <intptr_t>__nvmlDeviceGetCurrPcieLinkGeneration global __nvmlDeviceGetCurrPcieLinkWidth - data["__nvmlDeviceGetCurrPcieLinkWidth"] = <_cyb_intptr_t>__nvmlDeviceGetCurrPcieLinkWidth + data["__nvmlDeviceGetCurrPcieLinkWidth"] = <intptr_t>__nvmlDeviceGetCurrPcieLinkWidth global __nvmlDeviceGetPcieThroughput - data["__nvmlDeviceGetPcieThroughput"] = <_cyb_intptr_t>__nvmlDeviceGetPcieThroughput + data["__nvmlDeviceGetPcieThroughput"] = <intptr_t>__nvmlDeviceGetPcieThroughput global __nvmlDeviceGetPcieReplayCounter - data["__nvmlDeviceGetPcieReplayCounter"] = <_cyb_intptr_t>__nvmlDeviceGetPcieReplayCounter + data["__nvmlDeviceGetPcieReplayCounter"] = <intptr_t>__nvmlDeviceGetPcieReplayCounter global __nvmlDeviceGetClockInfo - data["__nvmlDeviceGetClockInfo"] = <_cyb_intptr_t>__nvmlDeviceGetClockInfo + data["__nvmlDeviceGetClockInfo"] = <intptr_t>__nvmlDeviceGetClockInfo global __nvmlDeviceGetMaxClockInfo - data["__nvmlDeviceGetMaxClockInfo"] = <_cyb_intptr_t>__nvmlDeviceGetMaxClockInfo + data["__nvmlDeviceGetMaxClockInfo"] = <intptr_t>__nvmlDeviceGetMaxClockInfo global __nvmlDeviceGetGpcClkVfOffset - data["__nvmlDeviceGetGpcClkVfOffset"] = <_cyb_intptr_t>__nvmlDeviceGetGpcClkVfOffset + data["__nvmlDeviceGetGpcClkVfOffset"] = <intptr_t>__nvmlDeviceGetGpcClkVfOffset global __nvmlDeviceGetClock - data["__nvmlDeviceGetClock"] = <_cyb_intptr_t>__nvmlDeviceGetClock + data["__nvmlDeviceGetClock"] = <intptr_t>__nvmlDeviceGetClock global __nvmlDeviceGetMaxCustomerBoostClock - data["__nvmlDeviceGetMaxCustomerBoostClock"] = <_cyb_intptr_t>__nvmlDeviceGetMaxCustomerBoostClock + data["__nvmlDeviceGetMaxCustomerBoostClock"] = <intptr_t>__nvmlDeviceGetMaxCustomerBoostClock global __nvmlDeviceGetSupportedMemoryClocks - data["__nvmlDeviceGetSupportedMemoryClocks"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedMemoryClocks + data["__nvmlDeviceGetSupportedMemoryClocks"] = <intptr_t>__nvmlDeviceGetSupportedMemoryClocks global __nvmlDeviceGetSupportedGraphicsClocks - data["__nvmlDeviceGetSupportedGraphicsClocks"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedGraphicsClocks + data["__nvmlDeviceGetSupportedGraphicsClocks"] = <intptr_t>__nvmlDeviceGetSupportedGraphicsClocks global __nvmlDeviceGetAutoBoostedClocksEnabled - data["__nvmlDeviceGetAutoBoostedClocksEnabled"] = <_cyb_intptr_t>__nvmlDeviceGetAutoBoostedClocksEnabled + data["__nvmlDeviceGetAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceGetAutoBoostedClocksEnabled global __nvmlDeviceGetFanSpeed - data["__nvmlDeviceGetFanSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetFanSpeed + data["__nvmlDeviceGetFanSpeed"] = <intptr_t>__nvmlDeviceGetFanSpeed global __nvmlDeviceGetFanSpeed_v2 - data["__nvmlDeviceGetFanSpeed_v2"] = <_cyb_intptr_t>__nvmlDeviceGetFanSpeed_v2 + data["__nvmlDeviceGetFanSpeed_v2"] = <intptr_t>__nvmlDeviceGetFanSpeed_v2 global __nvmlDeviceGetFanSpeedRPM - data["__nvmlDeviceGetFanSpeedRPM"] = <_cyb_intptr_t>__nvmlDeviceGetFanSpeedRPM + data["__nvmlDeviceGetFanSpeedRPM"] = <intptr_t>__nvmlDeviceGetFanSpeedRPM global __nvmlDeviceGetTargetFanSpeed - data["__nvmlDeviceGetTargetFanSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetTargetFanSpeed + data["__nvmlDeviceGetTargetFanSpeed"] = <intptr_t>__nvmlDeviceGetTargetFanSpeed global __nvmlDeviceGetMinMaxFanSpeed - data["__nvmlDeviceGetMinMaxFanSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetMinMaxFanSpeed + data["__nvmlDeviceGetMinMaxFanSpeed"] = <intptr_t>__nvmlDeviceGetMinMaxFanSpeed global __nvmlDeviceGetFanControlPolicy_v2 - data["__nvmlDeviceGetFanControlPolicy_v2"] = <_cyb_intptr_t>__nvmlDeviceGetFanControlPolicy_v2 + data["__nvmlDeviceGetFanControlPolicy_v2"] = <intptr_t>__nvmlDeviceGetFanControlPolicy_v2 global __nvmlDeviceGetNumFans - data["__nvmlDeviceGetNumFans"] = <_cyb_intptr_t>__nvmlDeviceGetNumFans + data["__nvmlDeviceGetNumFans"] = <intptr_t>__nvmlDeviceGetNumFans global __nvmlDeviceGetCoolerInfo - data["__nvmlDeviceGetCoolerInfo"] = <_cyb_intptr_t>__nvmlDeviceGetCoolerInfo + data["__nvmlDeviceGetCoolerInfo"] = <intptr_t>__nvmlDeviceGetCoolerInfo global __nvmlDeviceGetTemperatureV - data["__nvmlDeviceGetTemperatureV"] = <_cyb_intptr_t>__nvmlDeviceGetTemperatureV + data["__nvmlDeviceGetTemperatureV"] = <intptr_t>__nvmlDeviceGetTemperatureV global __nvmlDeviceGetTemperatureThreshold - data["__nvmlDeviceGetTemperatureThreshold"] = <_cyb_intptr_t>__nvmlDeviceGetTemperatureThreshold + data["__nvmlDeviceGetTemperatureThreshold"] = <intptr_t>__nvmlDeviceGetTemperatureThreshold global __nvmlDeviceGetMarginTemperature - data["__nvmlDeviceGetMarginTemperature"] = <_cyb_intptr_t>__nvmlDeviceGetMarginTemperature + data["__nvmlDeviceGetMarginTemperature"] = <intptr_t>__nvmlDeviceGetMarginTemperature global __nvmlDeviceGetThermalSettings - data["__nvmlDeviceGetThermalSettings"] = <_cyb_intptr_t>__nvmlDeviceGetThermalSettings + data["__nvmlDeviceGetThermalSettings"] = <intptr_t>__nvmlDeviceGetThermalSettings global __nvmlDeviceGetPerformanceState - data["__nvmlDeviceGetPerformanceState"] = <_cyb_intptr_t>__nvmlDeviceGetPerformanceState + data["__nvmlDeviceGetPerformanceState"] = <intptr_t>__nvmlDeviceGetPerformanceState global __nvmlDeviceGetCurrentClocksEventReasons - data["__nvmlDeviceGetCurrentClocksEventReasons"] = <_cyb_intptr_t>__nvmlDeviceGetCurrentClocksEventReasons + data["__nvmlDeviceGetCurrentClocksEventReasons"] = <intptr_t>__nvmlDeviceGetCurrentClocksEventReasons global __nvmlDeviceGetSupportedClocksEventReasons - data["__nvmlDeviceGetSupportedClocksEventReasons"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedClocksEventReasons + data["__nvmlDeviceGetSupportedClocksEventReasons"] = <intptr_t>__nvmlDeviceGetSupportedClocksEventReasons global __nvmlDeviceGetPowerState - data["__nvmlDeviceGetPowerState"] = <_cyb_intptr_t>__nvmlDeviceGetPowerState + data["__nvmlDeviceGetPowerState"] = <intptr_t>__nvmlDeviceGetPowerState global __nvmlDeviceGetDynamicPstatesInfo - data["__nvmlDeviceGetDynamicPstatesInfo"] = <_cyb_intptr_t>__nvmlDeviceGetDynamicPstatesInfo + data["__nvmlDeviceGetDynamicPstatesInfo"] = <intptr_t>__nvmlDeviceGetDynamicPstatesInfo global __nvmlDeviceGetMemClkVfOffset - data["__nvmlDeviceGetMemClkVfOffset"] = <_cyb_intptr_t>__nvmlDeviceGetMemClkVfOffset + data["__nvmlDeviceGetMemClkVfOffset"] = <intptr_t>__nvmlDeviceGetMemClkVfOffset global __nvmlDeviceGetMinMaxClockOfPState - data["__nvmlDeviceGetMinMaxClockOfPState"] = <_cyb_intptr_t>__nvmlDeviceGetMinMaxClockOfPState + data["__nvmlDeviceGetMinMaxClockOfPState"] = <intptr_t>__nvmlDeviceGetMinMaxClockOfPState global __nvmlDeviceGetSupportedPerformanceStates - data["__nvmlDeviceGetSupportedPerformanceStates"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedPerformanceStates + data["__nvmlDeviceGetSupportedPerformanceStates"] = <intptr_t>__nvmlDeviceGetSupportedPerformanceStates global __nvmlDeviceGetGpcClkMinMaxVfOffset - data["__nvmlDeviceGetGpcClkMinMaxVfOffset"] = <_cyb_intptr_t>__nvmlDeviceGetGpcClkMinMaxVfOffset + data["__nvmlDeviceGetGpcClkMinMaxVfOffset"] = <intptr_t>__nvmlDeviceGetGpcClkMinMaxVfOffset global __nvmlDeviceGetMemClkMinMaxVfOffset - data["__nvmlDeviceGetMemClkMinMaxVfOffset"] = <_cyb_intptr_t>__nvmlDeviceGetMemClkMinMaxVfOffset + data["__nvmlDeviceGetMemClkMinMaxVfOffset"] = <intptr_t>__nvmlDeviceGetMemClkMinMaxVfOffset global __nvmlDeviceGetClockOffsets - data["__nvmlDeviceGetClockOffsets"] = <_cyb_intptr_t>__nvmlDeviceGetClockOffsets + data["__nvmlDeviceGetClockOffsets"] = <intptr_t>__nvmlDeviceGetClockOffsets global __nvmlDeviceSetClockOffsets - data["__nvmlDeviceSetClockOffsets"] = <_cyb_intptr_t>__nvmlDeviceSetClockOffsets + data["__nvmlDeviceSetClockOffsets"] = <intptr_t>__nvmlDeviceSetClockOffsets global __nvmlDeviceGetPerformanceModes - data["__nvmlDeviceGetPerformanceModes"] = <_cyb_intptr_t>__nvmlDeviceGetPerformanceModes + data["__nvmlDeviceGetPerformanceModes"] = <intptr_t>__nvmlDeviceGetPerformanceModes global __nvmlDeviceGetCurrentClockFreqs - data["__nvmlDeviceGetCurrentClockFreqs"] = <_cyb_intptr_t>__nvmlDeviceGetCurrentClockFreqs + data["__nvmlDeviceGetCurrentClockFreqs"] = <intptr_t>__nvmlDeviceGetCurrentClockFreqs global __nvmlDeviceGetPowerManagementLimit - data["__nvmlDeviceGetPowerManagementLimit"] = <_cyb_intptr_t>__nvmlDeviceGetPowerManagementLimit + data["__nvmlDeviceGetPowerManagementLimit"] = <intptr_t>__nvmlDeviceGetPowerManagementLimit global __nvmlDeviceGetPowerManagementLimitConstraints - data["__nvmlDeviceGetPowerManagementLimitConstraints"] = <_cyb_intptr_t>__nvmlDeviceGetPowerManagementLimitConstraints + data["__nvmlDeviceGetPowerManagementLimitConstraints"] = <intptr_t>__nvmlDeviceGetPowerManagementLimitConstraints global __nvmlDeviceGetPowerManagementDefaultLimit - data["__nvmlDeviceGetPowerManagementDefaultLimit"] = <_cyb_intptr_t>__nvmlDeviceGetPowerManagementDefaultLimit + data["__nvmlDeviceGetPowerManagementDefaultLimit"] = <intptr_t>__nvmlDeviceGetPowerManagementDefaultLimit global __nvmlDeviceGetPowerUsage - data["__nvmlDeviceGetPowerUsage"] = <_cyb_intptr_t>__nvmlDeviceGetPowerUsage + data["__nvmlDeviceGetPowerUsage"] = <intptr_t>__nvmlDeviceGetPowerUsage global __nvmlDeviceGetTotalEnergyConsumption - data["__nvmlDeviceGetTotalEnergyConsumption"] = <_cyb_intptr_t>__nvmlDeviceGetTotalEnergyConsumption + data["__nvmlDeviceGetTotalEnergyConsumption"] = <intptr_t>__nvmlDeviceGetTotalEnergyConsumption global __nvmlDeviceGetEnforcedPowerLimit - data["__nvmlDeviceGetEnforcedPowerLimit"] = <_cyb_intptr_t>__nvmlDeviceGetEnforcedPowerLimit + data["__nvmlDeviceGetEnforcedPowerLimit"] = <intptr_t>__nvmlDeviceGetEnforcedPowerLimit global __nvmlDeviceGetGpuOperationMode - data["__nvmlDeviceGetGpuOperationMode"] = <_cyb_intptr_t>__nvmlDeviceGetGpuOperationMode + data["__nvmlDeviceGetGpuOperationMode"] = <intptr_t>__nvmlDeviceGetGpuOperationMode global __nvmlDeviceGetMemoryInfo_v2 - data["__nvmlDeviceGetMemoryInfo_v2"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryInfo_v2 + data["__nvmlDeviceGetMemoryInfo_v2"] = <intptr_t>__nvmlDeviceGetMemoryInfo_v2 global __nvmlDeviceGetComputeMode - data["__nvmlDeviceGetComputeMode"] = <_cyb_intptr_t>__nvmlDeviceGetComputeMode + data["__nvmlDeviceGetComputeMode"] = <intptr_t>__nvmlDeviceGetComputeMode global __nvmlDeviceGetCudaComputeCapability - data["__nvmlDeviceGetCudaComputeCapability"] = <_cyb_intptr_t>__nvmlDeviceGetCudaComputeCapability + data["__nvmlDeviceGetCudaComputeCapability"] = <intptr_t>__nvmlDeviceGetCudaComputeCapability global __nvmlDeviceGetDramEncryptionMode - data["__nvmlDeviceGetDramEncryptionMode"] = <_cyb_intptr_t>__nvmlDeviceGetDramEncryptionMode + data["__nvmlDeviceGetDramEncryptionMode"] = <intptr_t>__nvmlDeviceGetDramEncryptionMode global __nvmlDeviceSetDramEncryptionMode - data["__nvmlDeviceSetDramEncryptionMode"] = <_cyb_intptr_t>__nvmlDeviceSetDramEncryptionMode + data["__nvmlDeviceSetDramEncryptionMode"] = <intptr_t>__nvmlDeviceSetDramEncryptionMode global __nvmlDeviceGetEccMode - data["__nvmlDeviceGetEccMode"] = <_cyb_intptr_t>__nvmlDeviceGetEccMode + data["__nvmlDeviceGetEccMode"] = <intptr_t>__nvmlDeviceGetEccMode global __nvmlDeviceGetDefaultEccMode - data["__nvmlDeviceGetDefaultEccMode"] = <_cyb_intptr_t>__nvmlDeviceGetDefaultEccMode + data["__nvmlDeviceGetDefaultEccMode"] = <intptr_t>__nvmlDeviceGetDefaultEccMode global __nvmlDeviceGetBoardId - data["__nvmlDeviceGetBoardId"] = <_cyb_intptr_t>__nvmlDeviceGetBoardId + data["__nvmlDeviceGetBoardId"] = <intptr_t>__nvmlDeviceGetBoardId global __nvmlDeviceGetMultiGpuBoard - data["__nvmlDeviceGetMultiGpuBoard"] = <_cyb_intptr_t>__nvmlDeviceGetMultiGpuBoard + data["__nvmlDeviceGetMultiGpuBoard"] = <intptr_t>__nvmlDeviceGetMultiGpuBoard global __nvmlDeviceGetTotalEccErrors - data["__nvmlDeviceGetTotalEccErrors"] = <_cyb_intptr_t>__nvmlDeviceGetTotalEccErrors + data["__nvmlDeviceGetTotalEccErrors"] = <intptr_t>__nvmlDeviceGetTotalEccErrors global __nvmlDeviceGetMemoryErrorCounter - data["__nvmlDeviceGetMemoryErrorCounter"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryErrorCounter + data["__nvmlDeviceGetMemoryErrorCounter"] = <intptr_t>__nvmlDeviceGetMemoryErrorCounter global __nvmlDeviceGetUtilizationRates - data["__nvmlDeviceGetUtilizationRates"] = <_cyb_intptr_t>__nvmlDeviceGetUtilizationRates + data["__nvmlDeviceGetUtilizationRates"] = <intptr_t>__nvmlDeviceGetUtilizationRates global __nvmlDeviceGetEncoderUtilization - data["__nvmlDeviceGetEncoderUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetEncoderUtilization + data["__nvmlDeviceGetEncoderUtilization"] = <intptr_t>__nvmlDeviceGetEncoderUtilization global __nvmlDeviceGetEncoderCapacity - data["__nvmlDeviceGetEncoderCapacity"] = <_cyb_intptr_t>__nvmlDeviceGetEncoderCapacity + data["__nvmlDeviceGetEncoderCapacity"] = <intptr_t>__nvmlDeviceGetEncoderCapacity global __nvmlDeviceGetEncoderStats - data["__nvmlDeviceGetEncoderStats"] = <_cyb_intptr_t>__nvmlDeviceGetEncoderStats + data["__nvmlDeviceGetEncoderStats"] = <intptr_t>__nvmlDeviceGetEncoderStats global __nvmlDeviceGetEncoderSessions - data["__nvmlDeviceGetEncoderSessions"] = <_cyb_intptr_t>__nvmlDeviceGetEncoderSessions + data["__nvmlDeviceGetEncoderSessions"] = <intptr_t>__nvmlDeviceGetEncoderSessions global __nvmlDeviceGetDecoderUtilization - data["__nvmlDeviceGetDecoderUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetDecoderUtilization + data["__nvmlDeviceGetDecoderUtilization"] = <intptr_t>__nvmlDeviceGetDecoderUtilization global __nvmlDeviceGetJpgUtilization - data["__nvmlDeviceGetJpgUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetJpgUtilization + data["__nvmlDeviceGetJpgUtilization"] = <intptr_t>__nvmlDeviceGetJpgUtilization global __nvmlDeviceGetOfaUtilization - data["__nvmlDeviceGetOfaUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetOfaUtilization + data["__nvmlDeviceGetOfaUtilization"] = <intptr_t>__nvmlDeviceGetOfaUtilization global __nvmlDeviceGetFBCStats - data["__nvmlDeviceGetFBCStats"] = <_cyb_intptr_t>__nvmlDeviceGetFBCStats + data["__nvmlDeviceGetFBCStats"] = <intptr_t>__nvmlDeviceGetFBCStats global __nvmlDeviceGetFBCSessions - data["__nvmlDeviceGetFBCSessions"] = <_cyb_intptr_t>__nvmlDeviceGetFBCSessions + data["__nvmlDeviceGetFBCSessions"] = <intptr_t>__nvmlDeviceGetFBCSessions global __nvmlDeviceGetDriverModel_v2 - data["__nvmlDeviceGetDriverModel_v2"] = <_cyb_intptr_t>__nvmlDeviceGetDriverModel_v2 + data["__nvmlDeviceGetDriverModel_v2"] = <intptr_t>__nvmlDeviceGetDriverModel_v2 global __nvmlDeviceGetVbiosVersion - data["__nvmlDeviceGetVbiosVersion"] = <_cyb_intptr_t>__nvmlDeviceGetVbiosVersion + data["__nvmlDeviceGetVbiosVersion"] = <intptr_t>__nvmlDeviceGetVbiosVersion global __nvmlDeviceGetBridgeChipInfo - data["__nvmlDeviceGetBridgeChipInfo"] = <_cyb_intptr_t>__nvmlDeviceGetBridgeChipInfo + data["__nvmlDeviceGetBridgeChipInfo"] = <intptr_t>__nvmlDeviceGetBridgeChipInfo global __nvmlDeviceGetComputeRunningProcesses_v3 - data["__nvmlDeviceGetComputeRunningProcesses_v3"] = <_cyb_intptr_t>__nvmlDeviceGetComputeRunningProcesses_v3 + data["__nvmlDeviceGetComputeRunningProcesses_v3"] = <intptr_t>__nvmlDeviceGetComputeRunningProcesses_v3 global __nvmlDeviceGetGraphicsRunningProcesses_v3 - data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = <_cyb_intptr_t>__nvmlDeviceGetGraphicsRunningProcesses_v3 + data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = <intptr_t>__nvmlDeviceGetGraphicsRunningProcesses_v3 global __nvmlDeviceGetMPSComputeRunningProcesses_v3 - data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = <_cyb_intptr_t>__nvmlDeviceGetMPSComputeRunningProcesses_v3 + data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = <intptr_t>__nvmlDeviceGetMPSComputeRunningProcesses_v3 global __nvmlDeviceGetRunningProcessDetailList - data["__nvmlDeviceGetRunningProcessDetailList"] = <_cyb_intptr_t>__nvmlDeviceGetRunningProcessDetailList + data["__nvmlDeviceGetRunningProcessDetailList"] = <intptr_t>__nvmlDeviceGetRunningProcessDetailList global __nvmlDeviceOnSameBoard - data["__nvmlDeviceOnSameBoard"] = <_cyb_intptr_t>__nvmlDeviceOnSameBoard + data["__nvmlDeviceOnSameBoard"] = <intptr_t>__nvmlDeviceOnSameBoard global __nvmlDeviceGetAPIRestriction - data["__nvmlDeviceGetAPIRestriction"] = <_cyb_intptr_t>__nvmlDeviceGetAPIRestriction + data["__nvmlDeviceGetAPIRestriction"] = <intptr_t>__nvmlDeviceGetAPIRestriction global __nvmlDeviceGetSamples - data["__nvmlDeviceGetSamples"] = <_cyb_intptr_t>__nvmlDeviceGetSamples + data["__nvmlDeviceGetSamples"] = <intptr_t>__nvmlDeviceGetSamples global __nvmlDeviceGetBAR1MemoryInfo - data["__nvmlDeviceGetBAR1MemoryInfo"] = <_cyb_intptr_t>__nvmlDeviceGetBAR1MemoryInfo + data["__nvmlDeviceGetBAR1MemoryInfo"] = <intptr_t>__nvmlDeviceGetBAR1MemoryInfo global __nvmlDeviceGetIrqNum - data["__nvmlDeviceGetIrqNum"] = <_cyb_intptr_t>__nvmlDeviceGetIrqNum + data["__nvmlDeviceGetIrqNum"] = <intptr_t>__nvmlDeviceGetIrqNum global __nvmlDeviceGetNumGpuCores - data["__nvmlDeviceGetNumGpuCores"] = <_cyb_intptr_t>__nvmlDeviceGetNumGpuCores + data["__nvmlDeviceGetNumGpuCores"] = <intptr_t>__nvmlDeviceGetNumGpuCores global __nvmlDeviceGetPowerSource - data["__nvmlDeviceGetPowerSource"] = <_cyb_intptr_t>__nvmlDeviceGetPowerSource + data["__nvmlDeviceGetPowerSource"] = <intptr_t>__nvmlDeviceGetPowerSource global __nvmlDeviceGetMemoryBusWidth - data["__nvmlDeviceGetMemoryBusWidth"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryBusWidth + data["__nvmlDeviceGetMemoryBusWidth"] = <intptr_t>__nvmlDeviceGetMemoryBusWidth global __nvmlDeviceGetPcieLinkMaxSpeed - data["__nvmlDeviceGetPcieLinkMaxSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetPcieLinkMaxSpeed + data["__nvmlDeviceGetPcieLinkMaxSpeed"] = <intptr_t>__nvmlDeviceGetPcieLinkMaxSpeed global __nvmlDeviceGetPcieSpeed - data["__nvmlDeviceGetPcieSpeed"] = <_cyb_intptr_t>__nvmlDeviceGetPcieSpeed + data["__nvmlDeviceGetPcieSpeed"] = <intptr_t>__nvmlDeviceGetPcieSpeed global __nvmlDeviceGetAdaptiveClockInfoStatus - data["__nvmlDeviceGetAdaptiveClockInfoStatus"] = <_cyb_intptr_t>__nvmlDeviceGetAdaptiveClockInfoStatus + data["__nvmlDeviceGetAdaptiveClockInfoStatus"] = <intptr_t>__nvmlDeviceGetAdaptiveClockInfoStatus global __nvmlDeviceGetBusType - data["__nvmlDeviceGetBusType"] = <_cyb_intptr_t>__nvmlDeviceGetBusType + data["__nvmlDeviceGetBusType"] = <intptr_t>__nvmlDeviceGetBusType global __nvmlDeviceGetGpuFabricInfoV - data["__nvmlDeviceGetGpuFabricInfoV"] = <_cyb_intptr_t>__nvmlDeviceGetGpuFabricInfoV + data["__nvmlDeviceGetGpuFabricInfoV"] = <intptr_t>__nvmlDeviceGetGpuFabricInfoV global __nvmlSystemGetConfComputeCapabilities - data["__nvmlSystemGetConfComputeCapabilities"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeCapabilities + data["__nvmlSystemGetConfComputeCapabilities"] = <intptr_t>__nvmlSystemGetConfComputeCapabilities global __nvmlSystemGetConfComputeState - data["__nvmlSystemGetConfComputeState"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeState + data["__nvmlSystemGetConfComputeState"] = <intptr_t>__nvmlSystemGetConfComputeState global __nvmlDeviceGetConfComputeMemSizeInfo - data["__nvmlDeviceGetConfComputeMemSizeInfo"] = <_cyb_intptr_t>__nvmlDeviceGetConfComputeMemSizeInfo + data["__nvmlDeviceGetConfComputeMemSizeInfo"] = <intptr_t>__nvmlDeviceGetConfComputeMemSizeInfo global __nvmlSystemGetConfComputeGpusReadyState - data["__nvmlSystemGetConfComputeGpusReadyState"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeGpusReadyState + data["__nvmlSystemGetConfComputeGpusReadyState"] = <intptr_t>__nvmlSystemGetConfComputeGpusReadyState global __nvmlDeviceGetConfComputeProtectedMemoryUsage - data["__nvmlDeviceGetConfComputeProtectedMemoryUsage"] = <_cyb_intptr_t>__nvmlDeviceGetConfComputeProtectedMemoryUsage + data["__nvmlDeviceGetConfComputeProtectedMemoryUsage"] = <intptr_t>__nvmlDeviceGetConfComputeProtectedMemoryUsage global __nvmlDeviceGetConfComputeGpuCertificate - data["__nvmlDeviceGetConfComputeGpuCertificate"] = <_cyb_intptr_t>__nvmlDeviceGetConfComputeGpuCertificate + data["__nvmlDeviceGetConfComputeGpuCertificate"] = <intptr_t>__nvmlDeviceGetConfComputeGpuCertificate global __nvmlDeviceGetConfComputeGpuAttestationReport - data["__nvmlDeviceGetConfComputeGpuAttestationReport"] = <_cyb_intptr_t>__nvmlDeviceGetConfComputeGpuAttestationReport + data["__nvmlDeviceGetConfComputeGpuAttestationReport"] = <intptr_t>__nvmlDeviceGetConfComputeGpuAttestationReport global __nvmlSystemGetConfComputeKeyRotationThresholdInfo - data["__nvmlSystemGetConfComputeKeyRotationThresholdInfo"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeKeyRotationThresholdInfo + data["__nvmlSystemGetConfComputeKeyRotationThresholdInfo"] = <intptr_t>__nvmlSystemGetConfComputeKeyRotationThresholdInfo global __nvmlDeviceSetConfComputeUnprotectedMemSize - data["__nvmlDeviceSetConfComputeUnprotectedMemSize"] = <_cyb_intptr_t>__nvmlDeviceSetConfComputeUnprotectedMemSize + data["__nvmlDeviceSetConfComputeUnprotectedMemSize"] = <intptr_t>__nvmlDeviceSetConfComputeUnprotectedMemSize global __nvmlSystemSetConfComputeGpusReadyState - data["__nvmlSystemSetConfComputeGpusReadyState"] = <_cyb_intptr_t>__nvmlSystemSetConfComputeGpusReadyState + data["__nvmlSystemSetConfComputeGpusReadyState"] = <intptr_t>__nvmlSystemSetConfComputeGpusReadyState global __nvmlSystemSetConfComputeKeyRotationThresholdInfo - data["__nvmlSystemSetConfComputeKeyRotationThresholdInfo"] = <_cyb_intptr_t>__nvmlSystemSetConfComputeKeyRotationThresholdInfo + data["__nvmlSystemSetConfComputeKeyRotationThresholdInfo"] = <intptr_t>__nvmlSystemSetConfComputeKeyRotationThresholdInfo global __nvmlSystemGetConfComputeSettings - data["__nvmlSystemGetConfComputeSettings"] = <_cyb_intptr_t>__nvmlSystemGetConfComputeSettings + data["__nvmlSystemGetConfComputeSettings"] = <intptr_t>__nvmlSystemGetConfComputeSettings global __nvmlDeviceGetGspFirmwareVersion - data["__nvmlDeviceGetGspFirmwareVersion"] = <_cyb_intptr_t>__nvmlDeviceGetGspFirmwareVersion + data["__nvmlDeviceGetGspFirmwareVersion"] = <intptr_t>__nvmlDeviceGetGspFirmwareVersion global __nvmlDeviceGetGspFirmwareMode - data["__nvmlDeviceGetGspFirmwareMode"] = <_cyb_intptr_t>__nvmlDeviceGetGspFirmwareMode + data["__nvmlDeviceGetGspFirmwareMode"] = <intptr_t>__nvmlDeviceGetGspFirmwareMode global __nvmlDeviceGetSramEccErrorStatus - data["__nvmlDeviceGetSramEccErrorStatus"] = <_cyb_intptr_t>__nvmlDeviceGetSramEccErrorStatus + data["__nvmlDeviceGetSramEccErrorStatus"] = <intptr_t>__nvmlDeviceGetSramEccErrorStatus global __nvmlDeviceGetAccountingMode - data["__nvmlDeviceGetAccountingMode"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingMode + data["__nvmlDeviceGetAccountingMode"] = <intptr_t>__nvmlDeviceGetAccountingMode global __nvmlDeviceGetAccountingStats - data["__nvmlDeviceGetAccountingStats"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingStats + data["__nvmlDeviceGetAccountingStats"] = <intptr_t>__nvmlDeviceGetAccountingStats global __nvmlDeviceGetAccountingPids - data["__nvmlDeviceGetAccountingPids"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingPids + data["__nvmlDeviceGetAccountingPids"] = <intptr_t>__nvmlDeviceGetAccountingPids global __nvmlDeviceGetAccountingBufferSize - data["__nvmlDeviceGetAccountingBufferSize"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingBufferSize + data["__nvmlDeviceGetAccountingBufferSize"] = <intptr_t>__nvmlDeviceGetAccountingBufferSize global __nvmlDeviceGetRetiredPages - data["__nvmlDeviceGetRetiredPages"] = <_cyb_intptr_t>__nvmlDeviceGetRetiredPages + data["__nvmlDeviceGetRetiredPages"] = <intptr_t>__nvmlDeviceGetRetiredPages global __nvmlDeviceGetRetiredPages_v2 - data["__nvmlDeviceGetRetiredPages_v2"] = <_cyb_intptr_t>__nvmlDeviceGetRetiredPages_v2 + data["__nvmlDeviceGetRetiredPages_v2"] = <intptr_t>__nvmlDeviceGetRetiredPages_v2 global __nvmlDeviceGetRetiredPagesPendingStatus - data["__nvmlDeviceGetRetiredPagesPendingStatus"] = <_cyb_intptr_t>__nvmlDeviceGetRetiredPagesPendingStatus + data["__nvmlDeviceGetRetiredPagesPendingStatus"] = <intptr_t>__nvmlDeviceGetRetiredPagesPendingStatus global __nvmlDeviceGetRemappedRows - data["__nvmlDeviceGetRemappedRows"] = <_cyb_intptr_t>__nvmlDeviceGetRemappedRows + data["__nvmlDeviceGetRemappedRows"] = <intptr_t>__nvmlDeviceGetRemappedRows global __nvmlDeviceGetRowRemapperHistogram - data["__nvmlDeviceGetRowRemapperHistogram"] = <_cyb_intptr_t>__nvmlDeviceGetRowRemapperHistogram + data["__nvmlDeviceGetRowRemapperHistogram"] = <intptr_t>__nvmlDeviceGetRowRemapperHistogram global __nvmlDeviceGetArchitecture - data["__nvmlDeviceGetArchitecture"] = <_cyb_intptr_t>__nvmlDeviceGetArchitecture + data["__nvmlDeviceGetArchitecture"] = <intptr_t>__nvmlDeviceGetArchitecture global __nvmlDeviceGetClkMonStatus - data["__nvmlDeviceGetClkMonStatus"] = <_cyb_intptr_t>__nvmlDeviceGetClkMonStatus + data["__nvmlDeviceGetClkMonStatus"] = <intptr_t>__nvmlDeviceGetClkMonStatus global __nvmlDeviceGetProcessUtilization - data["__nvmlDeviceGetProcessUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetProcessUtilization + data["__nvmlDeviceGetProcessUtilization"] = <intptr_t>__nvmlDeviceGetProcessUtilization global __nvmlDeviceGetProcessesUtilizationInfo - data["__nvmlDeviceGetProcessesUtilizationInfo"] = <_cyb_intptr_t>__nvmlDeviceGetProcessesUtilizationInfo + data["__nvmlDeviceGetProcessesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetProcessesUtilizationInfo global __nvmlDeviceGetPlatformInfo - data["__nvmlDeviceGetPlatformInfo"] = <_cyb_intptr_t>__nvmlDeviceGetPlatformInfo + data["__nvmlDeviceGetPlatformInfo"] = <intptr_t>__nvmlDeviceGetPlatformInfo global __nvmlUnitSetLedState - data["__nvmlUnitSetLedState"] = <_cyb_intptr_t>__nvmlUnitSetLedState + data["__nvmlUnitSetLedState"] = <intptr_t>__nvmlUnitSetLedState global __nvmlDeviceSetPersistenceMode - data["__nvmlDeviceSetPersistenceMode"] = <_cyb_intptr_t>__nvmlDeviceSetPersistenceMode + data["__nvmlDeviceSetPersistenceMode"] = <intptr_t>__nvmlDeviceSetPersistenceMode global __nvmlDeviceSetComputeMode - data["__nvmlDeviceSetComputeMode"] = <_cyb_intptr_t>__nvmlDeviceSetComputeMode + data["__nvmlDeviceSetComputeMode"] = <intptr_t>__nvmlDeviceSetComputeMode global __nvmlDeviceSetEccMode - data["__nvmlDeviceSetEccMode"] = <_cyb_intptr_t>__nvmlDeviceSetEccMode + data["__nvmlDeviceSetEccMode"] = <intptr_t>__nvmlDeviceSetEccMode global __nvmlDeviceClearEccErrorCounts - data["__nvmlDeviceClearEccErrorCounts"] = <_cyb_intptr_t>__nvmlDeviceClearEccErrorCounts + data["__nvmlDeviceClearEccErrorCounts"] = <intptr_t>__nvmlDeviceClearEccErrorCounts global __nvmlDeviceSetDriverModel - data["__nvmlDeviceSetDriverModel"] = <_cyb_intptr_t>__nvmlDeviceSetDriverModel + data["__nvmlDeviceSetDriverModel"] = <intptr_t>__nvmlDeviceSetDriverModel global __nvmlDeviceSetGpuLockedClocks - data["__nvmlDeviceSetGpuLockedClocks"] = <_cyb_intptr_t>__nvmlDeviceSetGpuLockedClocks + data["__nvmlDeviceSetGpuLockedClocks"] = <intptr_t>__nvmlDeviceSetGpuLockedClocks global __nvmlDeviceResetGpuLockedClocks - data["__nvmlDeviceResetGpuLockedClocks"] = <_cyb_intptr_t>__nvmlDeviceResetGpuLockedClocks + data["__nvmlDeviceResetGpuLockedClocks"] = <intptr_t>__nvmlDeviceResetGpuLockedClocks global __nvmlDeviceSetMemoryLockedClocks - data["__nvmlDeviceSetMemoryLockedClocks"] = <_cyb_intptr_t>__nvmlDeviceSetMemoryLockedClocks + data["__nvmlDeviceSetMemoryLockedClocks"] = <intptr_t>__nvmlDeviceSetMemoryLockedClocks global __nvmlDeviceResetMemoryLockedClocks - data["__nvmlDeviceResetMemoryLockedClocks"] = <_cyb_intptr_t>__nvmlDeviceResetMemoryLockedClocks + data["__nvmlDeviceResetMemoryLockedClocks"] = <intptr_t>__nvmlDeviceResetMemoryLockedClocks global __nvmlDeviceSetAutoBoostedClocksEnabled - data["__nvmlDeviceSetAutoBoostedClocksEnabled"] = <_cyb_intptr_t>__nvmlDeviceSetAutoBoostedClocksEnabled + data["__nvmlDeviceSetAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceSetAutoBoostedClocksEnabled global __nvmlDeviceSetDefaultAutoBoostedClocksEnabled - data["__nvmlDeviceSetDefaultAutoBoostedClocksEnabled"] = <_cyb_intptr_t>__nvmlDeviceSetDefaultAutoBoostedClocksEnabled + data["__nvmlDeviceSetDefaultAutoBoostedClocksEnabled"] = <intptr_t>__nvmlDeviceSetDefaultAutoBoostedClocksEnabled global __nvmlDeviceSetDefaultFanSpeed_v2 - data["__nvmlDeviceSetDefaultFanSpeed_v2"] = <_cyb_intptr_t>__nvmlDeviceSetDefaultFanSpeed_v2 + data["__nvmlDeviceSetDefaultFanSpeed_v2"] = <intptr_t>__nvmlDeviceSetDefaultFanSpeed_v2 global __nvmlDeviceSetFanControlPolicy - data["__nvmlDeviceSetFanControlPolicy"] = <_cyb_intptr_t>__nvmlDeviceSetFanControlPolicy + data["__nvmlDeviceSetFanControlPolicy"] = <intptr_t>__nvmlDeviceSetFanControlPolicy global __nvmlDeviceSetTemperatureThreshold - data["__nvmlDeviceSetTemperatureThreshold"] = <_cyb_intptr_t>__nvmlDeviceSetTemperatureThreshold + data["__nvmlDeviceSetTemperatureThreshold"] = <intptr_t>__nvmlDeviceSetTemperatureThreshold global __nvmlDeviceSetGpuOperationMode - data["__nvmlDeviceSetGpuOperationMode"] = <_cyb_intptr_t>__nvmlDeviceSetGpuOperationMode + data["__nvmlDeviceSetGpuOperationMode"] = <intptr_t>__nvmlDeviceSetGpuOperationMode global __nvmlDeviceSetAPIRestriction - data["__nvmlDeviceSetAPIRestriction"] = <_cyb_intptr_t>__nvmlDeviceSetAPIRestriction + data["__nvmlDeviceSetAPIRestriction"] = <intptr_t>__nvmlDeviceSetAPIRestriction global __nvmlDeviceSetFanSpeed_v2 - data["__nvmlDeviceSetFanSpeed_v2"] = <_cyb_intptr_t>__nvmlDeviceSetFanSpeed_v2 + data["__nvmlDeviceSetFanSpeed_v2"] = <intptr_t>__nvmlDeviceSetFanSpeed_v2 global __nvmlDeviceSetAccountingMode - data["__nvmlDeviceSetAccountingMode"] = <_cyb_intptr_t>__nvmlDeviceSetAccountingMode + data["__nvmlDeviceSetAccountingMode"] = <intptr_t>__nvmlDeviceSetAccountingMode global __nvmlDeviceClearAccountingPids - data["__nvmlDeviceClearAccountingPids"] = <_cyb_intptr_t>__nvmlDeviceClearAccountingPids + data["__nvmlDeviceClearAccountingPids"] = <intptr_t>__nvmlDeviceClearAccountingPids global __nvmlDeviceSetPowerManagementLimit_v2 - data["__nvmlDeviceSetPowerManagementLimit_v2"] = <_cyb_intptr_t>__nvmlDeviceSetPowerManagementLimit_v2 + data["__nvmlDeviceSetPowerManagementLimit_v2"] = <intptr_t>__nvmlDeviceSetPowerManagementLimit_v2 global __nvmlDeviceGetNvLinkState - data["__nvmlDeviceGetNvLinkState"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkState + data["__nvmlDeviceGetNvLinkState"] = <intptr_t>__nvmlDeviceGetNvLinkState global __nvmlDeviceGetNvLinkVersion - data["__nvmlDeviceGetNvLinkVersion"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkVersion + data["__nvmlDeviceGetNvLinkVersion"] = <intptr_t>__nvmlDeviceGetNvLinkVersion global __nvmlDeviceGetNvLinkCapability - data["__nvmlDeviceGetNvLinkCapability"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkCapability + data["__nvmlDeviceGetNvLinkCapability"] = <intptr_t>__nvmlDeviceGetNvLinkCapability global __nvmlDeviceGetNvLinkRemotePciInfo_v2 - data["__nvmlDeviceGetNvLinkRemotePciInfo_v2"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkRemotePciInfo_v2 + data["__nvmlDeviceGetNvLinkRemotePciInfo_v2"] = <intptr_t>__nvmlDeviceGetNvLinkRemotePciInfo_v2 global __nvmlDeviceGetNvLinkErrorCounter - data["__nvmlDeviceGetNvLinkErrorCounter"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkErrorCounter + data["__nvmlDeviceGetNvLinkErrorCounter"] = <intptr_t>__nvmlDeviceGetNvLinkErrorCounter global __nvmlDeviceResetNvLinkErrorCounters - data["__nvmlDeviceResetNvLinkErrorCounters"] = <_cyb_intptr_t>__nvmlDeviceResetNvLinkErrorCounters + data["__nvmlDeviceResetNvLinkErrorCounters"] = <intptr_t>__nvmlDeviceResetNvLinkErrorCounters global __nvmlDeviceGetNvLinkRemoteDeviceType - data["__nvmlDeviceGetNvLinkRemoteDeviceType"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkRemoteDeviceType + data["__nvmlDeviceGetNvLinkRemoteDeviceType"] = <intptr_t>__nvmlDeviceGetNvLinkRemoteDeviceType global __nvmlDeviceSetNvLinkDeviceLowPowerThreshold - data["__nvmlDeviceSetNvLinkDeviceLowPowerThreshold"] = <_cyb_intptr_t>__nvmlDeviceSetNvLinkDeviceLowPowerThreshold + data["__nvmlDeviceSetNvLinkDeviceLowPowerThreshold"] = <intptr_t>__nvmlDeviceSetNvLinkDeviceLowPowerThreshold global __nvmlSystemSetNvlinkBwMode - data["__nvmlSystemSetNvlinkBwMode"] = <_cyb_intptr_t>__nvmlSystemSetNvlinkBwMode + data["__nvmlSystemSetNvlinkBwMode"] = <intptr_t>__nvmlSystemSetNvlinkBwMode global __nvmlSystemGetNvlinkBwMode - data["__nvmlSystemGetNvlinkBwMode"] = <_cyb_intptr_t>__nvmlSystemGetNvlinkBwMode + data["__nvmlSystemGetNvlinkBwMode"] = <intptr_t>__nvmlSystemGetNvlinkBwMode global __nvmlDeviceGetNvlinkSupportedBwModes - data["__nvmlDeviceGetNvlinkSupportedBwModes"] = <_cyb_intptr_t>__nvmlDeviceGetNvlinkSupportedBwModes + data["__nvmlDeviceGetNvlinkSupportedBwModes"] = <intptr_t>__nvmlDeviceGetNvlinkSupportedBwModes global __nvmlDeviceGetNvlinkBwMode - data["__nvmlDeviceGetNvlinkBwMode"] = <_cyb_intptr_t>__nvmlDeviceGetNvlinkBwMode + data["__nvmlDeviceGetNvlinkBwMode"] = <intptr_t>__nvmlDeviceGetNvlinkBwMode global __nvmlDeviceSetNvlinkBwMode - data["__nvmlDeviceSetNvlinkBwMode"] = <_cyb_intptr_t>__nvmlDeviceSetNvlinkBwMode + data["__nvmlDeviceSetNvlinkBwMode"] = <intptr_t>__nvmlDeviceSetNvlinkBwMode global __nvmlEventSetCreate - data["__nvmlEventSetCreate"] = <_cyb_intptr_t>__nvmlEventSetCreate + data["__nvmlEventSetCreate"] = <intptr_t>__nvmlEventSetCreate global __nvmlDeviceRegisterEvents - data["__nvmlDeviceRegisterEvents"] = <_cyb_intptr_t>__nvmlDeviceRegisterEvents + data["__nvmlDeviceRegisterEvents"] = <intptr_t>__nvmlDeviceRegisterEvents global __nvmlDeviceGetSupportedEventTypes - data["__nvmlDeviceGetSupportedEventTypes"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedEventTypes + data["__nvmlDeviceGetSupportedEventTypes"] = <intptr_t>__nvmlDeviceGetSupportedEventTypes global __nvmlEventSetWait_v2 - data["__nvmlEventSetWait_v2"] = <_cyb_intptr_t>__nvmlEventSetWait_v2 + data["__nvmlEventSetWait_v2"] = <intptr_t>__nvmlEventSetWait_v2 global __nvmlEventSetFree - data["__nvmlEventSetFree"] = <_cyb_intptr_t>__nvmlEventSetFree + data["__nvmlEventSetFree"] = <intptr_t>__nvmlEventSetFree global __nvmlSystemEventSetCreate - data["__nvmlSystemEventSetCreate"] = <_cyb_intptr_t>__nvmlSystemEventSetCreate + data["__nvmlSystemEventSetCreate"] = <intptr_t>__nvmlSystemEventSetCreate global __nvmlSystemEventSetFree - data["__nvmlSystemEventSetFree"] = <_cyb_intptr_t>__nvmlSystemEventSetFree + data["__nvmlSystemEventSetFree"] = <intptr_t>__nvmlSystemEventSetFree global __nvmlSystemRegisterEvents - data["__nvmlSystemRegisterEvents"] = <_cyb_intptr_t>__nvmlSystemRegisterEvents + data["__nvmlSystemRegisterEvents"] = <intptr_t>__nvmlSystemRegisterEvents global __nvmlSystemEventSetWait - data["__nvmlSystemEventSetWait"] = <_cyb_intptr_t>__nvmlSystemEventSetWait + data["__nvmlSystemEventSetWait"] = <intptr_t>__nvmlSystemEventSetWait global __nvmlDeviceModifyDrainState - data["__nvmlDeviceModifyDrainState"] = <_cyb_intptr_t>__nvmlDeviceModifyDrainState + data["__nvmlDeviceModifyDrainState"] = <intptr_t>__nvmlDeviceModifyDrainState global __nvmlDeviceQueryDrainState - data["__nvmlDeviceQueryDrainState"] = <_cyb_intptr_t>__nvmlDeviceQueryDrainState + data["__nvmlDeviceQueryDrainState"] = <intptr_t>__nvmlDeviceQueryDrainState global __nvmlDeviceRemoveGpu_v2 - data["__nvmlDeviceRemoveGpu_v2"] = <_cyb_intptr_t>__nvmlDeviceRemoveGpu_v2 + data["__nvmlDeviceRemoveGpu_v2"] = <intptr_t>__nvmlDeviceRemoveGpu_v2 global __nvmlDeviceDiscoverGpus - data["__nvmlDeviceDiscoverGpus"] = <_cyb_intptr_t>__nvmlDeviceDiscoverGpus + data["__nvmlDeviceDiscoverGpus"] = <intptr_t>__nvmlDeviceDiscoverGpus global __nvmlDeviceGetFieldValues - data["__nvmlDeviceGetFieldValues"] = <_cyb_intptr_t>__nvmlDeviceGetFieldValues + data["__nvmlDeviceGetFieldValues"] = <intptr_t>__nvmlDeviceGetFieldValues global __nvmlDeviceClearFieldValues - data["__nvmlDeviceClearFieldValues"] = <_cyb_intptr_t>__nvmlDeviceClearFieldValues + data["__nvmlDeviceClearFieldValues"] = <intptr_t>__nvmlDeviceClearFieldValues global __nvmlDeviceGetVirtualizationMode - data["__nvmlDeviceGetVirtualizationMode"] = <_cyb_intptr_t>__nvmlDeviceGetVirtualizationMode + data["__nvmlDeviceGetVirtualizationMode"] = <intptr_t>__nvmlDeviceGetVirtualizationMode global __nvmlDeviceGetHostVgpuMode - data["__nvmlDeviceGetHostVgpuMode"] = <_cyb_intptr_t>__nvmlDeviceGetHostVgpuMode + data["__nvmlDeviceGetHostVgpuMode"] = <intptr_t>__nvmlDeviceGetHostVgpuMode global __nvmlDeviceSetVirtualizationMode - data["__nvmlDeviceSetVirtualizationMode"] = <_cyb_intptr_t>__nvmlDeviceSetVirtualizationMode + data["__nvmlDeviceSetVirtualizationMode"] = <intptr_t>__nvmlDeviceSetVirtualizationMode global __nvmlDeviceGetVgpuHeterogeneousMode - data["__nvmlDeviceGetVgpuHeterogeneousMode"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuHeterogeneousMode + data["__nvmlDeviceGetVgpuHeterogeneousMode"] = <intptr_t>__nvmlDeviceGetVgpuHeterogeneousMode global __nvmlDeviceSetVgpuHeterogeneousMode - data["__nvmlDeviceSetVgpuHeterogeneousMode"] = <_cyb_intptr_t>__nvmlDeviceSetVgpuHeterogeneousMode + data["__nvmlDeviceSetVgpuHeterogeneousMode"] = <intptr_t>__nvmlDeviceSetVgpuHeterogeneousMode global __nvmlVgpuInstanceGetPlacementId - data["__nvmlVgpuInstanceGetPlacementId"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetPlacementId + data["__nvmlVgpuInstanceGetPlacementId"] = <intptr_t>__nvmlVgpuInstanceGetPlacementId global __nvmlDeviceGetVgpuTypeSupportedPlacements - data["__nvmlDeviceGetVgpuTypeSupportedPlacements"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuTypeSupportedPlacements + data["__nvmlDeviceGetVgpuTypeSupportedPlacements"] = <intptr_t>__nvmlDeviceGetVgpuTypeSupportedPlacements global __nvmlDeviceGetVgpuTypeCreatablePlacements - data["__nvmlDeviceGetVgpuTypeCreatablePlacements"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuTypeCreatablePlacements + data["__nvmlDeviceGetVgpuTypeCreatablePlacements"] = <intptr_t>__nvmlDeviceGetVgpuTypeCreatablePlacements global __nvmlVgpuTypeGetGspHeapSize - data["__nvmlVgpuTypeGetGspHeapSize"] = <_cyb_intptr_t>__nvmlVgpuTypeGetGspHeapSize + data["__nvmlVgpuTypeGetGspHeapSize"] = <intptr_t>__nvmlVgpuTypeGetGspHeapSize global __nvmlVgpuTypeGetFbReservation - data["__nvmlVgpuTypeGetFbReservation"] = <_cyb_intptr_t>__nvmlVgpuTypeGetFbReservation + data["__nvmlVgpuTypeGetFbReservation"] = <intptr_t>__nvmlVgpuTypeGetFbReservation global __nvmlVgpuInstanceGetRuntimeStateSize - data["__nvmlVgpuInstanceGetRuntimeStateSize"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetRuntimeStateSize + data["__nvmlVgpuInstanceGetRuntimeStateSize"] = <intptr_t>__nvmlVgpuInstanceGetRuntimeStateSize global __nvmlDeviceSetVgpuCapabilities - data["__nvmlDeviceSetVgpuCapabilities"] = <_cyb_intptr_t>__nvmlDeviceSetVgpuCapabilities + data["__nvmlDeviceSetVgpuCapabilities"] = <intptr_t>__nvmlDeviceSetVgpuCapabilities global __nvmlDeviceGetGridLicensableFeatures_v4 - data["__nvmlDeviceGetGridLicensableFeatures_v4"] = <_cyb_intptr_t>__nvmlDeviceGetGridLicensableFeatures_v4 + data["__nvmlDeviceGetGridLicensableFeatures_v4"] = <intptr_t>__nvmlDeviceGetGridLicensableFeatures_v4 global __nvmlGetVgpuDriverCapabilities - data["__nvmlGetVgpuDriverCapabilities"] = <_cyb_intptr_t>__nvmlGetVgpuDriverCapabilities + data["__nvmlGetVgpuDriverCapabilities"] = <intptr_t>__nvmlGetVgpuDriverCapabilities global __nvmlDeviceGetVgpuCapabilities - data["__nvmlDeviceGetVgpuCapabilities"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuCapabilities + data["__nvmlDeviceGetVgpuCapabilities"] = <intptr_t>__nvmlDeviceGetVgpuCapabilities global __nvmlDeviceGetSupportedVgpus - data["__nvmlDeviceGetSupportedVgpus"] = <_cyb_intptr_t>__nvmlDeviceGetSupportedVgpus + data["__nvmlDeviceGetSupportedVgpus"] = <intptr_t>__nvmlDeviceGetSupportedVgpus global __nvmlDeviceGetCreatableVgpus - data["__nvmlDeviceGetCreatableVgpus"] = <_cyb_intptr_t>__nvmlDeviceGetCreatableVgpus + data["__nvmlDeviceGetCreatableVgpus"] = <intptr_t>__nvmlDeviceGetCreatableVgpus global __nvmlVgpuTypeGetClass - data["__nvmlVgpuTypeGetClass"] = <_cyb_intptr_t>__nvmlVgpuTypeGetClass + data["__nvmlVgpuTypeGetClass"] = <intptr_t>__nvmlVgpuTypeGetClass global __nvmlVgpuTypeGetName - data["__nvmlVgpuTypeGetName"] = <_cyb_intptr_t>__nvmlVgpuTypeGetName + data["__nvmlVgpuTypeGetName"] = <intptr_t>__nvmlVgpuTypeGetName global __nvmlVgpuTypeGetGpuInstanceProfileId - data["__nvmlVgpuTypeGetGpuInstanceProfileId"] = <_cyb_intptr_t>__nvmlVgpuTypeGetGpuInstanceProfileId + data["__nvmlVgpuTypeGetGpuInstanceProfileId"] = <intptr_t>__nvmlVgpuTypeGetGpuInstanceProfileId global __nvmlVgpuTypeGetDeviceID - data["__nvmlVgpuTypeGetDeviceID"] = <_cyb_intptr_t>__nvmlVgpuTypeGetDeviceID + data["__nvmlVgpuTypeGetDeviceID"] = <intptr_t>__nvmlVgpuTypeGetDeviceID global __nvmlVgpuTypeGetFramebufferSize - data["__nvmlVgpuTypeGetFramebufferSize"] = <_cyb_intptr_t>__nvmlVgpuTypeGetFramebufferSize + data["__nvmlVgpuTypeGetFramebufferSize"] = <intptr_t>__nvmlVgpuTypeGetFramebufferSize global __nvmlVgpuTypeGetNumDisplayHeads - data["__nvmlVgpuTypeGetNumDisplayHeads"] = <_cyb_intptr_t>__nvmlVgpuTypeGetNumDisplayHeads + data["__nvmlVgpuTypeGetNumDisplayHeads"] = <intptr_t>__nvmlVgpuTypeGetNumDisplayHeads global __nvmlVgpuTypeGetResolution - data["__nvmlVgpuTypeGetResolution"] = <_cyb_intptr_t>__nvmlVgpuTypeGetResolution + data["__nvmlVgpuTypeGetResolution"] = <intptr_t>__nvmlVgpuTypeGetResolution global __nvmlVgpuTypeGetLicense - data["__nvmlVgpuTypeGetLicense"] = <_cyb_intptr_t>__nvmlVgpuTypeGetLicense + data["__nvmlVgpuTypeGetLicense"] = <intptr_t>__nvmlVgpuTypeGetLicense global __nvmlVgpuTypeGetFrameRateLimit - data["__nvmlVgpuTypeGetFrameRateLimit"] = <_cyb_intptr_t>__nvmlVgpuTypeGetFrameRateLimit + data["__nvmlVgpuTypeGetFrameRateLimit"] = <intptr_t>__nvmlVgpuTypeGetFrameRateLimit global __nvmlVgpuTypeGetMaxInstances - data["__nvmlVgpuTypeGetMaxInstances"] = <_cyb_intptr_t>__nvmlVgpuTypeGetMaxInstances + data["__nvmlVgpuTypeGetMaxInstances"] = <intptr_t>__nvmlVgpuTypeGetMaxInstances global __nvmlVgpuTypeGetMaxInstancesPerVm - data["__nvmlVgpuTypeGetMaxInstancesPerVm"] = <_cyb_intptr_t>__nvmlVgpuTypeGetMaxInstancesPerVm + data["__nvmlVgpuTypeGetMaxInstancesPerVm"] = <intptr_t>__nvmlVgpuTypeGetMaxInstancesPerVm global __nvmlVgpuTypeGetBAR1Info - data["__nvmlVgpuTypeGetBAR1Info"] = <_cyb_intptr_t>__nvmlVgpuTypeGetBAR1Info + data["__nvmlVgpuTypeGetBAR1Info"] = <intptr_t>__nvmlVgpuTypeGetBAR1Info global __nvmlDeviceGetActiveVgpus - data["__nvmlDeviceGetActiveVgpus"] = <_cyb_intptr_t>__nvmlDeviceGetActiveVgpus + data["__nvmlDeviceGetActiveVgpus"] = <intptr_t>__nvmlDeviceGetActiveVgpus global __nvmlVgpuInstanceGetVmID - data["__nvmlVgpuInstanceGetVmID"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetVmID + data["__nvmlVgpuInstanceGetVmID"] = <intptr_t>__nvmlVgpuInstanceGetVmID global __nvmlVgpuInstanceGetUUID - data["__nvmlVgpuInstanceGetUUID"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetUUID + data["__nvmlVgpuInstanceGetUUID"] = <intptr_t>__nvmlVgpuInstanceGetUUID global __nvmlVgpuInstanceGetVmDriverVersion - data["__nvmlVgpuInstanceGetVmDriverVersion"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetVmDriverVersion + data["__nvmlVgpuInstanceGetVmDriverVersion"] = <intptr_t>__nvmlVgpuInstanceGetVmDriverVersion global __nvmlVgpuInstanceGetFbUsage - data["__nvmlVgpuInstanceGetFbUsage"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetFbUsage + data["__nvmlVgpuInstanceGetFbUsage"] = <intptr_t>__nvmlVgpuInstanceGetFbUsage global __nvmlVgpuInstanceGetLicenseStatus - data["__nvmlVgpuInstanceGetLicenseStatus"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetLicenseStatus + data["__nvmlVgpuInstanceGetLicenseStatus"] = <intptr_t>__nvmlVgpuInstanceGetLicenseStatus global __nvmlVgpuInstanceGetType - data["__nvmlVgpuInstanceGetType"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetType + data["__nvmlVgpuInstanceGetType"] = <intptr_t>__nvmlVgpuInstanceGetType global __nvmlVgpuInstanceGetFrameRateLimit - data["__nvmlVgpuInstanceGetFrameRateLimit"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetFrameRateLimit + data["__nvmlVgpuInstanceGetFrameRateLimit"] = <intptr_t>__nvmlVgpuInstanceGetFrameRateLimit global __nvmlVgpuInstanceGetEccMode - data["__nvmlVgpuInstanceGetEccMode"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetEccMode + data["__nvmlVgpuInstanceGetEccMode"] = <intptr_t>__nvmlVgpuInstanceGetEccMode global __nvmlVgpuInstanceGetEncoderCapacity - data["__nvmlVgpuInstanceGetEncoderCapacity"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetEncoderCapacity + data["__nvmlVgpuInstanceGetEncoderCapacity"] = <intptr_t>__nvmlVgpuInstanceGetEncoderCapacity global __nvmlVgpuInstanceSetEncoderCapacity - data["__nvmlVgpuInstanceSetEncoderCapacity"] = <_cyb_intptr_t>__nvmlVgpuInstanceSetEncoderCapacity + data["__nvmlVgpuInstanceSetEncoderCapacity"] = <intptr_t>__nvmlVgpuInstanceSetEncoderCapacity global __nvmlVgpuInstanceGetEncoderStats - data["__nvmlVgpuInstanceGetEncoderStats"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetEncoderStats + data["__nvmlVgpuInstanceGetEncoderStats"] = <intptr_t>__nvmlVgpuInstanceGetEncoderStats global __nvmlVgpuInstanceGetEncoderSessions - data["__nvmlVgpuInstanceGetEncoderSessions"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetEncoderSessions + data["__nvmlVgpuInstanceGetEncoderSessions"] = <intptr_t>__nvmlVgpuInstanceGetEncoderSessions global __nvmlVgpuInstanceGetFBCStats - data["__nvmlVgpuInstanceGetFBCStats"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetFBCStats + data["__nvmlVgpuInstanceGetFBCStats"] = <intptr_t>__nvmlVgpuInstanceGetFBCStats global __nvmlVgpuInstanceGetFBCSessions - data["__nvmlVgpuInstanceGetFBCSessions"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetFBCSessions + data["__nvmlVgpuInstanceGetFBCSessions"] = <intptr_t>__nvmlVgpuInstanceGetFBCSessions global __nvmlVgpuInstanceGetGpuInstanceId - data["__nvmlVgpuInstanceGetGpuInstanceId"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetGpuInstanceId + data["__nvmlVgpuInstanceGetGpuInstanceId"] = <intptr_t>__nvmlVgpuInstanceGetGpuInstanceId global __nvmlVgpuInstanceGetGpuPciId - data["__nvmlVgpuInstanceGetGpuPciId"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetGpuPciId + data["__nvmlVgpuInstanceGetGpuPciId"] = <intptr_t>__nvmlVgpuInstanceGetGpuPciId global __nvmlVgpuTypeGetCapabilities - data["__nvmlVgpuTypeGetCapabilities"] = <_cyb_intptr_t>__nvmlVgpuTypeGetCapabilities + data["__nvmlVgpuTypeGetCapabilities"] = <intptr_t>__nvmlVgpuTypeGetCapabilities global __nvmlVgpuInstanceGetMdevUUID - data["__nvmlVgpuInstanceGetMdevUUID"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetMdevUUID + data["__nvmlVgpuInstanceGetMdevUUID"] = <intptr_t>__nvmlVgpuInstanceGetMdevUUID global __nvmlGpuInstanceGetCreatableVgpus - data["__nvmlGpuInstanceGetCreatableVgpus"] = <_cyb_intptr_t>__nvmlGpuInstanceGetCreatableVgpus + data["__nvmlGpuInstanceGetCreatableVgpus"] = <intptr_t>__nvmlGpuInstanceGetCreatableVgpus global __nvmlVgpuTypeGetMaxInstancesPerGpuInstance - data["__nvmlVgpuTypeGetMaxInstancesPerGpuInstance"] = <_cyb_intptr_t>__nvmlVgpuTypeGetMaxInstancesPerGpuInstance + data["__nvmlVgpuTypeGetMaxInstancesPerGpuInstance"] = <intptr_t>__nvmlVgpuTypeGetMaxInstancesPerGpuInstance global __nvmlGpuInstanceGetActiveVgpus - data["__nvmlGpuInstanceGetActiveVgpus"] = <_cyb_intptr_t>__nvmlGpuInstanceGetActiveVgpus + data["__nvmlGpuInstanceGetActiveVgpus"] = <intptr_t>__nvmlGpuInstanceGetActiveVgpus global __nvmlGpuInstanceSetVgpuSchedulerState - data["__nvmlGpuInstanceSetVgpuSchedulerState"] = <_cyb_intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState + data["__nvmlGpuInstanceSetVgpuSchedulerState"] = <intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState global __nvmlGpuInstanceGetVgpuSchedulerState - data["__nvmlGpuInstanceGetVgpuSchedulerState"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState + data["__nvmlGpuInstanceGetVgpuSchedulerState"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState global __nvmlGpuInstanceGetVgpuSchedulerLog - data["__nvmlGpuInstanceGetVgpuSchedulerLog"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog + data["__nvmlGpuInstanceGetVgpuSchedulerLog"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog global __nvmlGpuInstanceGetVgpuTypeCreatablePlacements - data["__nvmlGpuInstanceGetVgpuTypeCreatablePlacements"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuTypeCreatablePlacements + data["__nvmlGpuInstanceGetVgpuTypeCreatablePlacements"] = <intptr_t>__nvmlGpuInstanceGetVgpuTypeCreatablePlacements global __nvmlGpuInstanceGetVgpuHeterogeneousMode - data["__nvmlGpuInstanceGetVgpuHeterogeneousMode"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuHeterogeneousMode + data["__nvmlGpuInstanceGetVgpuHeterogeneousMode"] = <intptr_t>__nvmlGpuInstanceGetVgpuHeterogeneousMode global __nvmlGpuInstanceSetVgpuHeterogeneousMode - data["__nvmlGpuInstanceSetVgpuHeterogeneousMode"] = <_cyb_intptr_t>__nvmlGpuInstanceSetVgpuHeterogeneousMode + data["__nvmlGpuInstanceSetVgpuHeterogeneousMode"] = <intptr_t>__nvmlGpuInstanceSetVgpuHeterogeneousMode global __nvmlVgpuInstanceGetMetadata - data["__nvmlVgpuInstanceGetMetadata"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetMetadata + data["__nvmlVgpuInstanceGetMetadata"] = <intptr_t>__nvmlVgpuInstanceGetMetadata global __nvmlDeviceGetVgpuMetadata - data["__nvmlDeviceGetVgpuMetadata"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuMetadata + data["__nvmlDeviceGetVgpuMetadata"] = <intptr_t>__nvmlDeviceGetVgpuMetadata global __nvmlGetVgpuCompatibility - data["__nvmlGetVgpuCompatibility"] = <_cyb_intptr_t>__nvmlGetVgpuCompatibility + data["__nvmlGetVgpuCompatibility"] = <intptr_t>__nvmlGetVgpuCompatibility global __nvmlDeviceGetPgpuMetadataString - data["__nvmlDeviceGetPgpuMetadataString"] = <_cyb_intptr_t>__nvmlDeviceGetPgpuMetadataString + data["__nvmlDeviceGetPgpuMetadataString"] = <intptr_t>__nvmlDeviceGetPgpuMetadataString global __nvmlDeviceGetVgpuSchedulerLog - data["__nvmlDeviceGetVgpuSchedulerLog"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerLog + data["__nvmlDeviceGetVgpuSchedulerLog"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerLog global __nvmlDeviceGetVgpuSchedulerState - data["__nvmlDeviceGetVgpuSchedulerState"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerState + data["__nvmlDeviceGetVgpuSchedulerState"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerState global __nvmlDeviceGetVgpuSchedulerCapabilities - data["__nvmlDeviceGetVgpuSchedulerCapabilities"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerCapabilities + data["__nvmlDeviceGetVgpuSchedulerCapabilities"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerCapabilities global __nvmlDeviceSetVgpuSchedulerState - data["__nvmlDeviceSetVgpuSchedulerState"] = <_cyb_intptr_t>__nvmlDeviceSetVgpuSchedulerState + data["__nvmlDeviceSetVgpuSchedulerState"] = <intptr_t>__nvmlDeviceSetVgpuSchedulerState global __nvmlGetVgpuVersion - data["__nvmlGetVgpuVersion"] = <_cyb_intptr_t>__nvmlGetVgpuVersion + data["__nvmlGetVgpuVersion"] = <intptr_t>__nvmlGetVgpuVersion global __nvmlSetVgpuVersion - data["__nvmlSetVgpuVersion"] = <_cyb_intptr_t>__nvmlSetVgpuVersion + data["__nvmlSetVgpuVersion"] = <intptr_t>__nvmlSetVgpuVersion global __nvmlDeviceGetVgpuUtilization - data["__nvmlDeviceGetVgpuUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuUtilization + data["__nvmlDeviceGetVgpuUtilization"] = <intptr_t>__nvmlDeviceGetVgpuUtilization global __nvmlDeviceGetVgpuInstancesUtilizationInfo - data["__nvmlDeviceGetVgpuInstancesUtilizationInfo"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuInstancesUtilizationInfo + data["__nvmlDeviceGetVgpuInstancesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetVgpuInstancesUtilizationInfo global __nvmlDeviceGetVgpuProcessUtilization - data["__nvmlDeviceGetVgpuProcessUtilization"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuProcessUtilization + data["__nvmlDeviceGetVgpuProcessUtilization"] = <intptr_t>__nvmlDeviceGetVgpuProcessUtilization global __nvmlDeviceGetVgpuProcessesUtilizationInfo - data["__nvmlDeviceGetVgpuProcessesUtilizationInfo"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuProcessesUtilizationInfo + data["__nvmlDeviceGetVgpuProcessesUtilizationInfo"] = <intptr_t>__nvmlDeviceGetVgpuProcessesUtilizationInfo global __nvmlVgpuInstanceGetAccountingMode - data["__nvmlVgpuInstanceGetAccountingMode"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetAccountingMode + data["__nvmlVgpuInstanceGetAccountingMode"] = <intptr_t>__nvmlVgpuInstanceGetAccountingMode global __nvmlVgpuInstanceGetAccountingPids - data["__nvmlVgpuInstanceGetAccountingPids"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetAccountingPids + data["__nvmlVgpuInstanceGetAccountingPids"] = <intptr_t>__nvmlVgpuInstanceGetAccountingPids global __nvmlVgpuInstanceGetAccountingStats - data["__nvmlVgpuInstanceGetAccountingStats"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetAccountingStats + data["__nvmlVgpuInstanceGetAccountingStats"] = <intptr_t>__nvmlVgpuInstanceGetAccountingStats global __nvmlVgpuInstanceClearAccountingPids - data["__nvmlVgpuInstanceClearAccountingPids"] = <_cyb_intptr_t>__nvmlVgpuInstanceClearAccountingPids + data["__nvmlVgpuInstanceClearAccountingPids"] = <intptr_t>__nvmlVgpuInstanceClearAccountingPids global __nvmlVgpuInstanceGetLicenseInfo_v2 - data["__nvmlVgpuInstanceGetLicenseInfo_v2"] = <_cyb_intptr_t>__nvmlVgpuInstanceGetLicenseInfo_v2 + data["__nvmlVgpuInstanceGetLicenseInfo_v2"] = <intptr_t>__nvmlVgpuInstanceGetLicenseInfo_v2 global __nvmlGetExcludedDeviceCount - data["__nvmlGetExcludedDeviceCount"] = <_cyb_intptr_t>__nvmlGetExcludedDeviceCount + data["__nvmlGetExcludedDeviceCount"] = <intptr_t>__nvmlGetExcludedDeviceCount global __nvmlGetExcludedDeviceInfoByIndex - data["__nvmlGetExcludedDeviceInfoByIndex"] = <_cyb_intptr_t>__nvmlGetExcludedDeviceInfoByIndex + data["__nvmlGetExcludedDeviceInfoByIndex"] = <intptr_t>__nvmlGetExcludedDeviceInfoByIndex global __nvmlDeviceSetMigMode - data["__nvmlDeviceSetMigMode"] = <_cyb_intptr_t>__nvmlDeviceSetMigMode + data["__nvmlDeviceSetMigMode"] = <intptr_t>__nvmlDeviceSetMigMode global __nvmlDeviceGetMigMode - data["__nvmlDeviceGetMigMode"] = <_cyb_intptr_t>__nvmlDeviceGetMigMode + data["__nvmlDeviceGetMigMode"] = <intptr_t>__nvmlDeviceGetMigMode global __nvmlDeviceGetGpuInstanceProfileInfoV - data["__nvmlDeviceGetGpuInstanceProfileInfoV"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoV + data["__nvmlDeviceGetGpuInstanceProfileInfoV"] = <intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoV global __nvmlDeviceGetGpuInstancePossiblePlacements_v2 - data["__nvmlDeviceGetGpuInstancePossiblePlacements_v2"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstancePossiblePlacements_v2 + data["__nvmlDeviceGetGpuInstancePossiblePlacements_v2"] = <intptr_t>__nvmlDeviceGetGpuInstancePossiblePlacements_v2 global __nvmlDeviceGetGpuInstanceRemainingCapacity - data["__nvmlDeviceGetGpuInstanceRemainingCapacity"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceRemainingCapacity + data["__nvmlDeviceGetGpuInstanceRemainingCapacity"] = <intptr_t>__nvmlDeviceGetGpuInstanceRemainingCapacity global __nvmlDeviceCreateGpuInstance - data["__nvmlDeviceCreateGpuInstance"] = <_cyb_intptr_t>__nvmlDeviceCreateGpuInstance + data["__nvmlDeviceCreateGpuInstance"] = <intptr_t>__nvmlDeviceCreateGpuInstance global __nvmlDeviceCreateGpuInstanceWithPlacement - data["__nvmlDeviceCreateGpuInstanceWithPlacement"] = <_cyb_intptr_t>__nvmlDeviceCreateGpuInstanceWithPlacement + data["__nvmlDeviceCreateGpuInstanceWithPlacement"] = <intptr_t>__nvmlDeviceCreateGpuInstanceWithPlacement global __nvmlGpuInstanceDestroy - data["__nvmlGpuInstanceDestroy"] = <_cyb_intptr_t>__nvmlGpuInstanceDestroy + data["__nvmlGpuInstanceDestroy"] = <intptr_t>__nvmlGpuInstanceDestroy global __nvmlDeviceGetGpuInstances - data["__nvmlDeviceGetGpuInstances"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstances + data["__nvmlDeviceGetGpuInstances"] = <intptr_t>__nvmlDeviceGetGpuInstances global __nvmlDeviceGetGpuInstanceById - data["__nvmlDeviceGetGpuInstanceById"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceById + data["__nvmlDeviceGetGpuInstanceById"] = <intptr_t>__nvmlDeviceGetGpuInstanceById global __nvmlGpuInstanceGetInfo - data["__nvmlGpuInstanceGetInfo"] = <_cyb_intptr_t>__nvmlGpuInstanceGetInfo + data["__nvmlGpuInstanceGetInfo"] = <intptr_t>__nvmlGpuInstanceGetInfo global __nvmlGpuInstanceGetComputeInstanceProfileInfoV - data["__nvmlGpuInstanceGetComputeInstanceProfileInfoV"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstanceProfileInfoV + data["__nvmlGpuInstanceGetComputeInstanceProfileInfoV"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceProfileInfoV global __nvmlGpuInstanceGetComputeInstanceRemainingCapacity - data["__nvmlGpuInstanceGetComputeInstanceRemainingCapacity"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstanceRemainingCapacity + data["__nvmlGpuInstanceGetComputeInstanceRemainingCapacity"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceRemainingCapacity global __nvmlGpuInstanceGetComputeInstancePossiblePlacements - data["__nvmlGpuInstanceGetComputeInstancePossiblePlacements"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstancePossiblePlacements + data["__nvmlGpuInstanceGetComputeInstancePossiblePlacements"] = <intptr_t>__nvmlGpuInstanceGetComputeInstancePossiblePlacements global __nvmlGpuInstanceCreateComputeInstance - data["__nvmlGpuInstanceCreateComputeInstance"] = <_cyb_intptr_t>__nvmlGpuInstanceCreateComputeInstance + data["__nvmlGpuInstanceCreateComputeInstance"] = <intptr_t>__nvmlGpuInstanceCreateComputeInstance global __nvmlGpuInstanceCreateComputeInstanceWithPlacement - data["__nvmlGpuInstanceCreateComputeInstanceWithPlacement"] = <_cyb_intptr_t>__nvmlGpuInstanceCreateComputeInstanceWithPlacement + data["__nvmlGpuInstanceCreateComputeInstanceWithPlacement"] = <intptr_t>__nvmlGpuInstanceCreateComputeInstanceWithPlacement global __nvmlComputeInstanceDestroy - data["__nvmlComputeInstanceDestroy"] = <_cyb_intptr_t>__nvmlComputeInstanceDestroy + data["__nvmlComputeInstanceDestroy"] = <intptr_t>__nvmlComputeInstanceDestroy global __nvmlGpuInstanceGetComputeInstances - data["__nvmlGpuInstanceGetComputeInstances"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstances + data["__nvmlGpuInstanceGetComputeInstances"] = <intptr_t>__nvmlGpuInstanceGetComputeInstances global __nvmlGpuInstanceGetComputeInstanceById - data["__nvmlGpuInstanceGetComputeInstanceById"] = <_cyb_intptr_t>__nvmlGpuInstanceGetComputeInstanceById + data["__nvmlGpuInstanceGetComputeInstanceById"] = <intptr_t>__nvmlGpuInstanceGetComputeInstanceById global __nvmlComputeInstanceGetInfo_v2 - data["__nvmlComputeInstanceGetInfo_v2"] = <_cyb_intptr_t>__nvmlComputeInstanceGetInfo_v2 + data["__nvmlComputeInstanceGetInfo_v2"] = <intptr_t>__nvmlComputeInstanceGetInfo_v2 global __nvmlDeviceIsMigDeviceHandle - data["__nvmlDeviceIsMigDeviceHandle"] = <_cyb_intptr_t>__nvmlDeviceIsMigDeviceHandle + data["__nvmlDeviceIsMigDeviceHandle"] = <intptr_t>__nvmlDeviceIsMigDeviceHandle global __nvmlDeviceGetGpuInstanceId - data["__nvmlDeviceGetGpuInstanceId"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceId + data["__nvmlDeviceGetGpuInstanceId"] = <intptr_t>__nvmlDeviceGetGpuInstanceId global __nvmlDeviceGetComputeInstanceId - data["__nvmlDeviceGetComputeInstanceId"] = <_cyb_intptr_t>__nvmlDeviceGetComputeInstanceId + data["__nvmlDeviceGetComputeInstanceId"] = <intptr_t>__nvmlDeviceGetComputeInstanceId global __nvmlDeviceGetMaxMigDeviceCount - data["__nvmlDeviceGetMaxMigDeviceCount"] = <_cyb_intptr_t>__nvmlDeviceGetMaxMigDeviceCount + data["__nvmlDeviceGetMaxMigDeviceCount"] = <intptr_t>__nvmlDeviceGetMaxMigDeviceCount global __nvmlDeviceGetMigDeviceHandleByIndex - data["__nvmlDeviceGetMigDeviceHandleByIndex"] = <_cyb_intptr_t>__nvmlDeviceGetMigDeviceHandleByIndex + data["__nvmlDeviceGetMigDeviceHandleByIndex"] = <intptr_t>__nvmlDeviceGetMigDeviceHandleByIndex global __nvmlDeviceGetDeviceHandleFromMigDeviceHandle - data["__nvmlDeviceGetDeviceHandleFromMigDeviceHandle"] = <_cyb_intptr_t>__nvmlDeviceGetDeviceHandleFromMigDeviceHandle + data["__nvmlDeviceGetDeviceHandleFromMigDeviceHandle"] = <intptr_t>__nvmlDeviceGetDeviceHandleFromMigDeviceHandle global __nvmlDeviceGetCapabilities - data["__nvmlDeviceGetCapabilities"] = <_cyb_intptr_t>__nvmlDeviceGetCapabilities + data["__nvmlDeviceGetCapabilities"] = <intptr_t>__nvmlDeviceGetCapabilities global __nvmlDevicePowerSmoothingActivatePresetProfile - data["__nvmlDevicePowerSmoothingActivatePresetProfile"] = <_cyb_intptr_t>__nvmlDevicePowerSmoothingActivatePresetProfile + data["__nvmlDevicePowerSmoothingActivatePresetProfile"] = <intptr_t>__nvmlDevicePowerSmoothingActivatePresetProfile global __nvmlDevicePowerSmoothingUpdatePresetProfileParam - data["__nvmlDevicePowerSmoothingUpdatePresetProfileParam"] = <_cyb_intptr_t>__nvmlDevicePowerSmoothingUpdatePresetProfileParam + data["__nvmlDevicePowerSmoothingUpdatePresetProfileParam"] = <intptr_t>__nvmlDevicePowerSmoothingUpdatePresetProfileParam global __nvmlDevicePowerSmoothingSetState - data["__nvmlDevicePowerSmoothingSetState"] = <_cyb_intptr_t>__nvmlDevicePowerSmoothingSetState + data["__nvmlDevicePowerSmoothingSetState"] = <intptr_t>__nvmlDevicePowerSmoothingSetState global __nvmlDeviceGetAddressingMode - data["__nvmlDeviceGetAddressingMode"] = <_cyb_intptr_t>__nvmlDeviceGetAddressingMode + data["__nvmlDeviceGetAddressingMode"] = <intptr_t>__nvmlDeviceGetAddressingMode global __nvmlDeviceGetRepairStatus - data["__nvmlDeviceGetRepairStatus"] = <_cyb_intptr_t>__nvmlDeviceGetRepairStatus + data["__nvmlDeviceGetRepairStatus"] = <intptr_t>__nvmlDeviceGetRepairStatus global __nvmlDeviceGetPowerMizerMode_v1 - data["__nvmlDeviceGetPowerMizerMode_v1"] = <_cyb_intptr_t>__nvmlDeviceGetPowerMizerMode_v1 + data["__nvmlDeviceGetPowerMizerMode_v1"] = <intptr_t>__nvmlDeviceGetPowerMizerMode_v1 global __nvmlDeviceSetPowerMizerMode_v1 - data["__nvmlDeviceSetPowerMizerMode_v1"] = <_cyb_intptr_t>__nvmlDeviceSetPowerMizerMode_v1 + data["__nvmlDeviceSetPowerMizerMode_v1"] = <intptr_t>__nvmlDeviceSetPowerMizerMode_v1 global __nvmlDeviceGetPdi - data["__nvmlDeviceGetPdi"] = <_cyb_intptr_t>__nvmlDeviceGetPdi + data["__nvmlDeviceGetPdi"] = <intptr_t>__nvmlDeviceGetPdi global __nvmlDeviceSetHostname_v1 - data["__nvmlDeviceSetHostname_v1"] = <_cyb_intptr_t>__nvmlDeviceSetHostname_v1 + data["__nvmlDeviceSetHostname_v1"] = <intptr_t>__nvmlDeviceSetHostname_v1 global __nvmlDeviceGetHostname_v1 - data["__nvmlDeviceGetHostname_v1"] = <_cyb_intptr_t>__nvmlDeviceGetHostname_v1 + data["__nvmlDeviceGetHostname_v1"] = <intptr_t>__nvmlDeviceGetHostname_v1 global __nvmlDeviceGetNvLinkInfo - data["__nvmlDeviceGetNvLinkInfo"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkInfo + data["__nvmlDeviceGetNvLinkInfo"] = <intptr_t>__nvmlDeviceGetNvLinkInfo global __nvmlDeviceReadWritePRM_v1 - data["__nvmlDeviceReadWritePRM_v1"] = <_cyb_intptr_t>__nvmlDeviceReadWritePRM_v1 + data["__nvmlDeviceReadWritePRM_v1"] = <intptr_t>__nvmlDeviceReadWritePRM_v1 global __nvmlDeviceGetGpuInstanceProfileInfoByIdV - data["__nvmlDeviceGetGpuInstanceProfileInfoByIdV"] = <_cyb_intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoByIdV + data["__nvmlDeviceGetGpuInstanceProfileInfoByIdV"] = <intptr_t>__nvmlDeviceGetGpuInstanceProfileInfoByIdV global __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts - data["__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts"] = <_cyb_intptr_t>__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts + data["__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts"] = <intptr_t>__nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts global __nvmlDeviceGetUnrepairableMemoryFlag_v1 - data["__nvmlDeviceGetUnrepairableMemoryFlag_v1"] = <_cyb_intptr_t>__nvmlDeviceGetUnrepairableMemoryFlag_v1 + data["__nvmlDeviceGetUnrepairableMemoryFlag_v1"] = <intptr_t>__nvmlDeviceGetUnrepairableMemoryFlag_v1 global __nvmlDeviceReadPRMCounters_v1 - data["__nvmlDeviceReadPRMCounters_v1"] = <_cyb_intptr_t>__nvmlDeviceReadPRMCounters_v1 + data["__nvmlDeviceReadPRMCounters_v1"] = <intptr_t>__nvmlDeviceReadPRMCounters_v1 global __nvmlDeviceSetRusdSettings_v1 - data["__nvmlDeviceSetRusdSettings_v1"] = <_cyb_intptr_t>__nvmlDeviceSetRusdSettings_v1 + data["__nvmlDeviceSetRusdSettings_v1"] = <intptr_t>__nvmlDeviceSetRusdSettings_v1 global __nvmlDeviceVgpuForceGspUnload - data["__nvmlDeviceVgpuForceGspUnload"] = <_cyb_intptr_t>__nvmlDeviceVgpuForceGspUnload + data["__nvmlDeviceVgpuForceGspUnload"] = <intptr_t>__nvmlDeviceVgpuForceGspUnload global __nvmlDeviceGetVgpuSchedulerState_v2 - data["__nvmlDeviceGetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerState_v2 + data["__nvmlDeviceGetVgpuSchedulerState_v2"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerState_v2 global __nvmlGpuInstanceGetVgpuSchedulerState_v2 - data["__nvmlGpuInstanceGetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerState_v2"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerState_v2 global __nvmlDeviceGetVgpuSchedulerLog_v2 - data["__nvmlDeviceGetVgpuSchedulerLog_v2"] = <_cyb_intptr_t>__nvmlDeviceGetVgpuSchedulerLog_v2 + data["__nvmlDeviceGetVgpuSchedulerLog_v2"] = <intptr_t>__nvmlDeviceGetVgpuSchedulerLog_v2 global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 - data["__nvmlGpuInstanceGetVgpuSchedulerLog_v2"] = <_cyb_intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerLog_v2"] = <intptr_t>__nvmlGpuInstanceGetVgpuSchedulerLog_v2 global __nvmlDeviceSetVgpuSchedulerState_v2 - data["__nvmlDeviceSetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlDeviceSetVgpuSchedulerState_v2 + data["__nvmlDeviceSetVgpuSchedulerState_v2"] = <intptr_t>__nvmlDeviceSetVgpuSchedulerState_v2 global __nvmlGpuInstanceSetVgpuSchedulerState_v2 - data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = <intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState_v2 global __nvmlSystemGetCPER_v1 - data["__nvmlSystemGetCPER_v1"] = <_cyb_intptr_t>__nvmlSystemGetCPER_v1 + data["__nvmlSystemGetCPER_v1"] = <intptr_t>__nvmlSystemGetCPER_v1 global __nvmlDeviceGetBBXTimeData_v1 - data["__nvmlDeviceGetBBXTimeData_v1"] = <_cyb_intptr_t>__nvmlDeviceGetBBXTimeData_v1 + data["__nvmlDeviceGetBBXTimeData_v1"] = <intptr_t>__nvmlDeviceGetBBXTimeData_v1 global __nvmlDeviceGetAccountingStats_v2 - data["__nvmlDeviceGetAccountingStats_v2"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingStats_v2 + data["__nvmlDeviceGetAccountingStats_v2"] = <intptr_t>__nvmlDeviceGetAccountingStats_v2 global __nvmlDeviceGetRemappedRows_v2 - data["__nvmlDeviceGetRemappedRows_v2"] = <_cyb_intptr_t>__nvmlDeviceGetRemappedRows_v2 + data["__nvmlDeviceGetRemappedRows_v2"] = <intptr_t>__nvmlDeviceGetRemappedRows_v2 global __nvmlDeviceSetAdaptiveTgpMode_v1 - data["__nvmlDeviceSetAdaptiveTgpMode_v1"] = <_cyb_intptr_t>__nvmlDeviceSetAdaptiveTgpMode_v1 + data["__nvmlDeviceSetAdaptiveTgpMode_v1"] = <intptr_t>__nvmlDeviceSetAdaptiveTgpMode_v1 global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 - data["__nvmlDeviceGetAdaptiveTgpModeInfo_v1"] = <_cyb_intptr_t>__nvmlDeviceGetAdaptiveTgpModeInfo_v1 + data["__nvmlDeviceGetAdaptiveTgpModeInfo_v1"] = <intptr_t>__nvmlDeviceGetAdaptiveTgpModeInfo_v1 global __nvmlDeviceSetMemoryLimits_v1 - data["__nvmlDeviceSetMemoryLimits_v1"] = <_cyb_intptr_t>__nvmlDeviceSetMemoryLimits_v1 + data["__nvmlDeviceSetMemoryLimits_v1"] = <intptr_t>__nvmlDeviceSetMemoryLimits_v1 global __nvmlDeviceGetMemoryLimits_v1 - data["__nvmlDeviceGetMemoryLimits_v1"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryLimits_v1 + data["__nvmlDeviceGetMemoryLimits_v1"] = <intptr_t>__nvmlDeviceGetMemoryLimits_v1 global __nvmlDeviceGetGpuFabricInfo_v4 - data["__nvmlDeviceGetGpuFabricInfo_v4"] = <_cyb_intptr_t>__nvmlDeviceGetGpuFabricInfo_v4 + data["__nvmlDeviceGetGpuFabricInfo_v4"] = <intptr_t>__nvmlDeviceGetGpuFabricInfo_v4 global __nvmlDevicePerfMetricsGetSamples_v1 - data["__nvmlDevicePerfMetricsGetSamples_v1"] = <_cyb_intptr_t>__nvmlDevicePerfMetricsGetSamples_v1 + data["__nvmlDevicePerfMetricsGetSamples_v1"] = <intptr_t>__nvmlDevicePerfMetricsGetSamples_v1 global __nvmlDeviceSetNvlinkBwModeAsync_v1 - data["__nvmlDeviceSetNvlinkBwModeAsync_v1"] = <_cyb_intptr_t>__nvmlDeviceSetNvlinkBwModeAsync_v1 + data["__nvmlDeviceSetNvlinkBwModeAsync_v1"] = <intptr_t>__nvmlDeviceSetNvlinkBwModeAsync_v1 global __nvmlDeviceGetNvLinkTelemetrySamples_v1 - data["__nvmlDeviceGetNvLinkTelemetrySamples_v1"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkTelemetrySamples_v1 + data["__nvmlDeviceGetNvLinkTelemetrySamples_v1"] = <intptr_t>__nvmlDeviceGetNvLinkTelemetrySamples_v1 global __nvmlEventSetRegisterGpuOperationalEvents_v1 - data["__nvmlEventSetRegisterGpuOperationalEvents_v1"] = <_cyb_intptr_t>__nvmlEventSetRegisterGpuOperationalEvents_v1 + data["__nvmlEventSetRegisterGpuOperationalEvents_v1"] = <intptr_t>__nvmlEventSetRegisterGpuOperationalEvents_v1 global __nvmlEventSetWait_v3 - data["__nvmlEventSetWait_v3"] = <_cyb_intptr_t>__nvmlEventSetWait_v3 + data["__nvmlEventSetWait_v3"] = <intptr_t>__nvmlEventSetWait_v3 global __nvmlEventSetGetContextCount_v1 - data["__nvmlEventSetGetContextCount_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextCount_v1 + data["__nvmlEventSetGetContextCount_v1"] = <intptr_t>__nvmlEventSetGetContextCount_v1 global __nvmlEventSetGetContextInfo_v1 - data["__nvmlEventSetGetContextInfo_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextInfo_v1 + data["__nvmlEventSetGetContextInfo_v1"] = <intptr_t>__nvmlEventSetGetContextInfo_v1 global __nvmlEventSetGetContextData_v1 - data["__nvmlEventSetGetContextData_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextData_v1 + data["__nvmlEventSetGetContextData_v1"] = <intptr_t>__nvmlEventSetGetContextData_v1 global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 - data["__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1"] = <_cyb_intptr_t>__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + data["__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1"] = <intptr_t>__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 global __nvmlDeviceGetBankRemapperStatus_v1 - data["__nvmlDeviceGetBankRemapperStatus_v1"] = <_cyb_intptr_t>__nvmlDeviceGetBankRemapperStatus_v1 + data["__nvmlDeviceGetBankRemapperStatus_v1"] = <intptr_t>__nvmlDeviceGetBankRemapperStatus_v1 _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx index 06a6277d829..a946c5f7436 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3d6013b99cb59aaab8ae661d838401b123ed27efda53268eab153c7add7ca3a8 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ff8ab1d01d04a6bc7ea43685ddbd6512479385981974c6a7e08bacbb0e651602 # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,7 @@ cdef extern from "<dlfcn.h>": void* _cyb_dlsym "dlsym"(void*, const char*) nogil const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport intptr_t import threading as _cyb_threading @@ -322,91 +322,91 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvrtc() cdef dict data = {} global __nvrtcGetErrorString - data["__nvrtcGetErrorString"] = <_cyb_intptr_t>__nvrtcGetErrorString + data["__nvrtcGetErrorString"] = <intptr_t>__nvrtcGetErrorString global __nvrtcVersion - data["__nvrtcVersion"] = <_cyb_intptr_t>__nvrtcVersion + data["__nvrtcVersion"] = <intptr_t>__nvrtcVersion global __nvrtcGetNumSupportedArchs - data["__nvrtcGetNumSupportedArchs"] = <_cyb_intptr_t>__nvrtcGetNumSupportedArchs + data["__nvrtcGetNumSupportedArchs"] = <intptr_t>__nvrtcGetNumSupportedArchs global __nvrtcGetSupportedArchs - data["__nvrtcGetSupportedArchs"] = <_cyb_intptr_t>__nvrtcGetSupportedArchs + data["__nvrtcGetSupportedArchs"] = <intptr_t>__nvrtcGetSupportedArchs global __nvrtcCreateProgram - data["__nvrtcCreateProgram"] = <_cyb_intptr_t>__nvrtcCreateProgram + data["__nvrtcCreateProgram"] = <intptr_t>__nvrtcCreateProgram global __nvrtcDestroyProgram - data["__nvrtcDestroyProgram"] = <_cyb_intptr_t>__nvrtcDestroyProgram + data["__nvrtcDestroyProgram"] = <intptr_t>__nvrtcDestroyProgram global __nvrtcCompileProgram - data["__nvrtcCompileProgram"] = <_cyb_intptr_t>__nvrtcCompileProgram + data["__nvrtcCompileProgram"] = <intptr_t>__nvrtcCompileProgram global __nvrtcGetPTXSize - data["__nvrtcGetPTXSize"] = <_cyb_intptr_t>__nvrtcGetPTXSize + data["__nvrtcGetPTXSize"] = <intptr_t>__nvrtcGetPTXSize global __nvrtcGetPTX - data["__nvrtcGetPTX"] = <_cyb_intptr_t>__nvrtcGetPTX + data["__nvrtcGetPTX"] = <intptr_t>__nvrtcGetPTX global __nvrtcGetCUBINSize - data["__nvrtcGetCUBINSize"] = <_cyb_intptr_t>__nvrtcGetCUBINSize + data["__nvrtcGetCUBINSize"] = <intptr_t>__nvrtcGetCUBINSize global __nvrtcGetCUBIN - data["__nvrtcGetCUBIN"] = <_cyb_intptr_t>__nvrtcGetCUBIN + data["__nvrtcGetCUBIN"] = <intptr_t>__nvrtcGetCUBIN global __nvrtcGetLTOIRSize - data["__nvrtcGetLTOIRSize"] = <_cyb_intptr_t>__nvrtcGetLTOIRSize + data["__nvrtcGetLTOIRSize"] = <intptr_t>__nvrtcGetLTOIRSize global __nvrtcGetLTOIR - data["__nvrtcGetLTOIR"] = <_cyb_intptr_t>__nvrtcGetLTOIR + data["__nvrtcGetLTOIR"] = <intptr_t>__nvrtcGetLTOIR global __nvrtcGetOptiXIRSize - data["__nvrtcGetOptiXIRSize"] = <_cyb_intptr_t>__nvrtcGetOptiXIRSize + data["__nvrtcGetOptiXIRSize"] = <intptr_t>__nvrtcGetOptiXIRSize global __nvrtcGetOptiXIR - data["__nvrtcGetOptiXIR"] = <_cyb_intptr_t>__nvrtcGetOptiXIR + data["__nvrtcGetOptiXIR"] = <intptr_t>__nvrtcGetOptiXIR global __nvrtcGetProgramLogSize - data["__nvrtcGetProgramLogSize"] = <_cyb_intptr_t>__nvrtcGetProgramLogSize + data["__nvrtcGetProgramLogSize"] = <intptr_t>__nvrtcGetProgramLogSize global __nvrtcGetProgramLog - data["__nvrtcGetProgramLog"] = <_cyb_intptr_t>__nvrtcGetProgramLog + data["__nvrtcGetProgramLog"] = <intptr_t>__nvrtcGetProgramLog global __nvrtcAddNameExpression - data["__nvrtcAddNameExpression"] = <_cyb_intptr_t>__nvrtcAddNameExpression + data["__nvrtcAddNameExpression"] = <intptr_t>__nvrtcAddNameExpression global __nvrtcGetLoweredName - data["__nvrtcGetLoweredName"] = <_cyb_intptr_t>__nvrtcGetLoweredName + data["__nvrtcGetLoweredName"] = <intptr_t>__nvrtcGetLoweredName global __nvrtcGetPCHHeapSize - data["__nvrtcGetPCHHeapSize"] = <_cyb_intptr_t>__nvrtcGetPCHHeapSize + data["__nvrtcGetPCHHeapSize"] = <intptr_t>__nvrtcGetPCHHeapSize global __nvrtcSetPCHHeapSize - data["__nvrtcSetPCHHeapSize"] = <_cyb_intptr_t>__nvrtcSetPCHHeapSize + data["__nvrtcSetPCHHeapSize"] = <intptr_t>__nvrtcSetPCHHeapSize global __nvrtcGetPCHCreateStatus - data["__nvrtcGetPCHCreateStatus"] = <_cyb_intptr_t>__nvrtcGetPCHCreateStatus + data["__nvrtcGetPCHCreateStatus"] = <intptr_t>__nvrtcGetPCHCreateStatus global __nvrtcGetPCHHeapSizeRequired - data["__nvrtcGetPCHHeapSizeRequired"] = <_cyb_intptr_t>__nvrtcGetPCHHeapSizeRequired + data["__nvrtcGetPCHHeapSizeRequired"] = <intptr_t>__nvrtcGetPCHHeapSizeRequired global __nvrtcSetFlowCallback - data["__nvrtcSetFlowCallback"] = <_cyb_intptr_t>__nvrtcSetFlowCallback + data["__nvrtcSetFlowCallback"] = <intptr_t>__nvrtcSetFlowCallback global __nvrtcGetTileIRSize - data["__nvrtcGetTileIRSize"] = <_cyb_intptr_t>__nvrtcGetTileIRSize + data["__nvrtcGetTileIRSize"] = <intptr_t>__nvrtcGetTileIRSize global __nvrtcGetTileIR - data["__nvrtcGetTileIR"] = <_cyb_intptr_t>__nvrtcGetTileIR + data["__nvrtcGetTileIR"] = <intptr_t>__nvrtcGetTileIR global __nvrtcInstallBundledHeaders - data["__nvrtcInstallBundledHeaders"] = <_cyb_intptr_t>__nvrtcInstallBundledHeaders + data["__nvrtcInstallBundledHeaders"] = <intptr_t>__nvrtcInstallBundledHeaders global __nvrtcGetBundledHeadersInfo - data["__nvrtcGetBundledHeadersInfo"] = <_cyb_intptr_t>__nvrtcGetBundledHeadersInfo + data["__nvrtcGetBundledHeadersInfo"] = <intptr_t>__nvrtcGetBundledHeadersInfo global __nvrtcRemoveBundledHeaders - data["__nvrtcRemoveBundledHeaders"] = <_cyb_intptr_t>__nvrtcRemoveBundledHeaders + data["__nvrtcRemoveBundledHeaders"] = <intptr_t>__nvrtcRemoveBundledHeaders _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx index 752c659677f..5e343e3033e 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=574a59b0c82321fb7c287f06c11dd873715e47bea253df57466f0cfc29d8f5de +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7e09096317d97b6fa04099e31ae2ab90d762f42a7dbd13ce79fe865737b746e4 # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,10 @@ cdef extern from "<windows.h>": ctypedef void* HMODULE void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport ( + intptr_t, + uintptr_t, +) import threading as _cyb_threading @@ -206,91 +209,91 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvrtc() cdef dict data = {} global __nvrtcGetErrorString - data["__nvrtcGetErrorString"] = <_cyb_intptr_t>__nvrtcGetErrorString + data["__nvrtcGetErrorString"] = <intptr_t>__nvrtcGetErrorString global __nvrtcVersion - data["__nvrtcVersion"] = <_cyb_intptr_t>__nvrtcVersion + data["__nvrtcVersion"] = <intptr_t>__nvrtcVersion global __nvrtcGetNumSupportedArchs - data["__nvrtcGetNumSupportedArchs"] = <_cyb_intptr_t>__nvrtcGetNumSupportedArchs + data["__nvrtcGetNumSupportedArchs"] = <intptr_t>__nvrtcGetNumSupportedArchs global __nvrtcGetSupportedArchs - data["__nvrtcGetSupportedArchs"] = <_cyb_intptr_t>__nvrtcGetSupportedArchs + data["__nvrtcGetSupportedArchs"] = <intptr_t>__nvrtcGetSupportedArchs global __nvrtcCreateProgram - data["__nvrtcCreateProgram"] = <_cyb_intptr_t>__nvrtcCreateProgram + data["__nvrtcCreateProgram"] = <intptr_t>__nvrtcCreateProgram global __nvrtcDestroyProgram - data["__nvrtcDestroyProgram"] = <_cyb_intptr_t>__nvrtcDestroyProgram + data["__nvrtcDestroyProgram"] = <intptr_t>__nvrtcDestroyProgram global __nvrtcCompileProgram - data["__nvrtcCompileProgram"] = <_cyb_intptr_t>__nvrtcCompileProgram + data["__nvrtcCompileProgram"] = <intptr_t>__nvrtcCompileProgram global __nvrtcGetPTXSize - data["__nvrtcGetPTXSize"] = <_cyb_intptr_t>__nvrtcGetPTXSize + data["__nvrtcGetPTXSize"] = <intptr_t>__nvrtcGetPTXSize global __nvrtcGetPTX - data["__nvrtcGetPTX"] = <_cyb_intptr_t>__nvrtcGetPTX + data["__nvrtcGetPTX"] = <intptr_t>__nvrtcGetPTX global __nvrtcGetCUBINSize - data["__nvrtcGetCUBINSize"] = <_cyb_intptr_t>__nvrtcGetCUBINSize + data["__nvrtcGetCUBINSize"] = <intptr_t>__nvrtcGetCUBINSize global __nvrtcGetCUBIN - data["__nvrtcGetCUBIN"] = <_cyb_intptr_t>__nvrtcGetCUBIN + data["__nvrtcGetCUBIN"] = <intptr_t>__nvrtcGetCUBIN global __nvrtcGetLTOIRSize - data["__nvrtcGetLTOIRSize"] = <_cyb_intptr_t>__nvrtcGetLTOIRSize + data["__nvrtcGetLTOIRSize"] = <intptr_t>__nvrtcGetLTOIRSize global __nvrtcGetLTOIR - data["__nvrtcGetLTOIR"] = <_cyb_intptr_t>__nvrtcGetLTOIR + data["__nvrtcGetLTOIR"] = <intptr_t>__nvrtcGetLTOIR global __nvrtcGetOptiXIRSize - data["__nvrtcGetOptiXIRSize"] = <_cyb_intptr_t>__nvrtcGetOptiXIRSize + data["__nvrtcGetOptiXIRSize"] = <intptr_t>__nvrtcGetOptiXIRSize global __nvrtcGetOptiXIR - data["__nvrtcGetOptiXIR"] = <_cyb_intptr_t>__nvrtcGetOptiXIR + data["__nvrtcGetOptiXIR"] = <intptr_t>__nvrtcGetOptiXIR global __nvrtcGetProgramLogSize - data["__nvrtcGetProgramLogSize"] = <_cyb_intptr_t>__nvrtcGetProgramLogSize + data["__nvrtcGetProgramLogSize"] = <intptr_t>__nvrtcGetProgramLogSize global __nvrtcGetProgramLog - data["__nvrtcGetProgramLog"] = <_cyb_intptr_t>__nvrtcGetProgramLog + data["__nvrtcGetProgramLog"] = <intptr_t>__nvrtcGetProgramLog global __nvrtcAddNameExpression - data["__nvrtcAddNameExpression"] = <_cyb_intptr_t>__nvrtcAddNameExpression + data["__nvrtcAddNameExpression"] = <intptr_t>__nvrtcAddNameExpression global __nvrtcGetLoweredName - data["__nvrtcGetLoweredName"] = <_cyb_intptr_t>__nvrtcGetLoweredName + data["__nvrtcGetLoweredName"] = <intptr_t>__nvrtcGetLoweredName global __nvrtcGetPCHHeapSize - data["__nvrtcGetPCHHeapSize"] = <_cyb_intptr_t>__nvrtcGetPCHHeapSize + data["__nvrtcGetPCHHeapSize"] = <intptr_t>__nvrtcGetPCHHeapSize global __nvrtcSetPCHHeapSize - data["__nvrtcSetPCHHeapSize"] = <_cyb_intptr_t>__nvrtcSetPCHHeapSize + data["__nvrtcSetPCHHeapSize"] = <intptr_t>__nvrtcSetPCHHeapSize global __nvrtcGetPCHCreateStatus - data["__nvrtcGetPCHCreateStatus"] = <_cyb_intptr_t>__nvrtcGetPCHCreateStatus + data["__nvrtcGetPCHCreateStatus"] = <intptr_t>__nvrtcGetPCHCreateStatus global __nvrtcGetPCHHeapSizeRequired - data["__nvrtcGetPCHHeapSizeRequired"] = <_cyb_intptr_t>__nvrtcGetPCHHeapSizeRequired + data["__nvrtcGetPCHHeapSizeRequired"] = <intptr_t>__nvrtcGetPCHHeapSizeRequired global __nvrtcSetFlowCallback - data["__nvrtcSetFlowCallback"] = <_cyb_intptr_t>__nvrtcSetFlowCallback + data["__nvrtcSetFlowCallback"] = <intptr_t>__nvrtcSetFlowCallback global __nvrtcGetTileIRSize - data["__nvrtcGetTileIRSize"] = <_cyb_intptr_t>__nvrtcGetTileIRSize + data["__nvrtcGetTileIRSize"] = <intptr_t>__nvrtcGetTileIRSize global __nvrtcGetTileIR - data["__nvrtcGetTileIR"] = <_cyb_intptr_t>__nvrtcGetTileIR + data["__nvrtcGetTileIR"] = <intptr_t>__nvrtcGetTileIR global __nvrtcInstallBundledHeaders - data["__nvrtcInstallBundledHeaders"] = <_cyb_intptr_t>__nvrtcInstallBundledHeaders + data["__nvrtcInstallBundledHeaders"] = <intptr_t>__nvrtcInstallBundledHeaders global __nvrtcGetBundledHeadersInfo - data["__nvrtcGetBundledHeadersInfo"] = <_cyb_intptr_t>__nvrtcGetBundledHeadersInfo + data["__nvrtcGetBundledHeadersInfo"] = <intptr_t>__nvrtcGetBundledHeadersInfo global __nvrtcRemoveBundledHeaders - data["__nvrtcRemoveBundledHeaders"] = <_cyb_intptr_t>__nvrtcRemoveBundledHeaders + data["__nvrtcRemoveBundledHeaders"] = <intptr_t>__nvrtcRemoveBundledHeaders _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 08f74faa61b..15295e29d0f 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b8fe65feec44ce979fc981ea49fefa1b8bdd487092159d597ba5b18b427cc74d +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d15f388e4d48b2d20cd688b2dcc6494a9f62fcf39bf4498bfe868231b54ab79a # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,7 @@ cdef extern from "<dlfcn.h>": void* _cyb_dlsym "dlsym"(void*, const char*) nogil const void * _cyb_RTLD_DEFAULT "RTLD_DEFAULT" -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport intptr_t import threading as _cyb_threading @@ -202,46 +202,46 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvvm() cdef dict data = {} global __nvvmGetErrorString - data["__nvvmGetErrorString"] = <_cyb_intptr_t>__nvvmGetErrorString + data["__nvvmGetErrorString"] = <intptr_t>__nvvmGetErrorString global __nvvmVersion - data["__nvvmVersion"] = <_cyb_intptr_t>__nvvmVersion + data["__nvvmVersion"] = <intptr_t>__nvvmVersion global __nvvmIRVersion - data["__nvvmIRVersion"] = <_cyb_intptr_t>__nvvmIRVersion + data["__nvvmIRVersion"] = <intptr_t>__nvvmIRVersion global __nvvmCreateProgram - data["__nvvmCreateProgram"] = <_cyb_intptr_t>__nvvmCreateProgram + data["__nvvmCreateProgram"] = <intptr_t>__nvvmCreateProgram global __nvvmDestroyProgram - data["__nvvmDestroyProgram"] = <_cyb_intptr_t>__nvvmDestroyProgram + data["__nvvmDestroyProgram"] = <intptr_t>__nvvmDestroyProgram global __nvvmAddModuleToProgram - data["__nvvmAddModuleToProgram"] = <_cyb_intptr_t>__nvvmAddModuleToProgram + data["__nvvmAddModuleToProgram"] = <intptr_t>__nvvmAddModuleToProgram global __nvvmLazyAddModuleToProgram - data["__nvvmLazyAddModuleToProgram"] = <_cyb_intptr_t>__nvvmLazyAddModuleToProgram + data["__nvvmLazyAddModuleToProgram"] = <intptr_t>__nvvmLazyAddModuleToProgram global __nvvmCompileProgram - data["__nvvmCompileProgram"] = <_cyb_intptr_t>__nvvmCompileProgram + data["__nvvmCompileProgram"] = <intptr_t>__nvvmCompileProgram global __nvvmVerifyProgram - data["__nvvmVerifyProgram"] = <_cyb_intptr_t>__nvvmVerifyProgram + data["__nvvmVerifyProgram"] = <intptr_t>__nvvmVerifyProgram global __nvvmGetCompiledResultSize - data["__nvvmGetCompiledResultSize"] = <_cyb_intptr_t>__nvvmGetCompiledResultSize + data["__nvvmGetCompiledResultSize"] = <intptr_t>__nvvmGetCompiledResultSize global __nvvmGetCompiledResult - data["__nvvmGetCompiledResult"] = <_cyb_intptr_t>__nvvmGetCompiledResult + data["__nvvmGetCompiledResult"] = <intptr_t>__nvvmGetCompiledResult global __nvvmGetProgramLogSize - data["__nvvmGetProgramLogSize"] = <_cyb_intptr_t>__nvvmGetProgramLogSize + data["__nvvmGetProgramLogSize"] = <intptr_t>__nvvmGetProgramLogSize global __nvvmGetProgramLog - data["__nvvmGetProgramLog"] = <_cyb_intptr_t>__nvvmGetProgramLog + data["__nvvmGetProgramLog"] = <intptr_t>__nvvmGetProgramLog global __nvvmLLVMVersion - data["__nvvmLLVMVersion"] = <_cyb_intptr_t>__nvvmLLVMVersion + data["__nvvmLLVMVersion"] = <intptr_t>__nvvmLLVMVersion _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index 2a6754f0450..76648d88c4d 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1a8d9ee78bc417c85345caf1dd580ac660ab437cd874a89d6924786f4ad7aade +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c34f226d941a77ab78685766f1df3af41e44e3c34580ac476391e2918ee2a15b # <<<< PREAMBLE CONTENT >>>> @@ -45,7 +45,10 @@ cdef extern from "<windows.h>": ctypedef void* HMODULE void* _cyb_GetProcAddress "GetProcAddress"(HMODULE, const char*) nogil -from libc.stdint cimport intptr_t as _cyb_intptr_t +from libc.stdint cimport ( + intptr_t, + uintptr_t, +) import threading as _cyb_threading @@ -146,46 +149,46 @@ cpdef dict _inspect_function_pointers(): _check_or_init_nvvm() cdef dict data = {} global __nvvmGetErrorString - data["__nvvmGetErrorString"] = <_cyb_intptr_t>__nvvmGetErrorString + data["__nvvmGetErrorString"] = <intptr_t>__nvvmGetErrorString global __nvvmVersion - data["__nvvmVersion"] = <_cyb_intptr_t>__nvvmVersion + data["__nvvmVersion"] = <intptr_t>__nvvmVersion global __nvvmIRVersion - data["__nvvmIRVersion"] = <_cyb_intptr_t>__nvvmIRVersion + data["__nvvmIRVersion"] = <intptr_t>__nvvmIRVersion global __nvvmCreateProgram - data["__nvvmCreateProgram"] = <_cyb_intptr_t>__nvvmCreateProgram + data["__nvvmCreateProgram"] = <intptr_t>__nvvmCreateProgram global __nvvmDestroyProgram - data["__nvvmDestroyProgram"] = <_cyb_intptr_t>__nvvmDestroyProgram + data["__nvvmDestroyProgram"] = <intptr_t>__nvvmDestroyProgram global __nvvmAddModuleToProgram - data["__nvvmAddModuleToProgram"] = <_cyb_intptr_t>__nvvmAddModuleToProgram + data["__nvvmAddModuleToProgram"] = <intptr_t>__nvvmAddModuleToProgram global __nvvmLazyAddModuleToProgram - data["__nvvmLazyAddModuleToProgram"] = <_cyb_intptr_t>__nvvmLazyAddModuleToProgram + data["__nvvmLazyAddModuleToProgram"] = <intptr_t>__nvvmLazyAddModuleToProgram global __nvvmCompileProgram - data["__nvvmCompileProgram"] = <_cyb_intptr_t>__nvvmCompileProgram + data["__nvvmCompileProgram"] = <intptr_t>__nvvmCompileProgram global __nvvmVerifyProgram - data["__nvvmVerifyProgram"] = <_cyb_intptr_t>__nvvmVerifyProgram + data["__nvvmVerifyProgram"] = <intptr_t>__nvvmVerifyProgram global __nvvmGetCompiledResultSize - data["__nvvmGetCompiledResultSize"] = <_cyb_intptr_t>__nvvmGetCompiledResultSize + data["__nvvmGetCompiledResultSize"] = <intptr_t>__nvvmGetCompiledResultSize global __nvvmGetCompiledResult - data["__nvvmGetCompiledResult"] = <_cyb_intptr_t>__nvvmGetCompiledResult + data["__nvvmGetCompiledResult"] = <intptr_t>__nvvmGetCompiledResult global __nvvmGetProgramLogSize - data["__nvvmGetProgramLogSize"] = <_cyb_intptr_t>__nvvmGetProgramLogSize + data["__nvvmGetProgramLogSize"] = <intptr_t>__nvvmGetProgramLogSize global __nvvmGetProgramLog - data["__nvvmGetProgramLog"] = <_cyb_intptr_t>__nvvmGetProgramLog + data["__nvvmGetProgramLog"] = <intptr_t>__nvvmGetProgramLog global __nvvmLLVMVersion - data["__nvvmLLVMVersion"] = <_cyb_intptr_t>__nvvmLLVMVersion + data["__nvvmLLVMVersion"] = <intptr_t>__nvvmLLVMVersion _cyb_func_ptrs = data return data diff --git a/cuda_bindings/cuda/bindings/_lib/windll.pxd b/cuda_bindings/cuda/bindings/_lib/windll.pxd index 294a1a9fd90..b5fd5c4db90 100644 --- a/cuda_bindings/cuda/bindings/_lib/windll.pxd +++ b/cuda_bindings/cuda/bindings/_lib/windll.pxd @@ -14,7 +14,7 @@ cdef extern from "windows.h" nogil: ctypedef const char *LPCSTR ctypedef int BOOL - cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + const DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 HMODULE _LoadLibraryExW "LoadLibraryExW"( LPCWSTR lpLibFileName, diff --git a/cuda_bindings/cuda/bindings/_v2/nvrtc.pxd b/cuda_bindings/cuda/bindings/_v2/nvrtc.pxd index 3e8aa8a3675..8e49c44a782 100644 --- a/cuda_bindings/cuda/bindings/_v2/nvrtc.pxd +++ b/cuda_bindings/cuda/bindings/_v2/nvrtc.pxd @@ -3,9 +3,17 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=632bbedaee3acec49d09764a74b02343ada9ddc14f52c6fe00843d62e147006b +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d60da53322a0c187f791aa742fc10141626385989be92d1170f17e71328df4b5 + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport intptr_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + from libc.stdint cimport intptr_t from ..cynvrtc cimport * diff --git a/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx b/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx index 4e267b1bd47..747fe108309 100644 --- a/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx +++ b/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b919b9cb09a71e4b2f6ad7dd1f76c7e3bf92b5cb1dd51c0d83087d2ce0cab581 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bfdc6e06639d60b7bfeb85d99575a89addb69548b11343689696df1b857b6940 # <<<< PREAMBLE CONTENT >>>> @@ -12,6 +12,7 @@ cimport cpython as _cyb_cpython cimport cpython.buffer as _cyb_cpython_buffer 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, @@ -657,6 +658,8 @@ cpdef tuple version(): cpdef int get_num_supported_archs() except? -1: """nvrtcGetNumSupportedArchs sets the output parameter ``num_archs`` with the number of architectures supported by NVRTC. This can then be used to pass an array to ``nvrtcGetSupportedArchs`` to get the supported architectures. + see ``nvrtcGetSupportedArchs``. + Returns: int: number of supported architectures. @@ -672,6 +675,8 @@ cpdef int get_num_supported_archs() except? -1: cpdef object get_supported_archs(): """nvrtcGetSupportedArchs populates the array passed via the output parameter ``supported_archs`` 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 ``nvrtcGetNumSupportedArchs``. + see ``nvrtcGetNumSupportedArchs``. + Returns: int: sorted array of supported architectures. @@ -881,6 +886,9 @@ cpdef bytes get_optix_ir(intptr_t prog): cpdef size_t get_program_log_size(intptr_t prog) except? 0: """nvrtcGetProgramLogSize sets ``log_size_ret`` 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. + Args: prog (intptr_t): CUDA Runtime Compilation program. @@ -925,6 +933,9 @@ cpdef bytes get_program_log(intptr_t prog): cpdef add_name_expression(intptr_t prog, 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. + Args: prog (intptr_t): CUDA Runtime Compilation program. name_expression (str): constant expression denoting the @@ -961,6 +972,10 @@ cpdef size_t get_pch_heap_size() except? 0: cpdef set_pch_heap_size(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. + Args: size (size_t): requested size of the PCH Heap, in bytes. @@ -974,6 +989,20 @@ cpdef set_pch_heap_size(size_t size): cpdef int get_pch_create_status(intptr_t prog) except? -1: """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 :func:`get_pch_heap_size_required` can be used + to query the required heap size, the heap can be reallocated for this size + with :func:`set_pch_heap_size` and PCH creation may be reattempted again + invoking :func:`compile_program` with a new NVRTC program instance. + NVRTC_ERROR_PCH_CREATE indicates that an error condition prevented the PCH + file from being created. + Args: prog (intptr_t): CUDA Runtime Compilation program. diff --git a/cuda_bindings/cuda/bindings/cudla.pxd b/cuda_bindings/cuda/bindings/cudla.pxd index 97ecfb1bf25..ac79e7024bb 100644 --- a/cuda_bindings/cuda/bindings/cudla.pxd +++ b/cuda_bindings/cuda/bindings/cudla.pxd @@ -2,9 +2,21 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=436984a783ea5e6bef13945d0b6d60b4143aa08131c82cdea619337233b15737 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1897e221f7cea1db8c935488157e3b929f4225e2de3eb5bdc80d302fc35d7e96 + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + intptr_t, + uint32_t, + uint64_t, +) + + +# <<<< END OF PREAMBLE CONTENT >>>> + from libc.stdint cimport intptr_t from .cycudla cimport * @@ -45,10 +57,10 @@ cpdef intptr_t mem_register(intptr_t dev_handle, intptr_t ptr, size_t size, uint cpdef intptr_t module_load_from_memory(intptr_t dev_handle, p_module, size_t module_size, uint32_t flags) except * cpdef module_unload(intptr_t h_module, uint32_t flags) cpdef submit_task(intptr_t dev_handle, intptr_t ptr_to_tasks, uint32_t num_tasks, intptr_t stream, uint32_t flags) -cpdef object device_get_attribute(intptr_t dev_handle, int attrib) except * +cpdef object device_get_attribute(intptr_t dev_handle, int attrib) cpdef mem_unregister(intptr_t dev_handle, intptr_t dev_ptr) cpdef int get_last_error(intptr_t dev_handle) except? 0 cpdef destroy_device(intptr_t dev_handle) cpdef set_task_timeout_in_ms(intptr_t dev_handle, uint32_t timeout) -cpdef module_get_attributes(intptr_t h_module, int attr_type) except * +cpdef module_get_attributes(intptr_t h_module, int attr_type) diff --git a/cuda_bindings/cuda/bindings/cudla.pyx b/cuda_bindings/cuda/bindings/cudla.pyx index 4532ebaeb97..a82f7164b53 100644 --- a/cuda_bindings/cuda/bindings/cudla.pyx +++ b/cuda_bindings/cuda/bindings/cudla.pyx @@ -3,7 +3,7 @@ # This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=37c4218155319e18c12093c50fd40d05d05035b9625c2aaf8c111b0ab26d3c8c +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e2fb6627d8729b1cbfc97858f01ebe848153980f9fa958bd031225e3232f3485 # <<<< PREAMBLE CONTENT >>>> @@ -11,6 +11,12 @@ cimport cpython as _cyb_cpython cimport cpython.buffer as _cyb_cpython_buffer from cython cimport view as _cyb_view +from libc.stdint cimport ( + intptr_t, + uint32_t, + uint64_t, + uint8_t, +) from libc.stdlib cimport ( calloc as _cyb_calloc, free as _cyb_free, @@ -63,6 +69,35 @@ cdef _cyb_from_data(data, dtype_name, expected_dtype, lowpp_type): raise ValueError(f"data array must be of dtype {dtype_name}") return lowpp_type.from_ptr(data.ctypes.data, not data.flags.writeable, data) +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 = <intptr_t>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 = <intptr_t>view.buf + finally: + if status == 0: + _cyb_cpython.PyBuffer_Release(&view) + return ptr + # <<<< END OF PREAMBLE CONTENT >>>> @@ -70,7 +105,6 @@ cimport cython # NOQA from libc.stdint cimport intptr_t, uintptr_t from libc.stdlib cimport malloc, free -from ._internal.utils cimport get_buffer_pointer @@ -1740,7 +1774,7 @@ cpdef uint64_t device_get_count() except? -1: cpdef intptr_t create_device(uint64_t device, uint32_t flags) except *: cdef DevHandle dev_handle - if flags == CUDLA_STANDALONE: + if flags & CUDLA_STANDALONE: raise CudlaError(cudlaErrorUnsupportedOperation) with nogil: __status__ = cudlaCreateDevice(<const uint64_t>device, &dev_handle, <const uint32_t>flags) @@ -1757,7 +1791,7 @@ cpdef intptr_t mem_register(intptr_t dev_handle, intptr_t ptr, size_t size, uint cpdef intptr_t module_load_from_memory(intptr_t dev_handle, p_module, size_t module_size, uint32_t flags) except *: - cdef void* _p_module_ = get_buffer_pointer(p_module, module_size, readonly=True) + cdef void* _p_module_ = <void *>_cyb_get_buffer_pointer(p_module, module_size, readonly=True) cdef Module h_module with nogil: __status__ = cudlaModuleLoadFromMemory(<const DevHandle>dev_handle, <const uint8_t* const>_p_module_, <const size_t>module_size, &h_module, <const uint32_t>flags) @@ -1777,7 +1811,7 @@ cpdef submit_task(intptr_t dev_handle, intptr_t ptr_to_tasks, uint32_t num_tasks check_status(__status__) -cpdef object device_get_attribute(intptr_t dev_handle, int attrib) except *: +cpdef object device_get_attribute(intptr_t dev_handle, int attrib): cdef DevAttribute p_attribute_py = DevAttribute() cdef cudlaDevAttribute *p_attribute = <cudlaDevAttribute *><intptr_t>(p_attribute_py._get_ptr()) with nogil: @@ -1811,7 +1845,7 @@ cpdef set_task_timeout_in_ms(intptr_t dev_handle, uint32_t timeout): check_status(__status__) -cpdef module_get_attributes(intptr_t h_module, int attr_type) except *: +cpdef module_get_attributes(intptr_t h_module, int attr_type): """Query module attributes, interpreting the cudlaModuleAttribute union based on the requested attribute type. diff --git a/cuda_bindings/cuda/bindings/cufile.pxd b/cuda_bindings/cuda/bindings/cufile.pxd index 35b6271e529..a99f2ea16b4 100644 --- a/cuda_bindings/cuda/bindings/cufile.pxd +++ b/cuda_bindings/cuda/bindings/cufile.pxd @@ -3,10 +3,18 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1d85ffab055c92f1ea96fc186f7ede91090e0d65388d2a03591d374f74937209 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=434eee0d83610eff4f57f8530176efdd91369fa3f56eae651ef2a8e5f96ed063 + + + +# <<<< PREAMBLE CONTENT >>>> + from libc.stdint cimport intptr_t +from libcpp cimport bool as _cyb_bool + + +# <<<< END OF PREAMBLE CONTENT >>>> from .cycufile cimport * diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/cuda/bindings/cufile.pyx index 15eedf9708f..a2fc10d0291 100644 --- a/cuda_bindings/cuda/bindings/cufile.pyx +++ b/cuda_bindings/cuda/bindings/cufile.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9bb12d58d34130a4d23007783ff3b16344fd90af5d0977196234ced1b9e6574d +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=597b2c9e8f97786ca7a037c256f812e294b936e9776179ab066f597739300d17 # <<<< PREAMBLE CONTENT >>>> @@ -13,6 +13,10 @@ 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, + uint64_t, +) from libc.stdlib cimport ( calloc as _cyb_calloc, free as _cyb_free, @@ -22,6 +26,7 @@ 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 @@ -70,7 +75,7 @@ cdef _cyb_from_data(data, dtype_name, expected_dtype, lowpp_type): cimport cython # NOQA from libc cimport errno -from ._internal.utils cimport (get_buffer_pointer, get_nested_resource_ptr, +from ._internal.utils cimport (get_nested_resource_ptr, nested_resource) import cython @@ -3302,9 +3307,12 @@ class cuFileError(Exception): @cython.profile(False) cdef int check_status(ReturnT status) except 1 nogil: if ReturnT is CUfileError_t: - if status.err != 0 or status.cu_err != 0: + 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 @@ -3423,7 +3431,7 @@ cpdef driver_set_poll_mode(bint poll, size_t poll_threshold_size): .. seealso:: `cuFileDriverSetPollMode` """ with nogil: - __status__ = cuFileDriverSetPollMode(<cpp_bool>poll, poll_threshold_size) + __status__ = cuFileDriverSetPollMode(<_cyb_bool>poll, poll_threshold_size) check_status(__status__) @@ -3548,7 +3556,7 @@ cpdef size_t get_parameter_size_t(int param) except? 0: cpdef bint get_parameter_bool(int param) except? 0: - cdef cpp_bool value + cdef _cyb_bool value with nogil: __status__ = cuFileGetParameterBool(<_BoolConfigParameter>param, &value) check_status(__status__) @@ -3572,7 +3580,7 @@ cpdef set_parameter_size_t(int param, size_t value): cpdef set_parameter_bool(int param, bint value): with nogil: - __status__ = cuFileSetParameterBool(<_BoolConfigParameter>param, <cpp_bool>value) + __status__ = cuFileSetParameterBool(<_BoolConfigParameter>param, <_cyb_bool>value) check_status(__status__) diff --git a/cuda_bindings/cuda/bindings/cycudla.pxd b/cuda_bindings/cuda/bindings/cycudla.pxd index 5f42abe0de5..9d5f2bd8e66 100644 --- a/cuda_bindings/cuda/bindings/cycudla.pxd +++ b/cuda_bindings/cuda/bindings/cycudla.pxd @@ -3,12 +3,21 @@ # This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. # This layer exposes the C header to Cython as-is. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f24f3dc6fe7d137fe1753e5eb4ebb613d631f984996f6dbb859befed8211c73b -from libc.stdint cimport int8_t, int16_t, int32_t, int64_t -from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t -from libc.stdint cimport intptr_t, uintptr_t +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ba14530d880001870d344c52df77dcaaede52ae6421387f08cac4624003f683e + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + uint32_t, + uint64_t, + uint8_t, +) + + +# <<<< END OF PREAMBLE CONTENT >>>> + from libc.stddef cimport size_t diff --git a/cuda_bindings/cuda/bindings/cycudla.pyx b/cuda_bindings/cuda/bindings/cycudla.pyx index df23650e881..3128e105ab5 100644 --- a/cuda_bindings/cuda/bindings/cycudla.pyx +++ b/cuda_bindings/cuda/bindings/cycudla.pyx @@ -2,9 +2,21 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=71bfc67b64e7e78ba54303e68d8df46f44f73c601c5d303926a46e261b3fd042 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b7b38cce9b72640bc4cb706f26610c8ec12472eb0f37d50336c2722382c04f8e + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + uint32_t, + uint64_t, + uint8_t, +) + + +# <<<< END OF PREAMBLE CONTENT >>>> + from ._internal cimport cudla as _cudla diff --git a/cuda_bindings/cuda/bindings/cycufile.pxd b/cuda_bindings/cuda/bindings/cycufile.pxd index 47aa51465fe..c259b4a282f 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pxd +++ b/cuda_bindings/cuda/bindings/cycufile.pxd @@ -3,12 +3,22 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7961eb9a31b8ad5274ddd2a6357f2f75c1004c44ee4a5edeadf22674f1833d3e -from libc.stdint cimport uint32_t, uint64_t +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e2826fd354311fb0e8b09a69465f585b46982968694efaf4416db0b2b5761d69 + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + uint32_t, + uint64_t, +) +from libcpp cimport bool as _cyb_bool + + +# <<<< END OF PREAMBLE CONTENT >>>> + from libc.time cimport time_t -from libcpp cimport bool as cpp_bool from posix.types cimport off_t cimport cuda.bindings.cydriver @@ -393,6 +403,13 @@ cdef extern from 'cufile.h': CUfilePerGpuStats_t per_gpu_stats[16] +# 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. @@ -422,7 +439,7 @@ cdef CUfileError_t cuFileDriverClose() except?<CUfileError_t>CUFILE_LOADING_ERRO cdef CUfileError_t cuFileDriverClose_v2() except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef long cuFileUseCount() except* nogil cdef CUfileError_t cuFileDriverGetProperties(CUfileDrvProps_t* props) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil -cdef CUfileError_t cuFileDriverSetPollMode(cpp_bool poll, size_t poll_threshold_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileDriverSetMaxDirectIOSize(size_t max_direct_io_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileDriverSetMaxCacheSize(size_t max_cache_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileDriverSetMaxPinnedMemSize(size_t max_pinned_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil @@ -437,10 +454,10 @@ cdef CUfileError_t cuFileStreamRegister(CUstream stream, unsigned flags) except? cdef CUfileError_t cuFileStreamDeregister(CUstream stream) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileGetVersion(int* version) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil -cdef CUfileError_t cuFileGetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileGetParameterString(CUFileStringConfigParameter_t param, char* desc_str, int len) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil -cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileGetParameterMinMaxValue(CUFileSizeTConfigParameter_t param, size_t* min_value, size_t* max_value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileSetStatsLevel(int level) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cycufile.pyx b/cuda_bindings/cuda/bindings/cycufile.pyx index 5c6ac42c8cd..5d1d5b5e599 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pyx +++ b/cuda_bindings/cuda/bindings/cycufile.pyx @@ -4,12 +4,13 @@ # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f665ca316ab6166959a5f3338c901e698617b31146000a9d99422dcf9849d3fc +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e57d69f406c760d8e1164f96ab601735651181d13db254ea6e0c3a9d66b72b9b # <<<< PREAMBLE CONTENT >>>> cimport cython as _cyb_cython +from libcpp cimport bool as _cyb_bool # <<<< END OF PREAMBLE CONTENT >>>> @@ -67,7 +68,7 @@ cdef CUfileError_t cuFileDriverGetProperties(CUfileDrvProps_t* props) except?<CU return _cufile._cuFileDriverGetProperties(props) -cdef CUfileError_t cuFileDriverSetPollMode(cpp_bool poll, size_t poll_threshold_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: +cdef CUfileError_t cuFileDriverSetPollMode(_cyb_bool poll, size_t poll_threshold_size) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: return _cufile._cuFileDriverSetPollMode(poll, poll_threshold_size) @@ -128,7 +129,7 @@ cdef CUfileError_t cuFileGetParameterSizeT(CUFileSizeTConfigParameter_t param, s return _cufile._cuFileGetParameterSizeT(param, value) -cdef CUfileError_t cuFileGetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: +cdef CUfileError_t cuFileGetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool* value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: return _cufile._cuFileGetParameterBool(param, value) @@ -140,7 +141,7 @@ cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, s return _cufile._cuFileSetParameterSizeT(param, value) -cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: +cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, _cyb_bool value) except?<CUfileError_t>CUFILE_LOADING_ERROR nogil: return _cufile._cuFileSetParameterBool(param, value) diff --git a/cuda_bindings/cuda/bindings/cydriver.pxd b/cuda_bindings/cuda/bindings/cydriver.pxd index da6754e7af2..0be5396d160 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pxd +++ b/cuda_bindings/cuda/bindings/cydriver.pxd @@ -3,9 +3,20 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9e145065ec8a0e7780c0d8e38d0cec7a9b4bf2512e8a745f32593531bbb64676 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b2499d947f781ee7e8b828134b2549b45e0771780adfd0ad62871bb735a19891 + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + uint32_t, + uint64_t, +) + + +# <<<< END OF PREAMBLE CONTENT >>>> + from libc.stdint cimport uint32_t, uint64_t diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pxd b/cuda_bindings/cuda/bindings/cynvfatbin.pxd index c9d844c6da9..47b4c4c8efe 100644 --- a/cuda_bindings/cuda/bindings/cynvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/cynvfatbin.pxd @@ -4,9 +4,6 @@ # # This code was automatically generated across versions from 12.4.1 to 13.4.0. Do not modify it directly. -# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=350ce092394c88b497887fcb76999a31e960cb7c395fbc50aadd7d5ce174ffc7 -from libc.stdint cimport intptr_t, uint32_t ############################################################################### @@ -14,6 +11,8 @@ from libc.stdint cimport intptr_t, uint32_t ############################################################################### # enums +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=15a32de9a2c28520e84759f8eb508b8ca7dd4f3e5b462d70ed9b252240a4ac55 ctypedef enum nvFatbinResult "nvFatbinResult": NVFATBIN_SUCCESS "NVFATBIN_SUCCESS" = 0 NVFATBIN_ERROR_INTERNAL "NVFATBIN_ERROR_INTERNAL" diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/cuda/bindings/cynvjitlink.pxd index b6bc62c1d7b..78020419b59 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pxd @@ -4,9 +4,6 @@ # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. -# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=19b54696d673ac6a15251d0a9fb4d23d19a3ed87a31a38a1727cf89a4a1a8383 -from libc.stdint cimport intptr_t, uint32_t ############################################################################### @@ -14,6 +11,16 @@ from libc.stdint cimport intptr_t, uint32_t ############################################################################### # enums +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4e2f2fa7cdc6275ba2b8bd666047fe788152a7daa8f4d2fc9cc9b0e48f43ca86 + +# <<<< 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" diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/cuda/bindings/cynvjitlink.pyx index fd20bfee10f..c8546283741 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pyx @@ -3,9 +3,17 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f91e9f01600d3933b3489ae1d9963b33f8095779168d3b27949645eb41926ec3 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=47897bfaeb454861edbe979303c63d0f1740d920a7cdd24e3b22a5e221830fba + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport uint32_t + + +# <<<< END OF PREAMBLE CONTENT >>>> + from ._internal cimport nvjitlink as _nvjitlink diff --git a/cuda_bindings/cuda/bindings/cynvml.pxd b/cuda_bindings/cuda/bindings/cynvml.pxd index be3ab2da3ae..2891b867473 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pxd +++ b/cuda_bindings/cuda/bindings/cynvml.pxd @@ -4,9 +4,6 @@ # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. -# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6cd5217ee9e8afc03e6cce40801c8b2ad5f105d1fb2a1528910955e91e3cc570 -from libc.stdint cimport int64_t ############################################################################### @@ -14,6 +11,8 @@ from libc.stdint cimport int64_t ############################################################################### # enums +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=924be66344cb7c8837c46976a9f394569b0e5d00df6b5026ad42ef6d1258984f ctypedef enum nvmlBridgeChipType_t "nvmlBridgeChipType_t": NVML_BRIDGE_CHIP_PLX "NVML_BRIDGE_CHIP_PLX" = 0 NVML_BRIDGE_CHIP_BRO4 "NVML_BRIDGE_CHIP_BRO4" = 1 diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pxd b/cuda_bindings/cuda/bindings/cynvrtc.pxd index 37e76005971..70beba81b68 100644 --- a/cuda_bindings/cuda/bindings/cynvrtc.pxd +++ b/cuda_bindings/cuda/bindings/cynvrtc.pxd @@ -4,12 +4,11 @@ # # This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a5984ec05eaf04c2ac41c7771b8f7b364aeab3379ee9785f1b24be8d3cf54996 -from libc.stdint cimport uint32_t, uint64_t # ENUMS +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9b3dd5d3dc0c812b2b9f95e2d50a082efc2735744e0187108b1639c26f494c94 cdef extern from 'nvrtc.h': ctypedef enum nvrtcResult "nvrtcResult": NVRTC_SUCCESS diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pxd b/cuda_bindings/cuda/bindings/nvfatbin.pxd index aca95c85185..5d3e8d51836 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/nvfatbin.pxd @@ -3,10 +3,17 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.4.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f9455d8c181ccdf20d59511bf1236f302dbe9ef903b61035cc1dd971e278caa1 -from libc.stdint cimport intptr_t, uint32_t +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f5f385bd424c3bc290ea11bc66661b9eaba40a07b5a232a9f515dd2c884343db + + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport intptr_t + + +# <<<< END OF PREAMBLE CONTENT >>>> from .cynvfatbin cimport * diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pyx b/cuda_bindings/cuda/bindings/nvfatbin.pyx index 8e640a970d3..13477d3c554 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/nvfatbin.pyx @@ -4,20 +4,52 @@ # # This code was automatically generated across versions from 12.4.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a9f06b8372f6c9da9bd1056df4fe0095a6e4a2b85496da6cca9a5496b641a909 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4e110b2c731e012ecdcb6a537d79d3e9276c287056daf67650c5c895cf368d24 # <<<< 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 = <intptr_t>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 = <intptr_t>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_buffer_pointer, get_resource_ptrs) + get_resource_ptrs) from libcpp.vector cimport vector @@ -157,7 +189,7 @@ cpdef add_ptx(intptr_t handle, code, size_t size, arch, identifier, options_cmd_ .. seealso:: `nvFatbinAddPTX` """ - cdef void* _code_ = get_buffer_pointer(code, size, readonly=True) + cdef void* _code_ = <void *>_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_ = (<str>arch).encode() @@ -189,7 +221,7 @@ cpdef add_cubin(intptr_t handle, code, size_t size, arch, identifier): .. seealso:: `nvFatbinAddCubin` """ - cdef void* _code_ = get_buffer_pointer(code, size, readonly=True) + cdef void* _code_ = <void *>_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_ = (<str>arch).encode() @@ -218,7 +250,7 @@ cpdef add_ltoir(intptr_t handle, code, size_t size, arch, identifier, options_cm .. seealso:: `nvFatbinAddLTOIR` """ - cdef void* _code_ = get_buffer_pointer(code, size, readonly=True) + cdef void* _code_ = <void *>_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_ = (<str>arch).encode() @@ -263,7 +295,7 @@ cpdef get(intptr_t handle, buffer): .. seealso:: `nvFatbinGet` """ - cdef void* _buffer_ = get_buffer_pointer(buffer, -1, readonly=False) + cdef void* _buffer_ = <void *>_cyb_get_buffer_pointer(buffer, -1, readonly=False) with nogil: __status__ = nvFatbinGet(<Handle>handle, <void*>_buffer_) check_status(__status__) @@ -289,7 +321,7 @@ cpdef tuple version(): cpdef add_index(intptr_t handle, code, size_t size, identifier): - cdef void* _code_ = get_buffer_pointer(code, size, readonly=True) + cdef void* _code_ = <void *>_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_ = (<str>identifier).encode() @@ -309,7 +341,7 @@ cpdef add_reloc(intptr_t handle, code, size_t size): .. seealso:: `nvFatbinAddReloc` """ - cdef void* _code_ = get_buffer_pointer(code, size, readonly=True) + cdef void* _code_ = <void *>_cyb_get_buffer_pointer(code, size, readonly=True) with nogil: __status__ = nvFatbinAddReloc(<Handle>handle, <const void*>_code_, size) check_status(__status__) @@ -328,7 +360,7 @@ cpdef add_tile_ir(intptr_t handle, code, size_t size, identifier, options_cmd_li .. seealso:: `nvFatbinAddTileIR` """ - cdef void* _code_ = get_buffer_pointer(code, size, readonly=True) + cdef void* _code_ = <void *>_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_ = (<str>identifier).encode() diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/cuda/bindings/nvjitlink.pxd index 7c55364f171..76ce8e0c2d9 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/nvjitlink.pxd @@ -3,10 +3,20 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=71dbc31e82ef2e456eb1a686757dc7a9f951a37f7c4d813d8b4ed92956a0f225 -from libc.stdint cimport intptr_t, uint32_t +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=825a8ba33da8bf973732e0796858beef6b72c920f964b67e6a28434eda495b66 + + + +# <<<< PREAMBLE CONTENT >>>> + +from libc.stdint cimport ( + intptr_t, + uint32_t, +) + + +# <<<< END OF PREAMBLE CONTENT >>>> from .cynvjitlink cimport * diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index adeb4c40de9..f2ca7be9b50 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -4,20 +4,55 @@ # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f722861e068fe62c47806f8fc7757afc24a313435cc14026e1b4f59d1b7f2be7 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=aa44e59efcaf2832770b60a168b74cc79bc06d1a35dcbf78c90f7917f3c900a4 # <<<< 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 = <intptr_t>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 = <intptr_t>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_buffer_pointer, get_resource_ptrs) + get_resource_ptrs) from libcpp.vector cimport vector @@ -153,7 +188,7 @@ cpdef add_data(intptr_t handle, int input_type, data, size_t size, name): .. seealso:: `nvJitLinkAddData` """ - cdef void* _data_ = get_buffer_pointer(data, size, readonly=True) + cdef void* _data_ = <void *>_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_ = (<str>name).encode() @@ -222,7 +257,7 @@ cpdef get_linked_cubin(intptr_t handle, cubin): .. seealso:: `nvJitLinkGetLinkedCubin` """ - cdef void* _cubin_ = get_buffer_pointer(cubin, -1, readonly=False) + cdef void* _cubin_ = <void *>_cyb_get_buffer_pointer(cubin, -1, readonly=False) with nogil: __status__ = nvJitLinkGetLinkedCubin(<Handle>handle, <void*>_cubin_) check_status(__status__) @@ -255,7 +290,7 @@ cpdef get_linked_ptx(intptr_t handle, ptx): .. seealso:: `nvJitLinkGetLinkedPtx` """ - cdef void* _ptx_ = get_buffer_pointer(ptx, -1, readonly=False) + cdef void* _ptx_ = <void *>_cyb_get_buffer_pointer(ptx, -1, readonly=False) with nogil: __status__ = nvJitLinkGetLinkedPtx(<Handle>handle, <char*>_ptx_) check_status(__status__) @@ -288,7 +323,7 @@ cpdef get_error_log(intptr_t handle, log): .. seealso:: `nvJitLinkGetErrorLog` """ - cdef void* _log_ = get_buffer_pointer(log, -1, readonly=False) + cdef void* _log_ = <void *>_cyb_get_buffer_pointer(log, -1, readonly=False) with nogil: __status__ = nvJitLinkGetErrorLog(<Handle>handle, <char*>_log_) check_status(__status__) @@ -321,7 +356,7 @@ cpdef get_info_log(intptr_t handle, log): .. seealso:: `nvJitLinkGetInfoLog` """ - cdef void* _log_ = get_buffer_pointer(log, -1, readonly=False) + cdef void* _log_ = <void *>_cyb_get_buffer_pointer(log, -1, readonly=False) with nogil: __status__ = nvJitLinkGetInfoLog(<Handle>handle, <char*>_log_) check_status(__status__) @@ -373,7 +408,7 @@ cpdef get_linked_ltoir(intptr_t handle, ltoir): .. seealso:: `nvJitLinkGetLinkedLTOIR` """ - cdef void* _ltoir_ = get_buffer_pointer(ltoir, -1, readonly=False) + cdef void* _ltoir_ = <void *>_cyb_get_buffer_pointer(ltoir, -1, readonly=False) with nogil: __status__ = nvJitLinkGetLinkedLTOIR(<Handle>handle, <void*>_ltoir_) check_status(__status__) diff --git a/cuda_bindings/cuda/bindings/nvml.pxd b/cuda_bindings/cuda/bindings/nvml.pxd index 40546231530..debb18ad75a 100644 --- a/cuda_bindings/cuda/bindings/nvml.pxd +++ b/cuda_bindings/cuda/bindings/nvml.pxd @@ -3,11 +3,18 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f699a98280e825837b6ddf7fb083deca9f51318e2406acefd67481a68b43a165 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=48a7b0d320e83e759cdd3e877e32713c97676a35b51aa327521880e783c7ea01 + + + +# <<<< PREAMBLE CONTENT >>>> + from libc.stdint cimport intptr_t + +# <<<< END OF PREAMBLE CONTENT >>>> + from .cynvml cimport * diff --git a/cuda_bindings/cuda/bindings/nvml.pyx b/cuda_bindings/cuda/bindings/nvml.pyx index b8b720ee11f..a936780a795 100644 --- a/cuda_bindings/cuda/bindings/nvml.pyx +++ b/cuda_bindings/cuda/bindings/nvml.pyx @@ -4,7 +4,7 @@ # # This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e6637452fb185e3d30ab3d126d11f1f4de18b77785d64948b4ee580f4ddf03fe +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=331cd635d123e94faac2d9b218fae5a0f778c93a6b3dbf2040a0c9831f631975 # <<<< PREAMBLE CONTENT >>>> @@ -13,6 +13,7 @@ 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, @@ -73,7 +74,7 @@ from cython cimport view cimport cpython from libc.string cimport memcpy -from ._internal.utils cimport (get_buffer_pointer, get_nested_resource_ptr, +from ._internal.utils cimport (get_nested_resource_ptr, nested_resource) from cuda.bindings._internal._fast_enum import FastEnum as _FastEnum @@ -1392,7 +1393,7 @@ class CPERType(_cyb_FastEnum): class GpuOperationalEventLogLevel(_cyb_FastEnum): """ - Log-level values used by GPU Operational Events.These values are used + Log-level values used by GPU Operational Events. These values are used both for event reporting in `nvmlEventData_v2_t` and for subscription filtering in `nvmlGpuOperationalEventConfig_v1_t`. Higher numeric values represent more selective log levels. @@ -1412,7 +1413,7 @@ class GpuOperationalEventLogLevel(_cyb_FastEnum): class OperationalEventSeverity(_cyb_FastEnum): """ - Severity values used by Operational Events.These values are used both + Severity values used by Operational Events. These values are used both for event reporting in `nvmlEventData_v2_t` and for subscription filtering in `nvmlGpuOperationalEventConfig_v1_t`. Higher numeric values represent more selective severities. @@ -1440,9 +1441,9 @@ class EventDataType(_cyb_FastEnum): class GpuOperationalEventContextType(_cyb_FastEnum): """ - NVML-defined GPU Operational Event context classifications.These values - describe the NVML public interpretation of a context payload. The - original source-defined context type is returned separately in + NVML-defined GPU Operational Event context classifications. These + values describe the NVML public interpretation of a context payload. + The original source-defined context type is returned separately in `nvmlOperationalEventContextInfo_v1_t.sourceEventContextType`. See `nvmlGpuOperationalEventContextType_t`. @@ -14943,7 +14944,7 @@ cdef class DevicePowerMizerModes_v1: @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.""" + """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 diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx b/cuda_bindings/cuda/bindings/nvrtc.pyx index b4b4d713579..ebf3810e2f6 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx @@ -3,7 +3,7 @@ # This code was automatically generated with version 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9dcd9e24a5962a3fa156378497290ef95c84fb433d2c31c6e2a5da5528391fe8 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d5cf00b9db7880e26f7f555cc4d96bc106638d06f9470281879fee44d0fcd767 from typing import Any, Optional import cython import ctypes @@ -45,8 +45,10 @@ ctypedef unsigned long long float_ptr ctypedef unsigned long long double_ptr ctypedef unsigned long long void_ptr -#: Flags for nvrtcInstallBundledHeaders.Skip installation if version marker -#: exists and version matches. This is the default behavior when flags=0. +#: Flags for nvrtcInstallBundledHeaders. +#: +#: Skip installation if version marker exists and version matches. This is +#: the default behavior when flags=0. NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS = cynvrtc.NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS #: Clear existing directory contents before installation. Guarantees diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/cuda/bindings/nvvm.pxd index 6e96ef7c920..0d22bdc9a94 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/nvvm.pxd @@ -3,11 +3,18 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. - # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=64399bc158dff1d573ee582b859de69945c0aa7daca57980ad1372b441bd0fbd +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=42bff00f1f4c3a045096af6f33066dd5ec597905d19a6fbb3434f96bd9a2d6d4 + + + +# <<<< PREAMBLE CONTENT >>>> + from libc.stdint cimport intptr_t + +# <<<< END OF PREAMBLE CONTENT >>>> + from .cynvvm cimport * diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index fecc9c36856..bd54d1b1e59 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -4,19 +4,51 @@ # # This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. # !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c4c368f2adb8e24c25c067370ec9263cbd656df971795916276cdd859d339743 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c70e229488a1b3c07944e0e086b17572e1c23a6176a7f63c2e54ee9756d8c29c # <<<< 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 = <intptr_t>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 = <intptr_t>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_buffer_pointer, get_nested_resource_ptr, +from ._internal.utils cimport (get_nested_resource_ptr, nested_resource) @@ -171,7 +203,7 @@ cpdef add_module_to_program(intptr_t prog, buffer, size_t size, name): .. seealso:: `nvvmAddModuleToProgram` """ - cdef void* _buffer_ = get_buffer_pointer(buffer, size, readonly=True) + cdef void* _buffer_ = <void *>_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_ = (<str>name).encode() @@ -193,7 +225,7 @@ cpdef lazy_add_module_to_program(intptr_t prog, buffer, size_t size, name): .. seealso:: `nvvmLazyAddModuleToProgram` """ - cdef void* _buffer_ = get_buffer_pointer(buffer, size, readonly=True) + cdef void* _buffer_ = <void *>_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_ = (<str>name).encode() @@ -279,7 +311,7 @@ cpdef get_compiled_result(intptr_t prog, buffer): .. seealso:: `nvvmGetCompiledResult` """ - cdef void* _buffer_ = get_buffer_pointer(buffer, -1, readonly=False) + cdef void* _buffer_ = <void *>_cyb_get_buffer_pointer(buffer, -1, readonly=False) with nogil: __status__ = nvvmGetCompiledResult(<Program>prog, <char*>_buffer_) check_status(__status__) @@ -313,7 +345,7 @@ cpdef get_program_log(intptr_t prog, buffer): .. seealso:: `nvvmGetProgramLog` """ - cdef void* _buffer_ = get_buffer_pointer(buffer, -1, readonly=False) + cdef void* _buffer_ = <void *>_cyb_get_buffer_pointer(buffer, -1, readonly=False) with nogil: __status__ = nvvmGetProgramLog(<Program>prog, <char*>_buffer_) check_status(__status__) diff --git a/cuda_bindings/cuda/bindings/utils/__init__.py b/cuda_bindings/cuda/bindings/utils/__init__.py index 0bfff4b78be..9c29bb4dd81 100644 --- a/cuda_bindings/cuda/bindings/utils/__init__.py +++ b/cuda_bindings/cuda/bindings/utils/__init__.py @@ -27,6 +27,9 @@ def get_cuda_native_handle(obj: Any) -> int: """ obj_type = type(obj) try: - return _handle_getters[obj_type](obj) + getter = _handle_getters[obj_type] except KeyError: raise TypeError("Unknown type: " + str(obj_type)) from None + # Deliberately outside the try: a KeyError raised by the getter itself is a + # bug in that getter, not an unregistered type. + return getter(obj) diff --git a/cuda_bindings/docs/source/module/nvrtc.rst b/cuda_bindings/docs/source/module/nvrtc.rst index c4e453bee6b..d4a85257a73 100644 --- a/cuda_bindings/docs/source/module/nvrtc.rst +++ b/cuda_bindings/docs/source/module/nvrtc.rst @@ -4,7 +4,7 @@ .. This code was automatically generated with version 13.4.0. Do not modify it directly. .. !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! -.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e81ae93eee7b54340488dc4be19f2767d6c7316292571214623473e1d8452da7 +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e76a612b65e25ae5ed1d2a8527e929bb3df7e42fb4c61e274e9fa8ec740142fa ----- nvrtc ----- @@ -129,7 +129,11 @@ NVRTC defines the following types and functions for bundled headers installation .. autofunction:: cuda.bindings.nvrtc.nvrtcRemoveBundledHeaders .. autoattribute:: cuda.bindings.nvrtc.NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS - Flags for nvrtcInstallBundledHeaders.Skip installation if version marker exists and version matches. This is the default behavior when flags=0. + Flags for nvrtcInstallBundledHeaders. + + + + Skip installation if version marker exists and version matches. This is the default behavior when flags=0. .. autoattribute:: cuda.bindings.nvrtc.NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE diff --git a/cuda_bindings/examples/0_Introduction/clock_nvrtc.py b/cuda_bindings/examples/0_Introduction/clock_nvrtc.py index 14572469e79..71b30d7efb0 100644 --- a/cuda_bindings/examples/0_Introduction/clock_nvrtc.py +++ b/cuda_bindings/examples/0_Introduction/clock_nvrtc.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py b/cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py index cad35990e91..17ecb83adf5 100644 --- a/cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py +++ b/cuda_bindings/examples/0_Introduction/simple_cubemap_texture.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/0_Introduction/simple_p2p.py b/cuda_bindings/examples/0_Introduction/simple_p2p.py index 0c6700bc8df..61b021c1793 100644 --- a/cuda_bindings/examples/0_Introduction/simple_p2p.py +++ b/cuda_bindings/examples/0_Introduction/simple_p2p.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/0_Introduction/simple_zero_copy.py b/cuda_bindings/examples/0_Introduction/simple_zero_copy.py index 72c5fe8b701..2c0692abcfb 100644 --- a/cuda_bindings/examples/0_Introduction/simple_zero_copy.py +++ b/cuda_bindings/examples/0_Introduction/simple_zero_copy.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/0_Introduction/system_wide_atomics.py b/cuda_bindings/examples/0_Introduction/system_wide_atomics.py index fde3e67ad8f..5d98a74f8a9 100644 --- a/cuda_bindings/examples/0_Introduction/system_wide_atomics.py +++ b/cuda_bindings/examples/0_Introduction/system_wide_atomics.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/0_Introduction/vector_add_drv.py b/cuda_bindings/examples/0_Introduction/vector_add_drv.py index d2356c0d3a1..7a987126f52 100644 --- a/cuda_bindings/examples/0_Introduction/vector_add_drv.py +++ b/cuda_bindings/examples/0_Introduction/vector_add_drv.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/0_Introduction/vector_add_mmap.py b/cuda_bindings/examples/0_Introduction/vector_add_mmap.py index 9faa45bedb8..2a8f4a99a1d 100644 --- a/cuda_bindings/examples/0_Introduction/vector_add_mmap.py +++ b/cuda_bindings/examples/0_Introduction/vector_add_mmap.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py b/cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py index b45f11f317b..5118600a493 100644 --- a/cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py +++ b/cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py b/cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py index 9a2ec3dec3b..615006049fd 100644 --- a/cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py +++ b/cuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py b/cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py index 317a774d5df..816bc84e274 100644 --- a/cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py +++ b/cuda_bindings/examples/3_CUDA_Features/simple_cuda_graphs.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py b/cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py index 83d359b1e93..488f57d03ab 100644 --- a/cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py +++ b/cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py b/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py index 459022784b3..348e8c38236 100644 --- a/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py +++ b/cuda_bindings/examples/4_CUDA_Libraries/nvidia_smi.py @@ -1,4 +1,4 @@ -# Copyright 2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 diff --git a/cuda_bindings/examples/extra/iso_fd_modelling.py b/cuda_bindings/examples/extra/iso_fd_modelling.py index 9fe9432862c..e1f29936a9f 100644 --- a/cuda_bindings/examples/extra/iso_fd_modelling.py +++ b/cuda_bindings/examples/extra/iso_fd_modelling.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/examples/extra/jit_program.py b/cuda_bindings/examples/extra/jit_program.py index 7a5cc1495fc..ad3409c1f68 100644 --- a/cuda_bindings/examples/extra/jit_program.py +++ b/cuda_bindings/examples/extra/jit_program.py @@ -1,4 +1,4 @@ -# Copyright 2021-2026 NVIDIA Corporation. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # ################################################################################ diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index 3896e4527ec..15ee1782eed 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -21,7 +21,6 @@ license-files = ["LICENSE"] requires-python = ">=3.10" classifiers = [ "Intended Audience :: Developers", - "Topic :: Database", "Topic :: Scientific/Engineering", "Programming Language :: Python", "Programming Language :: Python :: 3.10", diff --git a/cuda_bindings/tests/cython/build_tests.bat b/cuda_bindings/tests/cython/build_tests.bat index a59bcf53d05..0ef6abb06f3 100644 --- a/cuda_bindings/tests/cython/build_tests.bat +++ b/cuda_bindings/tests/cython/build_tests.bat @@ -4,7 +4,9 @@ REM SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIA REM SPDX-License-Identifier: Apache-2.0 setlocal - set CL=%CL% /I"%CUDA_HOME%\include" - REM Use -j 1 to side-step any process-pool issues and ensure deterministic single-threaded builds - cythonize -3 -j 1 -i -Xfreethreading_compatible=True %~dp0test_*.pyx -endlocal +set CL=%CL% /I"%CUDA_HOME%\include" +REM The Python driver provides Cython's .pxd include path and builds in this +REM directory so Windows does not duplicate the checkout path in link outputs. +python "%~dp0build_tests.py" +set "BUILD_RESULT=%ERRORLEVEL%" +endlocal & exit /b %BUILD_RESULT% diff --git a/cuda_bindings/tests/cython/build_tests.py b/cuda_bindings/tests/cython/build_tests.py index ac22e1fd962..5bde350e87b 100644 --- a/cuda_bindings/tests/cython/build_tests.py +++ b/cuda_bindings/tests/cython/build_tests.py @@ -34,7 +34,10 @@ def _bindings_source_root() -> Path: def main() -> None: script_dir = Path(__file__).resolve().parent - pyx_files = sorted(str(p) for p in script_dir.glob("test_*.pyx")) + # Avoid appending the absolute checkout path under build/temp: the + # concatenated path can exceed Windows' path limit. These files are siblings. + os.chdir(script_dir) + pyx_files = sorted(p.name for p in script_dir.glob("test_*.pyx")) if not pyx_files: raise SystemExit(f"no test_*.pyx files under {script_dir}") @@ -46,13 +49,8 @@ def main() -> None: compiler_directives={"freethreading_compatible": True}, ) - # `build_ext --inplace` places the compiled .so relative to the current - # working directory, but pixi runs this task from the project root. pytest - # imports each extension by bare module name (see test_cython.py), which - # only resolves when the .so sits in tests/cython (the dir pytest puts on - # sys.path). chdir here so the .so lands next to its .pyx regardless of the - # invoking cwd. - os.chdir(script_dir) + # pytest imports each extension by bare module name (see test_cython.py), + # so build in-place next to its .pyx regardless of the invoking cwd. sys.argv = [sys.argv[0], "build_ext", "--inplace"] setup(name="cuda_bindings_cython_tests", ext_modules=ext_modules) diff --git a/cuda_bindings/tests/nvml/test_compute_mode.py b/cuda_bindings/tests/nvml/test_compute_mode.py index 83c7827f53a..3392a71e23b 100644 --- a/cuda_bindings/tests/nvml/test_compute_mode.py +++ b/cuda_bindings/tests/nvml/test_compute_mode.py @@ -18,15 +18,28 @@ @pytest.mark.skipif(sys.platform == "win32", reason="Test not supported on Windows") -def test_compute_mode_supported_nonroot(all_devices): +def test_compute_mode_supported_nonroot(all_devices, subtests): for device in all_devices: - with unsupported_before(device, None): + device_index = nvml.device_get_index(device) + original_compute_mode = None + with ( + subtests.test(device_index=device_index, compute_mode_api="get_compute_mode"), + unsupported_before(device, None), + ): original_compute_mode = nvml.device_get_compute_mode(device) + if original_compute_mode is None: + continue 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" + with subtests.test(device_index=device_index, compute_mode=cm.name): + try: + nvml.device_set_compute_mode(device, cm) + except nvml.NoPermissionError: + pytest.skip("Insufficient permissions to set compute mode") + except nvml.NvmlError: + nvml.device_set_compute_mode(device, original_compute_mode) + raise + 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/tests/nvml/test_device.py b/cuda_bindings/tests/nvml/test_device.py index 0d412ab24bd..e07f8748113 100644 --- a/cuda_bindings/tests/nvml/test_device.py +++ b/cuda_bindings/tests/nvml/test_device.py @@ -39,11 +39,12 @@ def test_clk_mon_status_t(): assert not hasattr(obj, "clk_mon_list_size") -def test_current_clock_freqs(all_devices): +def test_current_clock_freqs(all_devices, subtests): for device in all_devices: - with unsupported_before(device, None): - clk_freqs = nvml.device_get_current_clock_freqs(device) - assert isinstance(clk_freqs, str) + with subtests.test(device_index=nvml.device_get_index(device)): + with unsupported_before(device, None): + clk_freqs = nvml.device_get_current_clock_freqs(device) + assert isinstance(clk_freqs, str) def test_grid_licensable_features(all_devices): @@ -71,17 +72,18 @@ def test_get_handle_by_uuidv(all_devices): assert new_handle == device -def test_get_nv_link_supported_bw_modes(all_devices): +def test_get_nv_link_supported_bw_modes(all_devices, subtests): for device in all_devices: - with unsupported_before(device, None): - modes = nvml.device_get_nvlink_supported_bw_modes(device) - assert isinstance(modes, nvml.NvlinkSupportedBwModes_v1) - # #define NVML_NVLINK_TOTAL_SUPPORTED_BW_MODES 23 - assert len(modes.bw_modes) <= 23 - assert not hasattr(modes, "total_bw_modes") + with subtests.test(device_index=nvml.device_get_index(device)): + with unsupported_before(device, None): + modes = nvml.device_get_nvlink_supported_bw_modes(device) + assert isinstance(modes, nvml.NvlinkSupportedBwModes_v1) + # #define NVML_NVLINK_TOTAL_SUPPORTED_BW_MODES 23 + assert len(modes.bw_modes) <= 23 + assert not hasattr(modes, "total_bw_modes") - for mode in modes.bw_modes: - assert isinstance(mode, np.uint8) + for mode in modes.bw_modes: + assert isinstance(mode, np.uint8) def test_device_get_pdi(all_devices): @@ -91,62 +93,70 @@ def test_device_get_pdi(all_devices): assert isinstance(pdi, int) -def test_device_get_performance_modes(all_devices): +def test_device_get_performance_modes(all_devices, subtests): for device in all_devices: - with unsupported_before(device, None): - modes = nvml.device_get_performance_modes(device) - assert isinstance(modes, str) + with subtests.test(device_index=nvml.device_get_index(device)): + with unsupported_before(device, None): + modes = nvml.device_get_performance_modes(device) + assert isinstance(modes, str) @pytest.mark.skipif(cuda_version_less_than(13010), reason="Introduced in 13.1") -def test_device_get_unrepairable_memory_flag(all_devices): +def test_device_get_unrepairable_memory_flag(all_devices, subtests): for device in all_devices: - with unsupported_before(device, None): - status = nvml.device_get_unrepairable_memory_flag_v1(device) - assert isinstance(status, int) + with subtests.test(device_index=nvml.device_get_index(device)): + with unsupported_before(device, None): + status = nvml.device_get_unrepairable_memory_flag_v1(device) + assert isinstance(status, int) -def test_device_vgpu_get_heterogeneous_mode(all_devices): +def test_device_vgpu_get_heterogeneous_mode(all_devices, subtests): for device in all_devices: - with unsupported_before(device, None): - mode = nvml.device_get_vgpu_heterogeneous_mode(device) - assert isinstance(mode, int) + with subtests.test(device_index=nvml.device_get_index(device)): + with unsupported_before(device, None): + mode = nvml.device_get_vgpu_heterogeneous_mode(device) + assert isinstance(mode, int) @pytest.mark.skipif(cuda_version_less_than(13010), reason="Introduced in 13.1") -def test_read_prm_counters(all_devices): +def test_read_prm_counters(all_devices, subtests): for device in all_devices: - counters = nvml.PRMCounter_v1(5) - with unsupported_before(device, None): - read_counters = nvml.device_read_prm_counters_v1(device, counters) - assert counters is read_counters - assert len(read_counters) == 5 + with subtests.test(device_index=nvml.device_get_index(device)): + counters = nvml.PRMCounter_v1(5) + with unsupported_before(device, None): + read_counters = nvml.device_read_prm_counters_v1(device, counters) + assert counters is read_counters + assert len(read_counters) == 5 @pytest.mark.thread_unsafe(reason="API appears to be thread-unsafe (2026-06)") -def test_read_write_prm(all_devices): +def test_read_write_prm(all_devices, subtests): for device in all_devices: - # Docs say supported in BLACKWELL or later - with unsupported_before(device, None): - try: - result = nvml.device_read_write_prm_v1(device, b"012345678") - except nvml.NoPermissionError: - pytest.skip("No permission to read/write PRM") - assert isinstance(result, tuple) - assert isinstance(result[0], int) - assert isinstance(result[1], bytes) - - -def test_get_power_management_limit(all_devices): + with subtests.test(device_index=nvml.device_get_index(device)): + # Docs say supported in BLACKWELL or later + with unsupported_before(device, None): + try: + result = nvml.device_read_write_prm_v1(device, b"012345678") + except nvml.NoPermissionError: + pytest.skip("No permission to read/write PRM") + assert isinstance(result, tuple) + assert isinstance(result[0], int) + assert isinstance(result[1], bytes) + + +def test_get_power_management_limit(all_devices, subtests): for device in all_devices: # Docs say supported on KEPLER or later - with unsupported_before(device, None): + with subtests.test(device_index=nvml.device_get_index(device)), unsupported_before(device, None): nvml.device_get_power_management_limit(device) -def test_set_power_management_limit(all_devices): +def test_set_power_management_limit(all_devices, subtests): for device in all_devices: - with unsupported_before(device, None): + with ( + subtests.test(device_index=nvml.device_get_index(device)), + unsupported_before(device, None), + ): try: nvml.device_set_power_management_limit_v2(device, nvml.PowerScope.GPU, 10000) except nvml.NoPermissionError: @@ -155,18 +165,19 @@ def test_set_power_management_limit(all_devices): pytest.skip("Invalid argument when setting power management limit -- probably unsupported") -def test_set_temperature_threshold(all_devices): +def test_set_temperature_threshold(all_devices, subtests): for device in all_devices: - # Docs say supported on MAXWELL or newer - with unsupported_before(device, None): - temp = nvml.device_get_temperature_threshold( - device, nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_CURR - ) - try: - nvml.device_set_temperature_threshold( - device, nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_CURR, temp - ) - except nvml.NoPermissionError: - pytest.skip("No permission to set temperature threshold") - except nvml.InvalidArgumentError: - pytest.skip("Invalid argument when setting temperature threshold -- this is probably the temp type") + with subtests.test(device_index=nvml.device_get_index(device)): + # Docs say supported on MAXWELL or newer + with unsupported_before(device, None): + temp = nvml.device_get_temperature_threshold( + device, nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_CURR + ) + try: + nvml.device_set_temperature_threshold( + device, nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_CURR, temp + ) + except nvml.NoPermissionError: + pytest.skip("No permission to set temperature threshold") + except nvml.InvalidArgumentError: + pytest.skip("Invalid argument when setting temperature threshold -- this is probably the temp type") diff --git a/cuda_bindings/tests/nvml/test_gpu.py b/cuda_bindings/tests/nvml/test_gpu.py index 6757e4760f1..74d4f7489dc 100644 --- a/cuda_bindings/tests/nvml/test_gpu.py +++ b/cuda_bindings/tests/nvml/test_gpu.py @@ -10,7 +10,7 @@ from .conftest import unsupported_before -def test_gpu_get_module_id(nvml_init): +def test_gpu_get_module_id(nvml_init, subtests): # Unique module IDs cannot exceed the number of GPUs on the system device_count = nvml.device_get_count_v2() @@ -21,23 +21,25 @@ def test_gpu_get_module_id(nvml_init): if util.is_vgpu(device): continue - with unsupported_before(device, None): - module_id = nvml.device_get_module_id(device) - assert isinstance(module_id, int) + with subtests.test(device_index=i): + with unsupported_before(device, None): + module_id = nvml.device_get_module_id(device) + assert isinstance(module_id, int) -def test_gpu_get_platform_info(all_devices): +def test_gpu_get_platform_info(all_devices, subtests): for device in all_devices: - if util.is_vgpu(device): - pytest.skip(f"Not supported on vGPU device {device}") + with subtests.test(device_index=nvml.device_get_index(device)): + 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. + # 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) + with unsupported_before(device, None): + platform_info = nvml.device_get_platform_info(device) - assert isinstance(platform_info, (nvml.PlatformInfo_v1, nvml.PlatformInfo_v2)) + assert isinstance(platform_info, (nvml.PlatformInfo_v1, nvml.PlatformInfo_v2)) # TODO: Test APIs related to GPU instances, which require specific hardware and root @@ -58,10 +60,14 @@ def test_conf_compute_attestation_report_t(all_devices): assert report.nonce.dtype == np.uint8 -def test_gpu_conf_compute_attestation_report(all_devices): +def test_gpu_conf_compute_attestation_report(all_devices, subtests): for device in all_devices: # Documentation says AMPERE or newer - with unsupported_before(device, None), pytest.raises(nvml.UnknownError): + with ( + subtests.test(device_index=nvml.device_get_index(device)), + 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") @@ -74,9 +80,13 @@ def test_conf_compute_gpu_certificate_t(): assert len(cert.attestation_cert_chain) == 0 -def test_conf_compute_gpu_certificate(all_devices): +def test_conf_compute_gpu_certificate(all_devices, subtests): for device in all_devices: # Documentation says AMPERE or newer - with unsupported_before(device, None), pytest.raises(nvml.UnknownError): + with ( + subtests.test(device_index=nvml.device_get_index(device)), + 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/tests/nvml/test_pci.py b/cuda_bindings/tests/nvml/test_pci.py index 74c7a65a655..877f9d2998a 100644 --- a/cuda_bindings/tests/nvml/test_pci.py +++ b/cuda_bindings/tests/nvml/test_pci.py @@ -9,12 +9,13 @@ from .conftest import unsupported_before -def test_discover_gpus(all_devices): +def test_discover_gpus(all_devices, subtests): for device in all_devices: - pci_info = nvml.device_get_pci_info_v3(device) - # Docs say this should be supported on PASCAL and later - with unsupported_before(device, None), contextlib.suppress(nvml.OperatingSystemError): - nvml.device_discover_gpus(pci_info.ptr) + with subtests.test(device_index=nvml.device_get_index(device)): + pci_info = nvml.device_get_pci_info_v3(device) + # Docs say this should be supported on PASCAL and later + with unsupported_before(device, None), contextlib.suppress(nvml.OperatingSystemError): + nvml.device_discover_gpus(pci_info.ptr) def test_bridge_chip_hierarchy_t(): @@ -24,12 +25,13 @@ def test_bridge_chip_hierarchy_t(): assert isinstance(hierarchy.bridge_chip_info, nvml.BridgeChipInfo) -def test_bridge_chip_info(all_devices): +def test_bridge_chip_info(all_devices, subtests): for device in all_devices: - with unsupported_before(device, None): - info = nvml.device_get_bridge_chip_info(device) - assert isinstance(info, nvml.BridgeChipHierarchy) - for entry in info.bridge_chip_info: - assert isinstance(entry, nvml.BridgeChipInfo) - assert isinstance(entry.type, int) - assert isinstance(entry.fw_version, int) + with subtests.test(device_index=nvml.device_get_index(device)): + with unsupported_before(device, None): + info = nvml.device_get_bridge_chip_info(device) + assert isinstance(info, nvml.BridgeChipHierarchy) + for entry in info.bridge_chip_info: + assert isinstance(entry, nvml.BridgeChipInfo) + assert isinstance(entry.type, int) + assert isinstance(entry.fw_version, int) diff --git a/cuda_bindings/tests/nvml/test_pynvml.py b/cuda_bindings/tests/nvml/test_pynvml.py index 64a08fbf5c9..630a2f845a3 100644 --- a/cuda_bindings/tests/nvml/test_pynvml.py +++ b/cuda_bindings/tests/nvml/test_pynvml.py @@ -4,7 +4,6 @@ # 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 @@ -72,24 +71,26 @@ def test_device_get_handle_by_pci_bus_id(ngpus): @pytest.mark.parametrize("scope", [nvml.AffinityScope.NODE, nvml.AffinityScope.SOCKET]) @pytest.mark.skipif(IS_WSL or IS_WINDOWS, reason="Not supported on WSL or Windows") -def test_device_get_memory_affinity(handles, scope): +def test_device_get_memory_affinity(handles, scope, subtests): 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 + for device_index, handle in enumerate(handles): + with subtests.test(device_index=device_index): + 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(IS_WSL or IS_WINDOWS, reason="Not supported on WSL or Windows") -def test_device_get_cpu_affinity_within_scope(handles, scope): +def test_device_get_cpu_affinity_within_scope(handles, scope, subtests): 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 + for device_index, handle in enumerate(handles): + with subtests.test(device_index=device_index): + 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( @@ -150,29 +151,14 @@ def test_device_get_p2p_status(handles, index): # [Skipping] pynvml.nvmlDeviceGetEnforcedPowerLimit -def test_device_get_power_usage(ngpus, handles): +def test_device_get_power_usage(ngpus, handles, subtests): 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], None): - 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 subtests.test(device_index=i): + # 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): - 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") + power_mwatts = nvml.device_get_power_usage(handles[i]) + assert power_mwatts >= 0.0 # [Skipping] pynvml.nvmlDeviceGetGpuOperationMode @@ -180,11 +166,12 @@ def test_device_get_total_energy_consumption(ngpus, handles): # [Skipping] pynvml.nvmlDeviceGetPendingGpuOperationMode -def test_device_get_memory_info(ngpus, handles): +def test_device_get_memory_info(ngpus, handles, subtests): for i in range(ngpus): - with unsupported_before(handles[i], None): - meminfo = nvml.device_get_memory_info_v2(handles[i]) - assert (meminfo.used <= meminfo.total) and (meminfo.free <= meminfo.total) + with subtests.test(device_index=i): + with unsupported_before(handles[i], None): + meminfo = nvml.device_get_memory_info_v2(handles[i]) + assert (meminfo.used <= meminfo.total) and (meminfo.free <= meminfo.total) # [Skipping] pynvml.nvmlDeviceGetBAR1MemoryInfo @@ -197,12 +184,13 @@ def test_device_get_memory_info(ngpus, handles): # [Skipping] pynvml.nvmlDeviceGetMemoryErrorCounter -def test_device_get_utilization_rates(ngpus, handles): +def test_device_get_utilization_rates(ngpus, handles, subtests): for i in range(ngpus): - with unsupported_before(handles[i], None): - urate = nvml.device_get_utilization_rates(handles[i]) - assert urate.gpu >= 0 - assert urate.memory >= 0 + with subtests.test(device_index=i): + with unsupported_before(handles[i], None): + urate = nvml.device_get_utilization_rates(handles[i]) + assert urate.gpu >= 0 + assert urate.memory >= 0 # [Skipping] pynvml.nvmlDeviceGetEncoderUtilization @@ -255,14 +243,15 @@ def test_device_get_utilization_rates(ngpus, handles): # [Skipping] pynvml.nvmlDeviceGetViolationStatus -def test_device_get_pcie_throughput(ngpus, handles): +def test_device_get_pcie_throughput(ngpus, handles, subtests): for i in range(ngpus): - with unsupported_before(handles[i], None): - tx_bytes_tp = nvml.device_get_pcie_throughput(handles[i], nvml.PcieUtilCounter.PCIE_UTIL_TX_BYTES) - assert tx_bytes_tp >= 0 - with unsupported_before(handles[i], None): - rx_bytes_tp = nvml.device_get_pcie_throughput(handles[i], nvml.PcieUtilCounter.PCIE_UTIL_RX_BYTES) - assert rx_bytes_tp >= 0 + with subtests.test(device_index=i): + with unsupported_before(handles[i], None): + tx_bytes_tp = nvml.device_get_pcie_throughput(handles[i], nvml.PcieUtilCounter.PCIE_UTIL_TX_BYTES) + assert tx_bytes_tp >= 0 + with unsupported_before(handles[i], None): + 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) diff --git a/cuda_bindings/tests/nvml/test_util.py b/cuda_bindings/tests/nvml/test_util.py new file mode 100644 index 00000000000..2eb46647777 --- /dev/null +++ b/cuda_bindings/tests/nvml/test_util.py @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + + +import pytest + +from cuda.bindings import nvml + +from . import util + + +class _FakeFieldValue: + nvml_return = nvml.Return.SUCCESS + + +@pytest.mark.agent_authored(model="claude-opus-5") +def test_supports_nvlink_queries_a_real_field_id(monkeypatch): + """The helper has to name an enum that exists; nvml.FI never did.""" + queried = {} + + def fake_device_get_field_values(device, fields): + queried["field_id"] = fields[0].field_id + return [_FakeFieldValue()] + + monkeypatch.setattr(nvml, "device_get_field_values", fake_device_get_field_values) + + assert util.supports_nvlink(object()) is True + assert queried["field_id"] == nvml.FieldId.DEV_NVLINK_GET_STATE diff --git a/cuda_bindings/tests/nvml/util.py b/cuda_bindings/tests/nvml/util.py index 129ded8f83c..7d63a141706 100644 --- a/cuda_bindings/tests/nvml/util.py +++ b/cuda_bindings/tests/nvml/util.py @@ -22,5 +22,5 @@ def supports_ecc(device): def supports_nvlink(device): fields = nvml.FieldValue(1) - fields[0].field_id = nvml.FI.DEV_NVLINK_GET_STATE + fields[0].field_id = nvml.FieldId.DEV_NVLINK_GET_STATE return nvml.device_get_field_values(device, fields)[0].nvml_return == nvml.Return.SUCCESS diff --git a/cuda_bindings/tests/test_cudart.py b/cuda_bindings/tests/test_cudart.py index 12d6d4352ca..53702280679 100644 --- a/cuda_bindings/tests/test_cudart.py +++ b/cuda_bindings/tests/test_cudart.py @@ -34,7 +34,16 @@ def supportsSparseTexturesDeviceFilter(): def supportsCudaAPI(name): - return name in dir(cuda) or dir(cudart) + return name in dir(cuda) or name in dir(cudart) + + +@pytest.mark.agent_authored(model="claude-opus-5") +def test_supportsCudaAPI(): + # Guards the operator precedence: `name in dir(cuda) or dir(cudart)` parses + # as `(name in dir(cuda)) or dir(cudart)`, which is truthy for every name. + assert supportsCudaAPI("cudaMalloc") is True # runtime module + assert supportsCudaAPI("cuInit") is True # driver module + assert supportsCudaAPI("this_is_not_a_cuda_api") is False def test_cudart_memcpy(): diff --git a/cuda_bindings/tests/test_utils.py b/cuda_bindings/tests/test_utils.py index c767996bced..84f7ca7b722 100644 --- a/cuda_bindings/tests/test_utils.py +++ b/cuda_bindings/tests/test_utils.py @@ -115,6 +115,27 @@ def test_get_handle_error(target): handle = get_cuda_native_handle(target) +@pytest.mark.agent_authored(model="claude-opus-5") +def test_get_handle_does_not_report_a_registered_type_as_unknown(monkeypatch): + """A KeyError from inside a handle getter is a bug in that getter. + + Reporting it as "Unknown type" is wrong twice over: the type *is* + registered, and `from None` hides the traceback that would say otherwise. + """ + from cuda.bindings.utils import _handle_getters + + class Registered: + pass + + def getter(_obj): + raise KeyError("lookup inside the getter failed") + + monkeypatch.setitem(_handle_getters, Registered, getter) + + with pytest.raises(KeyError, match="lookup inside the getter failed"): + get_cuda_native_handle(Registered()) + + @pytest.mark.parametrize( "module", # Top-level modules for external Python use diff --git a/cuda_core/AGENTS.md b/cuda_core/AGENTS.md index 83c96800e9d..9d80ab74aaa 100644 --- a/cuda_core/AGENTS.md +++ b/cuda_core/AGENTS.md @@ -151,6 +151,13 @@ a `StrEnum` is accepted as an argument, a `str` should also be acceptable. An invalid value should raise an exception. When a function returns a `str` drawn from a small number of values, return a `StrEnum` subclass instead. +For `__post_init__` validation in frozen dataclasses, use the +`not isinstance(value, EnumType) → try EnumType(value) except (ValueError, +TypeError)` pattern (modelled on `_normalize_enum` in +`cuda/core/texture/_texture.pyx`). This accepts the enum itself or a valid +string, and raises `ValueError` eagerly for any other type rather than +silently storing it. + ### Exception handling Raising exceptions is preferred over a C-style return code that must be checked diff --git a/cuda_core/LICENSE b/cuda_core/LICENSE index d6f74778be8..f3fe76ecadf 100644 --- a/cuda_core/LICENSE +++ b/cuda_core/LICENSE @@ -176,3 +176,28 @@ Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 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_core/NOTICE b/cuda_core/NOTICE index c4625e23899..f58d516a4ba 100644 --- a/cuda_core/NOTICE +++ b/cuda_core/NOTICE @@ -11,3 +11,20 @@ DLPack Copyright (c) 2017 by Contributors Licensed under the Apache License, Version 2.0. Source: https://github.com/dmlc/dlpack +Vendored at: cuda/core/_include/dlpack.h + +PyTorch +Copyright (c) 2016- Facebook, Inc (Adam Paszke) +Copyright (c) 2014- Facebook, Inc (Soumith Chintala) +Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) +Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) +Copyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu) +Copyright (c) 2011-2013 NYU (Clement Farabet) +Copyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston) +Copyright (c) 2006 Idiap Research Institute (Samy Bengio) +Copyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz) +Licensed under the BSD 3-Clause License. +Source: https://github.com/pytorch/pytorch +Vendored at: cuda/core/_include/aoti_shim.h, and the accompanying +cuda/core/_include/aoti_shim.def, which declares the same AOT Inductor +stable C ABI symbol names for the MSVC linker on Windows. diff --git a/cuda_core/cuda/core/__init__.py b/cuda_core/cuda/core/__init__.py index b9a36e3dee7..7864ae794ca 100644 --- a/cuda_core/cuda/core/__init__.py +++ b/cuda_core/cuda/core/__init__.py @@ -36,12 +36,17 @@ def _patch_rlcompleter_for_cython_properties() -> None: # which rlcompleter's narrow isinstance(..., property) check misses; the # fallback getattr() then invokes the descriptor and any non-AttributeError # it raises kills tab completion. Extend that isinstance check to also - # match getset_descriptor / member_descriptor. Only installed in - # interactive mode so library users running scripts see no global - # rlcompleter side effect. + # match getset_descriptor / member_descriptor. Installed unconditionally + # (the patch is scoped to the rlcompleter module, so non-interactive users + # only pay for the import). import os - if int(os.environ.get("CUDA_CORE_DONT_FIX_TAB_COMPLETION", "0")): + raw_opt_out = os.environ.get("CUDA_CORE_DONT_FIX_TAB_COMPLETION", "").strip() + try: + opt_out = int(raw_opt_out) != 0 + except ValueError: + opt_out = raw_opt_out != "" + if opt_out: # Explicit opt-out for users who don't want the global rlcompleter # side effect, even in an interactive session. return diff --git a/cuda_core/cuda/core/_context.pyi b/cuda_core/cuda/core/_context.pyi index afbc130882e..4adccfcbcfb 100644 --- a/cuda_core/cuda/core/_context.pyi +++ b/cuda_core/cuda/core/_context.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_context.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_context.pyx from collections.abc import Sequence from dataclasses import dataclass @@ -10,6 +8,8 @@ from cuda.core._device_resources import (DeviceResources, SMResource, WorkqueueResource) from cuda.core._stream import Stream +__all__ = ['Context', 'ContextOptions'] +DeviceResourcesType = Sequence[SMResource | WorkqueueResource] class Context: """CUDA context wrapper. @@ -17,25 +17,15 @@ class Context: Context objects represent CUDA contexts and cannot be instantiated directly. Use Device or Stream APIs to obtain context objects. """ - - def close(self): - """Release this context wrapper's underlying CUDA handles.""" - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... @property def handle(self) -> cuda.bindings.driver.CUcontext | None: """Return the underlying CUcontext handle.""" - @property - def _handle(self) -> cuda.bindings.driver.CUcontext | None: - ... - + def _handle(self) -> cuda.bindings.driver.CUcontext | None: ... @property def is_green(self) -> bool: """True if this context was created from device resources.""" - @property def resources(self) -> DeviceResources: """Query the hardware resources provisioned for this context. @@ -46,8 +36,7 @@ class Context: Raises :class:`RuntimeError` if the context has been closed. """ - - def create_stream(self, options: object=None) -> Stream: + def create_stream(self, options: object | None=None) -> Stream: """Create a new stream bound to this green context. This method is only available on green contexts. For primary @@ -63,15 +52,11 @@ class Context: :obj:`~_stream.Stream` Newly created stream object. """ - - def __eq__(self, other: object) -> bool: - ... - - def __hash__(self) -> int: - ... - - def __repr__(self) -> str: - ... + def close(self): + """Release this context wrapper's underlying CUDA handles.""" + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... @dataclass class ContextOptions: @@ -83,5 +68,3 @@ class ContextOptions: Device resources used to create a green context. """ resources: DeviceResourcesType -__all__ = ['Context', 'ContextOptions'] -DeviceResourcesType = Sequence[SMResource | WorkqueueResource] \ No newline at end of file diff --git a/cuda_core/cuda/core/_cpp/resource_handles.cpp b/cuda_core/cuda/core/_cpp/resource_handles.cpp index ef1b8d0f2f8..ee116a9f353 100644 --- a/cuda_core/cuda/core/_cpp/resource_handles.cpp +++ b/cuda_core/cuda/core/_cpp/resource_handles.cpp @@ -9,12 +9,14 @@ #include <atomic> #include <array> #include <cstdint> +#include <cstdio> #include <cstdlib> #include <cstring> #include <list> #include <map> #include <mutex> #include <stdexcept> +#include <thread> #include <unordered_map> #include <vector> @@ -34,6 +36,7 @@ namespace cuda_core { decltype(&cuDevicePrimaryCtxRetain) p_cuDevicePrimaryCtxRetain = nullptr; decltype(&cuDevicePrimaryCtxRelease) p_cuDevicePrimaryCtxRelease = nullptr; decltype(&cuCtxGetCurrent) p_cuCtxGetCurrent = nullptr; +decltype(&cuCtxSetCurrent) p_cuCtxSetCurrent = nullptr; decltype(&cuGreenCtxCreate) p_cuGreenCtxCreate = nullptr; decltype(&cuGreenCtxDestroy) p_cuGreenCtxDestroy = nullptr; decltype(&cuCtxFromGreenCtx) p_cuCtxFromGreenCtx = nullptr; @@ -108,6 +111,13 @@ decltype(&cuDevSmResourceSplit) p_cuDevSmResourceSplit = nullptr; void* p_cuDevSmResourceSplit = nullptr; #endif +// cuMemcpyWithAttributesAsync (13.2+ — may be null on older drivers/bindings) +#if CUDA_VERSION >= 13020 +decltype(&cuMemcpyWithAttributesAsync) p_cuMemcpyWithAttributesAsync = nullptr; +#else +void* p_cuMemcpyWithAttributesAsync = nullptr; +#endif + // NVRTC function pointers decltype(&nvrtcDestroyProgram) p_nvrtcDestroyProgram = nullptr; @@ -190,6 +200,53 @@ class GILAcquireGuard { bool acquired_; }; +// Temporarily make a context current, restoring the caller's prior binding +// (including having no context current) on scope exit. The handle is held for +// the duration so the context cannot be destroyed mid-scope. +class ScopedCurrentContext { +public: + explicit ScopedCurrentContext(ContextHandle h_context) noexcept + : h_context_(std::move(h_context)) { + CUcontext target = as_cu(h_context_); + if (!target) { + return; + } + + GILReleaseGuard gil; + status_ = p_cuCtxGetCurrent(&previous_); + if (status_ != CUDA_SUCCESS || previous_ == target) { + return; + } + status_ = p_cuCtxSetCurrent(target); + changed_ = status_ == CUDA_SUCCESS; + } + + ~ScopedCurrentContext() { + if (changed_) { + GILReleaseGuard gil; + CUresult status = p_cuCtxSetCurrent(previous_); + if (status != CUDA_SUCCESS) { + std::fprintf( + stderr, + "Warning: cuCtxSetCurrent (restoring the caller's context) " + "failed (CUDA error %d)\n", + static_cast<int>(status)); + } + } + } + + CUresult status() const noexcept { return status_; } + + ScopedCurrentContext(const ScopedCurrentContext&) = delete; + ScopedCurrentContext& operator=(const ScopedCurrentContext&) = delete; + +private: + ContextHandle h_context_; + CUcontext previous_ = nullptr; + bool changed_ = false; + CUresult status_ = CUDA_SUCCESS; +}; + } // namespace // ============================================================================ @@ -726,6 +783,97 @@ StreamHandle get_per_thread_stream() { return handle; } +// ============================================================================ +// Deallocation streams +// +// A DeallocationStream is a StreamHandle used for ordering frees. It differs +// from an ordinary StreamHandle only for default-stream tokens, for which it +// stores the (de)allocation context. Ordinarily, the LEGACY and PER_THREAD +// default streams resolve to whichever context is active at the time they are +// used, but for storing deallocation recipes we need to pin the context. With +// the PER_THREAD token, it is not possible to restore the original stream when +// deallocation runs on a different thread. Therefore, in that case the +// allocating host thread id is also stored so that cross-thread frees can be +// detected and warnings can be issued. +// ============================================================================ + +// ptds_tid is std::thread::id{} except for CU_STREAM_PER_THREAD. +struct DeallocationStream { + StreamHandle h_stream; + std::thread::id ptds_tid{}; +}; + +// Real streams are copied unchanged. Default-stream tokens without an embedded +// context are bound to the current context. Returns false (and sets err) when a +// default-stream token cannot be bound because no context is current. +static bool make_deallocation_stream( + const StreamHandle& h, DeallocationStream& out) noexcept { + out = {}; + if (!h) { + return true; + } + + const CUstream stream = as_cu(h); + if (stream != nullptr + && stream != CU_STREAM_LEGACY + && stream != CU_STREAM_PER_THREAD) { + out = DeallocationStream{h, {}}; + return true; + } + + StreamHandle h_bound = h; + if (!get_stream_context(h)) { + ContextHandle h_ctx = get_current_context(); + if (!h_ctx) { + if (err == CUDA_SUCCESS) { + err = CUDA_ERROR_INVALID_CONTEXT; + } + return false; + } + // Do not register in stream_registry: the token value alone is not + // a unique stream identity (context is part of the meaning). + auto box = std::shared_ptr<const StreamBox>( + new StreamBox{stream, h_ctx}); + h_bound = StreamHandle(box, &box->resource); + } + + std::thread::id ptds_tid{}; + if (stream == CU_STREAM_PER_THREAD) { + ptds_tid = std::this_thread::get_id(); + } + out = DeallocationStream{std::move(h_bound), ptds_tid}; + return true; +} + +template <typename Fn> +CUresult with_deallocation_context( + const DeallocationStream& stream, + const char* operation, + Fn&& fn) noexcept { + if (stream.ptds_tid != std::thread::id{} + && stream.ptds_tid != std::this_thread::get_id()) { + std::fprintf( + stderr, + "Warning: Buffer deallocation for a per-thread default stream " + "is running on a different host thread than the one that recorded " + "the deallocation stream; ordering relative to the allocating " + "thread's PTDS is not preserved\n"); + } + ScopedCurrentContext context(get_stream_context(stream.h_stream)); + CUresult status = context.status(); + if (status == CUDA_SUCCESS) { + status = fn(stream); + } + if (status != CUDA_SUCCESS) { + std::fprintf( + stderr, + "Warning: %s failed during resource destruction (CUDA error %d)\n", + operation, + static_cast<int>(status)); + } + return status; +} + // ============================================================================ // Event Handles // ============================================================================ @@ -913,10 +1061,10 @@ MemoryPoolHandle create_mempool_handle_ipc(int fd, CUmemAllocationHandleType han namespace { struct DevicePtrBox { CUdeviceptr resource; - // Mutable to allow set_deallocation_stream() to update the stream - // through a const DevicePtrHandle. The stream can be changed after - // allocation (e.g., to synchronize deallocation with a different stream). - mutable StreamHandle h_stream; + // Mutable so set_deallocation_stream() can update free ordering through a + // const DevicePtrHandle. Built with make_deallocation_stream so default- + // stream tokens carry a bound context. + mutable DeallocationStream deallocation; }; } // namespace @@ -924,7 +1072,7 @@ struct DevicePtrBox { // This works because DevicePtrHandle is a shared_ptr alias pointing to // &box->resource, so we can compute the containing struct using offsetof. // The const_cast is safe because we only use this to access the mutable -// h_stream member or in the deleter (where the box is being destroyed). +// deallocation member or in the deleter (where the box is being destroyed). static DevicePtrBox* get_box(const DevicePtrHandle& h) { const CUdeviceptr* p = h.get(); return reinterpret_cast<DevicePtrBox*>( @@ -933,11 +1081,20 @@ static DevicePtrBox* get_box(const DevicePtrHandle& h) { } StreamHandle deallocation_stream(const DevicePtrHandle& h) noexcept { - return get_box(h)->h_stream; + return get_box(h)->deallocation.h_stream; } -void set_deallocation_stream(const DevicePtrHandle& h, const StreamHandle& h_stream) noexcept { - get_box(h)->h_stream = h_stream; +CUresult set_deallocation_stream( + const DevicePtrHandle& h, const StreamHandle& h_stream) noexcept { + if (!h) { + return CUDA_ERROR_INVALID_VALUE; + } + DeallocationStream ds; + if (!make_deallocation_stream(h_stream, ds)) { + return err != CUDA_SUCCESS ? err : CUDA_ERROR_INVALID_CONTEXT; + } + get_box(h)->deallocation = std::move(ds); + return CUDA_SUCCESS; } DevicePtrHandle deviceptr_alloc_from_pool(size_t size, const MemoryPoolHandle& h_pool, const StreamHandle& h_stream) { @@ -947,11 +1104,23 @@ DevicePtrHandle deviceptr_alloc_from_pool(size_t size, const MemoryPoolHandle& h return {}; } + DeallocationStream ds; + if (!make_deallocation_stream(h_stream, ds)) { + p_cuMemFreeAsync(ptr, as_cu(h_stream)); + return {}; + } + auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{ptr, h_stream}, + new DevicePtrBox{ptr, std::move(ds)}, [h_pool](DevicePtrBox* b) { GILReleaseGuard gil; - p_cuMemFreeAsync(b->resource, as_cu(b->h_stream)); + with_deallocation_context( + b->deallocation, + "cuMemFreeAsync", + [b](const DeallocationStream& stream) { + return p_cuMemFreeAsync( + b->resource, as_cu(stream.h_stream)); + }); delete b; } ); @@ -965,11 +1134,23 @@ DevicePtrHandle deviceptr_alloc_async(size_t size, const StreamHandle& h_stream) return {}; } + DeallocationStream ds; + if (!make_deallocation_stream(h_stream, ds)) { + p_cuMemFreeAsync(ptr, as_cu(h_stream)); + return {}; + } + auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{ptr, h_stream}, + new DevicePtrBox{ptr, std::move(ds)}, [](DevicePtrBox* b) { GILReleaseGuard gil; - p_cuMemFreeAsync(b->resource, as_cu(b->h_stream)); + with_deallocation_context( + b->deallocation, + "cuMemFreeAsync", + [b](const DeallocationStream& stream) { + return p_cuMemFreeAsync( + b->resource, as_cu(stream.h_stream)); + }); delete b; } ); @@ -984,7 +1165,7 @@ DevicePtrHandle deviceptr_alloc(size_t size) { } auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{ptr, StreamHandle{}}, + new DevicePtrBox{ptr, DeallocationStream{}}, [](DevicePtrBox* b) { GILReleaseGuard gil; p_cuMemFree(b->resource); @@ -1002,7 +1183,7 @@ DevicePtrHandle deviceptr_alloc_host(size_t size) { } auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{reinterpret_cast<CUdeviceptr>(ptr), StreamHandle{}}, + new DevicePtrBox{reinterpret_cast<CUdeviceptr>(ptr), DeallocationStream{}}, [](DevicePtrBox* b) { GILReleaseGuard gil; p_cuMemFreeHost(reinterpret_cast<void*>(b->resource)); @@ -1013,7 +1194,7 @@ DevicePtrHandle deviceptr_alloc_host(size_t size) { } DevicePtrHandle deviceptr_create_ref(CUdeviceptr ptr) { - auto box = std::make_shared<DevicePtrBox>(DevicePtrBox{ptr, StreamHandle{}}); + auto box = std::make_shared<DevicePtrBox>(DevicePtrBox{ptr, DeallocationStream{}}); return DevicePtrHandle(box, &box->resource); } @@ -1029,7 +1210,7 @@ DevicePtrHandle deviceptr_create_with_owner(CUdeviceptr ptr, PyObject* owner) { } Py_INCREF(owner); auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{ptr, StreamHandle{}}, + new DevicePtrBox{ptr, DeallocationStream{}}, [owner](DevicePtrBox* b) { GILAcquireGuard gil; if (gil.acquired()) { @@ -1046,12 +1227,22 @@ DevicePtrHandle deviceptr_create_mapped_graphics( const GraphicsResourceHandle& h_resource, const StreamHandle& h_stream ) { + DeallocationStream ds; + if (!make_deallocation_stream(h_stream, ds)) { + return {}; + } auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{ptr, h_stream}, + new DevicePtrBox{ptr, std::move(ds)}, [h_resource](DevicePtrBox* b) { GILReleaseGuard gil; CUgraphicsResource resource = as_cu(h_resource); - p_cuGraphicsUnmapResources(1, &resource, as_cu(b->h_stream)); + with_deallocation_context( + b->deallocation, + "cuGraphicsUnmapResources", + [b, &resource](const DeallocationStream& stream) { + return p_cuGraphicsUnmapResources( + 1, &resource, as_cu(stream.h_stream)); + }); delete b; } ); @@ -1079,12 +1270,19 @@ DevicePtrHandle deviceptr_create_with_mr(CUdeviceptr ptr, size_t size, PyObject* } Py_INCREF(mr); auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{ptr, StreamHandle{}}, + new DevicePtrBox{ptr, DeallocationStream{}}, [mr, size](DevicePtrBox* b) { GILAcquireGuard gil; if (gil.acquired()) { if (mr_dealloc_cb) { - mr_dealloc_cb(mr, b->resource, size, b->h_stream); + with_deallocation_context( + b->deallocation, + "MemoryResource deallocate", + [mr, size, b](const DeallocationStream& stream) { + mr_dealloc_cb( + mr, b->resource, size, stream.h_stream); + return CUDA_SUCCESS; + }); } Py_DECREF(mr); } @@ -1172,12 +1370,24 @@ DevicePtrHandle deviceptr_import_ipc(const MemoryPoolHandle& h_pool, const void* return {}; } + DeallocationStream ds; + if (!make_deallocation_stream(h_stream, ds)) { + p_cuMemFreeAsync(ptr, as_cu(h_stream)); + return {}; + } + auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{ptr, h_stream}, + new DevicePtrBox{ptr, std::move(ds)}, [h_pool, key](DevicePtrBox* b) { ipc_ptr_cache.unregister_handle(key); GILReleaseGuard gil; - p_cuMemFreeAsync(b->resource, as_cu(b->h_stream)); + with_deallocation_context( + b->deallocation, + "cuMemFreeAsync", + [b](const DeallocationStream& stream) { + return p_cuMemFreeAsync( + b->resource, as_cu(stream.h_stream)); + }); delete b; } ); @@ -1192,11 +1402,23 @@ DevicePtrHandle deviceptr_import_ipc(const MemoryPoolHandle& h_pool, const void* return {}; } + DeallocationStream ds; + if (!make_deallocation_stream(h_stream, ds)) { + p_cuMemFreeAsync(ptr, as_cu(h_stream)); + return {}; + } + auto box = std::shared_ptr<DevicePtrBox>( - new DevicePtrBox{ptr, h_stream}, + new DevicePtrBox{ptr, std::move(ds)}, [h_pool](DevicePtrBox* b) { GILReleaseGuard gil; - p_cuMemFreeAsync(b->resource, as_cu(b->h_stream)); + with_deallocation_context( + b->deallocation, + "cuMemFreeAsync", + [b](const DeallocationStream& stream) { + return p_cuMemFreeAsync( + b->resource, as_cu(stream.h_stream)); + }); delete b; } ); @@ -2619,4 +2841,25 @@ bool has_sm_resource_split() noexcept { return p_cuDevSmResourceSplit != nullptr; } +// ============================================================================ +// cuMemcpyWithAttributesAsync wrapper +// ============================================================================ + +CUresult memcpy_with_attributes_async(CUdeviceptr dst, CUdeviceptr src, size_t size, + void* attr, CUstream hStream) { +#if CUDA_VERSION >= 13020 + if (!p_cuMemcpyWithAttributesAsync) { + return CUDA_ERROR_NOT_SUPPORTED; + } + return p_cuMemcpyWithAttributesAsync( + dst, src, size, static_cast<CUmemcpyAttributes*>(attr), hStream); +#else + return CUDA_ERROR_NOT_SUPPORTED; +#endif +} + +bool has_memcpy_with_attributes_async() noexcept { + return p_cuMemcpyWithAttributesAsync != nullptr; +} + } // namespace cuda_core diff --git a/cuda_core/cuda/core/_cpp/resource_handles.hpp b/cuda_core/cuda/core/_cpp/resource_handles.hpp index 6a1a0edd6c7..ff1a12a4618 100644 --- a/cuda_core/cuda/core/_cpp/resource_handles.hpp +++ b/cuda_core/cuda/core/_cpp/resource_handles.hpp @@ -67,6 +67,7 @@ void clear_last_error() noexcept; extern decltype(&cuDevicePrimaryCtxRetain) p_cuDevicePrimaryCtxRetain; extern decltype(&cuDevicePrimaryCtxRelease) p_cuDevicePrimaryCtxRelease; extern decltype(&cuCtxGetCurrent) p_cuCtxGetCurrent; +extern decltype(&cuCtxSetCurrent) p_cuCtxSetCurrent; extern decltype(&cuGreenCtxCreate) p_cuGreenCtxCreate; extern decltype(&cuGreenCtxDestroy) p_cuGreenCtxDestroy; extern decltype(&cuCtxFromGreenCtx) p_cuCtxFromGreenCtx; @@ -145,6 +146,15 @@ extern decltype(&cuDevSmResourceSplit) p_cuDevSmResourceSplit; extern void* p_cuDevSmResourceSplit; #endif +// cuMemcpyWithAttributesAsync (13.2+ — may be null on older drivers/bindings) +#if CUDA_VERSION >= 13020 +extern decltype(&cuMemcpyWithAttributesAsync) p_cuMemcpyWithAttributesAsync; +#else +// cuMemcpyWithAttributesAsync doesn't exist in CUDA < 13.2 headers, so use a +// void* placeholder. The pointer is always null when built against older CUDA. +extern void* p_cuMemcpyWithAttributesAsync; +#endif + // ============================================================================ // NVRTC function pointers // @@ -423,7 +433,10 @@ DevicePtrHandle deviceptr_import_ipc( StreamHandle deallocation_stream(const DevicePtrHandle& h) noexcept; // Set the deallocation stream for a device pointer handle. -void set_deallocation_stream(const DevicePtrHandle& h, const StreamHandle& h_stream) noexcept; +// Returns CUDA_ERROR_INVALID_CONTEXT when a default-stream token cannot be +// bound because no CUDA context is current. +CUresult set_deallocation_stream( + const DevicePtrHandle& h, const StreamHandle& h_stream) noexcept; // ============================================================================ // Library handle functions @@ -1106,4 +1119,21 @@ CUresult sm_resource_split(CUdevResource* result, unsigned int nbGroups, // Returns true if the cuDevSmResourceSplit function pointer is available. bool has_sm_resource_split() noexcept; +// ============================================================================ +// cuMemcpyWithAttributesAsync wrapper (13.2+) +// +// Calls through p_cuMemcpyWithAttributesAsync if available, otherwise returns +// CUDA_ERROR_NOT_SUPPORTED. This avoids a direct Cython cimport of the +// cydriver cdef function, which would fail at module init on cuda-bindings +// < 13.2 (see https://github.com/NVIDIA/cuda-python/issues/2063). +// ============================================================================ + +// attr is void* so the Cython declaration doesn't reference CUmemcpyAttributes +// (absent from cuda-bindings built against CUDA < 12.8). The C++ side casts it. +CUresult memcpy_with_attributes_async(CUdeviceptr dst, CUdeviceptr src, size_t size, + void* attr, CUstream hStream); + +// Returns true if the cuMemcpyWithAttributesAsync function pointer is available. +bool has_memcpy_with_attributes_async() noexcept; + } // namespace cuda_core diff --git a/cuda_core/cuda/core/_device.pyi b/cuda_core/cuda/core/_device.pyi index a086f0d2523..8b0bb4212b8 100644 --- a/cuda_core/cuda/core/_device.pyi +++ b/cuda_core/cuda/core/_device.pyi @@ -1,8 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_device.pyx - -from __future__ import annotations - -import threading +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_device.pyx import cuda.core.system from cuda.core._context import Context, ContextOptions @@ -17,6 +13,7 @@ from cuda.core.texture import (MipmappedArray, MipmappedArrayOptions, ResourceDescriptor, SurfaceObject, TextureObject, TextureObjectOptions) +__all__ = ['Device'] class DeviceProperties: """ @@ -24,588 +21,441 @@ class DeviceProperties: Attributes are read-only and provide information about the device. """ - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... @classmethod - def _init(cls, handle: int) -> DeviceProperties: - ... - + def _init(cls, handle: int) -> DeviceProperties: ... @property def max_threads_per_block(self) -> int: """int: Maximum number of threads per block.""" - @property def max_block_dim_x(self) -> int: """int: Maximum block dimension X.""" - @property def max_block_dim_y(self) -> int: """int: Maximum block dimension Y.""" - @property def max_block_dim_z(self) -> int: """int: Maximum block dimension Z.""" - @property def max_grid_dim_x(self) -> int: """int: Maximum grid dimension X.""" - @property def max_grid_dim_y(self) -> int: """int: Maximum grid dimension Y.""" - @property def max_grid_dim_z(self) -> int: """int: Maximum grid dimension Z.""" - @property def max_shared_memory_per_block(self) -> int: """int: Maximum shared memory available per block in bytes.""" - @property def total_constant_memory(self) -> int: """int: Memory available on device for constant variables in a CUDA C kernel in bytes.""" - @property def warp_size(self) -> int: """int: Warp size in threads.""" - @property def max_pitch(self) -> int: """int: Maximum pitch in bytes allowed by memory copies.""" - @property def maximum_texture1d_width(self) -> int: """int: Maximum 1D texture width.""" - @property def maximum_texture1d_linear_width(self) -> int: """int: Maximum width for a 1D texture bound to linear memory.""" - @property def maximum_texture1d_mipmapped_width(self) -> int: """int: Maximum mipmapped 1D texture width.""" - @property def maximum_texture2d_width(self) -> int: """int: Maximum 2D texture width.""" - @property def maximum_texture2d_height(self) -> int: """int: Maximum 2D texture height.""" - @property def maximum_texture2d_linear_width(self) -> int: """int: Maximum width for a 2D texture bound to linear memory.""" - @property def maximum_texture2d_linear_height(self) -> int: """int: Maximum height for a 2D texture bound to linear memory.""" - @property def maximum_texture2d_linear_pitch(self) -> int: """int: Maximum pitch in bytes for a 2D texture bound to linear memory.""" - @property def maximum_texture2d_mipmapped_width(self) -> int: """int: Maximum mipmapped 2D texture width.""" - @property def maximum_texture2d_mipmapped_height(self) -> int: """int: Maximum mipmapped 2D texture height.""" - @property def maximum_texture3d_width(self) -> int: """int: Maximum 3D texture width.""" - @property def maximum_texture3d_height(self) -> int: """int: Maximum 3D texture height.""" - @property def maximum_texture3d_depth(self) -> int: """int: Maximum 3D texture depth.""" - @property def maximum_texture3d_width_alternate(self) -> int: """int: Alternate maximum 3D texture width, 0 if no alternate maximum 3D texture size is supported.""" - @property def maximum_texture3d_height_alternate(self) -> int: """int: Alternate maximum 3D texture height, 0 if no alternate maximum 3D texture size is supported.""" - @property def maximum_texture3d_depth_alternate(self) -> int: """int: Alternate maximum 3D texture depth, 0 if no alternate maximum 3D texture size is supported.""" - @property def maximum_texturecubemap_width(self) -> int: """int: Maximum cubemap texture width or height.""" - @property def maximum_texture1d_layered_width(self) -> int: """int: Maximum 1D layered texture width.""" - @property def maximum_texture1d_layered_layers(self) -> int: """int: Maximum layers in a 1D layered texture.""" - @property def maximum_texture2d_layered_width(self) -> int: """int: Maximum 2D layered texture width.""" - @property def maximum_texture2d_layered_height(self) -> int: """int: Maximum 2D layered texture height.""" - @property def maximum_texture2d_layered_layers(self) -> int: """int: Maximum layers in a 2D layered texture.""" - @property def maximum_texturecubemap_layered_width(self) -> int: """int: Maximum cubemap layered texture width or height.""" - @property def maximum_texturecubemap_layered_layers(self) -> int: """int: Maximum layers in a cubemap layered texture.""" - @property def maximum_surface1d_width(self) -> int: """int: Maximum 1D surface width.""" - @property def maximum_surface2d_width(self) -> int: """int: Maximum 2D surface width.""" - @property def maximum_surface2d_height(self) -> int: """int: Maximum 2D surface height.""" - @property def maximum_surface3d_width(self) -> int: """int: Maximum 3D surface width.""" - @property def maximum_surface3d_height(self) -> int: """int: Maximum 3D surface height.""" - @property def maximum_surface3d_depth(self) -> int: """int: Maximum 3D surface depth.""" - @property def maximum_surface1d_layered_width(self) -> int: """int: Maximum 1D layered surface width.""" - @property def maximum_surface1d_layered_layers(self) -> int: """int: Maximum layers in a 1D layered surface.""" - @property def maximum_surface2d_layered_width(self) -> int: """int: Maximum 2D layered surface width.""" - @property def maximum_surface2d_layered_height(self) -> int: """int: Maximum 2D layered surface height.""" - @property def maximum_surface2d_layered_layers(self) -> int: """int: Maximum layers in a 2D layered surface.""" - @property def maximum_surfacecubemap_width(self) -> int: """int: Maximum cubemap surface width.""" - @property def maximum_surfacecubemap_layered_width(self) -> int: """int: Maximum cubemap layered surface width.""" - @property def maximum_surfacecubemap_layered_layers(self) -> int: """int: Maximum layers in a cubemap layered surface.""" - @property def max_registers_per_block(self) -> int: """int: Maximum number of 32-bit registers available to a thread block.""" - @property def clock_rate(self) -> int: """int: Typical clock frequency in kilohertz.""" - @property def texture_alignment(self) -> int: """int: Alignment requirement for textures.""" - @property def texture_pitch_alignment(self) -> int: """int: Pitch alignment requirement for textures.""" - @property def gpu_overlap(self) -> bool: """bool: Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use :attr:`~DeviceProperties.async_engine_count` instead.""" - @property def multiprocessor_count(self) -> int: """int: Number of multiprocessors on device.""" - @property def kernel_exec_timeout(self) -> bool: """bool: Specifies whether there is a run time limit on kernels.""" - @property def integrated(self) -> bool: """bool: Device is integrated with host memory.""" - @property def can_map_host_memory(self) -> bool: """bool: Device can map host memory into CUDA address space.""" - @property def compute_mode(self) -> int: """int: Compute mode (See CUcomputemode for details).""" - @property def concurrent_kernels(self) -> bool: """bool: Device can possibly execute multiple kernels concurrently.""" - @property def ecc_enabled(self) -> bool: """bool: Device has ECC support enabled.""" - @property def pci_bus_id(self) -> int: """int: PCI bus ID of the device.""" - @property def pci_device_id(self) -> int: """int: PCI device ID of the device.""" - @property def pci_domain_id(self) -> int: """int: PCI domain ID of the device.""" - @property def tcc_driver(self) -> bool: """bool: Device is using TCC driver model.""" - @property def memory_clock_rate(self) -> int: """int: Peak memory clock frequency in kilohertz.""" - @property def global_memory_bus_width(self) -> int: """int: Global memory bus width in bits.""" - @property def l2_cache_size(self) -> int: """int: Size of L2 cache in bytes.""" - @property def max_threads_per_multiprocessor(self) -> int: """int: Maximum resident threads per multiprocessor.""" - @property def unified_addressing(self) -> bool: """bool: Device shares a unified address space with the host.""" - @property def compute_capability_major(self) -> int: """int: Major compute capability version number.""" - @property def compute_capability_minor(self) -> int: """int: Minor compute capability version number.""" - @property def global_l1_cache_supported(self) -> bool: """bool: Device supports caching globals in L1.""" - @property def local_l1_cache_supported(self) -> bool: """bool: Device supports caching locals in L1.""" - @property def max_shared_memory_per_multiprocessor(self) -> int: """int: Maximum shared memory available per multiprocessor in bytes.""" - @property def max_registers_per_multiprocessor(self) -> int: """int: Maximum number of 32-bit registers available per multiprocessor.""" - @property def managed_memory(self) -> bool: """bool: Device can allocate managed memory on this system.""" - @property def multi_gpu_board(self) -> bool: """bool: Device is on a multi-GPU board.""" - @property def multi_gpu_board_group_id(self) -> int: """int: Unique id for a group of devices on the same multi-GPU board.""" - @property def host_native_atomic_supported(self) -> bool: """bool: Link between the device and the host supports all native atomic operations.""" - @property def single_to_double_precision_perf_ratio(self) -> int: """int: Ratio of single precision performance (in floating-point operations per second) to double precision performance.""" - @property def pageable_memory_access(self) -> bool: """bool: Device supports coherently accessing pageable memory without calling cudaHostRegister on it.""" - @property def concurrent_managed_access(self) -> bool: """bool: Device can coherently access managed memory concurrently with the CPU.""" - @property def compute_preemption_supported(self) -> bool: """bool: Device supports compute preemption.""" - @property def can_use_host_pointer_for_registered_mem(self) -> bool: """bool: Device can access host registered memory at the same virtual address as the CPU.""" - @property def cooperative_launch(self) -> bool: """bool: Device supports launching cooperative kernels via cuLaunchCooperativeKernel.""" - @property def max_shared_memory_per_block_optin(self) -> int: """int: Maximum optin shared memory per block.""" - @property def pageable_memory_access_uses_host_page_tables(self) -> bool: """bool: Device accesses pageable memory via the host's page tables.""" - @property def direct_managed_mem_access_from_host(self) -> bool: """bool: The host can directly access managed memory on the device without migration.""" - @property def virtual_memory_management_supported(self) -> bool: """bool: Device supports virtual memory management APIs like cuMemAddressReserve, cuMemCreate, cuMemMap and related APIs.""" - @property def handle_type_posix_file_descriptor_supported(self) -> bool: """bool: Device supports exporting memory to a posix file descriptor with cuMemExportToShareableHandle, if requested via cuMemCreate.""" - @property def handle_type_win32_handle_supported(self) -> bool: """bool: Device supports exporting memory to a Win32 NT handle with cuMemExportToShareableHandle, if requested via cuMemCreate.""" - @property def handle_type_win32_kmt_handle_supported(self) -> bool: """bool: Device supports exporting memory to a Win32 KMT handle with cuMemExportToShareableHandle, if requested via cuMemCreate.""" - @property def max_blocks_per_multiprocessor(self) -> int: """int: Maximum number of blocks per multiprocessor.""" - @property def generic_compression_supported(self) -> bool: """bool: Device supports compression of memory.""" - @property def max_persisting_l2_cache_size(self) -> int: """int: Maximum L2 persisting lines capacity setting in bytes.""" - @property def max_access_policy_window_size(self) -> int: """int: Maximum value of CUaccessPolicyWindow.num_bytes.""" - @property def gpu_direct_rdma_with_cuda_vmm_supported(self) -> bool: """bool: Device supports specifying the GPUDirect RDMA flag with cuMemCreate.""" - @property def reserved_shared_memory_per_block(self) -> int: """int: Shared memory reserved by CUDA driver per block in bytes.""" - @property def sparse_cuda_array_supported(self) -> bool: """bool: Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays.""" - @property def read_only_host_register_supported(self) -> bool: """bool: True if device supports using the cuMemHostRegister flag CU_MEMHOSTREGISTER_READ_ONLY to register memory that must be mapped as read-only to the GPU, False if not.""" - @property def memory_pools_supported(self) -> bool: """bool: Device supports using the cuMemAllocAsync and cuMemPool family of APIs.""" - @property def gpu_direct_rdma_supported(self) -> bool: """bool: Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see https://docs.nvidia.com/cuda/gpudirect-rdma for more information).""" - @property def gpu_direct_rdma_flush_writes_options(self) -> int: """int: The returned attribute shall be interpreted as a bitmask, where the individual bits are described by the CUflushGPUDirectRDMAWritesOptions enum.""" - @property def gpu_direct_rdma_writes_ordering(self) -> int: """int: GPUDirect RDMA writes to the device do not need to be flushed for consumers within the scope indicated by the returned attribute. See CUGPUDirectRDMAWritesOrdering for the numerical values returned here.""" - @property def mempool_supported_handle_types(self) -> int: """int: Handle types supported with mempool based IPC.""" - @property def deferred_mapping_cuda_array_supported(self) -> bool: """bool: Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays.""" - @property def numa_config(self) -> int: """int: NUMA configuration of a device: value is of type CUdeviceNumaConfig enum.""" - @property def numa_id(self) -> int: """int: NUMA node ID of the GPU memory.""" - @property def multicast_supported(self) -> bool: """bool: Device supports switch multicast and reduction operations.""" - @property def surface_alignment(self) -> int: """int: Surface alignment requirement in bytes.""" - @property def async_engine_count(self) -> int: """int: Number of asynchronous engines.""" - @property def can_tex2d_gather(self) -> bool: """bool: True if device supports 2D texture gather operations, False if not.""" - @property def maximum_texture2d_gather_width(self) -> int: """int: Maximum 2D texture gather width.""" - @property def maximum_texture2d_gather_height(self) -> int: """int: Maximum 2D texture gather height.""" - @property def stream_priorities_supported(self) -> bool: """bool: True if device supports stream priorities, False if not.""" - @property def can_flush_remote_writes(self) -> bool: """bool: The CU_STREAM_WAIT_VALUE_FLUSH flag and the CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES MemOp are supported on the device. See Stream Memory Operations for additional details.""" - @property def host_register_supported(self) -> bool: """bool: Device supports host memory registration via cudaHostRegister.""" - @property def timeline_semaphore_interop_supported(self) -> bool: """bool: External timeline semaphore interop is supported on the device.""" - @property def cluster_launch(self) -> bool: """bool: Indicates device supports cluster launch.""" - @property def can_use_64_bit_stream_mem_ops(self) -> bool: """bool: 64-bit operations are supported in cuStreamBatchMemOp and related MemOp APIs.""" - @property def can_use_stream_wait_value_nor(self) -> bool: """bool: CU_STREAM_WAIT_VALUE_NOR is supported by MemOp APIs.""" - @property def dma_buf_supported(self) -> bool: """bool: Device supports buffer sharing with dma_buf mechanism.""" - @property def ipc_event_supported(self) -> bool: """bool: Device supports IPC Events.""" - @property def mem_sync_domain_count(self) -> int: """int: Number of memory domains the device supports.""" - @property def tensor_map_access_supported(self) -> bool: """bool: Device supports accessing memory using Tensor Map.""" - @property def handle_type_fabric_supported(self) -> bool: """bool: Device supports exporting memory to a fabric handle with cuMemExportToShareableHandle() or requested with cuMemCreate().""" - @property def unified_function_pointers(self) -> bool: """bool: Device supports unified function pointers.""" - @property def mps_enabled(self) -> bool: """bool: Indicates if contexts created on this device will be shared via MPS.""" - @property def host_numa_id(self) -> int: """int: NUMA ID of the host node closest to the device. Returns -1 when system does not support NUMA.""" - @property def d3d12_cig_supported(self) -> bool: """bool: Device supports CIG with D3D12.""" - @property def mem_decompress_algorithm_mask(self) -> int: """int: The returned value shall be interpreted as a bitmask, where the individual bits are described by the CUmemDecompressAlgorithm enum.""" - @property def mem_decompress_maximum_length(self) -> int: """int: The returned value is the maximum length in bytes of a single decompress operation that is allowed.""" - @property def vulkan_cig_supported(self) -> bool: """bool: Device supports CIG with Vulkan.""" - @property def gpu_pci_device_id(self) -> int: """int: The combined 16-bit PCI device ID and 16-bit PCI vendor ID. Returns 0 if the driver does not support this query. """ - @property def gpu_pci_subsystem_id(self) -> int: """int: The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID. Returns 0 if the driver does not support this query. """ - @property def host_numa_virtual_memory_management_supported(self) -> bool: """bool: Device supports HOST_NUMA location with the virtual memory management APIs like cuMemCreate, cuMemMap and related APIs.""" - @property def host_numa_memory_pools_supported(self) -> bool: """bool: Device supports HOST_NUMA location with the cuMemAllocAsync and cuMemPool family of APIs.""" - @property def host_numa_multinode_ipc_supported(self) -> bool: """bool: Device supports HOST_NUMA location IPC between nodes in a multi-node system.""" - @property def host_memory_pools_supported(self) -> bool: """bool: Device supports HOST location with the cuMemAllocAsync and cuMemPool family of APIs.""" - @property def host_virtual_memory_management_supported(self) -> bool: """bool: Device supports HOST location with the virtual memory management APIs like cuMemCreate, cuMemMap and related APIs.""" - @property def host_alloc_dma_buf_supported(self) -> bool: """bool: Device supports page-locked host memory buffer sharing with dma_buf mechanism.""" - @property def only_partial_host_native_atomic_supported(self) -> bool: """bool: Link between the device and the host supports only some native atomic operations.""" @@ -638,12 +488,8 @@ class Device: """ __slots__ = ('_device_id', '_memory_resource', '_has_inited', '_properties', '_resources', '_uuid', '_context', '__weakref__') - def __new__(cls, device_id: Device | int | None=None) -> Device: - ... - - def _check_context_initialized(self) -> None: - ... - + def __new__(cls, device_id: Device | int | None=None) -> Device: ... + def _check_context_initialized(self) -> None: ... @classmethod def get_all_devices(cls) -> tuple[Device, ...]: """ @@ -654,12 +500,9 @@ class Device: tuple of Device A tuple containing instances of available devices. """ - @classmethod - def _get_all_devices_from_cuda_driver(cls): - ... - - def to_system_device(self) -> 'cuda.core.system.Device': + def _get_all_devices_from_cuda_driver(cls): ... + def to_system_device(self) -> cuda.core.system.Device: """ Get the corresponding :class:`cuda.core.system.Device` (which is used for NVIDIA Management Library (NVML) access) for this @@ -672,15 +515,12 @@ class Device: cuda.core.system.Device The corresponding system-level device instance used for NVML access. """ - @property def device_id(self) -> int: """Return device ordinal.""" - @property def pci_bus_id(self) -> str: """Return a PCI Bus Id string for this device.""" - def can_access_peer(self, peer: Device | int) -> bool: """Check if this device can access memory from the specified peer device. @@ -692,7 +532,6 @@ class Device: peer : Device | int The peer device to check accessibility to. Can be a :obj:`~_device.Device` object or device ID. """ - @property def uuid(self) -> str: """Return a UUID for the device. @@ -709,27 +548,21 @@ class Device: The UUID is cached after first access to avoid repeated CUDA API calls. """ - @property def name(self) -> str: """Return the device name.""" - @property def properties(self) -> DeviceProperties: """Return a :obj:`~_device.DeviceProperties` class with information about the device.""" - @property def resources(self) -> DeviceResources: """Return the hardware resource query namespace for this device.""" - @property def compute_capability(self) -> ComputeCapability: """Return a named tuple with 2 fields: major and minor.""" - @property def arch(self) -> str: """Return compute capability as a string (e.g., '75' for CC 7.5).""" - @property def context(self) -> Context: """Return the :obj:`~_context.Context` associated with this device. @@ -739,15 +572,11 @@ class Device: Device must be initialized. """ - @property def memory_resource(self) -> MemoryResource: """Return :obj:`~_memory.MemoryResource` associated with this device.""" - @memory_resource.setter - def memory_resource(self, mr: MemoryResource) -> None: - ... - + def memory_resource(self, mr: MemoryResource) -> None: ... @property def default_stream(self) -> Stream: """Return default CUDA :obj:`~_stream.Stream` associated with this device. @@ -759,22 +588,12 @@ class Device: the legacy stream. """ - def __int__(self) -> int: """Return device_id.""" - - def __repr__(self) -> str: - ... - - def __hash__(self) -> int: - ... - - def __eq__(self, other: object) -> bool: - ... - - def __reduce__(self) -> tuple[object, ...]: - ... - + def __repr__(self) -> str: ... + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __reduce__(self) -> tuple[object, ...]: ... def set_current(self, ctx: Context | None=None) -> Context | None: """Set device to be used for GPU executions. @@ -805,7 +624,6 @@ class Device: >>> # ... do work on device 0 ... """ - def create_context(self, options: ContextOptions | None=None) -> Context: """Create a new :obj:`~_context.Context` object. @@ -824,8 +642,7 @@ class Device: Newly created context object. """ - - def create_stream(self, obj: IsStreamType | None=None, options: object=None) -> Stream: + def create_stream(self, obj: IsStreamType | None=None, options: object | None=None) -> Stream: """Create a :obj:`~_stream.Stream` object. New stream objects can be created in two different ways: @@ -853,7 +670,6 @@ class Device: Newly created stream object. """ - def create_event(self, options: EventOptions | None=None) -> Event: """Create an :obj:`~_event.Event` object without recording it to a :obj:`~_stream.Stream`. @@ -872,7 +688,6 @@ class Device: Newly created event object. """ - def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: """Allocate device memory from a specified stream. @@ -898,7 +713,6 @@ class Device: Newly created buffer object. """ - def sync(self) -> None: """Synchronize the device. @@ -907,7 +721,6 @@ class Device: Device must be initialized. """ - def create_graph_builder(self) -> GraphBuilder: """Create a new :obj:`~graph.GraphBuilder` object. @@ -917,7 +730,6 @@ class Device: Newly created graph builder object. """ - def create_opaque_array(self, options: OpaqueArrayOptions) -> OpaqueArray: """Create an :obj:`~cuda.core.texture.OpaqueArray` on the current device. @@ -942,7 +754,6 @@ class Device: .. versionadded:: 1.1.0 """ - def create_mipmapped_array(self, options: MipmappedArrayOptions) -> MipmappedArray: """Create a :obj:`~cuda.core.texture.MipmappedArray` on the current device. @@ -967,7 +778,6 @@ class Device: .. versionadded:: 1.1.0 """ - def create_texture_object(self, *, resource: ResourceDescriptor, options: TextureObjectOptions | None=None) -> TextureObject: """Create a :obj:`~cuda.core.texture.TextureObject` on the current device. @@ -997,7 +807,6 @@ class Device: .. versionadded:: 1.1.0 """ - def create_surface_object(self, *, resource: ResourceDescriptor) -> SurfaceObject: """Create a :obj:`~cuda.core.texture.SurfaceObject` on the current device. @@ -1026,5 +835,3 @@ class Device: .. versionadded:: 1.1.0 """ -_tls = threading.local() -_lock = threading.Lock() \ No newline at end of file diff --git a/cuda_core/cuda/core/_device_resources.pyi b/cuda_core/cuda/core/_device_resources.pyi index 7514f5a2f43..a6837e837e9 100644 --- a/cuda_core/cuda/core/_device_resources.pyi +++ b/cuda_core/cuda/core/_device_resources.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_device_resources.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_device_resources.pyx from collections.abc import Sequence as SequenceABC from dataclasses import dataclass @@ -8,6 +6,7 @@ from dataclasses import dataclass from cuda.core._device import Device from cuda.core.typing import WorkqueueSharingScopeType +__all__ = ['DeviceResources', 'SMResource', 'SMResourceOptions', 'WorkqueueResource', 'WorkqueueResourceOptions'] @dataclass class SMResourceOptions: @@ -61,8 +60,7 @@ class WorkqueueResourceOptions: sharing_scope: WorkqueueSharingScopeType | str | None = None concurrency_limit: int | None = None - def __post_init__(self): - ... + def __post_init__(self): ... class SMResource: """Represent an SM (streaming multiprocessor) resource partition. @@ -70,30 +68,22 @@ class SMResource: Instances are returned by :obj:`DeviceResources.sm` or :meth:`SMResource.split` and cannot be instantiated directly. """ - - def __init__(self, *args, **kwargs): - ... - + def __init__(self, *args, **kwargs): ... @property def handle(self) -> int: """Return the address of the underlying ``CUdevResource`` struct.""" - @property def sm_count(self) -> int: """Total SMs available in this resource.""" - @property def min_partition_size(self) -> int: """Minimum SM count required to create a partition.""" - @property def coscheduled_alignment(self) -> int: """Number of SMs guaranteed to be co-scheduled.""" - @property def flags(self) -> int: """Raw flags from the underlying SM resource.""" - def split(self, options: SMResourceOptions, *, dry_run: bool=False) -> tuple[list[SMResource], SMResource]: """Split this SM resource into groups and a remainder. @@ -120,14 +110,10 @@ class WorkqueueResource: Instances are returned by :obj:`DeviceResources.workqueue` and cannot be instantiated directly. """ - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... @property def handle(self) -> int: """Return the address of the underlying config ``CUdevResource`` struct.""" - @property def sharing_scope(self) -> WorkqueueSharingScopeType: """Current sharing scope of this workqueue resource. @@ -138,7 +124,6 @@ class WorkqueueResource: :meth:`configure` with :attr:`WorkqueueResourceOptions.sharing_scope`. """ - @property def concurrency_limit(self) -> int: """Current expected maximum concurrent stream-ordered workloads. @@ -149,11 +134,9 @@ class WorkqueueResource: via :meth:`configure` with :attr:`WorkqueueResourceOptions.concurrency_limit`. """ - @property def device(self) -> Device: """The :class:`~cuda.core.Device` this workqueue resource is available on.""" - def configure(self, options: WorkqueueResourceOptions) -> None: """Configure the workqueue resource in place. @@ -173,15 +156,10 @@ class DeviceResources: This class cannot be instantiated directly. """ - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... @property def sm(self) -> SMResource: """Return the :obj:`SMResource` for this device or context.""" - @property def workqueue(self) -> WorkqueueResource: """Return the :obj:`WorkqueueResource` for this device or context.""" -__all__ = ['DeviceResources', 'SMResource', 'SMResourceOptions', 'WorkqueueResource', 'WorkqueueResourceOptions'] \ No newline at end of file diff --git a/cuda_core/cuda/core/_dlpack.pyi b/cuda_core/cuda/core/_dlpack.pyi index 575d9ced8f5..37d65d9f0e4 100644 --- a/cuda_core/cuda/core/_dlpack.pyi +++ b/cuda_core/cuda/core/_dlpack.pyi @@ -1,11 +1,10 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_dlpack.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_dlpack.pyx from enum import IntEnum +from typing import Any, Callable, TypeAlias, TypedDict -_DLDeviceType = int -DLDataTypeCode = int +_DLDeviceType: TypeAlias = int +DLDataTypeCode: TypeAlias = int class DLDeviceType(IntEnum): kDLCPU = 1 @@ -13,12 +12,56 @@ class DLDeviceType(IntEnum): kDLCUDAHost = 3 kDLCUDAManaged = 13 -def make_py_capsule(buf: object, versioned: bool) -> object: - ... +class DLDevice(TypedDict): + device_type: _DLDeviceType + device_id: int + +class DLDataType(TypedDict): + code: int + bits: int + lanes: int + +class DLTensor(TypedDict): + data: None + device: DLDevice + ndim: int + dtype: DLDataType + shape: int + strides: int + byte_offset: int + +class DLManagedTensor(TypedDict): + dl_tensor: DLTensor + manager_ctx: None + deleter: Callable[..., Any] + +class DLPackVersion(TypedDict): + major: int + minor: int + +class DLManagedTensorVersioned(TypedDict): + version: DLPackVersion + manager_ctx: None + deleter: Callable[..., Any] + flags: int + dl_tensor: DLTensor + +class DLPackExchangeAPIHeader(TypedDict): + version: DLPackVersion + prev_api: DLPackExchangeAPIHeader + +class DLPackExchangeAPI(TypedDict): + header: DLPackExchangeAPIHeader + managed_tensor_allocator: ... + managed_tensor_from_py_object_no_sync: ... + managed_tensor_to_py_object_no_sync: ... + dltensor_from_py_object_no_sync: ... + current_work_stream: ... def classify_dl_device(buf: object) -> tuple[int, int]: """Classify a buffer into a DLPack (device_type, device_id) pair. ``buf`` must expose ``is_device_accessible``, ``is_host_accessible``, ``is_managed``, and ``device_id`` attributes. - """ \ No newline at end of file + """ +def make_py_capsule(buf: object, versioned: bool) -> object: ... diff --git a/cuda_core/cuda/core/_event.pyi b/cuda_core/cuda/core/_event.pyi index 1ea91308bc1..3fbb1b0b1b0 100644 --- a/cuda_core/cuda/core/_event.pyi +++ b/cuda_core/cuda/core/_event.pyi @@ -1,14 +1,13 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_event.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_event.pyx from dataclasses import dataclass +from typing import Any import cuda.bindings.driver -import cython from cuda.core._context import Context from cuda.core._device import Device +__all__ = ['Event', 'EventOptions'] @dataclass class EventOptions: @@ -61,39 +60,22 @@ class Event: and they should instead be created through a :obj:`~_stream.Stream` object. """ - + def __init__(self, *args, **kwargs) -> None: ... def close(self): """Destroy the event. Releases the event handle. The underlying CUDA event is destroyed when the last reference is released. """ - - def __init__(self, *args, **kwargs) -> None: - ... - - def __isub__(self, other: object): - ... - - def __rsub__(self, other: object): - ... - - def __sub__(self, other: Event) -> float: - ... - - def __hash__(self) -> int: - ... - - def __eq__(self, other: object) -> bool: - ... - - def __repr__(self) -> str: - ... - + def __isub__(self, other: object): ... + def __rsub__(self, other: object): ... + def __sub__(self, other: Event) -> float: ... + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __repr__(self) -> str: ... @property def ipc_descriptor(self) -> IPCEventDescriptor: """Descriptor for sharing this event with other processes.""" - @classmethod def from_ipc_descriptor(cls, ipc_descriptor: IPCEventDescriptor) -> Event: """Import an event that was exported from another process. @@ -110,21 +92,17 @@ class Event: A new event backed by the imported IPC handle. """ - @property def is_ipc_enabled(self) -> bool: """Return True if the event can be shared across process boundaries, otherwise False.""" - @property def is_timing_enabled(self) -> bool: """Return True if the event records timing data, otherwise False.""" - @property def is_blocking_sync(self) -> bool: """Return True if the event uses blocking synchronization (the CPU thread blocks on :meth:`sync` instead of busy-waiting), otherwise False. """ - def sync(self) -> None: """Synchronize until the event completes. @@ -134,11 +112,9 @@ class Event: thread busy-waits until the event has completed. """ - @property def is_done(self) -> bool: """Return True if all captured works have been completed, otherwise False.""" - @property def handle(self) -> cuda.bindings.driver.CUevent: """Return the underlying CUevent object. @@ -148,7 +124,6 @@ class Event: This handle is a Python object. To get the memory address of the underlying C handle, call ``int(Event.handle)``. """ - @property def device(self) -> Device: """Return the :obj:`~_device.Device` singleton associated with this event. @@ -160,26 +135,16 @@ class Event: context is set current after a event is created. """ - @property def context(self) -> Context: """Return the :obj:`~_context.Context` associated with this event.""" class IPCEventDescriptor: """Serializable object describing an event that can be shared between processes.""" - - def __init__(self, *arg, **kwargs) -> None: - ... - + def __init__(self, *arg, **kwargs) -> None: ... @staticmethod - def _init(reserved: bytes, is_blocking_sync: cython.bint) -> IPCEventDescriptor: - ... - - def __eq__(self, other: object) -> bool: - ... - - def __reduce__(self) -> tuple[object, ...]: - ... + def _init(reserved: bytes, is_blocking_sync: Any) -> IPCEventDescriptor: ... + def __eq__(self, other: object) -> bool: ... + def __reduce__(self) -> tuple[object, ...]: ... -def _reduce_event(event: Event) -> tuple[object, ...]: - ... \ No newline at end of file +def _reduce_event(event: Event) -> tuple[object, ...]: ... diff --git a/cuda_core/cuda/core/_graphics.pyi b/cuda_core/cuda/core/_graphics.pyi index b7022e5a18a..3ca77a137b6 100644 --- a/cuda_core/cuda/core/_graphics.pyi +++ b/cuda_core/cuda/core/_graphics.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_graphics.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_graphics.pyx from typing import Sequence @@ -8,6 +6,8 @@ from cuda.bindings import cydriver from cuda.core._memory._buffer import Buffer from cuda.core._stream import Stream +__all__ = ['GraphicsResource'] +_REGISTER_FLAGS = {'none': cydriver.CU_GRAPHICS_REGISTER_FLAGS_NONE, 'read_only': cydriver.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY, 'write_discard': cydriver.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD, 'surface_load_store': cydriver.CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST, 'texture_gather': cydriver.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER} class GraphicsResource: """RAII wrapper for a CUDA graphics resource (``CUgraphicsResource``). @@ -48,23 +48,7 @@ class GraphicsResource: # ... launch kernels using buf.handle, buf.size ... pass """ - - def close(self, stream: object=None): - """Unregister this graphics resource from CUDA. - - If the resource is currently mapped, it is unmapped first. After - closing, the resource cannot be used again. - - Parameters - ---------- - stream : :class:`~cuda.core.Stream`, optional - Optional override for the stream used to close the currently - mapped buffer, if one exists. - """ - - def __init__(self) -> None: - ... - + def __init__(self) -> None: ... @classmethod def from_gl_buffer(cls, gl_buffer: int, *, flags: str | tuple[str, ...] | list[str] | None=None, stream: Stream | None=None) -> GraphicsResource: """Register an OpenGL buffer object for CUDA access. @@ -111,7 +95,6 @@ class GraphicsResource: ValueError If an unknown flag string is provided. """ - @classmethod def from_gl_image(cls, image: int, target: int, *, flags: str | tuple[str, ...] | list[str] | None=None) -> GraphicsResource: """Register an OpenGL texture or renderbuffer for CUDA access. @@ -142,10 +125,7 @@ class GraphicsResource: ValueError If an unknown flag string is provided. """ - - def _get_mapped_buffer(self) -> object: - ... - + def _get_mapped_buffer(self) -> object: ... def map(self, *, stream: Stream) -> Buffer: """Map this graphics resource for CUDA access. @@ -178,7 +158,6 @@ class GraphicsResource: CUDAError If the mapping fails. """ - def unmap(self, *, stream: Stream | None=None) -> None: """Unmap this graphics resource, releasing it back to the graphics API. @@ -198,29 +177,29 @@ class GraphicsResource: CUDAError If the unmapping fails. """ + def __enter__(self) -> object: ... + def __exit__(self, exc_type: type | None, exc_val: BaseException | None, exc_tb: object) -> bool: ... + def close(self, stream: object | None=None): + """Unregister this graphics resource from CUDA. - def __enter__(self) -> object: - ... - - def __exit__(self, exc_type: type | None, exc_val: BaseException | None, exc_tb: object) -> bool: - ... + If the resource is currently mapped, it is unmapped first. After + closing, the resource cannot be used again. + Parameters + ---------- + stream : :class:`~cuda.core.Stream`, optional + Optional override for the stream used to close the currently + mapped buffer, if one exists. + """ @property def is_mapped(self) -> bool: """Whether the resource is currently mapped for CUDA access.""" - @property def handle(self) -> int: """The raw ``CUgraphicsResource`` handle as a Python int.""" - @property def resource_handle(self) -> int: """Alias for :attr:`handle`.""" + def __repr__(self) -> str: ... - def __repr__(self) -> str: - ... -__all__ = ['GraphicsResource'] -_REGISTER_FLAGS = {'none': cydriver.CU_GRAPHICS_REGISTER_FLAGS_NONE, 'read_only': cydriver.CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY, 'write_discard': cydriver.CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD, 'surface_load_store': cydriver.CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST, 'texture_gather': cydriver.CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER} - -def _parse_register_flags(flags: str | Sequence[str] | None) -> int: - ... \ No newline at end of file +def _parse_register_flags(flags: str | Sequence[str] | None) -> int: ... diff --git a/cuda_core/cuda/core/_include/layout.hpp b/cuda_core/cuda/core/_include/layout.hpp index b5da219df34..d76e2ca5a80 100644 --- a/cuda_core/cuda/core/_include/layout.hpp +++ b/cuda_core/cuda/core/_include/layout.hpp @@ -1,5 +1,4 @@ -// SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. -// All rights reserved. +// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // // SPDX-License-Identifier: Apache-2.0 diff --git a/cuda_core/cuda/core/_kernel_arg_handler.pyi b/cuda_core/cuda/core/_kernel_arg_handler.pyi index 0ebd2c0d0b6..918548ef40c 100644 --- a/cuda_core/cuda/core/_kernel_arg_handler.pyi +++ b/cuda_core/cuda/core/_kernel_arg_handler.pyi @@ -1,18 +1,15 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_kernel_arg_handler.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_kernel_arg_handler.pyx -from __future__ import annotations +from typing import Any, Sequence, TypeAlias, TypedDict -from typing import Any, Sequence - -from libcpp.complex import complex as cpp_complex +cpp_single_complex: TypeAlias = Any +cpp_double_complex: TypeAlias = Any +class __half_raw(TypedDict): + x: int class ParamHolder: + ptr: int - def __init__(self, kernel_args: Sequence[Any]) -> None: - ... - - def __dealloc__(self) -> None: - ... -cpp_single_complex = cpp_complex.complex -cpp_double_complex = cpp_complex.complex \ No newline at end of file + def __init__(self, kernel_args: Sequence[Any]) -> None: ... + def __dealloc__(self) -> None: ... diff --git a/cuda_core/cuda/core/_launch_config.pyi b/cuda_core/cuda/core/_launch_config.pyi index eac16c1878f..a731f2999ff 100644 --- a/cuda_core/cuda/core/_launch_config.pyi +++ b/cuda_core/cuda/core/_launch_config.pyi @@ -1,9 +1,9 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_launch_config.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_launch_config.pyx from typing import Any +_LAUNCH_CONFIG_ATTRS = ('grid', 'cluster', 'block', 'shmem_size', 'is_cooperative', 'programmatic_stream_serialization') +__all__ = ['LaunchConfig'] class LaunchConfig: """Customizable launch options. @@ -18,15 +18,15 @@ class LaunchConfig: Attributes ---------- - grid : Union[tuple, int] + grid : tuple | int Collection of threads that will execute a kernel function. When cluster is not specified, this represents the number of blocks, otherwise this represents the number of clusters. - cluster : Union[tuple, int] + cluster : tuple | int Group of blocks (Thread Block Cluster) that will execute on the same GPU Processing Cluster (GPC). Blocks within a cluster have access to distributed shared memory and can be explicitly synchronized. - block : Union[tuple, int] + block : tuple | int Group of threads (Thread Block) that will execute on the same streaming multiprocessor (SM). Threads within a thread blocks have access to shared memory and can be explicitly synchronized. @@ -35,37 +35,41 @@ class LaunchConfig: (Default to size 0) is_cooperative : bool, optional Whether this config can be used to launch a cooperative kernel. + programmatic_stream_serialization : bool, optional + Whether to allow programmatic stream serialization (PDL). When True, + the kernel may overlap with a previous kernel in the same stream that + signals completion via programmatic means. """ + grid: tuple[Any, ...] + cluster: tuple[Any, ...] + block: tuple[Any, ...] + shmem_size: int + is_cooperative: bool + programmatic_stream_serialization: bool - def __init__(self, grid: int | tuple[int, ...] | None=None, cluster: int | tuple[int, ...] | None=None, block: int | tuple[int, ...] | None=None, shmem_size: int | None=None, is_cooperative: bool=False) -> None: + def __init__(self, grid: int | tuple[int, ...] | None=None, cluster: int | tuple[int, ...] | None=None, block: int | tuple[int, ...] | None=None, shmem_size: int | None=None, is_cooperative: bool=False, programmatic_stream_serialization: bool=False) -> None: """Initialize LaunchConfig with validation. Parameters ---------- - grid : Union[tuple, int], optional + grid : tuple | int, optional Grid dimensions (number of blocks or clusters if cluster is specified) - cluster : Union[tuple, int], optional + cluster : tuple | int, optional Cluster dimensions (Thread Block Cluster) - block : Union[tuple, int], optional + block : tuple | int, optional Block dimensions (threads per block) shmem_size : int, optional Dynamic shared memory size in bytes (default: 0) is_cooperative : bool, optional Whether to launch as cooperative kernel (default: False) + programmatic_stream_serialization : bool, optional + Whether to allow programmatic stream serialization / PDL (default: False) """ - - def _identity(self) -> tuple[Any, ...]: - ... - + def _identity(self) -> tuple[Any, ...]: ... def __repr__(self) -> str: """Return string representation of LaunchConfig.""" - - def __eq__(self, other: object) -> bool: - ... - - def __hash__(self) -> int: - ... -_LAUNCH_CONFIG_ATTRS = ('grid', 'cluster', 'block', 'shmem_size', 'is_cooperative') + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... def _to_native_launch_config(config: LaunchConfig) -> object: """Convert LaunchConfig to native driver CUlaunchConfig. @@ -79,4 +83,4 @@ def _to_native_launch_config(config: LaunchConfig) -> object: ------- driver.CUlaunchConfig Native CUDA driver launch configuration - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/_launch_config.pyx b/cuda_core/cuda/core/_launch_config.pyx index 3a2f36a4dff..adbf9a16c5d 100644 --- a/cuda_core/cuda/core/_launch_config.pyx +++ b/cuda_core/cuda/core/_launch_config.pyx @@ -38,15 +38,15 @@ cdef class LaunchConfig: Attributes ---------- - grid : Union[tuple, int] + grid : tuple | int Collection of threads that will execute a kernel function. When cluster is not specified, this represents the number of blocks, otherwise this represents the number of clusters. - cluster : Union[tuple, int] + cluster : tuple | int Group of blocks (Thread Block Cluster) that will execute on the same GPU Processing Cluster (GPC). Blocks within a cluster have access to distributed shared memory and can be explicitly synchronized. - block : Union[tuple, int] + block : tuple | int Group of threads (Thread Block) that will execute on the same streaming multiprocessor (SM). Threads within a thread blocks have access to shared memory and can be explicitly synchronized. @@ -77,11 +77,11 @@ cdef class LaunchConfig: Parameters ---------- - grid : Union[tuple, int], optional + grid : tuple | int, optional Grid dimensions (number of blocks or clusters if cluster is specified) - cluster : Union[tuple, int], optional + cluster : tuple | int, optional Cluster dimensions (Thread Block Cluster) - block : Union[tuple, int], optional + block : tuple | int, optional Block dimensions (threads per block) shmem_size : int, optional Dynamic shared memory size in bytes (default: 0) diff --git a/cuda_core/cuda/core/_launcher.pyi b/cuda_core/cuda/core/_launcher.pyi index a292c3eec95..72ba7c6c623 100644 --- a/cuda_core/cuda/core/_launcher.pyi +++ b/cuda_core/cuda/core/_launcher.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_launcher.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_launcher.pyx from cuda.core._launch_config import LaunchConfig from cuda.core._module import Kernel @@ -8,6 +6,7 @@ from cuda.core._stream import Stream from cuda.core.graph import GraphBuilder from cuda.core.typing import IsStreamType +__all__ = ['launch'] def launch(stream: Stream | GraphBuilder | IsStreamType, config: LaunchConfig, kernel: Kernel, *kernel_args) -> None: """Launches a :obj:`~_module.Kernel` @@ -27,4 +26,4 @@ def launch(stream: Stream | GraphBuilder | IsStreamType, config: LaunchConfig, k Variable length argument list that is provided to the launching kernel. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/_layout.pyi b/cuda_core/cuda/core/_layout.pyi index 1562a2bf76f..0483a78b6ad 100644 --- a/cuda_core/cuda/core/_layout.pyi +++ b/cuda_core/cuda/core/_layout.pyi @@ -1,14 +1,17 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_layout.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_layout.pyx -from __future__ import annotations +from typing import Any, TypeAlias, TypedDict -import cython -from libcpp import vector +OrderFlag: TypeAlias = int +Property: TypeAlias = int +extent_t: TypeAlias = int +stride_t: TypeAlias = int +axis_t: TypeAlias = int +axes_mask_t: TypeAlias = int +property_mask_t: TypeAlias = int +extents_strides_t: TypeAlias = Any +axis_vec_t: TypeAlias = Any -OrderFlag = int -Property = int - -@cython.final class _StridedLayout: """ A class describing the layout of a multi-dimensional tensor @@ -39,10 +42,10 @@ class _StridedLayout: The offset (as a number of elements, not bytes) of the element at index ``(0,) * ndim``. See also :attr:`slice_offset_in_bytes`. """ + itemsize: int + slice_offset: stride_t - def __init__(self: _StridedLayout, shape: tuple[int, ...], strides: tuple[int, ...] | None, itemsize: int, divide_strides: bool=False) -> None: - ... - + def __init__(self: _StridedLayout, shape: tuple[int, ...], strides: tuple[int, ...] | None, itemsize: int, divide_strides: bool=False) -> None: ... @classmethod def dense(cls, shape: tuple[int], itemsize: int, stride_order: str | tuple[int]='C') -> _StridedLayout: """ @@ -72,7 +75,6 @@ class _StridedLayout: assert _StridedLayout.dense((5, 3, 7), 1, (2, 0, 1)) == _StridedLayout((5, 3, 7), (3, 1, 15), 1) """ - @classmethod def dense_like(cls, other: _StridedLayout, stride_order: str | tuple[int]='K') -> _StridedLayout: """ @@ -109,13 +111,8 @@ class _StridedLayout: assert _StridedLayout.dense_like(layout, "C") == _StridedLayout((7, 5, 3), (15, 3, 1), 1) assert _StridedLayout.dense_like(layout, "F") == _StridedLayout((7, 5, 3), (1, 7, 35), 1) """ - - def __repr__(self: _StridedLayout) -> str: - ... - - def __eq__(self, other: object) -> bool: - ... - + def __repr__(self: _StridedLayout) -> str: ... + def __eq__(self, other: object) -> bool: ... @property def ndim(self: _StridedLayout) -> int: """ @@ -123,7 +120,6 @@ class _StridedLayout: :type: int """ - @property def shape(self: _StridedLayout) -> tuple[int, ...]: """ @@ -131,7 +127,6 @@ class _StridedLayout: :type: tuple[int] """ - @property def strides(self: _StridedLayout) -> tuple[int, ...] | None: """ @@ -141,7 +136,6 @@ class _StridedLayout: :type: tuple[int] | None """ - @property def strides_in_bytes(self: _StridedLayout) -> tuple[int, ...] | None: """ @@ -149,7 +143,6 @@ class _StridedLayout: :type: tuple[int] | None """ - @property def stride_order(self: _StridedLayout) -> tuple[int, ...]: """ @@ -168,7 +161,6 @@ class _StridedLayout: :type: tuple[int] """ - @property def volume(self: _StridedLayout) -> int: """ @@ -176,7 +168,6 @@ class _StridedLayout: :type: int """ - @property def is_unique(self: _StridedLayout) -> bool: """ @@ -196,7 +187,6 @@ class _StridedLayout: :type: bool """ - @property def is_contiguous_c(self: _StridedLayout) -> bool: """ @@ -216,7 +206,6 @@ class _StridedLayout: :type: bool """ - @property def is_contiguous_f(self: _StridedLayout) -> bool: """ @@ -236,7 +225,6 @@ class _StridedLayout: :type: bool """ - @property def is_contiguous_any(self: _StridedLayout) -> bool: """ @@ -275,7 +263,6 @@ class _StridedLayout: :type: bool """ - @property def is_dense(self: _StridedLayout) -> bool: """ @@ -287,7 +274,6 @@ class _StridedLayout: :type: bool """ - @property def offset_bounds(self: _StridedLayout) -> tuple[int, int]: """ @@ -316,7 +302,6 @@ class _StridedLayout: :type: tuple[int, int] """ - @property def min_offset(self: _StridedLayout) -> int: """ @@ -324,7 +309,6 @@ class _StridedLayout: :type: int """ - @property def max_offset(self: _StridedLayout) -> int: """ @@ -332,7 +316,6 @@ class _StridedLayout: :type: int """ - @property def slice_offset_in_bytes(self: _StridedLayout) -> int: """ @@ -345,7 +328,6 @@ class _StridedLayout: :type: int """ - def required_size_in_bytes(self: _StridedLayout) -> int: """ The memory allocation size (in bytes) needed so that @@ -378,13 +360,11 @@ class _StridedLayout: b_view = StridedMemoryView.from_buffer(mem, layout, a_view.dtype) return b_view """ - def flattened_axis_mask(self: _StridedLayout) -> axes_mask_t: """ A mask describing which axes of this layout are mergeable using the :meth:`flattened` method. """ - def to_dense(self: _StridedLayout, stride_order: object='K') -> _StridedLayout: """ Returns a dense layout with the same shape and itemsize, @@ -392,7 +372,6 @@ class _StridedLayout: See :meth:`dense_like` method documentation for details. """ - def reshaped(self: _StridedLayout, shape: tuple[int]) -> _StridedLayout: """ Returns a layout with the new shape, if the new shape is compatible @@ -415,13 +394,11 @@ class _StridedLayout: assert layout.permuted((2, 0, 1)).reshaped((4, 15,)) == _StridedLayout((4, 15), (1, 4), 1) # layout.permuted((2, 0, 1)).reshaped((20, 3)) -> error """ - def permuted(self: _StridedLayout, axis_order: tuple[int]) -> _StridedLayout: """ Returns a new layout where the shape and strides tuples are permuted according to the specified permutation of axes. """ - def flattened(self: _StridedLayout, start_axis: int=0, end_axis: int=-1, mask: int | None=None) -> _StridedLayout: """ Merges consecutive extents into a single extent (equal to the product of merged extents) @@ -465,7 +442,6 @@ class _StridedLayout: assert layout.flattened(mask=mask) == _StridedLayout((4, 15), (15, 1), 4) assert layout2.flattened(mask=mask) == _StridedLayout((4, 15), (1, 4), 4) """ - def squeezed(self: _StridedLayout) -> _StridedLayout: """ Returns a new layout where all the singleton dimensions (extents equal to 1) @@ -473,14 +449,12 @@ class _StridedLayout: the returned layout will be reduced to a 1-dim layout with shape (0,) and strides (0,). """ - def unsqueezed(self: _StridedLayout, axis: int | tuple[int]) -> _StridedLayout: """ Returns a new layout where the specified axis or axes are added as singleton extents. The ``axis`` can be either a single integer in range ``[0, ndim]`` or a tuple of unique integers in range ``[0, ndim + len(axis) - 1]``. """ - def broadcast_to(self: _StridedLayout, shape: tuple[int]) -> _StridedLayout: """ Returns a layout with the new shape, if the old shape can be @@ -494,7 +468,6 @@ class _StridedLayout: Strides of the added or modified extents are set to 0, the remaining ones are unchanged. If the shapes are not compatible, a ValueError is raised. """ - def repacked(self: _StridedLayout, itemsize: int, data_ptr: int=0, axis: int=-1, keep_dim: bool=True) -> _StridedLayout: """ Converts the layout to match the specified itemsize. @@ -546,13 +519,11 @@ class _StridedLayout: b = numpy.from_dlpack(complex_view) assert b.shape == (5, 3) """ - def max_compatible_itemsize(self: _StridedLayout, max_itemsize: int=16, data_ptr: int=0, axis: int=-1) -> int: """ Returns the maximum itemsize (but no greater than ``max_itemsize``) that can be used with the :meth:`repacked` method for the current layout. """ - def sliced(self: _StridedLayout, slices: int | slice | tuple[int | slice]) -> _StridedLayout: """ Returns a sliced layout. @@ -569,13 +540,10 @@ class _StridedLayout: any data access. """ + def __getitem__(self: _StridedLayout, slices: int | slice | tuple[int | slice]) -> _StridedLayout: ... - def __getitem__(self: _StridedLayout, slices: int | slice | tuple[int | slice]) -> _StridedLayout: - ... -extent_t = int -stride_t = int -axis_t = int -axes_mask_t = int -property_mask_t = int -extents_strides_t = vector.vector -axis_vec_t = vector.vector \ No newline at end of file +class BaseLayout(TypedDict): + _mem: extents_strides_t + shape: extent_t + strides: stride_t + ndim: int diff --git a/cuda_core/cuda/core/_linker.pyi b/cuda_core/cuda/core/_linker.pyi index 42b08313f78..e6638d8abf2 100644 --- a/cuda_core/cuda/core/_linker.pyi +++ b/cuda_core/cuda/core/_linker.pyi @@ -1,4 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_linker.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_linker.pyx """Linking machinery for combining object codes. @@ -6,8 +6,6 @@ This module provides :class:`Linker` for linking one or more :class:`~cuda.core.ObjectCode` objects, with :class:`LinkerOptions` for configuration. """ -from __future__ import annotations - from dataclasses import dataclass from typing import Union @@ -16,6 +14,15 @@ import cuda.bindings.nvjitlink from cuda.core._module import ObjectCode from cuda.core.typing import CompilerBackendType, ObjectCodeFormatType +_keep_driver_in_stub: cuda.bindings.driver.CUlinkState +_keep_nvjitlink_in_stub: cuda.bindings.nvjitlink.nvJitLinkHandle +__all__ = ['Linker', 'LinkerOptions'] +LinkerHandleT = Union['cuda.bindings.nvjitlink.nvJitLinkHandle', 'cuda.bindings.driver.CUlinkState'] +_driver = None +_inited = False +_use_nvjitlink_backend = None +_nvjitlink_input_types = None +_driver_input_types = None class Linker: """Represent a linking machinery to link one or more object codes into @@ -31,10 +38,7 @@ class Linker: options : :class:`LinkerOptions`, optional Options for the linker. If not provided, default options will be used. """ - - def __init__(self, options: LinkerOptions | None=None, *object_codes: ObjectCode): - ... - + def __init__(self, *object_codes: ObjectCode, options: LinkerOptions | None=None): ... def link(self, target_type: ObjectCodeFormatType | str) -> ObjectCode: """Link the provided object codes into a single output of the specified target type. @@ -53,7 +57,6 @@ class Linker: Ensure that input object codes were compiled with appropriate flags for linking (e.g., relocatable device code enabled). """ - def get_error_log(self) -> str: """Get the error log generated by the linker. @@ -62,7 +65,6 @@ class Linker: str The error log. """ - def get_info_log(self) -> str: """Get the info log generated by the linker. @@ -71,10 +73,8 @@ class Linker: str The info log. """ - def close(self) -> None: """Destroy this linker.""" - @property def handle(self) -> LinkerHandleT: """Return the underlying handle object. @@ -88,7 +88,6 @@ class Linker: This handle is a Python object. To get the memory address of the underlying C handle, call ``int(Linker.handle)``. """ - @classmethod def which_backend(cls) -> CompilerBackendType: """Return which linking backend will be used. @@ -177,6 +176,18 @@ class LinkerOptions: no_cache : bool, optional Do not cache the intermediate steps of nvJitLink. Default: False. + numba_debug : bool, optional + Non-functional. ``numba_debug`` is an NVVM/NVRTC *compiler* option; + neither nvJitLink nor the driver's cuLink API recognizes it, so no + linking backend can honor it and the value is ignored. + Default: None. + + .. deprecated:: 1.2.0 + Setting this option emits a :class:`DeprecationWarning`. It has never + had an effect on any linking backend and will be removed in + ``cuda.core`` 2.0.0. Use + :attr:`ProgramOptions.numba_debug` on an NVVM or NVRTC compilation + path instead. """ name: str | None = '<default linker>' arch: str | None = None @@ -201,15 +212,9 @@ class LinkerOptions: no_cache: bool | None = None numba_debug: bool | None = None - def __post_init__(self) -> None: - ... - - def _prepare_nvjitlink_options(self, as_bytes: bool=False) -> list[bytes] | list[str]: - ... - - def _prepare_driver_options(self) -> tuple[list[object], list[object]]: - ... - + def __post_init__(self) -> None: ... + def _prepare_nvjitlink_options(self, as_bytes: bool=False) -> list[bytes] | list[str]: ... + def _prepare_driver_options(self) -> tuple[list[object], list[object]]: ... def as_bytes(self, backend: str='nvjitlink') -> list[bytes]: """Convert linker options to bytes format for the nvjitlink backend. @@ -230,21 +235,8 @@ class LinkerOptions: RuntimeError If nvJitLink backend is not available. """ -_keep_driver_in_stub: 'cuda.bindings.driver.CUlinkState' -_keep_nvjitlink_in_stub: 'cuda.bindings.nvjitlink.nvJitLinkHandle' -__all__ = ['Linker', 'LinkerOptions'] -LinkerHandleT = Union['cuda.bindings.nvjitlink.nvJitLinkHandle', 'cuda.bindings.driver.CUlinkState'] -_driver = None -_inited = False -_use_nvjitlink_backend = None -_nvjitlink_input_types = None -_driver_input_types = None - -def _nvjitlink_has_version_symbol(nvjitlink) -> bool: - ... +def _nvjitlink_has_version_symbol(nvjitlink) -> bool: ... def _decide_nvjitlink_or_driver() -> bool: """Return True if falling back to the cuLink* driver APIs.""" - -def _lazy_init() -> None: - ... \ No newline at end of file +def _lazy_init() -> None: ... diff --git a/cuda_core/cuda/core/_linker.pyx b/cuda_core/cuda/core/_linker.pyx index 0687632c3bb..9e14a789f95 100644 --- a/cuda_core/cuda/core/_linker.pyx +++ b/cuda_core/cuda/core/_linker.pyx @@ -283,6 +283,18 @@ class LinkerOptions: no_cache : bool, optional Do not cache the intermediate steps of nvJitLink. Default: False. + numba_debug : bool, optional + Non-functional. ``numba_debug`` is an NVVM/NVRTC *compiler* option; + neither nvJitLink nor the driver's cuLink API recognizes it, so no + linking backend can honor it and the value is ignored. + Default: None. + + .. deprecated:: 1.2.0 + Setting this option emits a :class:`DeprecationWarning`. It has never + had an effect on any linking backend and will be removed in + ``cuda.core`` 2.0.0. Use + :attr:`ProgramOptions.numba_debug` on an NVVM or NVRTC compilation + path instead. """ name: str | None = "<default linker>" @@ -311,6 +323,21 @@ class LinkerOptions: def __post_init__(self) -> None: _lazy_init() self._name = self.name.encode() + # No linking backend reads ``numba_debug``, so warn where the value is + # supplied rather than in the option builders -- the user learns once, + # at the call site that set it, instead of once per link. The gate is + # ``is not None`` (unlike the ignore-warning on the PTX compile path): + # it is the *field* that is going away, so any explicit value earns the + # notice, including ``False``. + if self.numba_debug is not None: + warn( + "numba_debug is not supported by any linking backend and is ignored. " + "LinkerOptions.numba_debug is deprecated and will be removed in " + "cuda.core 2.0.0; use ProgramOptions.numba_debug on an NVVM or NVRTC " + "compilation path instead.", + DeprecationWarning, + stacklevel=3, + ) def _prepare_nvjitlink_options(self, as_bytes: bool = False) -> list[bytes] | list[str]: options = [] diff --git a/cuda_core/cuda/core/_memory/_buffer.pxd b/cuda_core/cuda/core/_memory/_buffer.pxd index b552e69554d..a9fa0d7e99c 100644 --- a/cuda_core/cuda/core/_memory/_buffer.pxd +++ b/cuda_core/cuda/core/_memory/_buffer.pxd @@ -44,3 +44,9 @@ cdef Buffer Buffer_from_deviceptr_handle( object ipc_descriptor = *, type cls = *, ) + + +# Shared argument coercion for the batched free functions (copy_batch, +# prefetch_batch, discard_batch, discard_prefetch_batch). `single_hint` +# names the per-buffer API to use instead when a bare Buffer is passed. +cdef tuple Buffer_coerce_batch(object buffers, str what, str single_hint) diff --git a/cuda_core/cuda/core/_memory/_buffer.pyi b/cuda_core/cuda/core/_memory/_buffer.pyi index 1d824cf6fc0..f0ba484217e 100644 --- a/cuda_core/cuda/core/_memory/_buffer.pyi +++ b/cuda_core/cuda/core/_memory/_buffer.pyi @@ -1,8 +1,8 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_buffer.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_buffer.pyx -from __future__ import annotations +from typing import TypedDict -import cython +from cuda.core._memory._copy_enums import CopyOptions from cuda.core._memory._device_memory_resource import DeviceMemoryResource from cuda.core._memory._ipc import IPCBufferDescriptor from cuda.core._memory._pinned_memory_resource import PinnedMemoryResource @@ -11,6 +11,7 @@ from cuda.core._utils.pycompat import BufferProtocol from cuda.core.graph import GraphBuilder from cuda.core.typing import DevicePointerType +__all__ = ['Buffer', 'MemoryResource'] class Buffer: """Represent a handle to allocated memory. @@ -28,34 +29,26 @@ class Buffer: by calling :meth:`from_ipc_descriptor` and therefore performs an IPC import. Do not unpickle buffers from untrusted sources. """ + _size: int - def __cinit__(self) -> None: - ... - - def _clear(self) -> None: - ... - - def __init__(self, *args, **kwargs) -> None: - ... - + def _clear(self) -> None: ... + def __init__(self, *args, **kwargs) -> None: ... @classmethod - def _init(cls, ptr: DevicePointerType, size: int, mr: MemoryResource | None=None, ipc_descriptor: IPCBufferDescriptor | None=None, owner: object | None=None) -> Buffer: + def _init(cls, ptr: DevicePointerType, size: int, mr: MemoryResource | None=None, ipc_descriptor: IPCBufferDescriptor | None=None, owner: object | None=None, *, stream: Stream | GraphBuilder | None=None) -> Buffer: """Create a Buffer from a raw pointer. When ``mr`` is provided, the buffer takes ownership: ``mr.deallocate()`` is called when the buffer is closed or garbage collected. When ``owner`` is provided, the owner is kept alive but no deallocation is performed. + When ``mr`` is provided, a deallocation stream is recorded at creation + (``stream`` if given, otherwise ``default_stream()``). Recording a + default-stream token requires a CUDA context to be current. """ - @staticmethod - def _reduce_helper(mr, ipc_descriptor): - ... - - def __reduce__(self) -> tuple[object, ...]: - ... - + def _reduce_helper(mr, ipc_descriptor): ... + def __reduce__(self) -> tuple[object, ...]: ... @staticmethod - def from_handle(ptr: DevicePointerType, size: int, mr: MemoryResource | None=None, owner: object | None=None) -> Buffer: + def from_handle(ptr: DevicePointerType, size: int, mr: MemoryResource | None=None, owner: object | None=None, *, stream: Stream | GraphBuilder | None=None) -> Buffer: """Create a new :class:`Buffer` object from a pointer. Parameters @@ -72,6 +65,13 @@ class Buffer: An object holding external allocation that the ``ptr`` points to. The reference is kept as long as the buffer is alive. The ``owner`` and ``mr`` cannot be specified together. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder`, optional + Keyword-only. The stream used to order the buffer's deallocation + when ``mr`` owns the pointer. Defaults to ``default_stream()``. + Recording a default-stream token requires a CUDA context to be + current. If the buffer may be freed from a different host thread, + pass a stream other than the per-thread default stream, which + refers to a different stream on each thread. Note ---- @@ -79,7 +79,6 @@ class Buffer: non-owning reference. The pointer will NOT be freed when the :class:`Buffer` is closed or garbage collected. """ - @classmethod def from_ipc_descriptor(cls, mr: DeviceMemoryResource | PinnedMemoryResource, ipc_descriptor: IPCBufferDescriptor, *, stream: Stream) -> Buffer: """Import a buffer that was exported from another process. @@ -100,12 +99,9 @@ class Buffer: and must be treated as untrusted input unless the peer is known to be cooperating. """ - @property - @cython.critical_section def ipc_descriptor(self) -> IPCBufferDescriptor: """Descriptor for sharing this buffer with other processes.""" - def close(self, stream: Stream | GraphBuilder | None=None) -> None: """Deallocate this buffer asynchronously on the given stream. @@ -117,15 +113,44 @@ class Buffer: stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder`, optional The stream object to use for asynchronous deallocation. If None, the deallocation stream stored in the handle is used. + + See Also + -------- + set_deallocation_stream + Change the deallocation stream without closing the buffer. """ + def set_deallocation_stream(self, stream: Stream | GraphBuilder) -> None: + """Change the stream that orders this buffer's eventual deallocation. - def __enter__(self): - ... + The buffer remains open and usable. A later :meth:`close` without a + stream, garbage collection, or release of the final retained device + pointer handle uses the replacement stream. - def __exit__(self, exc_type, exc_val, exc_tb): - ... + This method does not synchronize streams or establish dependencies. + The caller must ensure that allocation and all accesses are ordered + before the deallocation on ``stream``. - def copy_to(self, dst: Buffer | None=None, *, stream: Stream | GraphBuilder) -> Buffer: + Parameters + ---------- + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + The stream to use for eventual asynchronous deallocation. + + Raises + ------ + RuntimeError + If the buffer is already closed, or if a default-stream token + cannot be bound because no CUDA context is current. + TypeError + If ``stream`` is ``None`` or is not an accepted stream object. + + Notes + ----- + Synchronizing concurrent mutation and destruction of the same buffer + is the caller's responsibility. + """ + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... + def copy_to(self, dst: Buffer | None=None, *, stream: Stream | GraphBuilder, options: CopyOptions | None=None) -> Buffer: """Copy from this buffer to the dst buffer asynchronously on the given stream. Copies the data from this buffer to the provided dst buffer. @@ -140,10 +165,31 @@ class Buffer: stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Keyword argument specifying the stream for the asynchronous copy + options : :class:`~utils.CopyOptions`, optional + Transfer hints (source access order, location hints, overlap mode). + Honored when cuda.bindings and the driver are both CUDA 13.2 or + newer. Not accepted with ``LEGACY_DEFAULT_STREAM``; use + ``PER_THREAD_DEFAULT_STREAM`` instead. Not accepted with a + capturing stream either, since a graph cannot represent these + attributes; use :meth:`graph.GraphNode.memcpy` for a plain, + non-attributed copy node, or pass ``options=None``. On an older + cuda.bindings/driver, ``src_access_order`` values of ``STREAM`` + and ``ANY`` are silently ignored; ``DURING_API_CALL`` raises + instead of silently downgrading its guarantee. - """ + Raises + ------ + TypeError + If ``options`` is not a :class:`~utils.CopyOptions` instance, or + if ``options`` is given together with ``LEGACY_DEFAULT_STREAM`` + or a stream currently in graph capture mode. + RuntimeError + If ``options.src_access_order`` is ``DURING_API_CALL`` and + cuda.bindings or the driver is older than CUDA 13.2: falling + back to a plain copy cannot honor that guarantee. - def copy_from(self, src: Buffer, *, stream: Stream | GraphBuilder) -> None: + """ + def copy_from(self, src: Buffer, *, stream: Stream | GraphBuilder, options: CopyOptions | None=None) -> None: """Copy from the src buffer to this buffer asynchronously on the given stream. Parameters @@ -153,9 +199,29 @@ class Buffer: stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Keyword argument specifying the stream for the asynchronous copy + options : :class:`~utils.CopyOptions`, optional + Transfer hints (source access order, location hints, overlap mode). + Honored when cuda.bindings and the driver are both CUDA 13.2 or + newer. Not accepted with ``LEGACY_DEFAULT_STREAM``; use + ``PER_THREAD_DEFAULT_STREAM`` instead. Not accepted with a + capturing stream either, since a graph cannot represent these + attributes; use :meth:`graph.GraphNode.memcpy` for a plain, + non-attributed copy node, or pass ``options=None``. On an older + cuda.bindings/driver, ``src_access_order`` values of ``STREAM`` + and ``ANY`` are silently ignored; ``DURING_API_CALL`` raises + instead of silently downgrading its guarantee. + Raises + ------ + TypeError + If ``options`` is not a :class:`~utils.CopyOptions` instance, or + if ``options`` is given together with ``LEGACY_DEFAULT_STREAM`` + or a stream currently in graph capture mode. + RuntimeError + If ``options.src_access_order`` is ``DURING_API_CALL`` and + cuda.bindings or the driver is older than CUDA 13.2: falling + back to a plain copy cannot honor that guarantee. """ - def fill(self, value: int | BufferProtocol, *, stream: Stream | GraphBuilder) -> None: """Fill this buffer with a repeating byte pattern. @@ -178,23 +244,13 @@ class Buffer: If int value is outside [0, 256). """ - - def __dlpack__(self, *, stream: int | None=None, max_version: tuple[int, int] | None=None, dl_device: tuple[int, int] | None=None, copy: bool | None=None) -> object: - ... - - def __dlpack_device__(self) -> tuple[int, int]: - ... - - def __buffer__(self, flags: int, /) -> memoryview: - ... - - def __release_buffer__(self, buffer: memoryview, /) -> None: - ... - + def __dlpack__(self, *, stream: int | None=None, max_version: tuple[int, int] | None=None, dl_device: tuple[int, int] | None=None, copy: bool | None=None) -> object: ... + def __dlpack_device__(self) -> tuple[int, int]: ... + def __buffer__(self, flags: int, /) -> memoryview: ... + def __release_buffer__(self, buffer: memoryview, /) -> None: ... @property def device_id(self) -> int: """Return the device ordinal of this buffer.""" - @property def handle(self) -> int: """Return the buffer handle object. @@ -204,40 +260,27 @@ class Buffer: This handle is a Python object. To get the memory address of the underlying C handle, call ``int(Buffer.handle)``. """ - - def __eq__(self, other: object) -> bool: - ... - - def __hash__(self) -> int: - ... - - def __repr__(self) -> str: - ... - + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... @property def is_device_accessible(self) -> bool: """Return True if this buffer can be accessed by the GPU, otherwise False.""" - @property def is_host_accessible(self) -> bool: """Return True if this buffer can be accessed by the CPU, otherwise False.""" - @property def is_managed(self) -> bool: """Return True if this buffer is CUDA managed (unified) memory, otherwise False.""" - @property def is_mapped(self) -> bool: """Return True if this buffer is mapped into the process via IPC.""" - @property def memory_resource(self) -> MemoryResource: """Return the memory resource associated with this buffer.""" - @property def size(self) -> int: """Return the memory size of this buffer.""" - @property def owner(self) -> object: """Return the object holding external allocation.""" @@ -253,7 +296,6 @@ class MemoryResource: buffer properties are retrieved simply by looking up the underlying memory resource's respective property.) """ - def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: """Allocate a buffer of the requested size. @@ -264,7 +306,12 @@ class MemoryResource: stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Keyword-only. The stream on which to perform the allocation asynchronously. Must be passed explicitly; pass - ``device.default_stream`` to use the default stream. + ``device.default_stream`` to use the default stream. For subclasses + that support stream-ordered deallocation, this stream also orders + the buffer's eventual deallocation, so if the buffer may be freed + from a different host thread, prefer a stream other than the + per-thread default stream, which refers to a different stream on + each thread. Returns ------- @@ -272,7 +319,6 @@ class MemoryResource: The allocated buffer object, which can be used for device or host operations depending on the resource's properties. """ - def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder) -> None: """Deallocate a buffer previously allocated by this resource. @@ -287,20 +333,21 @@ class MemoryResource: asynchronously. Must be passed explicitly; pass ``device.default_stream`` to use the default stream. """ - @property def is_device_accessible(self) -> bool: """Whether buffers allocated by this resource are device-accessible.""" - @property def is_host_accessible(self) -> bool: """Whether buffers allocated by this resource are host-accessible.""" - @property def is_managed(self) -> bool: """Whether buffers allocated by this resource are CUDA managed (unified) memory.""" - @property def device_id(self) -> int: """Device ID associated with this memory resource, or -1 if not applicable.""" -__all__ = ['Buffer', 'MemoryResource'] \ No newline at end of file + +class _MemAttrs(TypedDict): + device_id: int + is_device_accessible: bool + is_host_accessible: bool + is_managed: bool diff --git a/cuda_core/cuda/core/_memory/_buffer.pyx b/cuda_core/cuda/core/_memory/_buffer.pyx index 2506331d0fd..6c983c1de26 100644 --- a/cuda_core/cuda/core/_memory/_buffer.pyx +++ b/cuda_core/cuda/core/_memory/_buffer.pyx @@ -16,21 +16,31 @@ from cuda.core._memory cimport _ipc from cuda.core._resource_handles cimport ( DevicePtrHandle, StreamHandle, + ContextHandle, deviceptr_create_with_owner, deviceptr_create_with_mr, register_mr_dealloc_callback, as_intptr, as_cu, + get_current_context, set_deallocation_stream, ) from cuda.core.typing import DevicePointerType -from cuda.core._stream cimport Stream, Stream_accept, default_stream +from cuda.core._memory._copy_attributes cimport _with_attributes_available +from cuda.core._memory._copy_attributes cimport _to_cu_memcpy_attributes # no-cython-lint + +IF CUDA_CORE_BUILD_MAJOR >= 13: + from cuda.core._resource_handles cimport memcpy_with_attributes_async + +from cuda.core._stream cimport Stream, Stream_accept, Stream_is_legacy_default_token, default_stream from cuda.core._utils.cuda_utils cimport HANDLE_RETURN, _parse_fill_value import sys +from collections.abc import Sequence from typing import TYPE_CHECKING +from cuda.core._memory._copy_enums import CopyOptions, _reject_unsupported_during_api_call from cuda.core._utils.pycompat import BufferProtocol from cuda.core._dlpack import classify_dl_device, make_py_capsule from cuda.core._device import Device @@ -49,23 +59,21 @@ cdef void _mr_dealloc_callback( size_t size, const StreamHandle& h_stream, ) noexcept: - """Called by the C++ deleter to deallocate via MemoryResource.deallocate. - - This is the C++ teardown path: there is no Python caller frame from - which to obtain a stream. If the device-pointer handle was created - without ``set_deallocation_stream`` being called (e.g. buffers minted - via ``Buffer.from_handle(ptr, size, mr=mr)`` from DLPack import, - third-party adapters, or other foreign sources), ``h_stream`` is - empty here. Stream-ordered MR ``deallocate`` overrides reject - ``stream=None`` (issue #2001), so without a fallback the destructor - would print a warning and leak the allocation. Fall back to the - legacy/per-thread default stream so the free still happens; this is - the unique exception to the "no implicit default-stream fallback" - policy because the teardown has no other source of truth. - """ + """Called by the C++ deleter to deallocate via MemoryResource.deallocate.""" cdef Stream stream try: - stream = Stream._from_handle(Stream, h_stream) if h_stream else default_stream() + if not h_stream: + print( + "Warning: no deallocation stream was recorded; falling back to " + "the default stream for mr.deallocate() during Buffer " + "destruction. This is an internal cuda-core error; please " + "report it with your CUDA driver, CUDA Toolkit, and " + "cuda-python versions.", + file=sys.stderr, + ) + stream = default_stream() + else: + stream = Stream._from_handle(Stream, h_stream) mr.deallocate(int(ptr), size, stream=stream) except Exception as exc: print(f"Warning: mr.deallocate() failed during Buffer destruction: {exc}", @@ -74,6 +82,23 @@ cdef void _mr_dealloc_callback( register_mr_dealloc_callback(_mr_dealloc_callback) +cdef inline void _apply_deallocation_stream( + const DevicePtrHandle& h_ptr, const StreamHandle& h_stream) except *: + """Record h_stream as the deallocation stream for h_ptr. + + Translates CUDA_ERROR_INVALID_CONTEXT (default-stream token with no current + context) into a descriptive RuntimeError instead of a raw CUDAError. + """ + cdef cydriver.CUresult status = set_deallocation_stream(h_ptr, h_stream) + if status == cydriver.CUresult.CUDA_ERROR_INVALID_CONTEXT: + raise RuntimeError( + "Cannot record a default deallocation stream when no CUDA context is " + "current. Call Device.set_current() first, or pass stream= with a " + "non-default Stream." + ) + HANDLE_RETURN(status) + + __all__ = ['Buffer', 'MemoryResource'] @@ -141,6 +166,75 @@ cdef inline void _init_memory_attrs(Buffer self): self._mem_attrs_inited.store(True, memory_order_release) +cdef bint _stream_is_capturing(Stream s): + cdef cydriver.CUstreamCaptureStatus cap_status + IF CUDA_CORE_BUILD_MAJOR >= 13: + HANDLE_RETURN(cydriver.cuStreamGetCaptureInfo(as_cu(s._h_stream), &cap_status, + NULL, NULL, NULL, NULL, NULL)) + ELSE: + HANDLE_RETURN(cydriver.cuStreamGetCaptureInfo(as_cu(s._h_stream), &cap_status, + NULL, NULL, NULL, NULL)) + return cap_status == cydriver.CU_STREAM_CAPTURE_STATUS_ACTIVE + + +cdef void _do_copy_with_attributes( + cydriver.CUdeviceptr dst, cydriver.CUdeviceptr src, size_t nbytes, + object options, cydriver.CUstream hstream, +): + IF CUDA_CORE_BUILD_MAJOR >= 13: + # Routed through the memcpy_with_attributes_async() C++ shim since + # cydriver.cuMemcpyWithAttributesAsync is absent from cuda-bindings < 13.2. + cdef cydriver.CUmemcpyAttributes cu_attr = _to_cu_memcpy_attributes(options) + with nogil: + HANDLE_RETURN(memcpy_with_attributes_async(dst, src, nbytes, <void*>&cu_attr, hstream)) + ELSE: + pass # unreachable: _with_attributes_available() is always False on CUDA 12 + + +cdef void _dispatch_buffer_copy( + cydriver.CUdeviceptr dst, cydriver.CUdeviceptr src, size_t nbytes, + Stream s, object options, str method_name, +): + """Submit a single copy, honoring CopyOptions when the attributes path is usable.""" + if options is None: + with nogil: + HANDLE_RETURN(cydriver.cuMemcpyAsync(dst, src, nbytes, as_cu(s._h_stream))) + return + if not isinstance(options, CopyOptions): + raise TypeError( + f"{method_name}: options must be CopyOptions, got {type(options).__name__}" + ) + if Stream_is_legacy_default_token(s): + raise TypeError( + f"{method_name} does not accept LEGACY_DEFAULT_STREAM with options " + "(matches copy_batch); cuMemcpyWithAttributesAsync rejects it outright, " + "unlike PER_THREAD_DEFAULT_STREAM, which is a real stream to the driver " + "and is accepted. Pass an explicit stream, PER_THREAD_DEFAULT_STREAM, " + "or options=None." + ) + if _stream_is_capturing(s): + raise TypeError( + f"{method_name} does not support graph capture with options " + "(matches copy_batch); the driver has no graph-node form of " + "cuMemcpyWithAttributesAsync, so options cannot be honored in a graph. " + "Use GraphNode.memcpy for a plain (non-attributed) copy node, or pass " + "options=None." + ) + if _with_attributes_available(): + _do_copy_with_attributes(dst, src, nbytes, options, as_cu(s._h_stream)) + else: + _reject_unsupported_during_api_call( + options.src_access_order, + "cuda.bindings and the driver to both report CUDA 13.2 or newer " + "(cuMemcpyWithAttributesAsync is unavailable here)", + ) + # STREAM and ANY never require access sooner than stream order, so + # cuMemcpyAsync satisfies them; options are otherwise silently + # ignored on this pre-CUDA-13.2 fallback path, matching copy_batch. + with nogil: + HANDLE_RETURN(cydriver.cuMemcpyAsync(dst, src, nbytes, as_cu(s._h_stream))) + + cdef class Buffer: """Represent a handle to allocated memory. @@ -176,20 +270,43 @@ cdef class Buffer: def _init( cls, ptr: DevicePointerType, size_t size, mr: MemoryResource | None = None, ipc_descriptor: IPCBufferDescriptor | None = None, - owner : object | None = None + owner : object | None = None, + *, + stream: Stream | GraphBuilder | None = None, ) -> Buffer: """Create a Buffer from a raw pointer. When ``mr`` is provided, the buffer takes ownership: ``mr.deallocate()`` is called when the buffer is closed or garbage collected. When ``owner`` is provided, the owner is kept alive but no deallocation is performed. + When ``mr`` is provided, a deallocation stream is recorded at creation + (``stream`` if given, otherwise ``default_stream()``). Recording a + default-stream token requires a CUDA context to be current. """ if mr is not None and owner is not None: raise ValueError("owner and memory resource cannot be both specified together") + if stream is not None and mr is None: + raise ValueError("stream requires a memory resource (mr)") cdef Buffer self = Buffer.__new__(cls) cdef uintptr_t c_ptr = <uintptr_t>(int(ptr)) + cdef Stream s + cdef cydriver.CUresult _ds_status if mr is not None: + s = Stream_accept(default_stream() if stream is None else stream) self._h_ptr = deviceptr_create_with_mr(c_ptr, size, mr) + _ds_status = set_deallocation_stream(self._h_ptr, s._h_stream) + if _ds_status != cydriver.CUresult.CUDA_SUCCESS: + # Reset before raising: the DevicePtrHandle destructor would otherwise + # invoke _mr_dealloc_callback, which catches any inner exception and + # clears the exception state, swallowing the error we're about to raise. + self._h_ptr.reset() + if _ds_status == cydriver.CUresult.CUDA_ERROR_INVALID_CONTEXT: + raise RuntimeError( + "Cannot record a default deallocation stream when no CUDA context is " + "current. Call Device.set_current() first, or pass stream= with a " + "non-default Stream." + ) + HANDLE_RETURN(_ds_status) else: self._h_ptr = deviceptr_create_with_owner(c_ptr, owner) self._size = size @@ -201,10 +318,17 @@ cdef class Buffer: @staticmethod def _reduce_helper(mr, ipc_descriptor): + cdef ContextHandle h_ctx = get_current_context() + cdef int device_id + if not h_ctx: + # Spawned processes unpickle arguments before entering their target, + # so initialize the context needed to bind the default-stream token. + device_id = mr.device_id + (Device(device_id) if device_id >= 0 else Device()).set_current() # The parent process's stream is not portable across processes, so the # pickle path cannot thread an explicit stream through. Seed the # imported buffer's deallocation with the current context's default - # stream; the receiver can override via buffer.close(stream). + # stream; the receiver can override it before or during close. return Buffer.from_ipc_descriptor(mr, ipc_descriptor, stream=default_stream()) def __reduce__(self) -> tuple[object, ...]: @@ -217,6 +341,8 @@ cdef class Buffer: def from_handle( ptr: DevicePointerType, size_t size, mr: MemoryResource | None = None, owner: object | None = None, + *, + stream: Stream | GraphBuilder | None = None, ) -> Buffer: """Create a new :class:`Buffer` object from a pointer. @@ -234,6 +360,13 @@ cdef class Buffer: An object holding external allocation that the ``ptr`` points to. The reference is kept as long as the buffer is alive. The ``owner`` and ``mr`` cannot be specified together. + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder`, optional + Keyword-only. The stream used to order the buffer's deallocation + when ``mr`` owns the pointer. Defaults to ``default_stream()``. + Recording a default-stream token requires a CUDA context to be + current. If the buffer may be freed from a different host thread, + pass a stream other than the per-thread default stream, which + refers to a different stream on each thread. Note ---- @@ -241,7 +374,7 @@ cdef class Buffer: non-owning reference. The pointer will NOT be freed when the :class:`Buffer` is closed or garbage collected. """ - return Buffer._init(ptr, size, mr=mr, owner=owner) + return Buffer._init(ptr, size, mr=mr, owner=owner, stream=stream) @classmethod def from_ipc_descriptor( @@ -290,9 +423,45 @@ cdef class Buffer: stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder`, optional The stream object to use for asynchronous deallocation. If None, the deallocation stream stored in the handle is used. + + See Also + -------- + set_deallocation_stream + Change the deallocation stream without closing the buffer. """ Buffer_close(self, stream) + def set_deallocation_stream(self, stream: Stream | GraphBuilder) -> None: + """Change the stream that orders this buffer's eventual deallocation. + + The buffer remains open and usable. A later :meth:`close` without a + stream, garbage collection, or release of the final retained device + pointer handle uses the replacement stream. + + This method does not synchronize streams or establish dependencies. + The caller must ensure that allocation and all accesses are ordered + before the deallocation on ``stream``. + + Parameters + ---------- + stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` + The stream to use for eventual asynchronous deallocation. + + Raises + ------ + RuntimeError + If the buffer is already closed, or if a default-stream token + cannot be bound because no CUDA context is current. + TypeError + If ``stream`` is ``None`` or is not an accepted stream object. + + Notes + ----- + Synchronizing concurrent mutation and destruction of the same buffer + is the caller's responsibility. + """ + Buffer_set_deallocation_stream(self, stream) + def __enter__(self): return self @@ -300,7 +469,8 @@ cdef class Buffer: self.close() return False - def copy_to(self, dst: Buffer | None = None, *, stream: Stream | GraphBuilder) -> Buffer: + def copy_to(self, dst: Buffer | None = None, *, stream: Stream | GraphBuilder, + options: CopyOptions | None = None) -> Buffer: """Copy from this buffer to the dst buffer asynchronously on the given stream. Copies the data from this buffer to the provided dst buffer. @@ -315,6 +485,28 @@ cdef class Buffer: stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Keyword argument specifying the stream for the asynchronous copy + options : :class:`~utils.CopyOptions`, optional + Transfer hints (source access order, location hints, overlap mode). + Honored when cuda.bindings and the driver are both CUDA 13.2 or + newer. Not accepted with ``LEGACY_DEFAULT_STREAM``; use + ``PER_THREAD_DEFAULT_STREAM`` instead. Not accepted with a + capturing stream either, since a graph cannot represent these + attributes; use :meth:`graph.GraphNode.memcpy` for a plain, + non-attributed copy node, or pass ``options=None``. On an older + cuda.bindings/driver, ``src_access_order`` values of ``STREAM`` + and ``ANY`` are silently ignored; ``DURING_API_CALL`` raises + instead of silently downgrading its guarantee. + + Raises + ------ + TypeError + If ``options`` is not a :class:`~utils.CopyOptions` instance, or + if ``options`` is given together with ``LEGACY_DEFAULT_STREAM`` + or a stream currently in graph capture mode. + RuntimeError + If ``options.src_access_order`` is ``DURING_API_CALL`` and + cuda.bindings or the driver is older than CUDA 13.2: falling + back to a plain copy cannot honor that guarantee. """ cdef Stream s = Stream_accept(stream) @@ -331,12 +523,12 @@ cdef class Buffer: raise ValueError( "buffer sizes mismatch between src and dst (sizes " f"are: src={src_size}, dst={dst_size})" ) - with nogil: - HANDLE_RETURN(cydriver.cuMemcpyAsync( - as_cu(dst._h_ptr), as_cu(self._h_ptr), src_size, as_cu(s._h_stream))) + _dispatch_buffer_copy( + as_cu(dst._h_ptr), as_cu(self._h_ptr), src_size, s, options, "copy_to") return dst - def copy_from(self, src: Buffer, *, stream: Stream | GraphBuilder) -> None: + def copy_from(self, src: Buffer, *, stream: Stream | GraphBuilder, + options: CopyOptions | None = None) -> None: """Copy from the src buffer to this buffer asynchronously on the given stream. Parameters @@ -346,7 +538,28 @@ cdef class Buffer: stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Keyword argument specifying the stream for the asynchronous copy + options : :class:`~utils.CopyOptions`, optional + Transfer hints (source access order, location hints, overlap mode). + Honored when cuda.bindings and the driver are both CUDA 13.2 or + newer. Not accepted with ``LEGACY_DEFAULT_STREAM``; use + ``PER_THREAD_DEFAULT_STREAM`` instead. Not accepted with a + capturing stream either, since a graph cannot represent these + attributes; use :meth:`graph.GraphNode.memcpy` for a plain, + non-attributed copy node, or pass ``options=None``. On an older + cuda.bindings/driver, ``src_access_order`` values of ``STREAM`` + and ``ANY`` are silently ignored; ``DURING_API_CALL`` raises + instead of silently downgrading its guarantee. + Raises + ------ + TypeError + If ``options`` is not a :class:`~utils.CopyOptions` instance, or + if ``options`` is given together with ``LEGACY_DEFAULT_STREAM`` + or a stream currently in graph capture mode. + RuntimeError + If ``options.src_access_order`` is ``DURING_API_CALL`` and + cuda.bindings or the driver is older than CUDA 13.2: falling + back to a plain copy cannot honor that guarantee. """ cdef Stream s = Stream_accept(stream) cdef size_t dst_size = self._size @@ -356,9 +569,8 @@ cdef class Buffer: raise ValueError( "buffer sizes mismatch between src and dst (sizes " f"are: src={src_size}, dst={dst_size})" ) - with nogil: - HANDLE_RETURN(cydriver.cuMemcpyAsync( - as_cu(self._h_ptr), as_cu(src._h_ptr), dst_size, as_cu(s._h_stream))) + _dispatch_buffer_copy( + as_cu(self._h_ptr), as_cu(src._h_ptr), dst_size, s, options, "copy_from") def fill(self, value: int | BufferProtocol, *, stream: Stream | GraphBuilder) -> None: """Fill this buffer with a repeating byte pattern. @@ -546,7 +758,12 @@ cdef class MemoryResource: stream : :obj:`~_stream.Stream` | :obj:`~graph.GraphBuilder` Keyword-only. The stream on which to perform the allocation asynchronously. Must be passed explicitly; pass - ``device.default_stream`` to use the default stream. + ``device.default_stream`` to use the default stream. For subclasses + that support stream-ordered deallocation, this stream also orders + the buffer's eventual deallocation, so if the buffer may be freed + from a different host thread, prefer a stream other than the + per-thread default stream, which refers to a different stream on + each thread. Returns ------- @@ -619,15 +836,47 @@ cdef Buffer Buffer_from_deviceptr_handle( return buf +cdef tuple Buffer_coerce_batch(object buffers, str what, str single_hint): + """Coerce ``buffers`` to a ``tuple[Buffer, ...]``; reject a bare Buffer. + + Shared by the batched free functions. Passing one Buffer is rejected + rather than treated as a one-element batch so that the per-buffer API + named by ``single_hint`` stays the single obvious way to do it. + """ + cdef list out + if isinstance(buffers, Buffer): + raise TypeError( + f"{what}: pass a sequence of Buffers; for a single buffer use {single_hint}" + ) + if not isinstance(buffers, Sequence): + raise TypeError( + f"{what}: buffers must be a sequence of Buffer, got {type(buffers).__name__}" + ) + if not buffers: + raise ValueError(f"{what}: empty buffers sequence") + out = [] + for item in buffers: + if not isinstance(item, Buffer): + raise TypeError(f"{what}: expected Buffer, got {type(item).__name__}") + out.append(item) + return tuple(out) + + +cdef inline void Buffer_set_deallocation_stream(Buffer self, object stream): + """Validate and replace a live buffer's deallocation recipe.""" + if not self._h_ptr: + raise RuntimeError("Cannot set the deallocation stream on a closed Buffer") + cdef Stream s = Stream_accept(stream) + _apply_deallocation_stream(self._h_ptr, s._h_stream) + + cdef inline void Buffer_close(Buffer self, object stream): """Close a buffer, freeing its memory.""" - cdef Stream s if not self._h_ptr: return # Update deallocation stream if provided if stream is not None: - s = Stream_accept(stream) - set_deallocation_stream(self._h_ptr, s._h_stream) + Buffer_set_deallocation_stream(self, stream) # Reset handle - RAII deleter will free the memory (and release owner ref in C++) self._h_ptr.reset() self._size = 0 diff --git a/cuda_core/cuda/core/_memory/_copy_attributes.pxd b/cuda_core/cuda/core/_memory/_copy_attributes.pxd new file mode 100644 index 00000000000..96c213dfec5 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_copy_attributes.pxd @@ -0,0 +1,31 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Neutral leaf module: declares the CopyOptions-to-CUmemcpyAttributes converter +# and the 13.2 availability gate so both _buffer and _copy_ops can cimport them +# without either depending on the other. + +from cuda.bindings cimport cydriver +from cuda.core._utils.version cimport cy_binding_version, cy_driver_version # no-cython-lint + + +IF CUDA_CORE_BUILD_MAJOR >= 13: + from cuda.core._resource_handles cimport has_memcpy_with_attributes_async + + cdef inline bint _with_attributes_available(): + # has_memcpy_with_attributes_async() says whether the installed + # cuda-bindings actually exports cuMemcpyWithAttributesAsync (13.2+); + # the version checks alone are not sufficient, since cuda.core's build + # can be paired with a cuda-bindings install older than what it built + # against (see https://github.com/NVIDIA/cuda-python/issues/2063). + return ( + has_memcpy_with_attributes_async() + and cy_driver_version() >= (13, 2, 0) + and cy_binding_version() >= (13, 2, 0) + ) +ELSE: + cdef inline bint _with_attributes_available(): + return False + +cdef cydriver.CUmemcpyAttributes _to_cu_memcpy_attributes(object attr) diff --git a/cuda_core/cuda/core/_memory/_copy_attributes.pyi b/cuda_core/cuda/core/_memory/_copy_attributes.pyi new file mode 100644 index 00000000000..93b9a97aa2b --- /dev/null +++ b/cuda_core/cuda/core/_memory/_copy_attributes.pyi @@ -0,0 +1 @@ +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_copy_attributes.pyx diff --git a/cuda_core/cuda/core/_memory/_copy_attributes.pyx b/cuda_core/cuda/core/_memory/_copy_attributes.pyx new file mode 100644 index 00000000000..5618cf35527 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_copy_attributes.pyx @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from libc.string cimport memset + +from cuda.bindings cimport cydriver +from cuda.core._memory._location cimport to_cumemlocation + +from cuda.core._memory._managed_location import _coerce_location + + +cdef cydriver.CUmemcpyAttributes _to_cu_memcpy_attributes(object attr): + """Convert a CopyOptions to a cydriver.CUmemcpyAttributes struct.""" + cdef cydriver.CUmemcpyAttributes cu_attr + memset(&cu_attr, 0, sizeof(cydriver.CUmemcpyAttributes)) + cu_attr.srcAccessOrder = <cydriver.CUmemcpySrcAccessOrder>(<int>attr._to_driver_enum()) + cu_attr.flags = <unsigned int>(<int>attr._to_driver_flags()) + + cdef object src_loc = _coerce_location(attr.src_location_hint, allow_none=True) + cdef object dst_loc = _coerce_location(attr.dst_location_hint, allow_none=True) + + if src_loc is not None: + cu_attr.srcLocHint = to_cumemlocation(src_loc.kind, src_loc.id) + if dst_loc is not None: + cu_attr.dstLocHint = to_cumemlocation(dst_loc.kind, dst_loc.id) + + return cu_attr diff --git a/cuda_core/cuda/core/_memory/_copy_enums.py b/cuda_core/cuda/core/_memory/_copy_enums.py new file mode 100644 index 00000000000..84c72e71110 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_copy_enums.py @@ -0,0 +1,212 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +import dataclasses +from collections.abc import Sequence + +from cuda.core._device import Device +from cuda.core._host import Host +from cuda.core._utils.cuda_utils import driver +from cuda.core._utils.pycompat import StrEnum +from cuda.core._utils.version import binding_version + +__all__ = ["CopyOptions", "MemcpyOverlapMode", "MemcpySrcAccessOrder"] + + +class MemcpySrcAccessOrder(StrEnum): + """Source access order hint for batched memcpy operations. + + Maps to ``CUmemcpySrcAccessOrder``. + + ``STREAM`` + Source reads follow stream order. Earlier stream work may still be + accessing the source when the copy is enqueued. + ``DURING_API_CALL`` + The driver may read the source out of stream order, but all reads + are complete before :func:`copy_batch` returns. No earlier stream + work may be accessing the source at the time of the call. + ``ANY`` + The driver may read the source after the call returns. The caller + must keep the source unchanged until the copy completes in stream + order. No earlier stream work may be accessing the source. + """ + + STREAM = "stream" + DURING_API_CALL = "during_api_call" + ANY = "any" + + +class MemcpyOverlapMode(StrEnum): + """Overlap mode hint for batched memcpy operations. + + Maps to ``CUmemcpyFlags``. + + ``DEFAULT`` + No overlap preference; the driver uses its default scheduling. + ``PREFER_OVERLAP_WITH_COMPUTE`` + Hint that the copy should preferably overlap with concurrent + compute work. This is advisory and may be ignored depending on + the platform and copy parameters. + """ + + DEFAULT = "default" + PREFER_OVERLAP_WITH_COMPUTE = "prefer_overlap_with_compute" + + +@dataclasses.dataclass(frozen=True) +class CopyOptions: + """Attribute bundle for a single copy within a batched memcpy. + + Parameters + ---------- + src_access_order : :class:`MemcpySrcAccessOrder` or str + Hint describing how the source will be accessed. + Default is ``"stream"`` (stream-ordered access). + src_location_hint : :class:`cuda.core.Device` | :class:`cuda.core.Host` | None + Hint for the source memory location. Honored only for managed + memory on devices with concurrent managed access and for + system-allocated pageable memory on devices with pageable memory + access; ignored for all other memory types. Does not prefetch + memory and does not set persistent memory advice. + ``None`` means no hint. + dst_location_hint : :class:`cuda.core.Device` | :class:`cuda.core.Host` | None + Hint for the destination memory location. Same semantics and + restrictions as ``src_location_hint``. ``None`` means no hint. + overlap_mode : :class:`MemcpyOverlapMode` or str + Hint requesting that the copy overlap with concurrent compute work. + This is advisory; it has an effect only on devices that support it. + Default is ``"default"``. + """ + + src_access_order: MemcpySrcAccessOrder | str = "stream" + src_location_hint: Device | Host | None = None + dst_location_hint: Device | Host | None = None + overlap_mode: MemcpyOverlapMode | str = "default" + + def __post_init__(self): + # Frozen, unlike the other *Options dataclasses in cuda.core, because + # the batched-API contract agreed in NVIDIA/cuda-python#1775 specifies + # immutable per-call options: + # https://github.com/NVIDIA/cuda-python/pull/1775#issuecomment-4355502334 + # + # Normalizing str -> StrEnum therefore has to go through + # object.__setattr__; a plain assignment would raise + # FrozenInstanceError. Done here rather than at use so that a typo + # fails at construction and the field always holds the enum. + if not isinstance(self.src_access_order, MemcpySrcAccessOrder): + try: + object.__setattr__( + self, + "src_access_order", + MemcpySrcAccessOrder(self.src_access_order), + ) + except (ValueError, TypeError) as exc: + raise ValueError(f"invalid src_access_order: {self.src_access_order!r}") from exc + if not isinstance(self.overlap_mode, MemcpyOverlapMode): + try: + object.__setattr__( + self, + "overlap_mode", + MemcpyOverlapMode(self.overlap_mode), + ) + except (ValueError, TypeError) as exc: + raise ValueError(f"invalid overlap_mode: {self.overlap_mode!r}") from exc + + def _to_driver_enum(self) -> int: + """Return the driver CUmemcpySrcAccessOrder value.""" + if not _SRC_ACCESS_ORDER_TO_DRIVER: + raise NotImplementedError(_CUDA13_REQUIRED) + return _SRC_ACCESS_ORDER_TO_DRIVER[MemcpySrcAccessOrder(self.src_access_order)] + + def _to_driver_flags(self) -> int: + """Return the driver CUmemcpyFlags value.""" + if not _OVERLAP_MODE_TO_DRIVER: + raise NotImplementedError(_CUDA13_REQUIRED) + return _OVERLAP_MODE_TO_DRIVER[MemcpyOverlapMode(self.overlap_mode)] + + +_CUDA13_REQUIRED = "copy attributes require cuda.bindings 13.0 or newer" + +# CUmemcpySrcAccessOrder and CUmemcpyFlags are exposed by cuda.bindings 13.0+, +# so these maps are empty when it is older. Nothing reaches them there: +# copy_batch refuses non-default CopyOptions when the batched entry point is +# unavailable. +# +# Keyed by ``str``: under ``python_version = "3.10"`` mypy resolves StrEnum to +# the unstubbed backports shim and so infers the members as plain ``str``. +# StrEnum members are ``str`` instances, so this holds on every version. The +# values are wrapped in ``int()`` because the driver enums are untyped. +_SRC_ACCESS_ORDER_TO_DRIVER: dict[str, int] +_OVERLAP_MODE_TO_DRIVER: dict[str, int] + +if binding_version() >= (13, 0, 0): + _src_order = driver.CUmemcpySrcAccessOrder + _flags = driver.CUmemcpyFlags + _SRC_ACCESS_ORDER_TO_DRIVER = { + MemcpySrcAccessOrder.STREAM: int(_src_order.CU_MEMCPY_SRC_ACCESS_ORDER_STREAM), + MemcpySrcAccessOrder.DURING_API_CALL: int(_src_order.CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL), + MemcpySrcAccessOrder.ANY: int(_src_order.CU_MEMCPY_SRC_ACCESS_ORDER_ANY), + } + _OVERLAP_MODE_TO_DRIVER = { + MemcpyOverlapMode.DEFAULT: int(_flags.CU_MEMCPY_FLAG_DEFAULT), + MemcpyOverlapMode.PREFER_OVERLAP_WITH_COMPUTE: int(_flags.CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE), + } + del _src_order, _flags +else: + _SRC_ACCESS_ORDER_TO_DRIVER = {} + _OVERLAP_MODE_TO_DRIVER = {} + + +def _reject_unsupported_during_api_call( + src_access_order: MemcpySrcAccessOrder, requirement: str, *, index: int | None = None +) -> None: + """Raise if ``src_access_order`` is DURING_API_CALL but the native attributes + path (``cuMemcpyWithAttributesAsync`` / ``cuMemcpyBatchAsync``) is unavailable. + + STREAM and ANY never promise access sooner than stream order, so a plain + ``cuMemcpyAsync`` fallback satisfies them; DURING_API_CALL specifically + promises all source reads complete before the call returns, which + ``cuMemcpyAsync`` cannot provide (it reads the source in stream order + only). Silently downgrading that guarantee would let a caller reuse or + overwrite the source buffer before the real, stream-ordered read + happens: a silent data race, not a missed optimization. ``requirement`` + names what the native path needs and why it is unavailable here; + ``index`` identifies the offending copy within a batch. + + Internal, but deliberately importable: shared between the per-buffer and + batched fallback paths so both raise identically, and directly testable + without needing an actual old driver/bindings install. + """ + if src_access_order != MemcpySrcAccessOrder.DURING_API_CALL: + return + where = f" at index {index}" if index is not None else "" + raise RuntimeError( + f"src_access_order=DURING_API_CALL{where} requires {requirement}. A " + "plain cuMemcpyAsync fallback reads the source in stream order only, " + "which would silently violate the guarantee that all source reads " + "complete before the call returns, letting the caller reuse the " + "source buffer before the real (stream-ordered) read happens. Use " + "src_access_order=STREAM or ANY, or omit options, if that works for " + "your use case." + ) + + +def _attr_run_starts(attrs: Sequence[CopyOptions]) -> list[int]: + """Return the start index of each maximal run of equal attributes. + + This mirrors the ``attrsIdxs`` indirection that ``cuMemcpyBatchAsync`` + expects: ``attrs[k]`` applies to the copies in + ``[starts[k], starts[k + 1])``. Collapsing equal neighbours means a + broadcast attribute is passed to the driver once (``numAttrs == 1``) + rather than repeated per copy. + """ + starts: list[int] = [] + prev: CopyOptions | None = None + for i, attr in enumerate(attrs): + if i == 0 or attr != prev: + starts.append(i) + prev = attr + return starts diff --git a/cuda_core/cuda/core/_memory/_copy_ops.pyi b/cuda_core/cuda/core/_memory/_copy_ops.pyi new file mode 100644 index 00000000000..f3439732230 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_copy_ops.pyi @@ -0,0 +1,93 @@ +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_copy_ops.pyx + +from collections.abc import Sequence + +from cuda.core._memory._buffer import Buffer +from cuda.core._memory._copy_enums import CopyOptions +from cuda.core._stream import Stream + +_SINGLE_COPY_HINT = 'Buffer.copy_to / Buffer.copy_from' + +def _normalize_copy_options(options: CopyOptions | Sequence[CopyOptions] | None, n: int) -> tuple[CopyOptions, ...]: + """Expand ``options`` to exactly one :class:`CopyOptions` per copy. + + ``None`` and a scalar broadcast; a sequence pairs by index and must + already have length ``n``. + + Internal, but deliberately importable: options are hints that change + how the driver stages a transfer and never the bytes it produces, so + this expansion (and the run encoding applied to it) is the only + observable evidence that a scalar reached every copy. + """ +def copy_batch(stream: Stream, srcs: Sequence[Buffer], dsts: Sequence[Buffer], *, options: CopyOptions | Sequence[CopyOptions] | None=None) -> None: + """Copy a batch of buffers asynchronously. + + Source buffer and destination buffer sizes must match. For a single + buffer, use :meth:`Buffer.copy_to` or :meth:`Buffer.copy_from`. + + The driver provides no graph-node form of ``cuMemcpyBatchAsync``, so + this cannot be captured into a graph. Both passing a + :class:`~graph.GraphBuilder` and passing its underlying + :attr:`~graph.GraphBuilder.stream` while capture is active are + rejected. Build graph copies with + :meth:`graph.GraphNode.memcpy` or per-buffer :meth:`Buffer.copy_to`. + + Parameters + ---------- + stream : :class:`~_stream.Stream` + Stream for the asynchronous copy. First positional and required + (mirrors :func:`launch`). Does not accept a capturing stream + (including a :class:`~graph.GraphBuilder`'s underlying stream); use + :meth:`graph.GraphNode.memcpy` or per-buffer + :meth:`Buffer.copy_to` to build copies into a graph. Does not accept + ``LEGACY_DEFAULT_STREAM``, which ``cuMemcpyBatchAsync`` rejects + outright; ``PER_THREAD_DEFAULT_STREAM`` is a real stream to the + driver and is accepted. + srcs : Sequence[:class:`Buffer`] + Source buffers. Must be a sequence, not a single Buffer. + dsts : Sequence[:class:`Buffer`] + Destination buffers. Must match ``len(srcs)``. + options : :class:`CopyOptions` | Sequence[:class:`CopyOptions`] | None + Per-copy options. A single value applies to every copy; a + sequence pairs by index and must match ``len(srcs)``. ``None`` + uses stream-ordered defaults. + + Raises + ------ + ValueError + If lengths or sizes mismatch. + TypeError + If a single Buffer is passed instead of a sequence, if + ``LEGACY_DEFAULT_STREAM`` is passed, or if the stream is currently + in graph capture mode. + RuntimeError + If any copy requests ``src_access_order=DURING_API_CALL`` and the + native ``cuMemcpyBatchAsync`` path is unavailable (see Notes): the + per-copy ``cuMemcpyAsync`` fallback reads the source in stream + order only, which cannot honor that guarantee. + + Notes + ----- + Batching through ``cuMemcpyBatchAsync`` requires all three of: + ``cuda.core`` built against CUDA 13 headers, ``cuda.bindings`` 13.0 or + newer, and a driver reporting CUDA 13.0 or newer + (``cuDriverGetVersion() >= 13000``). ``cuda.bindings`` binds only the + CUDA 13.0 revision of the entry point, so a driver that predates it is + refused even where it implements the earlier CUDA 12.8 signature. + + The driver may execute batch items concurrently and in any order. + A batch must therefore not contain copies where the source range of + one copy overlaps the destination range of another; such aliasing + produces undefined results. Detecting overlaps at runtime is + impractical; callers are responsible for ensuring no aliasing exists. + + On pre-CUDA 13 installs the copies fall back to a Python-level loop + over ``cuMemcpyAsync``, so the potential performance benefit of + asynchronous batched copies is not realized. ``src_access_order`` values + of ``STREAM`` and ``ANY`` are silently ignored on the fallback path + (stream-ordered access already satisfies both); ``DURING_API_CALL`` + raises ``RuntimeError`` instead, since silently downgrading it to + stream-ordered access would let a caller reuse the source buffer before + the real read happens. + + """ diff --git a/cuda_core/cuda/core/_memory/_copy_ops.pyx b/cuda_core/cuda/core/_memory/_copy_ops.pyx new file mode 100644 index 00000000000..e57be2e40a0 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_copy_ops.pyx @@ -0,0 +1,319 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations + +from collections.abc import Sequence + +IF CUDA_CORE_BUILD_MAJOR >= 13: + from libcpp.vector cimport vector + +from cuda.bindings cimport cydriver +from cuda.core._memory._buffer cimport Buffer, Buffer_coerce_batch +from cuda.core._memory._copy_attributes cimport _to_cu_memcpy_attributes # no-cython-lint +from cuda.core._resource_handles cimport as_cu +from cuda.core._stream cimport Stream, Stream_accept, Stream_is_legacy_default_token +from cuda.core._utils.cuda_utils cimport HANDLE_RETURN + +# cy_driver_version and _attr_run_starts are referenced only from CUDA 13 +# branches. cython-lint does not evaluate compile-time IF blocks, so they need +# a pragma to be seen as used. +from cuda.core._utils.version cimport cy_driver_version # no-cython-lint + +from cuda.core._memory._copy_enums import ( + CopyOptions, + _attr_run_starts, # no-cython-lint + _reject_unsupported_during_api_call, +) + +_SINGLE_COPY_HINT = "Buffer.copy_to / Buffer.copy_from" + + +cdef inline bint _batch_entry_point_available(): + """Whether cuMemcpyBatchAsync can actually be called here. + + Requires ``cuda.core`` built against CUDA 13 headers (compile time) and + a driver reporting CUDA 13.0 or newer, i.e. + ``cuDriverGetVersion() >= 13000`` (run time). + + The run-time bound is set by the binding layer, not by when the driver + gained the feature. CUDA 12.8 already exposed a ``cuMemcpyBatchAsync``, + but its signature carried a ``failIdx`` out-parameter that CUDA 13.0 + dropped. ``cuda.bindings`` resolves only the 13.0 revision, via + ``cuGetProcAddress_v2('cuMemcpyBatchAsync', ..., 13000, ...)``, so an + older driver yields a NULL pointer even though it may implement the + earlier entry point. + """ + IF CUDA_CORE_BUILD_MAJOR >= 13: + return cy_driver_version() >= (13, 0, 0) + ELSE: + return False + + +def _normalize_copy_options( + options: CopyOptions | Sequence[CopyOptions] | None, + Py_ssize_t n, +) -> tuple[CopyOptions, ...]: + """Expand ``options`` to exactly one :class:`CopyOptions` per copy. + + ``None`` and a scalar broadcast; a sequence pairs by index and must + already have length ``n``. + + Internal, but deliberately importable: options are hints that change + how the driver stages a transfer and never the bytes it produces, so + this expansion (and the run encoding applied to it) is the only + observable evidence that a scalar reached every copy. + """ + if options is None: + return (CopyOptions(),) * n + if isinstance(options, CopyOptions): + return (options,) * n + if isinstance(options, Sequence): + if len(options) != n: + raise ValueError( + f"copy_batch: options length {len(options)} does not match " + f"buffers length {n}" + ) + for a in options: + if not isinstance(a, CopyOptions): + raise TypeError( + f"copy_batch: each options element must be CopyOptions, " + f"got {type(a).__name__}" + ) + return tuple(options) + raise TypeError( + f"copy_batch: options must be CopyOptions or a sequence of " + f"CopyOptions, got {type(options).__name__}" + ) + + +def copy_batch( + stream: Stream, + srcs: Sequence[Buffer], + dsts: Sequence[Buffer], + *, + options: CopyOptions | Sequence[CopyOptions] | None = None, +) -> None: + """Copy a batch of buffers asynchronously. + + Source buffer and destination buffer sizes must match. For a single + buffer, use :meth:`Buffer.copy_to` or :meth:`Buffer.copy_from`. + + The driver provides no graph-node form of ``cuMemcpyBatchAsync``, so + this cannot be captured into a graph. Both passing a + :class:`~graph.GraphBuilder` and passing its underlying + :attr:`~graph.GraphBuilder.stream` while capture is active are + rejected. Build graph copies with + :meth:`graph.GraphNode.memcpy` or per-buffer :meth:`Buffer.copy_to`. + + Parameters + ---------- + stream : :class:`~_stream.Stream` + Stream for the asynchronous copy. First positional and required + (mirrors :func:`launch`). Does not accept a capturing stream + (including a :class:`~graph.GraphBuilder`\'s underlying stream); use + :meth:`graph.GraphNode.memcpy` or per-buffer + :meth:`Buffer.copy_to` to build copies into a graph. Does not accept + ``LEGACY_DEFAULT_STREAM``, which ``cuMemcpyBatchAsync`` rejects + outright; ``PER_THREAD_DEFAULT_STREAM`` is a real stream to the + driver and is accepted. + srcs : Sequence[:class:`Buffer`] + Source buffers. Must be a sequence, not a single Buffer. + dsts : Sequence[:class:`Buffer`] + Destination buffers. Must match ``len(srcs)``. + options : :class:`CopyOptions` | Sequence[:class:`CopyOptions`] | None + Per-copy options. A single value applies to every copy; a + sequence pairs by index and must match ``len(srcs)``. ``None`` + uses stream-ordered defaults. + + Raises + ------ + ValueError + If lengths or sizes mismatch. + TypeError + If a single Buffer is passed instead of a sequence, if + ``LEGACY_DEFAULT_STREAM`` is passed, or if the stream is currently + in graph capture mode. + RuntimeError + If any copy requests ``src_access_order=DURING_API_CALL`` and the + native ``cuMemcpyBatchAsync`` path is unavailable (see Notes): the + per-copy ``cuMemcpyAsync`` fallback reads the source in stream + order only, which cannot honor that guarantee. + + Notes + ----- + Batching through ``cuMemcpyBatchAsync`` requires all three of: + ``cuda.core`` built against CUDA 13 headers, ``cuda.bindings`` 13.0 or + newer, and a driver reporting CUDA 13.0 or newer + (``cuDriverGetVersion() >= 13000``). ``cuda.bindings`` binds only the + CUDA 13.0 revision of the entry point, so a driver that predates it is + refused even where it implements the earlier CUDA 12.8 signature. + + The driver may execute batch items concurrently and in any order. + A batch must therefore not contain copies where the source range of + one copy overlaps the destination range of another; such aliasing + produces undefined results. Detecting overlaps at runtime is + impractical; callers are responsible for ensuring no aliasing exists. + + On pre-CUDA 13 installs the copies fall back to a Python-level loop + over ``cuMemcpyAsync``, so the potential performance benefit of + asynchronous batched copies is not realized. ``src_access_order`` values + of ``STREAM`` and ``ANY`` are silently ignored on the fallback path + (stream-ordered access already satisfies both); ``DURING_API_CALL`` + raises ``RuntimeError`` instead, since silently downgrading it to + stream-ordered access would let a caller reuse the source buffer before + the real read happens. + + """ + cdef tuple src_bufs = Buffer_coerce_batch(srcs, "copy_batch", _SINGLE_COPY_HINT) + cdef tuple dst_bufs = Buffer_coerce_batch(dsts, "copy_batch", _SINGLE_COPY_HINT) + cdef Py_ssize_t n = len(src_bufs) + + if len(dst_bufs) != n: + raise ValueError( + f"copy_batch: srcs length {n} does not match dsts length {len(dst_bufs)}" + ) + + cdef Stream s = Stream_accept(stream) + + if Stream_is_legacy_default_token(s): + raise TypeError( + "copy_batch does not accept LEGACY_DEFAULT_STREAM; cuMemcpyBatchAsync " + "rejects it outright, unlike PER_THREAD_DEFAULT_STREAM, which is a real " + "stream to the driver and is accepted. Pass an explicit stream or " + "PER_THREAD_DEFAULT_STREAM." + ) + + cdef cydriver.CUstreamCaptureStatus _cap_status + IF CUDA_CORE_BUILD_MAJOR >= 13: + HANDLE_RETURN(cydriver.cuStreamGetCaptureInfo(as_cu(s._h_stream), &_cap_status, + NULL, NULL, NULL, NULL, NULL)) + ELSE: + HANDLE_RETURN(cydriver.cuStreamGetCaptureInfo(as_cu(s._h_stream), &_cap_status, + NULL, NULL, NULL, NULL)) + if _cap_status == cydriver.CU_STREAM_CAPTURE_STATUS_ACTIVE: + raise TypeError( + "copy_batch does not support graph capture; " + "use GraphNode.memcpy or per-buffer Buffer.copy_to instead" + ) + + cdef Buffer src_buf + cdef Buffer dst_buf + cdef Py_ssize_t i + + for i in range(n): + src_buf = <Buffer>src_bufs[i] + dst_buf = <Buffer>dst_bufs[i] + if src_buf.size != dst_buf.size: + raise ValueError( + f"copy_batch: buffer size mismatch at index {i} " + f"(src={src_buf.size}, dst={dst_buf.size})" + ) + + cdef tuple attr_tuple = _normalize_copy_options(options, n) + + _do_copy_batch(src_bufs, dst_bufs, s, attr_tuple) + + +cdef void _do_copy_batch(tuple src_bufs, tuple dst_bufs, Stream s, tuple attr_tuple): + IF CUDA_CORE_BUILD_MAJOR >= 13: + # Building against CUDA 13 headers says nothing about the installed + # driver, so the run-time version still has to be checked before + # calling a 13.0-only entry point (see PRs #2054 / #2064). + if _batch_entry_point_available(): + _do_copy_batch_native(src_bufs, dst_bufs, s, attr_tuple) + else: + _reject_during_api_call_fallback(attr_tuple) + _do_copy_batch_loop(src_bufs, dst_bufs, s) + ELSE: + _reject_during_api_call_fallback(attr_tuple) + _do_copy_batch_loop(src_bufs, dst_bufs, s) + + +cdef void _reject_during_api_call_fallback(tuple attr_tuple): + """Raise before the per-copy cuMemcpyAsync loop if any copy needs + DURING_API_CALL, which that fallback cannot honor (see + _reject_unsupported_during_api_call for why this must raise rather than + silently ignore the option, unlike STREAM and ANY). + """ + cdef Py_ssize_t i + for i in range(len(attr_tuple)): + _reject_unsupported_during_api_call( + (<object>attr_tuple[i]).src_access_order, + "cuda.core built against CUDA 13 headers and cuda.bindings/driver " + "13.0 or newer (cuMemcpyBatchAsync is unavailable here)", + index=i, + ) + + +cdef void _do_copy_batch_loop(tuple src_bufs, tuple dst_bufs, Stream s): + """Per-copy cuMemcpyAsync fallback where the batch entry point is absent. + + Issues copies one at a time, so the performance benefit of batching is + not realized. STREAM and ANY are silently ignored here (satisfied by + stream-ordered cuMemcpyAsync regardless); DURING_API_CALL is rejected by + _reject_during_api_call_fallback before this is ever called. + """ + cdef Py_ssize_t n = len(src_bufs) + cdef Py_ssize_t i + cdef Buffer src_buf + cdef Buffer dst_buf + cdef size_t nbytes + cdef cydriver.CUstream hstream = as_cu(s._h_stream) + + for i in range(n): + src_buf = <Buffer>src_bufs[i] + dst_buf = <Buffer>dst_bufs[i] + nbytes = src_buf._size + with nogil: + HANDLE_RETURN(cydriver.cuMemcpyAsync( + as_cu(dst_buf._h_ptr), as_cu(src_buf._h_ptr), nbytes, hstream)) + + +IF CUDA_CORE_BUILD_MAJOR >= 13: + cdef void _do_copy_batch_native(tuple src_bufs, tuple dst_bufs, Stream s, tuple attr_tuple): + cdef Py_ssize_t n = len(src_bufs) + cdef cydriver.CUstream hstream = as_cu(s._h_stream) + cdef vector[cydriver.CUdeviceptr] dst_ptrs + cdef vector[cydriver.CUdeviceptr] src_ptrs + cdef vector[size_t] sizes + cdef vector[size_t] attrs_idxs + dst_ptrs.resize(n) + src_ptrs.resize(n) + sizes.resize(n) + + cdef Buffer src_buf + cdef Buffer dst_buf + cdef Py_ssize_t i + + # Collapse equal neighbouring attributes into runs so a broadcast + # attribute reaches the driver once (numAttrs == 1) instead of being + # repeated per copy. attrs[k] applies to [attrsIdxs[k], attrsIdxs[k+1]). + cdef list run_starts = _attr_run_starts(attr_tuple) + cdef vector[cydriver.CUmemcpyAttributes] cu_attrs + cdef size_t num_attrs = <size_t>len(run_starts) + cu_attrs.reserve(num_attrs) + attrs_idxs.reserve(num_attrs) + for i in run_starts: + cu_attrs.push_back(_to_cu_memcpy_attributes(attr_tuple[i])) + attrs_idxs.push_back(<size_t>i) + + for i in range(n): + src_buf = <Buffer>src_bufs[i] + dst_buf = <Buffer>dst_bufs[i] + src_ptrs[i] = as_cu(src_buf._h_ptr) + dst_ptrs[i] = as_cu(dst_buf._h_ptr) + sizes[i] = src_buf.size + + with nogil: + HANDLE_RETURN(cydriver.cuMemcpyBatchAsync( + dst_ptrs.data(), + src_ptrs.data(), + sizes.data(), + <size_t>n, + cu_attrs.data(), + attrs_idxs.data(), + num_attrs, + hstream, + )) diff --git a/cuda_core/cuda/core/_memory/_device_memory_resource.pyi b/cuda_core/cuda/core/_memory/_device_memory_resource.pyi index 21862b32b7a..897e1d03302 100644 --- a/cuda_core/cuda/core/_memory/_device_memory_resource.pyi +++ b/cuda_core/cuda/core/_memory/_device_memory_resource.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_device_memory_resource.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_device_memory_resource.pyx import uuid from dataclasses import dataclass @@ -10,6 +8,7 @@ from cuda.core._memory._ipc import IPCAllocationHandle from cuda.core._memory._memory_pool import _MemPool from cuda.core._memory._peer_access_utils import PeerAccessibleBySetProxy +__all__ = ['DeviceMemoryResource', 'DeviceMemoryResourceOptions'] @dataclass class DeviceMemoryResourceOptions: @@ -116,16 +115,8 @@ class DeviceMemoryResource(_MemPool): descriptors from trusted peers, and do not unpickle buffers from untrusted sources. """ - - def __cinit__(self, *args, **kwargs) -> None: - ... - - def __init__(self, device_id: Device | int, options: DeviceMemoryResourceOptions | dict[str, object] | None=None) -> None: - ... - - def __reduce__(self) -> tuple[object, ...]: - ... - + def __init__(self, device_id: Device | int, options: DeviceMemoryResourceOptions | None=None) -> None: ... + def __reduce__(self) -> tuple[object, ...]: ... @staticmethod def from_registry(uuid: uuid.UUID) -> DeviceMemoryResource: """ @@ -136,7 +127,6 @@ class DeviceMemoryResource(_MemPool): RuntimeError If no mapped memory resource is found in the registry. """ - def register(self, uuid: uuid.UUID) -> DeviceMemoryResource: """ Register a mapped memory resource. @@ -146,7 +136,6 @@ class DeviceMemoryResource(_MemPool): The registered mapped memory resource. If one was previously registered with the given key, it is returned. """ - @classmethod def from_allocation_handle(cls, device_id: Device | int, alloc_handle: int | IPCAllocationHandle) -> DeviceMemoryResource: """Create a device memory resource from an allocation handle. @@ -170,7 +159,6 @@ class DeviceMemoryResource(_MemPool): ------- A new device memory resource instance with the imported handle. """ - @property def allocation_handle(self) -> IPCAllocationHandle: """Shareable handle for this memory pool (requires IPC). @@ -178,11 +166,9 @@ class DeviceMemoryResource(_MemPool): The handle can be used to share the memory pool with other processes. The handle is cached in this `MemoryResource` and owned by it. """ - @property def device_id(self) -> int: """The associated device ordinal.""" - @property def peer_accessible_by(self) -> PeerAccessibleBySetProxy: """ @@ -202,19 +188,14 @@ class DeviceMemoryResource(_MemPool): >>> dmr.peer_accessible_by.add(2) # update access to include device 2 >>> dmr.peer_accessible_by = [] # revoke peer access """ - @peer_accessible_by.setter - def peer_accessible_by(self, devices) -> None: - ... - + def peer_accessible_by(self, devices) -> None: ... @property def is_device_accessible(self) -> bool: """Return True. This memory resource provides device-accessible buffers.""" - @property def is_host_accessible(self) -> bool: """Return False. This memory resource does not provide host-accessible buffers.""" -__all__ = ['DeviceMemoryResource', 'DeviceMemoryResourceOptions'] def DMR_mempool_get_access(dmr: DeviceMemoryResource, device_id: int) -> str: """ @@ -230,6 +211,4 @@ def DMR_mempool_get_access(dmr: DeviceMemoryResource, device_id: int) -> str: str Access permissions: "rw" for read-write, "r" for read-only, "" for no access. """ - -def _deep_reduce_device_memory_resource(mr) -> tuple[object, ...]: - ... \ No newline at end of file +def _deep_reduce_device_memory_resource(mr) -> tuple[object, ...]: ... diff --git a/cuda_core/cuda/core/_memory/_device_memory_resource.pyx b/cuda_core/cuda/core/_memory/_device_memory_resource.pyx index 22b1488f638..7ff17933194 100644 --- a/cuda_core/cuda/core/_memory/_device_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_device_memory_resource.pyx @@ -148,7 +148,7 @@ cdef class DeviceMemoryResource(_MemPool): def __init__( self, device_id: Device | int, - options: DeviceMemoryResourceOptions | dict[str, object] | None = None + options: DeviceMemoryResourceOptions | None = None ) -> None: _DMR_init(self, device_id, options) @@ -321,10 +321,9 @@ cpdef str DMR_mempool_get_access(DeviceMemoryResource dmr, int device_id): cdef int dev_id = Device(device_id).device_id cdef cydriver.CUmemAccess_flags flags - cdef cydriver.CUmemLocation location = cydriver.CUmemLocation( - type=cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE, - id=dev_id, - ) + cdef cydriver.CUmemLocation location + location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + location.id = dev_id with nogil: HANDLE_RETURN(cydriver.cuMemPoolGetAccess(&flags, as_cu(dmr._h_pool), &location)) diff --git a/cuda_core/cuda/core/_memory/_graph_memory_resource.pyi b/cuda_core/cuda/core/_memory/_graph_memory_resource.pyi index b34f968fdc9..5801490f8fb 100644 --- a/cuda_core/cuda/core/_memory/_graph_memory_resource.pyi +++ b/cuda_core/cuda/core/_memory/_graph_memory_resource.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_graph_memory_resource.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_graph_memory_resource.pyx from cuda.core._device import Device from cuda.core._memory._buffer import Buffer, MemoryResource @@ -8,82 +6,59 @@ from cuda.core._stream import Stream from cuda.core.graph import GraphBuilder from cuda.core.typing import DevicePointerType +__all__ = ['GraphMemoryResource'] class GraphMemoryResourceAttributes: - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... @classmethod - def _init(cls, device_id: int) -> GraphMemoryResourceAttributes: - ... - - def __repr__(self) -> str: - ... - + def _init(cls, device_id: int) -> GraphMemoryResourceAttributes: ... + def __repr__(self) -> str: ... @property def reserved_mem_current(self) -> int: """Current amount of backing memory allocated.""" - @property def reserved_mem_high(self) -> int: """ High watermark of backing memory allocated. It can be set to zero to reset it to the current usage. """ - @reserved_mem_high.setter - def reserved_mem_high(self, value: int) -> None: - ... - + def reserved_mem_high(self, value: int) -> None: ... @property def used_mem_current(self) -> int: """Current amount of memory in use.""" - @property def used_mem_high(self) -> int: """ High watermark of memory in use. It can be set to zero to reset it to the current usage. """ - @used_mem_high.setter - def used_mem_high(self, value: int) -> None: - ... + def used_mem_high(self, value: int) -> None: ... class cyGraphMemoryResource(MemoryResource): - - def __cinit__(self, device_id: int) -> None: - ... - + def __init__(self, device_id: int) -> None: ... def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: """ Allocate a buffer of the requested size. See documentation for :obj:`~_memory.MemoryResource`. """ - def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder) -> None: """ Deallocate a buffer of the requested size. See documentation for :obj:`~_memory.MemoryResource`. """ - def close(self) -> None: """No operation (provided for compatibility).""" - def trim(self) -> None: """Free unused memory that was cached on the specified device for use with graphs back to the OS.""" - @property def attributes(self) -> GraphMemoryResourceAttributes: """Asynchronous allocation attributes related to graphs.""" - @property def device_id(self) -> int: """The associated device ordinal.""" - @property def is_device_accessible(self) -> bool: """Return True. This memory resource provides device-accessible buffers.""" - @property def is_host_accessible(self) -> bool: """Return False. This memory resource does not provide host-accessible buffers.""" @@ -106,11 +81,6 @@ class GraphMemoryResource(cyGraphMemoryResource): device_id: int | Device Device or Device ordinal for which a graph memory resource is obtained. """ - - def __new__(cls, device_id: int | Device) -> GraphMemoryResource: - ... - + def __new__(cls, device_id: int | Device) -> GraphMemoryResource: ... @classmethod - def _create(cls, device_id: int) -> GraphMemoryResource: - ... -__all__ = ['GraphMemoryResource'] \ No newline at end of file + def _create(cls, device_id: int) -> GraphMemoryResource: ... diff --git a/cuda_core/cuda/core/_memory/_graph_memory_resource.pyx b/cuda_core/cuda/core/_memory/_graph_memory_resource.pyx index e845a47b080..67ecf97f58c 100644 --- a/cuda_core/cuda/core/_memory/_graph_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_graph_memory_resource.pyx @@ -225,7 +225,7 @@ cdef inline Buffer GMR_allocate(cyGraphMemoryResource self, size_t size, Stream return Buffer_from_deviceptr_handle(h_ptr, size, self, None) -cdef inline void GMR_deallocate(intptr_t ptr, size_t size, Stream stream) noexcept: +cdef inline void GMR_deallocate(intptr_t ptr, size_t size, Stream stream) except *: cdef cydriver.CUstream s = as_cu(stream._h_stream) cdef cydriver.CUdeviceptr devptr = <cydriver.CUdeviceptr>ptr with nogil: diff --git a/cuda_core/cuda/core/_memory/_ipc.pyi b/cuda_core/cuda/core/_memory/_ipc.pyi index 0c912a567bd..d1b2324b8f4 100644 --- a/cuda_core/cuda/core/_memory/_ipc.pyi +++ b/cuda_core/cuda/core/_memory/_ipc.pyi @@ -1,41 +1,26 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_ipc.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_ipc.pyx import uuid +__all__ = [] class IPCDataForBuffer: """Data members related to sharing memory buffers via IPC.""" - - def __cinit__(self, ipc_descriptor: IPCBufferDescriptor, is_mapped: bool) -> None: - ... - + def __init__(self, ipc_descriptor: IPCBufferDescriptor, is_mapped: bool) -> None: ... @property - def ipc_descriptor(self) -> IPCBufferDescriptor: - ... - + def ipc_descriptor(self) -> IPCBufferDescriptor: ... @property - def is_mapped(self) -> bool: - ... + def is_mapped(self) -> bool: ... class IPCDataForMR: """Data members related to sharing memory resources via IPC.""" - - def __cinit__(self, alloc_handle: IPCAllocationHandle, is_mapped: bool) -> None: - ... - + def __init__(self, alloc_handle: IPCAllocationHandle, is_mapped: bool) -> None: ... @property - def alloc_handle(self) -> IPCAllocationHandle: - ... - + def alloc_handle(self) -> IPCAllocationHandle: ... @property - def is_mapped(self) -> bool: - ... - + def is_mapped(self) -> bool: ... @property - def uuid(self) -> uuid.UUID | None: - ... + def uuid(self) -> uuid.UUID | None: ... class IPCBufferDescriptor: """Serializable object describing a buffer that can be shared between processes. @@ -46,48 +31,25 @@ class IPCBufferDescriptor: Receivers must treat them as untrusted and import only through :meth:`Buffer.from_ipc_descriptor`. """ - - def __init__(self, *arg, **kwargs) -> None: - ... - + def __init__(self, *arg, **kwargs) -> None: ... @staticmethod - def _init(reserved: bytes, size: int) -> IPCBufferDescriptor: - ... - - def __reduce__(self) -> tuple[object, ...]: - ... - + def _init(reserved: bytes, size: int) -> IPCBufferDescriptor: ... + def __reduce__(self) -> tuple[object, ...]: ... @property - def size(self) -> int: - ... + def size(self) -> int: ... class IPCAllocationHandle: """Shareable handle to an IPC-enabled device memory pool.""" - + def __init__(self, *arg, **kwargs) -> None: ... + @classmethod + def _init(cls, handle: int, uuid: uuid.UUID | None) -> IPCAllocationHandle: ... def close(self): """Close the handle.""" - - def __init__(self, *arg, **kwargs) -> None: - ... - - @classmethod - def _init(cls, handle: int, uuid: uuid.UUID | None) -> IPCAllocationHandle: - ... - - def __int__(self) -> int: - ... - + def __int__(self) -> int: ... @property - def handle(self) -> int: - ... - + def handle(self) -> int: ... @property - def uuid(self) -> uuid.UUID: - ... -__all__ = ['IPCBufferDescriptor', 'IPCAllocationHandle'] - -def _reduce_allocation_handle(alloc_handle: IPCAllocationHandle) -> tuple[object, ...]: - ... + def uuid(self) -> uuid.UUID: ... -def _reconstruct_allocation_handle(cls: type, df: object, uuid: uuid.UUID | None) -> IPCAllocationHandle: - ... \ No newline at end of file +def _reduce_allocation_handle(alloc_handle: IPCAllocationHandle) -> tuple[object, ...]: ... +def _reconstruct_allocation_handle(cls: type, df: object, uuid: uuid.UUID | None) -> IPCAllocationHandle: ... diff --git a/cuda_core/cuda/core/_memory/_ipc.pyx b/cuda_core/cuda/core/_memory/_ipc.pyx index f4194b22b0e..3d676856415 100644 --- a/cuda_core/cuda/core/_memory/_ipc.pyx +++ b/cuda_core/cuda/core/_memory/_ipc.pyx @@ -268,6 +268,8 @@ cdef _MemPool MP_register(_MemPool self, uuid): existing = registry.get(uuid) if existing is not None: return existing + if not self.is_ipc_enabled: + raise RuntimeError("Memory resource is not IPC-enabled") assert self.uuid is None or self.uuid == uuid registry[uuid] = self self._ipc_data._alloc_handle._uuid = uuid diff --git a/cuda_core/cuda/core/_memory/_location.pxd b/cuda_core/cuda/core/_memory/_location.pxd new file mode 100644 index 00000000000..7cee3c6564e --- /dev/null +++ b/cuda_core/cuda/core/_memory/_location.pxd @@ -0,0 +1,38 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Conversion from the internal ``_LocSpec`` record produced by +# ``_managed_location._coerce_location`` to the driver's ``CUmemLocation``. +# +# Header-only so both the managed-memory ops and the batched copy path can +# cimport it without either module depending on the other. ``CUmemLocation`` +# is only populated on a CUDA 13 build; the CUDA 12 stub exists so callers +# compiled there still resolve the symbol. + +from cuda.bindings cimport cydriver + + +IF CUDA_CORE_BUILD_MAJOR >= 13: + cdef inline cydriver.CUmemLocation to_cumemlocation(str kind, int loc_id): + cdef cydriver.CUmemLocation cu_loc + if kind == "device": + cu_loc.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + cu_loc.id = loc_id + elif kind == "host": + cu_loc.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST + cu_loc.id = 0 + elif kind == "host_numa": + cu_loc.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA + cu_loc.id = loc_id + elif kind == "host_numa_current": + cu_loc.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT + cu_loc.id = 0 + else: + raise ValueError(f"unknown location kind: {kind!r}") + return cu_loc +ELSE: + cdef inline cydriver.CUmemLocation to_cumemlocation(str kind, int loc_id): + raise NotImplementedError( + "CUmemLocation requires cuda.core built against CUDA 13 headers" + ) diff --git a/cuda_core/cuda/core/_memory/_location.pyi b/cuda_core/cuda/core/_memory/_location.pyi new file mode 100644 index 00000000000..fa1467c3432 --- /dev/null +++ b/cuda_core/cuda/core/_memory/_location.pyi @@ -0,0 +1 @@ +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_location.pxd diff --git a/cuda_core/cuda/core/_memory/_managed_buffer.py b/cuda_core/cuda/core/_memory/_managed_buffer.py index 83a6c618864..d00c4d0ec88 100644 --- a/cuda_core/cuda/core/_memory/_managed_buffer.py +++ b/cuda_core/cuda/core/_memory/_managed_buffer.py @@ -154,6 +154,8 @@ def from_handle( size: int, mr: MemoryResource | None = None, owner: object | None = None, + *, + stream: Stream | GraphBuilder | None = None, ) -> Buffer: """Wrap an existing managed-memory pointer in a :class:`ManagedBuffer`. @@ -173,8 +175,15 @@ def from_handle( owner : object, optional An object that keeps the underlying allocation alive. ``owner`` and ``mr`` cannot both be specified. + stream : Stream | GraphBuilder, optional + Keyword-only. The stream used to order the buffer's deallocation + when ``mr`` owns the pointer. Defaults to ``default_stream()``. + Recording a default-stream token requires a CUDA context to be + current. If the buffer may be freed from a different host thread, + pass a stream other than the per-thread default stream, which + refers to a different stream on each thread. """ - return cls._init(ptr, size, mr=mr, owner=owner) + return cls._init(ptr, size, mr=mr, owner=owner, stream=stream) @property def read_mostly(self) -> bool: diff --git a/cuda_core/cuda/core/_memory/_managed_memory_ops.pyi b/cuda_core/cuda/core/_memory/_managed_memory_ops.pyi index ca29265f103..4523a39d728 100644 --- a/cuda_core/cuda/core/_memory/_managed_memory_ops.pyi +++ b/cuda_core/cuda/core/_memory/_managed_memory_ops.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_managed_memory_ops.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_managed_memory_ops.pyx from collections.abc import Sequence @@ -11,6 +9,7 @@ from cuda.core._memory._buffer import Buffer from cuda.core._stream import Stream from cuda.core._utils.cuda_utils import driver +_SINGLE_MANAGED_HINT = 'the ManagedBuffer instance method' def discard_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer]) -> None: """Discard a batch of managed-memory ranges. @@ -33,17 +32,14 @@ def discard_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer]) -> N NotImplementedError On a CUDA 12 build of ``cuda.core``. """ - def _do_single_discard_py(buf: Buffer, stream: Stream | GraphBuilder | None) -> None: """Internal: single-buffer discard for ManagedBuffer.discard().""" - def _advise_one(buf: Buffer, advice: driver.CUmem_advise, location: Device | Host | None) -> None: """Internal: apply managed-memory advice to a single buffer. Used by :class:`ManagedBuffer` property setters. Not part of the public API. """ - def prefetch_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer], locations: Device | Host | Sequence[Device | Host]) -> None: """Prefetch a batch of managed-memory ranges to target locations. @@ -67,16 +63,12 @@ def prefetch_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer], loc ``cuMemPrefetchAsync`` per buffer (no batched driver entry point on CUDA 12). CUDA 13 builds use ``cuMemPrefetchBatchAsync`` directly. """ - def _do_single_prefetch_py(buf: Buffer, location: Device | Host | None, stream: Stream | GraphBuilder | None) -> None: """Internal: single-buffer prefetch for ManagedBuffer.prefetch(). Uses cuMemPrefetchAsync (works on CUDA 12 and 13). """ - -def _read_preferred_location_v2(buf: Buffer) -> Device | Host | None: - ... - +def _read_preferred_location_v2(buf: Buffer) -> Device | Host | None: ... def discard_prefetch_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buffer], locations: Device | Host | Sequence[Device | Host]) -> None: """Discard a batch of managed-memory ranges and prefetch them to target locations. @@ -99,7 +91,6 @@ def discard_prefetch_batch(stream: Stream | GraphBuilder, buffers: Sequence[Buff NotImplementedError On a CUDA 12 build of ``cuda.core``. """ - def _do_single_discard_prefetch_py(buf: Buffer, location: Device | Host | None, stream: Stream | GraphBuilder | None) -> None: """Internal: single-buffer discard+prefetch for - ManagedBuffer.discard_prefetch().""" \ No newline at end of file + ManagedBuffer.discard_prefetch().""" diff --git a/cuda_core/cuda/core/_memory/_managed_memory_ops.pyx b/cuda_core/cuda/core/_memory/_managed_memory_ops.pyx index b2ecde29f39..6d504670f36 100644 --- a/cuda_core/cuda/core/_memory/_managed_memory_ops.pyx +++ b/cuda_core/cuda/core/_memory/_managed_memory_ops.pyx @@ -11,7 +11,11 @@ IF CUDA_CORE_BUILD_MAJOR >= 13: from libcpp.vector cimport vector from cuda.bindings cimport cydriver -from cuda.core._memory._buffer cimport Buffer +from cuda.core._memory._buffer cimport Buffer, Buffer_coerce_batch + +# to_cumemlocation is referenced only from CUDA 13 branches. cython-lint does +# not evaluate compile-time IF blocks, so it needs a pragma to be seen as used. +from cuda.core._memory._location cimport to_cumemlocation # no-cython-lint from cuda.core._resource_handles cimport as_cu from cuda.core._stream cimport Stream, Stream_accept from cuda.core._utils.cuda_utils cimport HANDLE_RETURN @@ -52,31 +56,16 @@ cdef void _require_managed_buffer(Buffer self, str what): raise ValueError(f"{what} requires a managed-memory allocation") -cdef tuple _coerce_batch_buffers(object buffers, str what): +_SINGLE_MANAGED_HINT = "the ManagedBuffer instance method" + + +cdef inline tuple _coerce_batch_buffers(object buffers, str what): """Coerce ``buffers`` to a tuple[Buffer, ...]; rejects a single Buffer. For single-buffer operations, use the corresponding ManagedBuffer instance method instead. """ - cdef Buffer buf - cdef list out - if isinstance(buffers, Buffer): - raise TypeError( - f"{what}: pass a sequence of Buffers; for a single buffer use " - f"the ManagedBuffer instance method" - ) - if isinstance(buffers, Sequence): - if not buffers: - raise ValueError(f"{what}: empty buffers sequence") - out = [] - for t in buffers: - buf = <Buffer?>t - out.append(buf) - return tuple(out) - raise TypeError( - f"{what}: buffers must be a sequence of Buffer, " - f"got {type(buffers).__name__}" - ) + return Buffer_coerce_batch(buffers, what, _SINGLE_MANAGED_HINT) cdef tuple _broadcast_locations(object location, Py_ssize_t n, bint allow_none, str what): @@ -91,27 +80,7 @@ cdef tuple _broadcast_locations(object location, Py_ssize_t n, bint allow_none, return tuple([coerced] * n) -IF CUDA_CORE_BUILD_MAJOR >= 13: - # Convert a _LocSpec dataclass to a cydriver.CUmemLocation struct. - cdef inline cydriver.CUmemLocation _to_cumemlocation(object loc): - cdef str kind = loc.kind - if kind == "device": - return cydriver.CUmemLocation( - type=cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE, - id=<int>loc.id) - elif kind == "host": - return cydriver.CUmemLocation( - type=cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST, - id=0) - elif kind == "host_numa": - return cydriver.CUmemLocation( - type=cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA, - id=<int>loc.id) - else: # host_numa_current - return cydriver.CUmemLocation( - type=cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT, - id=0) -ELSE: +IF CUDA_CORE_BUILD_MAJOR < 13: # CUDA 12 cuMemPrefetchAsync takes a device ordinal (-1 = host). cdef inline int _to_legacy_device(object loc) except? -2: cdef str kind = loc.kind @@ -224,11 +193,10 @@ cdef void _do_single_advise(Buffer buf, object advice_value, object loc, bint al # Driver ignores location for read_mostly / unset_preferred_location # advice values but still validates the CUmemLocation; pass a # host placeholder. - cu_loc = cydriver.CUmemLocation( - type=cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST, - id=0) + cu_loc.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST + cu_loc.id = 0 else: - cu_loc = _to_cumemlocation(loc) + cu_loc = to_cumemlocation(loc.kind, loc.id) with nogil: HANDLE_RETURN(cydriver.cuMemAdvise(cu_ptr, nbytes, advice_enum, cu_loc)) ELSE: @@ -292,7 +260,7 @@ cdef void _do_single_prefetch(Buffer buf, object loc, Stream s): cdef size_t nbytes = buf._size cdef cydriver.CUstream hstream = as_cu(s._h_stream) IF CUDA_CORE_BUILD_MAJOR >= 13: - cdef cydriver.CUmemLocation cu_loc = _to_cumemlocation(loc) + cdef cydriver.CUmemLocation cu_loc = to_cumemlocation(loc.kind, loc.id) with nogil: HANDLE_RETURN(cydriver.cuMemPrefetchAsync(cu_ptr, nbytes, cu_loc, 0, hstream)) ELSE: @@ -361,11 +329,13 @@ IF CUDA_CORE_BUILD_MAJOR >= 13: loc_indices.resize(n) cdef Buffer buf cdef Py_ssize_t i + cdef object loc_spec for i in range(n): buf = <Buffer>bufs[i] ptrs[i] = as_cu(buf._h_ptr) sizes[i] = buf._size - loc_arr[i] = _to_cumemlocation(locs[i]) + loc_spec = locs[i] + loc_arr[i] = to_cumemlocation(loc_spec.kind, loc_spec.id) loc_indices[i] = <size_t>i with nogil: HANDLE_RETURN(fn( diff --git a/cuda_core/cuda/core/_memory/_managed_memory_resource.pyi b/cuda_core/cuda/core/_memory/_managed_memory_resource.pyi index 7f3f584e5ca..44523ae0f53 100644 --- a/cuda_core/cuda/core/_memory/_managed_memory_resource.pyi +++ b/cuda_core/cuda/core/_memory/_managed_memory_resource.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_managed_memory_resource.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_managed_memory_resource.pyx from dataclasses import dataclass @@ -10,6 +8,7 @@ from cuda.core._stream import Stream from cuda.core.graph import GraphBuilder from cuda.core.typing import ManagedMemoryLocationType +__all__ = ['ManagedMemoryResource', 'ManagedMemoryResourceOptions'] @dataclass class ManagedMemoryResourceOptions: @@ -76,10 +75,7 @@ class ManagedMemoryResource(_MemPool): IPC (Inter-Process Communication) is not currently supported for managed memory pools. """ - - def __init__(self, options: ManagedMemoryResourceOptions | dict[str, object] | None=None) -> None: - ... - + def __init__(self, options: ManagedMemoryResourceOptions | None=None) -> None: ... def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> ManagedBuffer: """Allocate a managed-memory buffer of the requested size. @@ -101,11 +97,9 @@ class ManagedMemoryResource(_MemPool): and instance methods (``prefetch``, ``discard``, ``discard_prefetch``). """ - @property def device_id(self) -> int: """The preferred device ordinal, or -1 if the preferred location is not a device.""" - @property def preferred_location(self) -> tuple[ManagedMemoryLocationType, int | None] | None: """The preferred location for managed memory allocations. @@ -115,19 +109,15 @@ class ManagedMemoryResource(_MemPool): ``"host"``, or ``"host_numa"``, and *id* is the device ordinal, ``None`` (for ``"host"``), or the NUMA node ID, respectively. """ - @property def is_device_accessible(self) -> bool: """Return True. This memory resource provides device-accessible buffers.""" - @property def is_host_accessible(self) -> bool: """Return True. This memory resource provides host-accessible buffers.""" - @property def is_managed(self) -> bool: """Return True. This memory resource provides managed (unified) memory buffers.""" -__all__ = ['ManagedMemoryResource', 'ManagedMemoryResourceOptions'] def reset_concurrent_access_warning() -> None: - """Reset the concurrent access warning flag for testing purposes.""" \ No newline at end of file + """Reset the concurrent access warning flag for testing purposes.""" diff --git a/cuda_core/cuda/core/_memory/_managed_memory_resource.pyx b/cuda_core/cuda/core/_memory/_managed_memory_resource.pyx index d5a637a7b50..152770568aa 100644 --- a/cuda_core/cuda/core/_memory/_managed_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_managed_memory_resource.pyx @@ -97,7 +97,7 @@ cdef class ManagedMemoryResource(_MemPool): memory pools. """ - def __init__(self, options: ManagedMemoryResourceOptions | dict[str, object] | None = None) -> None: + def __init__(self, options: ManagedMemoryResourceOptions | None = None) -> None: _MMR_init(self, options) def allocate(self, size_t size, *, stream: Stream | GraphBuilder) -> ManagedBuffer: diff --git a/cuda_core/cuda/core/_memory/_memory_pool.pyi b/cuda_core/cuda/core/_memory/_memory_pool.pyi index 7f8c64aedda..70189ee5413 100644 --- a/cuda_core/cuda/core/_memory/_memory_pool.pyi +++ b/cuda_core/cuda/core/_memory/_memory_pool.pyi @@ -1,10 +1,7 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_memory_pool.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_memory_pool.pyx import uuid -import cython from cuda.core._memory._buffer import Buffer, MemoryResource from cuda.core._stream import Stream from cuda.core.graph import GraphBuilder @@ -13,56 +10,40 @@ from cuda.core.typing import DevicePointerType class _MemPoolAttributes: """Provides access to memory pool attributes.""" - - def __init__(self, *args, **kwargs) -> None: - ... - - def __repr__(self) -> str: - ... - + def __init__(self, *args, **kwargs) -> None: ... + def __repr__(self) -> str: ... @property def reuse_follow_event_dependencies(self) -> bool: """Allow memory to be reused when there are event dependencies between streams.""" - @property def reuse_allow_opportunistic(self) -> bool: """Allow reuse of completed frees without dependencies.""" - @property def reuse_allow_internal_dependencies(self) -> bool: """Allow insertion of new stream dependencies for memory reuse.""" - @property def release_threshold(self) -> int: """Amount of reserved memory to hold before OS release.""" - @property def reserved_mem_current(self) -> int: """Current amount of backing memory allocated.""" - @property def reserved_mem_high(self) -> int: """High watermark of backing memory allocated.""" - @property def used_mem_current(self) -> int: """Current amount of memory in use.""" - @property def used_mem_high(self) -> int: """High watermark of memory in use.""" class _MemPool(MemoryResource): - - def __cinit__(self) -> None: - ... - + def __init__(self) -> None: ... def close(self) -> None: """ Close the memory resource and destroy the associated memory pool if owned. """ - def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: """Allocate a buffer of the requested size. @@ -81,7 +62,6 @@ class _MemPool(MemoryResource): The allocated buffer object, which is accessible on the device that this memory resource was created for. """ - def deallocate(self, ptr: DevicePointerType, size: int, *, stream: Stream | GraphBuilder) -> None: """Deallocate a buffer previously allocated by this resource. @@ -96,34 +76,27 @@ class _MemPool(MemoryResource): asynchronously. Must be passed explicitly; pass ``device.default_stream`` to use the default stream. """ - @property - @cython.critical_section def attributes(self) -> _MemPoolAttributes: """Memory pool attributes.""" - @property def handle(self) -> object: """Handle to the underlying memory pool.""" - @property def is_handle_owned(self) -> bool: """Whether the memory resource handle is owned. If False, ``close`` has no effect.""" - @property def is_ipc_enabled(self) -> bool: """Whether this memory resource has IPC enabled.""" - @property def is_mapped(self) -> bool: """ Whether this is a mapping of an IPC-enabled memory resource from another process. If True, allocation is not permitted. """ - @property def uuid(self) -> uuid.UUID | None: """ A universally unique identifier for this memory resource. Meaningful only for IPC-enabled memory resources. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/_memory/_memory_pool.pyx b/cuda_core/cuda/core/_memory/_memory_pool.pyx index 8f9a4354b84..988c3ab532b 100644 --- a/cuda_core/cuda/core/_memory/_memory_pool.pyx +++ b/cuda_core/cuda/core/_memory/_memory_pool.pyx @@ -279,8 +279,9 @@ cdef int MP_init_current_pool( """ IF CUDA_CORE_BUILD_MAJOR >= 13: cdef cydriver.CUmemoryPool pool - cdef cydriver.CUmemLocation loc = cydriver.CUmemLocation( - type=loc_type, id=loc_id) + cdef cydriver.CUmemLocation loc + loc.type = loc_type + loc.id = loc_id with nogil: HANDLE_RETURN(cydriver.cuMemGetMemPool(&pool, &loc, alloc_type)) self._h_pool = create_mempool_handle_ref(pool) @@ -347,14 +348,11 @@ cdef Buffer _MP_allocate(_MemPool self, size_t size, Stream stream, type cls = B cdef inline void _MP_deallocate( _MemPool self, uintptr_t ptr, size_t size, Stream stream -) noexcept nogil: +) except *: cdef cydriver.CUstream s = as_cu(stream._h_stream) cdef cydriver.CUdeviceptr devptr = <cydriver.CUdeviceptr>ptr - cdef cydriver.CUresult r with nogil: - r = cydriver.cuMemFreeAsync(devptr, s) - if r != cydriver.CUDA_ERROR_INVALID_CONTEXT: - HANDLE_RETURN(r) + HANDLE_RETURN(cydriver.cuMemFreeAsync(devptr, s)) cdef inline _MP_close(_MemPool self): diff --git a/cuda_core/cuda/core/_memory/_peer_access_utils.pyi b/cuda_core/cuda/core/_memory/_peer_access_utils.pyi index fa2b5c490a4..2c38debd2de 100644 --- a/cuda_core/cuda/core/_memory/_peer_access_utils.pyi +++ b/cuda_core/cuda/core/_memory/_peer_access_utils.pyi @@ -1,10 +1,8 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_peer_access_utils.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_peer_access_utils.pyx -from __future__ import annotations - -from collections.abc import Callable, Iterable, Iterator, Set +from collections.abc import Iterable, Iterator, Set from dataclasses import dataclass -from typing import Any +from typing import Any, Callable from cuda.core._device import Device from cuda.core._memory._device_memory_resource import DeviceMemoryResource @@ -35,60 +33,33 @@ class PeerAccessibleBySetProxy: is updated, so coalescing into a single driver call lets the toolkit handle the mappings in parallel. """ - __slots__ = ('_mr',) - - def __init__(self, mr: DeviceMemoryResource) -> None: - ... + __slots__ = '_mr' + def __init__(self, mr: DeviceMemoryResource) -> None: ... @classmethod - def _from_iterable(cls, it: Iterable[Device]) -> set[Device]: - ... - - def __contains__(self, value: object) -> bool: - ... - - def __iter__(self) -> Iterator[Device]: - ... - - def __len__(self) -> int: - ... - + def _from_iterable(cls, it: Iterable[Device]) -> set[Device]: ... + def __contains__(self, value: object) -> bool: ... + def __iter__(self) -> Iterator[Device]: ... + def __len__(self) -> int: ... def add(self, value: Device | int) -> None: """Grant peer access from ``value`` to allocations in this pool.""" - def discard(self, value: Device | int) -> None: """Revoke peer access from ``value`` to allocations in this pool.""" - def clear(self) -> None: """Revoke all peer access in a single driver call.""" - def update(self, *others: Iterable[Device | int]) -> None: """Grant peer access to every device in ``others`` in one driver call.""" - def difference_update(self, *others: Iterable[Device | int]) -> None: """Revoke peer access for every device in ``others`` in one driver call.""" - def intersection_update(self, *others: Iterable[Device | int]) -> None: """Restrict peer access to the intersection in a single driver call.""" - def symmetric_difference_update(self, other: Iterable[Device | int]) -> None: """Toggle peer access for every device in ``other`` in one driver call.""" - - def __ior__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: - ... - - def __iand__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: - ... - - def __isub__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: - ... - - def __ixor__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: - ... - - def __repr__(self) -> str: - ... - + def __ior__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: ... + def __iand__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: ... + def __isub__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: ... + def __ixor__(self, other: Set[Any]) -> PeerAccessibleBySetProxy: ... + def __repr__(self) -> str: ... def _apply(self, additions, removals) -> None: """Compute the diff and issue a single ``cuMemPoolSetAccess``. @@ -98,24 +69,12 @@ class PeerAccessibleBySetProxy: removals bypass that check (revoking is always permitted). """ -def replace_peer_accessible_by(mr: DeviceMemoryResource, devices: object) -> None: - """Replace the full peer-access set in a single batched driver call. - - Backs the ``mr.peer_accessible_by = [...]`` setter. Uses the same planner - as the proxy's bulk ops; the only difference is that adds and removes are - derived from the symmetric difference between current driver state and the - requested target set. - """ - def normalize_peer_access_targets(owner_device_id: int, requested_devices: Iterable[object], *, resolve_device_id: Callable[[object], int]) -> tuple[int, ...]: """Return sorted, unique peer device IDs, excluding the owner device.""" - def plan_peer_access_update(owner_device_id: int, current_peer_ids: Iterable[int], requested_devices: Iterable[object], *, resolve_device_id: Callable[[object], int], can_access_peer: Callable[[int], bool]) -> PeerAccessPlan: """Compute the peer-access target state and add/remove deltas.""" - def _resolve_peer_device_id(value: Device | int | None) -> int: """Coerce ``Device | int`` into a device-ordinal int.""" - def _set_pool_access(mr: object, to_add: tuple[int, ...], to_remove: tuple[int, ...]) -> None: """Issue one ``cuMemPoolSetAccess`` for the given add/remove deltas. @@ -127,7 +86,6 @@ def _set_pool_access(mr: object, to_add: tuple[int, ...], to_remove: tuple[int, Preconditions: ``len(to_add) + len(to_remove) > 0`` (the caller is responsible for skipping empty diffs). """ - def _apply_peer_access_diff(mr: DeviceMemoryResource, to_add: Iterable[int], to_remove: Iterable[int]) -> None: """Apply a peer-access diff in at most one driver call. @@ -135,4 +93,12 @@ def _apply_peer_access_diff(mr: DeviceMemoryResource, to_add: Iterable[int], to_ ``peer_accessible_by`` setter routes through this function. Empty diffs short-circuit here so the driver-level helper :func:`_set_pool_access` is only invoked when there is actual work for ``cuMemPoolSetAccess`` to do. - """ \ No newline at end of file + """ +def replace_peer_accessible_by(mr: DeviceMemoryResource, devices: object) -> None: + """Replace the full peer-access set in a single batched driver call. + + Backs the ``mr.peer_accessible_by = [...]`` setter. Uses the same planner + as the proxy's bulk ops; the only difference is that adds and removes are + derived from the symmetric difference between current driver state and the + requested target set. + """ diff --git a/cuda_core/cuda/core/_memory/_peer_access_utils.pyx b/cuda_core/cuda/core/_memory/_peer_access_utils.pyx index 69d59f9e005..b39a1838f79 100644 --- a/cuda_core/cuda/core/_memory/_peer_access_utils.pyx +++ b/cuda_core/cuda/core/_memory/_peer_access_utils.pyx @@ -113,10 +113,9 @@ cdef inline tuple _query_peer_access_ids(DeviceMemoryResource mr): cdef inline bint _peer_access_includes(DeviceMemoryResource mr, int dev_id): """Return True if peer access from ``dev_id`` is currently granted.""" cdef cydriver.CUmemAccess_flags flags - cdef cydriver.CUmemLocation location = cydriver.CUmemLocation( - type=cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE, - id=dev_id, - ) + cdef cydriver.CUmemLocation location + location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + location.id = dev_id with nogil: HANDLE_RETURN(cydriver.cuMemPoolGetAccess(&flags, as_cu(mr._h_pool), &location)) return flags == cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE diff --git a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyi b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyi index a83cd8ea581..76a7010dbc4 100644 --- a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyi +++ b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyi @@ -1,13 +1,15 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx import uuid from dataclasses import dataclass +from cuda.core._memory._buffer import Buffer from cuda.core._memory._ipc import IPCAllocationHandle from cuda.core._memory._memory_pool import _MemPool +from cuda.core._stream import Stream +from cuda.core.graph import GraphBuilder +__all__ = ['PinnedMemoryResource', 'PinnedMemoryResourceOptions'] @dataclass class PinnedMemoryResourceOptions: @@ -63,6 +65,14 @@ class PinnedMemoryResource(_MemPool): Notes ----- + The device associated with ``stream`` must support host memory pools. If + ``numa_id`` is set or derived for IPC, it must support host NUMA memory pools. + You can query these capabilities through + ``Device.properties.host_memory_pools_supported`` and + ``Device.properties.host_numa_memory_pools_supported``. If the required pool + is unsupported and stream-ordered allocation is not needed, use + :class:`LegacyPinnedMemoryResource`. + To create an IPC-Enabled memory resource (MR) that is capable of sharing allocations between processes, specify ``ipc_enabled=True`` in the initializer option. When IPC is enabled and ``numa_id`` is not specified, the NUMA node @@ -72,13 +82,10 @@ class PinnedMemoryResource(_MemPool): See :class:`DeviceMemoryResource` for more details on IPC usage patterns. """ - - def __init__(self, options: PinnedMemoryResourceOptions | dict[str, object] | None=None) -> None: - ... - - def __reduce__(self) -> tuple[object, ...]: - ... - + def __init__(self, options: PinnedMemoryResourceOptions | None=None) -> None: ... + def allocate(self, size: int, *, stream: Stream | GraphBuilder) -> Buffer: + """Allocate a host-pinned buffer asynchronously on the supplied stream.""" + def __reduce__(self) -> tuple[object, ...]: ... @staticmethod def from_registry(uuid: uuid.UUID) -> PinnedMemoryResource: """ @@ -89,7 +96,6 @@ class PinnedMemoryResource(_MemPool): RuntimeError If no mapped memory resource is found in the registry. """ - def register(self, uuid: uuid.UUID) -> PinnedMemoryResource: """ Register a mapped memory resource. @@ -99,7 +105,6 @@ class PinnedMemoryResource(_MemPool): The registered mapped memory resource. If one was previously registered with the given key, it is returned. """ - @classmethod def from_allocation_handle(cls, alloc_handle: int | IPCAllocationHandle) -> PinnedMemoryResource: """Create a host-pinned memory resource from an allocation handle. @@ -118,7 +123,6 @@ class PinnedMemoryResource(_MemPool): ------- A new host-pinned memory resource instance with the imported handle. """ - @property def allocation_handle(self) -> IPCAllocationHandle: """Shareable handle for this memory pool (requires IPC). @@ -126,23 +130,17 @@ class PinnedMemoryResource(_MemPool): The handle can be used to share the memory pool with other processes. The handle is cached in this `MemoryResource` and owned by it. """ - @property def device_id(self) -> int: """Return -1. Pinned memory is host memory and is not associated with a specific device.""" - @property def numa_id(self) -> int: """The host NUMA node ID used for pool placement, or -1 for OS-managed placement.""" - @property def is_device_accessible(self) -> bool: """Return True. This memory resource provides device-accessible buffers.""" - @property def is_host_accessible(self) -> bool: """Return True. This memory resource provides host-accessible buffers.""" -__all__ = ['PinnedMemoryResource', 'PinnedMemoryResourceOptions'] -def _deep_reduce_pinned_memory_resource(mr: object) -> tuple[object, ...]: - ... \ No newline at end of file +def _deep_reduce_pinned_memory_resource(mr: object) -> tuple[object, ...]: ... diff --git a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx index e5f89606330..3efbf5ea325 100644 --- a/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx @@ -103,7 +103,7 @@ cdef class PinnedMemoryResource(_MemPool): See :class:`DeviceMemoryResource` for more details on IPC usage patterns. """ - def __init__(self, options: PinnedMemoryResourceOptions | dict[str, object] | None = None) -> None: + def __init__(self, options: PinnedMemoryResourceOptions | None = None) -> None: _PMR_init(self, options) def allocate(self, size_t size, *, stream: Stream | GraphBuilder) -> Buffer: diff --git a/cuda_core/cuda/core/_memory/_virtual_memory_resource.py b/cuda_core/cuda/core/_memory/_virtual_memory_resource.py index 7cd12f597a6..4a0ec1f6bf7 100644 --- a/cuda_core/cuda/core/_memory/_virtual_memory_resource.py +++ b/cuda_core/cuda/core/_memory/_virtual_memory_resource.py @@ -350,10 +350,9 @@ def _grow_allocation_fast_path( # All succeeded, cancel undo actions trans.commit() - # Update the buffer size (pointer stays the same) - # TODO: #2049 This is a real bug, accessing _size which doesn't exist. - # Fix bug and remove the "type: ignore[attr-defined]" comment. - buf._size = new_size # type: ignore[attr-defined] + # Update the buffer size (pointer stays the same). `Buffer.size` has + # no public setter, so this reaches into the private attribute. + buf._size = new_size return buf def _grow_allocation_slow_path( diff --git a/cuda_core/cuda/core/_memoryview.pyi b/cuda_core/cuda/core/_memoryview.pyi index e0ed0d3cf0d..e718be87140 100644 --- a/cuda_core/cuda/core/_memoryview.pyi +++ b/cuda_core/cuda/core/_memoryview.pyi @@ -1,10 +1,7 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_memoryview.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_memoryview.pyx import functools -from collections.abc import Callable -from typing import Any +from typing import Any, Callable, TypedDict import numpy from cuda.core._layout import _StridedLayout @@ -13,6 +10,10 @@ from cuda.core._stream import Stream from ._dlpack import * +_SMV_DLPACK_EXCHANGE_API_CAPSULE = ... + +class PyTypeObject(TypedDict): + tp_dict: None class StridedMemoryView: """A class holding metadata of a strided dense array/tensor. @@ -70,10 +71,13 @@ class StridedMemoryView: it will be the Buffer instance passed to the method. """ + ptr: int + device_id: int + is_device_accessible: bool + readonly: bool + exporting_obj: object - def __init__(self, obj: object=None, stream_ptr: int | None=None) -> None: - ... - + def __init__(self, obj: object | None=None, stream_ptr: int | None=None) -> None: ... @classmethod def from_dlpack(cls, obj: object, stream_ptr: int | None=None) -> StridedMemoryView: """Create a view from an object supporting the `DLPack <https://dmlc.github.io/dlpack/latest/>`_ protocol. @@ -86,7 +90,6 @@ class StridedMemoryView: stream_ptr : int, optional Stream pointer for synchronization. If ``None``, no synchronization is performed. """ - @classmethod def from_cuda_array_interface(cls, obj: object, stream_ptr: int | None=None) -> StridedMemoryView: """Create a view from an object supporting the `__cuda_array_interface__ <https://numba.readthedocs.io/en/stable/cuda/cuda_array_interface.html>`_ protocol. @@ -98,7 +101,6 @@ class StridedMemoryView: stream_ptr : int, optional Stream pointer for synchronization. If ``None``, no synchronization is performed. """ - @classmethod def from_array_interface(cls, obj: object) -> StridedMemoryView: """Create a view from an object supporting the `__array_interface__ <https://numpy.org/doc/stable/reference/arrays.interface.html>`_ protocol. @@ -108,7 +110,6 @@ class StridedMemoryView: obj : object An object implementing the `__array_interface__ <https://numpy.org/doc/stable/reference/arrays.interface.html>`_ protocol (e.g., a numpy array). """ - @classmethod def from_any_interface(cls, obj: object, stream_ptr: int | None=None) -> StridedMemoryView: """Create a view by automatically selecting the best available protocol. @@ -126,7 +127,6 @@ class StridedMemoryView: stream_ptr : int, optional Stream pointer for synchronization. If ``None``, no synchronization is performed. """ - @classmethod def from_buffer(cls, buffer: Buffer, shape: tuple[int, ...], strides: tuple[int, ...] | None=None, *, itemsize: int | None=None, dtype: numpy.dtype | None=None, is_readonly: bool=False) -> StridedMemoryView: """ @@ -155,17 +155,13 @@ class StridedMemoryView: is_readonly : bool, optional Whether the mark the view as readonly. """ - - def __dealloc__(self) -> None: - ... - + def __dealloc__(self) -> None: ... def view(self, layout: _StridedLayout | None=None, dtype: numpy.dtype | None=None) -> StridedMemoryView: """ Creates a new view with adjusted layout and dtype. Same as calling :meth:`from_buffer` with the current buffer. """ - - def as_tensor_map(self, box_dim: tuple[int, ...] | None=None, *, options: object=None, element_strides: tuple[int, ...] | None=None, data_type: object=None, interleave: object=None, swizzle: object=None, l2_promotion: object=None, oob_fill: object=None) -> object: + def as_tensor_map(self, box_dim: tuple[int, ...] | None=None, *, options: object | None=None, element_strides: tuple[int, ...] | None=None, data_type: object | None=None, interleave: object | None=None, swizzle: object | None=None, l2_promotion: object | None=None, oob_fill: object | None=None) -> object: """Create a tiled :obj:`TensorMapDescriptor` from this view. This is the public entry point for creating tiled tensor map @@ -173,8 +169,7 @@ class StridedMemoryView: individual keyword arguments directly, or provide bundled tiled options via ``options=``. """ - - def copy_from(self, other: StridedMemoryView, stream: Stream, allocator: object=None, blocking: bool | None=None) -> None: + def copy_from(self, other: StridedMemoryView, stream: Stream, allocator: object | None=None, blocking: bool | None=None) -> None: """ Copies the data from the other view into this view. @@ -202,43 +197,32 @@ class StridedMemoryView: * for device-to-device, it defaults to ``False`` (non-blocking), * for host-to-device or device-to-host, it defaults to ``True`` (blocking). """ - - def copy_to(self, other: StridedMemoryView, stream: Stream | None=None, allocator: object=None, blocking: bool | None=None) -> None: + def copy_to(self, other: StridedMemoryView, stream: Stream | None=None, allocator: object | None=None, blocking: bool | None=None) -> None: """ Copies the data from this view into the ``other`` view. For details, see :meth:`copy_from`. """ - - def __dlpack__(self, *, stream: int | None=None, max_version: tuple[int, int] | None=None, dl_device: tuple[int, int] | None=None, copy: bool | None=None) -> object: - ... - - def __dlpack_device__(self) -> tuple[int, int]: - ... - + def __dlpack__(self, *, stream: int | None=None, max_version: tuple[int, int] | None=None, dl_device: tuple[int, int] | None=None, copy: bool | None=None) -> object: ... + def __dlpack_device__(self) -> tuple[int, int]: ... @property def _layout(self) -> _StridedLayout: """ The layout of the tensor. For StridedMemoryView created from DLPack or CAI, the layout is inferred from the tensor object's metadata. """ - @property - def size(self) -> int: - ... - + def size(self) -> int: ... @property def shape(self) -> tuple[int, ...]: """ Shape of the tensor. """ - @property def strides(self) -> tuple[int, ...] | None: """ Strides of the tensor (in **counts**, not bytes). """ - @property def dtype(self) -> numpy.dtype | None: """ @@ -249,33 +233,21 @@ class StridedMemoryView: installed. If ``ml_dtypes`` is not available and such a tensor is encountered, a :obj:`NotImplementedError` will be raised. """ - - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class _StridedMemoryViewProxy: + obj: object + has_dlpack: bool - def view(self, stream_ptr=None) -> StridedMemoryView: - ... - - def __init__(self, obj: object) -> None: - ... -_SMV_DLPACK_EXCHANGE_API_CAPSULE = ... - -def view_as_cai(obj, stream_ptr, view=None) -> StridedMemoryView: - ... - -def view_as_array_interface(obj, view=None) -> StridedMemoryView: - ... + def __init__(self, obj: object) -> None: ... + def view(self, stream_ptr=None) -> StridedMemoryView: ... @functools.lru_cache -def _typestr2dtype(typestr: str) -> numpy.dtype: - ... - +def _typestr2dtype(typestr: str) -> numpy.dtype: ... @functools.lru_cache -def _typestr2itemsize(typestr: str) -> int: - ... - +def _typestr2itemsize(typestr: str) -> int: ... +def view_as_cai(obj, stream_ptr, view=None) -> StridedMemoryView: ... +def view_as_array_interface(obj, view=None) -> StridedMemoryView: ... def args_viewable_as_strided_memory(arg_indices: tuple[int, ...]) -> Callable[[Callable[..., Any]], Callable[..., Any]]: """ Decorator to create proxy objects to :obj:`StridedMemoryView` for the @@ -304,4 +276,4 @@ def args_viewable_as_strided_memory(arg_indices: tuple[int, ...]) -> Callable[[C ---------- arg_indices : tuple The indices of the target positional arguments. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/_module.pyi b/cuda_core/cuda/core/_module.pyi index f51b4cb2817..9fb502920ad 100644 --- a/cuda_core/cuda/core/_module.pyi +++ b/cuda_core/cuda/core/_module.pyi @@ -1,16 +1,15 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_module.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_module.pyx -from __future__ import annotations - -from collections import namedtuple from os import PathLike +from typing import Any -import cython from cuda.core._device import Device from cuda.core._launch_config import LaunchConfig from cuda.core._stream import Stream from cuda.core._utils.cuda_utils import driver +__all__ = ['Kernel', 'ObjectCode'] +CodeTypeT = bytes | bytearray | str class KernelAttributes: """Read-only view of a kernel's per-device attributes. @@ -22,10 +21,7 @@ class KernelAttributes: views share the underlying cache so a value queried through one view is visible through the others. """ - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... def __getitem__(self, device: Device | int) -> KernelAttributes: """Return a view of these attributes bound to a specific device. @@ -41,77 +37,61 @@ class KernelAttributes: A view bound to ``device`` that shares the underlying cache with this view. """ - @property def max_threads_per_block(self) -> int: """int : The maximum number of threads per block. This attribute is read-only.""" - @property def shared_size_bytes(self) -> int: """int : The size in bytes of statically-allocated shared memory required by this function. This attribute is read-only.""" - @property def const_size_bytes(self) -> int: """int : The size in bytes of user-allocated constant memory required by this function. This attribute is read-only.""" - @property def local_size_bytes(self) -> int: """int : The size in bytes of local memory used by each thread of this function. This attribute is read-only.""" - @property def num_regs(self) -> int: """int : The number of registers used by each thread of this function. This attribute is read-only.""" - @property def ptx_version(self) -> int: """int : The PTX virtual architecture version for which the function was compiled. This attribute is read-only.""" - @property def binary_version(self) -> int: """int : The binary architecture version for which the function was compiled. This attribute is read-only.""" - @property def cache_mode_ca(self) -> bool: """bool : Whether the function has been compiled with user specified option "-Xptxas --dlcm=ca" set. This attribute is read-only.""" - @property def max_dynamic_shared_size_bytes(self) -> int: """int : The maximum size in bytes of dynamically-allocated shared memory that can be used by this function.""" - @property def preferred_shared_memory_carveout(self) -> int: """int : The shared memory carveout preference, in percent of the total shared memory.""" - @property def cluster_size_must_be_set(self) -> bool: """bool : The kernel must launch with a valid cluster size specified. This attribute is read-only.""" - @property def required_cluster_width(self) -> int: """int : The required cluster width in blocks.""" - @property def required_cluster_height(self) -> int: """int : The required cluster height in blocks.""" - @property def required_cluster_depth(self) -> int: """int : The required cluster depth in blocks.""" - @property def non_portable_cluster_size_allowed(self) -> bool: """bool : Whether the function can be launched with non-portable cluster size.""" - @property def cluster_scheduling_policy_preference(self) -> int: """int : The block scheduling policy of a function.""" @@ -120,10 +100,7 @@ class KernelOccupancy: """This class offers methods to query occupancy metrics that help determine optimal launch parameters such as block size, grid size, and shared memory usage. """ - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... def max_active_blocks_per_multiprocessor(self, block_size: int, dynamic_shared_memory_size: int) -> int: """Occupancy of the kernel. @@ -149,8 +126,7 @@ class KernelOccupancy: theoretical multiprocessor utilization (occupancy). """ - - def max_potential_block_size(self, dynamic_shared_memory_needed: int | driver.CUoccupancyB2DSize, block_size_limit: int) -> MaxPotentialBlockSizeOccupancyResult: + def max_potential_block_size(self, dynamic_shared_memory_needed: int | driver.CUoccupancyB2DSize, block_size_limit: int) -> Any: """MaxPotentialBlockSizeOccupancyResult: Suggested launch configuration for reasonable occupancy. Returns the minimum grid size needed to achieve the maximum occupancy and @@ -158,7 +134,7 @@ class KernelOccupancy: Parameters ---------- - dynamic_shared_memory_needed: Union[int, driver.CUoccupancyB2DSize] + dynamic_shared_memory_needed: int | driver.CUoccupancyB2DSize The amount of dynamic shared memory in bytes needed by block. Use `0` if block does not need shared memory. Use C-callable represented by :obj:`~driver.CUoccupancyB2DSize` to encode @@ -180,7 +156,6 @@ class KernelOccupancy: Interpreter Lock may lead to deadlocks. """ - def available_dynamic_shared_memory_per_block(self, num_blocks_per_multiprocessor: int, block_size: int) -> int: """Dynamic shared memory available per block for given launch configuration. @@ -198,7 +173,6 @@ class KernelOccupancy: int Dynamic shared memory available per block for given launch configuration. """ - def max_potential_cluster_size(self, config: LaunchConfig, *, stream: Stream) -> int: """Maximum potential cluster size. @@ -218,7 +192,6 @@ class KernelOccupancy: int The maximum cluster size that can be launched for this kernel and launch configuration. """ - def max_active_clusters(self, config: LaunchConfig, *, stream: Stream) -> int: """Maximum number of active clusters on the target device. @@ -249,28 +222,19 @@ class Kernel: should instead be created through a :obj:`~_module.ObjectCode` object. """ - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... @property - @cython.critical_section def attributes(self) -> KernelAttributes: """Get the read-only attributes of this kernel.""" - @property def num_arguments(self) -> int: """int : The number of arguments of this function""" - @property - def arguments_info(self) -> list[ParamInfo]: + def arguments_info(self) -> list[Any]: """list[ParamInfo]: (offset, size) for each argument of this function""" - @property - @cython.critical_section def occupancy(self) -> KernelOccupancy: """Get the occupancy information for launching this kernel.""" - @property def handle(self) -> object: """Return the underlying kernel handle object. @@ -280,11 +244,8 @@ class Kernel: This handle is a Python object. To get the memory address of the underlying C handle, call ``int(Kernel.handle)``. """ - @property - def _handle(self) -> object: - ... - + def _handle(self) -> object: ... @staticmethod def from_handle(handle, mod: ObjectCode | None=None) -> Kernel: """Creates a new :obj:`Kernel` object from a kernel handle. @@ -299,15 +260,9 @@ class Kernel: library lifetime for foreign kernels not created by cuda.core. """ - - def __eq__(self, other: object) -> bool: - ... - - def __hash__(self) -> int: - ... - - def __repr__(self) -> str: - ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... class ObjectCode: """Represent a compiled program to be loaded onto the device. @@ -322,127 +277,112 @@ class ObjectCode: from all other possible code types should be avoided in favor of compilation through :class:`~cuda.core.Program` """ - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... @classmethod - def _init(cls, module, code_type, *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: - ... - + def _init(cls, module, code_type, *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: ... @staticmethod - def _reduce_helper(module, code_type, name, symbol_mapping): - ... - - def __reduce__(self) -> tuple[object, ...]: - ... - + def _reduce_helper(module, code_type, name, symbol_mapping): ... + def __reduce__(self) -> tuple[object, ...]: ... @staticmethod def from_cubin(module: bytes | str | PathLike[str], *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing cubin. Parameters ---------- - module : Union[bytes, str, os.PathLike] + module : bytes | str | os.PathLike Either a bytes object containing the in-memory cubin to load, or a file path object (or its string representation) pointing to the on-disk cubin to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - @staticmethod def from_ptx(module: bytes | str | PathLike[str], *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing PTX. Parameters ---------- - module : Union[bytes, str, os.PathLike] + module : bytes | str | os.PathLike Either a bytes object containing the in-memory ptx code to load, or a file path object (or its string representation) pointing to the on-disk ptx file to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - @staticmethod def from_ltoir(module: bytes | str | PathLike[str], *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing LTOIR. Parameters ---------- - module : Union[bytes, str, os.PathLike] + module : bytes | str | os.PathLike Either a bytes object containing the in-memory ltoir code to load, or a file path object (or its string representation) pointing to the on-disk ltoir file to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - @staticmethod def from_fatbin(module: bytes | str | PathLike[str], *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing fatbin. Parameters ---------- - module : Union[bytes, str, os.PathLike] + module : bytes | str | os.PathLike Either a bytes object containing the in-memory fatbin to load, or or a file path object (or its string representation) pointing to the on-disk fatbin to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - @staticmethod def from_object(module: bytes | str, *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing object code. Parameters ---------- - module : Union[bytes, str] + module : bytes | str Either a bytes object containing the in-memory object code to load, or a file path string pointing to the on-disk object code to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - @staticmethod def from_library(module: bytes | str, *, name: str='', symbol_mapping: dict[str, str] | None=None) -> ObjectCode: """Create an :class:`ObjectCode` instance from an existing library. Parameters ---------- - module : Union[bytes, str] + module : bytes | str Either a bytes object containing the in-memory library to load, or a file path string pointing to the on-disk library to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). """ - def get_kernel(self, name: str | bytes) -> Kernel: """Return the :obj:`~_module.Kernel` of a specified name from this object code. @@ -457,8 +397,7 @@ class ObjectCode: Newly created kernel object. """ - - def get_module(self) -> object: + def get_module(self) -> driver.CUmodule: """Return a context-dependent :obj:`~driver.CUmodule` for legacy interop. Bridges the native :obj:`~driver.CUlibrary` (see :attr:`handle`) to a @@ -471,23 +410,18 @@ class ObjectCode: Module handle for the current CUDA context, suitable for legacy driver APIs that accept ``CUmodule``. """ - @property def code(self) -> CodeTypeT: """Return the underlying code object.""" - @property def name(self) -> str: """Return a human-readable name of this code object.""" - @property def code_type(self) -> str: """Return the type of the underlying code object.""" - @property def symbol_mapping(self) -> dict[str, str]: """Return a copy of the symbol mapping dictionary.""" - @property def handle(self) -> object: """Return the native, context-independent :obj:`~driver.CUlibrary` handle. @@ -500,16 +434,6 @@ class ObjectCode: This handle is a Python object. To get the memory address of the underlying C handle, call ``int(ObjectCode.handle)``. """ - - def __eq__(self, other: object) -> bool: - ... - - def __hash__(self) -> int: - ... - - def __repr__(self) -> str: - ... -__all__ = ['Kernel', 'ObjectCode'] -MaxPotentialBlockSizeOccupancyResult = namedtuple('MaxPotentialBlockSizeOccupancyResult', ('min_grid_size', 'max_block_size')) -ParamInfo = namedtuple('ParamInfo', ['offset', 'size']) -CodeTypeT = bytes | bytearray | str \ No newline at end of file + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __repr__(self) -> str: ... diff --git a/cuda_core/cuda/core/_module.pyx b/cuda_core/cuda/core/_module.pyx index 95e149065bf..a350f14887f 100644 --- a/cuda_core/cuda/core/_module.pyx +++ b/cuda_core/cuda/core/_module.pyx @@ -300,7 +300,7 @@ cdef class KernelOccupancy: Parameters ---------- - dynamic_shared_memory_needed: Union[int, driver.CUoccupancyB2DSize] + dynamic_shared_memory_needed: int | driver.CUoccupancyB2DSize The amount of dynamic shared memory in bytes needed by block. Use `0` if block does not need shared memory. Use C-callable represented by :obj:`~driver.CUoccupancyB2DSize` to encode @@ -669,13 +669,13 @@ cdef class ObjectCode: Parameters ---------- - module : Union[bytes, str, os.PathLike] + module : bytes | str | os.PathLike Either a bytes object containing the in-memory cubin to load, or a file path object (or its string representation) pointing to the on-disk cubin to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). @@ -688,13 +688,13 @@ cdef class ObjectCode: Parameters ---------- - module : Union[bytes, str, os.PathLike] + module : bytes | str | os.PathLike Either a bytes object containing the in-memory ptx code to load, or a file path object (or its string representation) pointing to the on-disk ptx file to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). @@ -707,13 +707,13 @@ cdef class ObjectCode: Parameters ---------- - module : Union[bytes, str, os.PathLike] + module : bytes | str | os.PathLike Either a bytes object containing the in-memory ltoir code to load, or a file path object (or its string representation) pointing to the on-disk ltoir file to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). @@ -726,13 +726,13 @@ cdef class ObjectCode: Parameters ---------- - module : Union[bytes, str, os.PathLike] + module : bytes | str | os.PathLike Either a bytes object containing the in-memory fatbin to load, or or a file path object (or its string representation) pointing to the on-disk fatbin to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). @@ -745,12 +745,12 @@ cdef class ObjectCode: Parameters ---------- - module : Union[bytes, str] + module : bytes | str Either a bytes object containing the in-memory object code to load, or a file path string pointing to the on-disk object code to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). @@ -763,12 +763,12 @@ cdef class ObjectCode: Parameters ---------- - module : Union[bytes, str] + module : bytes | str Either a bytes object containing the in-memory library to load, or a file path string pointing to the on-disk library to load. - name : Optional[str] + name : str | None A human-readable identifier representing this code object. - symbol_mapping : Optional[dict] + symbol_mapping : dict | None A dictionary specifying how the unmangled symbol names (as keys) should be mapped to the mangled names before trying to retrieve them (default to no mappings). diff --git a/cuda_core/cuda/core/_program.pyi b/cuda_core/cuda/core/_program.pyi index df7ed66446a..40d2f6c7dee 100644 --- a/cuda_core/cuda/core/_program.pyi +++ b/cuda_core/cuda/core/_program.pyi @@ -1,12 +1,10 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_program.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_program.pyx """Compilation machinery for CUDA programs. This module provides :class:`Program` for compiling source code into :class:`~cuda.core.ObjectCode`, with :class:`ProgramOptions` for configuration. """ -from __future__ import annotations - from dataclasses import dataclass from cuda.bindings import nvrtc @@ -16,6 +14,10 @@ from cuda.core.typing import (CompilerBackendType, ObjectCodeFormatType, PCHStatusType, SourceCodeType) from cuda.core.utils._program_cache import ProgramCacheResource +__all__ = ['Program', 'ProgramOptions'] +ProgramHandleT = nvrtc.nvrtcProgram | int | LinkerHandleT +_nvvm_module = None +_nvvm_import_attempted = False class Program: """Represent a compilation machinery to process programs into @@ -35,14 +37,10 @@ class Program: options : :class:`ProgramOptions`, optional Options to customize the compilation process. """ - - def __init__(self, code: str | bytes | bytearray, code_type: SourceCodeType | str, options: ProgramOptions | None=None): - ... - + def __init__(self, code: str | bytes | bytearray, code_type: SourceCodeType | str, options: ProgramOptions | None=None): ... def close(self) -> None: """Destroy this program.""" - - def compile(self, target_type: ObjectCodeFormatType | str, name_expressions: tuple[str, ...] | list[str]=..., logs: object=None, *, cache: ProgramCacheResource | None=None) -> ObjectCode: + def compile(self, target_type: ObjectCodeFormatType | str, name_expressions: tuple[str, ...] | list[str]=(), logs: object | None=None, *, cache: ProgramCacheResource | None=None) -> ObjectCode: """Compile the program to the specified target type. Parameters @@ -90,7 +88,6 @@ class Program: :class:`~cuda.core.ObjectCode` The compiled object code. """ - @property def pch_status(self) -> PCHStatusType | None: """PCH creation outcome from the most recent :meth:`compile` call. @@ -115,11 +112,9 @@ class Program: use the NVRTC backend. For PTX and NVVM programs this property always returns ``None``. """ - @property def backend(self) -> CompilerBackendType: """Return this Program instance's underlying :class:`CompilerBackendType`.""" - @property def handle(self) -> ProgramHandleT: """Return the underlying handle object. @@ -133,9 +128,7 @@ class Program: This handle is a Python object. To get the memory address of the underlying C handle, call ``int(Program.handle)``. """ - - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... @dataclass class ProgramOptions: @@ -145,6 +138,7 @@ class ProgramOptions: ---------- name : str, optional Name of the program. If the compilation succeeds, the name is passed down to the generated :class:`ObjectCode`. + When set to `None`, ``"default_program"`` is used. arch : str, optional Pass the SM architecture value, such as ``sm_<CC>`` (for generating CUBIN) or ``compute_<CC>`` (for generating PTX). If not provided, the current device's architecture @@ -165,7 +159,7 @@ class ProgramOptions: Enable device code optimization. When specified along with '-G', enables limited debug information generation for optimized device code. Default: None - ptxas_options : Union[str, list[str]], optional + ptxas_options : str | list[str], optional Specify one or more options directly to ptxas, the PTX optimizing assembler. Options should be strings. For example ["-v", "-O2"]. Default: None @@ -199,17 +193,17 @@ class ProgramOptions: gen_opt_lto : bool, optional Run the optimizer passes before generating the LTO IR. Default: False - define_macro : Union[str, tuple[str, str], list[Union[str, tuple[str, str]]]], optional + define_macro : str | tuple[str, str] | list[str | tuple[str, str]], optional Predefine a macro. Can be either a string, in which case that macro will be set to 1, a 2 element tuple of strings, in which case the first element is defined as the second, or a list of strings or tuples. Default: None - undefine_macro : Union[str, list[str]], optional + undefine_macro : str | list[str], optional Cancel any previous definition of a macro, or list of macros. Default: None - include_path : Union[str, list[str]], optional + include_path : str | list[str], optional Add the directory or directories to the list of directories to be searched for headers. Default: None - pre_include : Union[str, list[str]], optional + pre_include : str | list[str], optional Preinclude one or more headers during preprocessing. Can be either a string or a list of strings. Default: None no_source_include : bool, optional @@ -242,13 +236,13 @@ class ProgramOptions: no_display_error_number : bool, optional Disable the display of a diagnostic number for warning messages. Default: False - diag_error : Union[int, list[int]], optional + diag_error : int | list[int], optional Emit error for a specified diagnostic message number or comma-separated list of numbers. Default: None - diag_suppress : Union[int, list[int]], optional + diag_suppress : int | list[int], optional Suppress a specified diagnostic message number or comma-separated list of numbers. Default: None - diag_warn : Union[int, list[int]], optional + diag_warn : int | list[int], optional Emit warning for a specified diagnostic message number or comma-separated list of numbers. Default: None brief_diagnostics : bool, optional @@ -312,6 +306,14 @@ class ProgramOptions: Load NVIDIA's `libdevice <https://docs.nvidia.com/cuda/libdevice-users-guide/>`_ math builtins library. Only supported for the NVVM backend. Default: False + numba_debug : bool, optional + Emit the debug information layout expected by Numba. Recognized only by + newer toolkits; compilers that do not support it reject the option with + an error. Applies only to the NVVM and NVRTC compilation backends -- + ``code_type="ptx"`` is processed by the linker, which cannot honor it, + so enabling this option there emits a :class:`UserWarning` and the + option is ignored. + Default: None """ name: str | None = 'default_program' arch: str | None = None @@ -368,15 +370,9 @@ class ProgramOptions: use_libdevice: bool | None = None numba_debug: bool | None = None - def __post_init__(self) -> None: - ... - - def _prepare_nvrtc_options(self) -> list[bytes]: - ... - - def _prepare_nvvm_options(self, as_bytes: bool=True) -> list[bytes] | list[str]: - ... - + def __post_init__(self) -> None: ... + def _prepare_nvrtc_options(self) -> list[bytes]: ... + def _prepare_nvvm_options(self, as_bytes: bool=True) -> list[bytes] | list[str]: ... def as_bytes(self, backend: CompilerBackendType | str, target_type: ObjectCodeFormatType | str | None=None) -> list[bytes]: """Convert program options to bytes format for the specified backend. @@ -409,19 +405,9 @@ class ProgramOptions: >>> options = ProgramOptions(arch="sm_80", debug=True) >>> nvrtc_options = options.as_bytes("nvrtc") """ - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... def _prepare_extra_sources_bytes(self) -> list[tuple[bytes, bytes]] | None: """Convert extra_sources to bytes format for NVVM.""" -__all__ = ['Program', 'ProgramOptions'] -ProgramHandleT = nvrtc.nvrtcProgram | int | LinkerHandleT -_nvvm_module = None -_nvvm_import_attempted = False - -def _can_load_generated_ptx() -> bool: - """Check if the driver can load PTX generated by the current NVRTC version.""" def _program_compile_uncached(program, target_type, name_expressions, logs): """Run ``Program_compile`` without the cache wrapper. @@ -432,9 +418,19 @@ def _program_compile_uncached(program, target_type, name_expressions, logs): and its methods cannot be reassigned from Python, so the seam must live outside the class. """ - def _get_nvvm_module() -> object: """Get the NVVM module, importing it lazily with availability checks.""" - def _find_libdevice_path() -> object: - """Find libdevice*.bc for NVVM compilation using cuda.pathfinder.""" \ No newline at end of file + """Find libdevice*.bc for NVVM compilation using cuda.pathfinder.""" +def _can_load_generated_ptx() -> bool: + """Check if the driver can load PTX generated by the current NVRTC version.""" +def _assert_single_dashed_nvvm_options(options: list[str]) -> None: + """Guard against emitting a double-dashed option to libNVVM. + + libNVVM's parser accepts only single-dashed options and rejects the + double-dashed spelling of every option with NVVM_ERROR_INVALID_OPTION + (see #2570). Every option on this path is generated from typed fields, so + a double dash can only mean a bug in ``cuda.core`` rather than bad user + input. Fail here, naming the option, instead of leaving the user with + libNVVM's opaque error. + """ diff --git a/cuda_core/cuda/core/_program.pyx b/cuda_core/cuda/core/_program.pyx index 7fb099b06d2..1d07b88bbf4 100644 --- a/cuda_core/cuda/core/_program.pyx +++ b/cuda_core/cuda/core/_program.pyx @@ -319,7 +319,7 @@ class ProgramOptions: Enable device code optimization. When specified along with '-G', enables limited debug information generation for optimized device code. Default: None - ptxas_options : Union[str, list[str]], optional + ptxas_options : str | list[str], optional Specify one or more options directly to ptxas, the PTX optimizing assembler. Options should be strings. For example ["-v", "-O2"]. Default: None @@ -353,17 +353,17 @@ class ProgramOptions: gen_opt_lto : bool, optional Run the optimizer passes before generating the LTO IR. Default: False - define_macro : Union[str, tuple[str, str], list[Union[str, tuple[str, str]]]], optional + define_macro : str | tuple[str, str] | list[str | tuple[str, str]], optional Predefine a macro. Can be either a string, in which case that macro will be set to 1, a 2 element tuple of strings, in which case the first element is defined as the second, or a list of strings or tuples. Default: None - undefine_macro : Union[str, list[str]], optional + undefine_macro : str | list[str], optional Cancel any previous definition of a macro, or list of macros. Default: None - include_path : Union[str, list[str]], optional + include_path : str | list[str], optional Add the directory or directories to the list of directories to be searched for headers. Default: None - pre_include : Union[str, list[str]], optional + pre_include : str | list[str], optional Preinclude one or more headers during preprocessing. Can be either a string or a list of strings. Default: None no_source_include : bool, optional @@ -396,13 +396,13 @@ class ProgramOptions: no_display_error_number : bool, optional Disable the display of a diagnostic number for warning messages. Default: False - diag_error : Union[int, list[int]], optional + diag_error : int | list[int], optional Emit error for a specified diagnostic message number or comma-separated list of numbers. Default: None - diag_suppress : Union[int, list[int]], optional + diag_suppress : int | list[int], optional Suppress a specified diagnostic message number or comma-separated list of numbers. Default: None - diag_warn : Union[int, list[int]], optional + diag_warn : int | list[int], optional Emit warning for a specified diagnostic message number or comma-separated list of numbers. Default: None brief_diagnostics : bool, optional @@ -466,6 +466,14 @@ class ProgramOptions: Load NVIDIA's `libdevice <https://docs.nvidia.com/cuda/libdevice-users-guide/>`_ math builtins library. Only supported for the NVVM backend. Default: False + numba_debug : bool, optional + Emit the debug information layout expected by Numba. Recognized only by + newer toolkits; compilers that do not support it reject the option with + an error. Applies only to the NVVM and NVRTC compilation backends -- + ``code_type="ptx"`` is processed by the linker, which cannot honor it, + so enabling this option there emits a :class:`UserWarning` and the + option is ignored. + Default: None """ name: str | None = "default_program" @@ -727,6 +735,21 @@ cpdef bint _can_load_generated_ptx() except? -1: cdef inline object _translate_program_options(object options): """Translate ProgramOptions to LinkerOptions for PTX compilation.""" + # ``numba_debug`` is an NVVM/NVRTC compiler option that no linking backend can + # honor. It used to be forwarded into ``LinkerOptions`` and dropped without a + # word; warn instead, and do not forward -- forwarding would only trigger the + # deprecation warning on a field the user never touched. ``UserWarning``, not + # ``DeprecationWarning``: ``ProgramOptions.numba_debug`` is not deprecated, it + # is fully supported on NVVM and NVRTC and merely inapplicable here. The gate + # is truthiness, matching ``_prepare_nvvm_options_impl``: only an enabled + # ``numba_debug`` asks for something this path cannot deliver. + if options.numba_debug: + warn( + "numba_debug is ignored for code_type='ptx', which is processed by the linker; " + "it applies only to the NVVM and NVRTC compilation backends.", + UserWarning, + stacklevel=4, + ) return LinkerOptions( name=options.name, arch=options.arch, @@ -742,7 +765,6 @@ cdef inline object _translate_program_options(object options): split_compile=options.split_compile, ptxas_options=options.ptxas_options, no_cache=options.no_cache, - numba_debug = options.numba_debug ) @@ -1220,6 +1242,24 @@ cdef inline list _prepare_nvrtc_options_impl(object opts): return [o.encode() for o in options] +cpdef void _assert_single_dashed_nvvm_options(options: list[str]) except *: + """Guard against emitting a double-dashed option to libNVVM. + + libNVVM's parser accepts only single-dashed options and rejects the + double-dashed spelling of every option with NVVM_ERROR_INVALID_OPTION + (see #2570). Every option on this path is generated from typed fields, so + a double dash can only mean a bug in ``cuda.core`` rather than bad user + input. Fail here, naming the option, instead of leaving the user with + libNVVM's opaque error. + """ + for option in options: + if option.startswith("--"): + raise RuntimeError( + f"Internal error: NVVM option {option!r} is double-dashed. libNVVM accepts " + f"only single-dashed options; emit {option[1:]!r} instead." + ) + + cdef inline object _prepare_nvvm_options_impl(object opts, bint as_bytes): """Build NVVM-specific compiler options.""" options = [] @@ -1232,8 +1272,10 @@ cdef inline object _prepare_nvvm_options_impl(object opts, bint as_bytes): options.append(f"-arch={arch}") if opts.debug is not None and opts.debug: options.append("-g") + # libNVVM only accepts single-dashed options; the double-dashed spelling + # accepted by NVRTC is rejected with NVVM_ERROR_INVALID_OPTION. if opts.numba_debug: - options.append("--numba-debug") + options.append("-numba-debug") if opts.device_code_optimize is False: options.append("-opt=0") elif opts.device_code_optimize is True: @@ -1313,6 +1355,8 @@ cdef inline object _prepare_nvvm_options_impl(object opts, bint as_bytes): if unsupported: raise CUDAError(f"The following options are not supported by NVVM backend: {', '.join(unsupported)}") + _assert_single_dashed_nvvm_options(options) + if as_bytes: return [o.encode() for o in options] else: diff --git a/cuda_core/cuda/core/_resource_handles.pxd b/cuda_core/cuda/core/_resource_handles.pxd index 2637abb5137..568af27ac2e 100644 --- a/cuda_core/cuda/core/_resource_handles.pxd +++ b/cuda_core/cuda/core/_resource_handles.pxd @@ -239,7 +239,7 @@ cdef void register_mr_dealloc_callback(MRDeallocCallback cb) noexcept cdef DevicePtrHandle deviceptr_import_ipc( const MemoryPoolHandle& h_pool, const void* export_data, const StreamHandle& h_stream) except+ nogil cdef StreamHandle deallocation_stream(const DevicePtrHandle& h) noexcept nogil -cdef void set_deallocation_stream(const DevicePtrHandle& h, const StreamHandle& h_stream) noexcept nogil +cdef cydriver.CUresult set_deallocation_stream(const DevicePtrHandle& h, const StreamHandle& h_stream) noexcept nogil # Library handles cdef LibraryHandle create_library_handle_from_file(const char* path) except+ nogil @@ -351,3 +351,11 @@ cdef cydriver.CUresult sm_resource_split( const cydriver.CUdevResource* input, cydriver.CUdevResource* remainder, unsigned int flags, void* groupParams) nogil cdef bint has_sm_resource_split() noexcept nogil + +# cuMemcpyWithAttributesAsync (13.2+ — calls through function pointer, safe on older bindings) +# attr is void* here to avoid referencing CUmemcpyAttributes (absent from +# cuda-bindings built against CUDA < 12.8). The C++ side casts it. +cdef cydriver.CUresult memcpy_with_attributes_async( + cydriver.CUdeviceptr dst, cydriver.CUdeviceptr src, size_t size, + void* attr, cydriver.CUstream hStream) nogil +cdef bint has_memcpy_with_attributes_async() noexcept nogil diff --git a/cuda_core/cuda/core/_resource_handles.pyi b/cuda_core/cuda/core/_resource_handles.pyi index f11f6f08e00..457e2921047 100644 --- a/cuda_core/cuda/core/_resource_handles.pyi +++ b/cuda_core/cuda/core/_resource_handles.pyi @@ -1,29 +1,29 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_resource_handles.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_resource_handles.pyx -from __future__ import annotations +from typing import Any, TypeAlias -from libcpp.memory import shared_ptr, unique_ptr - -ContextHandle = shared_ptr -GreenCtxHandle = shared_ptr -StreamHandle = shared_ptr -EventHandle = shared_ptr -MemoryPoolHandle = shared_ptr -DevicePtrHandle = shared_ptr -LibraryHandle = shared_ptr -KernelHandle = shared_ptr -GraphHandle = shared_ptr -GraphExecHandle = shared_ptr -GraphNodeHandle = shared_ptr -GraphicsResourceHandle = shared_ptr -NvrtcProgramHandle = shared_ptr -NvvmProgramHandle = shared_ptr -NvJitLinkHandle = shared_ptr -CuLinkHandle = shared_ptr -FileDescriptorHandle = shared_ptr -OpaqueArrayHandle = shared_ptr -MipmappedArrayHandle = shared_ptr -TexObjectHandle = shared_ptr -SurfObjectHandle = shared_ptr -OpaqueHandle = shared_ptr -PreparedAttachment = unique_ptr \ No newline at end of file +ContextHandle: TypeAlias = Any +GreenCtxHandle: TypeAlias = Any +StreamHandle: TypeAlias = Any +EventHandle: TypeAlias = Any +MemoryPoolHandle: TypeAlias = Any +DevicePtrHandle: TypeAlias = Any +LibraryHandle: TypeAlias = Any +KernelHandle: TypeAlias = Any +GraphHandle: TypeAlias = Any +GraphExecHandle: TypeAlias = Any +GraphNodeHandle: TypeAlias = Any +GraphicsResourceHandle: TypeAlias = Any +NvrtcProgramHandle: TypeAlias = Any +NvvmProgramHandle: TypeAlias = Any +NvJitLinkHandle: TypeAlias = Any +CuLinkHandle: TypeAlias = Any +FileDescriptorHandle: TypeAlias = Any +OpaqueArrayHandle: TypeAlias = Any +MipmappedArrayHandle: TypeAlias = Any +TexObjectHandle: TypeAlias = Any +SurfObjectHandle: TypeAlias = Any +OpaqueHandle: TypeAlias = Any +PreparedAttachment: TypeAlias = Any +PreparedChildGraphUpdate: TypeAlias = Any +PreparedExecAttachment: TypeAlias = Any diff --git a/cuda_core/cuda/core/_resource_handles.pyx b/cuda_core/cuda/core/_resource_handles.pyx index 464fad6c1bf..c7de24666f8 100644 --- a/cuda_core/cuda/core/_resource_handles.pyx +++ b/cuda_core/cuda/core/_resource_handles.pyx @@ -128,7 +128,7 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": const MemoryPoolHandle& h_pool, const void* export_data, const StreamHandle& h_stream) except+ nogil StreamHandle deallocation_stream "cuda_core::deallocation_stream" ( const DevicePtrHandle& h) noexcept nogil - void set_deallocation_stream "cuda_core::set_deallocation_stream" ( + cydriver.CUresult set_deallocation_stream "cuda_core::set_deallocation_stream" ( const DevicePtrHandle& h, const StreamHandle& h_stream) noexcept nogil # Library handles @@ -243,6 +243,14 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": unsigned int flags, void* groupParams) nogil bint has_sm_resource_split "cuda_core::has_sm_resource_split" () noexcept nogil + # cuMemcpyWithAttributesAsync (13.2+ wrapper — avoids direct cydriver cimport) + # attr is void* to avoid referencing CUmemcpyAttributes (absent from + # cuda-bindings built against CUDA < 12.8). The C++ side casts it. + cydriver.CUresult memcpy_with_attributes_async "cuda_core::memcpy_with_attributes_async" ( + cydriver.CUdeviceptr dst, cydriver.CUdeviceptr src, size_t size, + void* attr, cydriver.CUstream hStream) nogil + bint has_memcpy_with_attributes_async "cuda_core::has_memcpy_with_attributes_async" () noexcept nogil + # Array / mipmapped-array / texture / surface handles (PR #467) OpaqueArrayHandle create_array_handle "cuda_core::create_array_handle" ( const cydriver.CUDA_ARRAY3D_DESCRIPTOR& desc) except+ nogil @@ -293,6 +301,7 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": void* p_cuDevicePrimaryCtxRetain "reinterpret_cast<void*&>(cuda_core::p_cuDevicePrimaryCtxRetain)" void* p_cuDevicePrimaryCtxRelease "reinterpret_cast<void*&>(cuda_core::p_cuDevicePrimaryCtxRelease)" void* p_cuCtxGetCurrent "reinterpret_cast<void*&>(cuda_core::p_cuCtxGetCurrent)" + void* p_cuCtxSetCurrent "reinterpret_cast<void*&>(cuda_core::p_cuCtxSetCurrent)" void* p_cuGreenCtxCreate "reinterpret_cast<void*&>(cuda_core::p_cuGreenCtxCreate)" void* p_cuGreenCtxDestroy "reinterpret_cast<void*&>(cuda_core::p_cuGreenCtxDestroy)" void* p_cuCtxFromGreenCtx "reinterpret_cast<void*&>(cuda_core::p_cuCtxFromGreenCtx)" @@ -371,6 +380,9 @@ cdef extern from "_cpp/resource_handles.hpp" namespace "cuda_core": # SM resource split (13.1+) void* p_cuDevSmResourceSplit "reinterpret_cast<void*&>(cuda_core::p_cuDevSmResourceSplit)" + # cuMemcpyWithAttributesAsync (13.2+) + void* p_cuMemcpyWithAttributesAsync "reinterpret_cast<void*&>(cuda_core::p_cuMemcpyWithAttributesAsync)" + # NVRTC void* p_nvrtcDestroyProgram "reinterpret_cast<void*&>(cuda_core::p_nvrtcDestroyProgram)" @@ -397,6 +409,7 @@ cdef void* _get_optional_driver_fn(str name): cdef void _init_driver_fn_pointers() noexcept: global p_cuDevicePrimaryCtxRetain, p_cuDevicePrimaryCtxRelease, p_cuCtxGetCurrent + global p_cuCtxSetCurrent global p_cuGreenCtxCreate, p_cuGreenCtxDestroy, p_cuCtxFromGreenCtx global p_cuDevResourceGenerateDesc, p_cuGreenCtxStreamCreate global p_cuStreamCreateWithPriority, p_cuStreamDestroy @@ -416,6 +429,7 @@ cdef void _init_driver_fn_pointers() noexcept: global p_cuLinkDestroy global p_cuGraphicsUnmapResources, p_cuGraphicsUnregisterResource global p_cuDevSmResourceSplit + global p_cuMemcpyWithAttributesAsync global p_cuArray3DCreate, p_cuArrayDestroy global p_cuMipmappedArrayCreate, p_cuMipmappedArrayDestroy, p_cuMipmappedArrayGetLevel global p_cuTexObjectCreate, p_cuTexObjectDestroy @@ -425,6 +439,7 @@ cdef void _init_driver_fn_pointers() noexcept: p_cuDevicePrimaryCtxRetain = _get_driver_fn("cuDevicePrimaryCtxRetain") p_cuDevicePrimaryCtxRelease = _get_driver_fn("cuDevicePrimaryCtxRelease") p_cuCtxGetCurrent = _get_driver_fn("cuCtxGetCurrent") + p_cuCtxSetCurrent = _get_driver_fn("cuCtxSetCurrent") p_cuGreenCtxCreate = _get_optional_driver_fn("cuGreenCtxCreate") p_cuGreenCtxDestroy = _get_optional_driver_fn("cuGreenCtxDestroy") p_cuCtxFromGreenCtx = _get_optional_driver_fn("cuCtxFromGreenCtx") @@ -503,6 +518,9 @@ cdef void _init_driver_fn_pointers() noexcept: # SM resource split (13.1+ — may not exist in older cuda-bindings) p_cuDevSmResourceSplit = _get_optional_driver_fn("cuDevSmResourceSplit") + # cuMemcpyWithAttributesAsync (13.2+ — may not exist in older cuda-bindings) + p_cuMemcpyWithAttributesAsync = _get_optional_driver_fn("cuMemcpyWithAttributesAsync") + _init_driver_fn_pointers() initialize_deferred_cleanup() diff --git a/cuda_core/cuda/core/_stream.pxd b/cuda_core/cuda/core/_stream.pxd index de16b84bde2..b9c8677e130 100644 --- a/cuda_core/cuda/core/_stream.pxd +++ b/cuda_core/cuda/core/_stream.pxd @@ -23,3 +23,5 @@ cdef class Stream: cpdef Stream default_stream() cpdef Stream Stream_accept(arg, bint allow_stream_protocol=*) +cdef bint Stream_is_default_token(Stream self) noexcept nogil +cdef bint Stream_is_legacy_default_token(Stream self) noexcept nogil diff --git a/cuda_core/cuda/core/_stream.pyi b/cuda_core/cuda/core/_stream.pyi index f4d78982a1d..bee6efd9d31 100644 --- a/cuda_core/cuda/core/_stream.pyi +++ b/cuda_core/cuda/core/_stream.pyi @@ -1,18 +1,18 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_stream.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_stream.pyx from dataclasses import dataclass -from typing import Protocol +from typing import Any, Protocol import cuda.bindings.driver -import cython from cuda.core._context import Context from cuda.core._device import Device from cuda.core._device_resources import DeviceResources from cuda.core._event import Event, EventOptions from cuda.core.graph import GraphBuilder +__all__ = ['LEGACY_DEFAULT_STREAM', 'PER_THREAD_DEFAULT_STREAM', 'Stream', 'StreamOptions'] +LEGACY_DEFAULT_STREAM: Stream = Stream._legacy_default() +PER_THREAD_DEFAULT_STREAM: Stream = Stream._per_thread_default() @dataclass class StreamOptions: @@ -27,11 +27,10 @@ class StreamOptions: higher priority. (Default to lowest priority) """ - nonblocking: cython.bint = True + nonblocking: Any = True priority: int | None = None class IsStreamType(Protocol): - def __cuda_stream__(self) -> tuple[int, int]: """ For any Python object that is meant to be interpreted as a CUDA stream, the intent @@ -56,42 +55,27 @@ class Stream: object, or created directly through using an existing handle using Stream.from_handle(). """ - - def close(self): - """Destroy the stream. - - Releases the stream handle. For owned streams, this destroys the - underlying CUDA stream. For borrowed streams, this releases the - reference and allows the Python owner to be GC'd. - """ - - def __init__(self, *args, **kwargs) -> None: - ... - + def __init__(self, *args, **kwargs) -> None: ... @classmethod def _legacy_default(cls) -> Stream: """Return the legacy default stream (supports subclassing).""" - @classmethod def _per_thread_default(cls) -> Stream: """Return the per-thread default stream (supports subclassing).""" - @classmethod - def _init(cls, obj: IsStreamType | None=None, options: object=None, device_id: int | None=None, ctx: Context | None=None) -> Stream: - ... + def _init(cls, obj: IsStreamType | None=None, options: object | None=None, device_id: int | None=None, ctx: Context | None=None) -> Stream: ... + def close(self): + """Destroy the stream. + Releases the stream handle. For owned streams, this destroys the + underlying CUDA stream. For borrowed streams, this releases the + reference and allows the Python owner to be GC'd. + """ def __cuda_stream__(self) -> tuple[int, int]: """Return an instance of a __cuda_stream__ protocol.""" - - def __hash__(self) -> int: - ... - - def __eq__(self, other: object) -> bool: - ... - - def __repr__(self) -> str: - ... - + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __repr__(self) -> str: ... @property def handle(self) -> cuda.bindings.driver.CUstream: """Return the underlying ``CUstream`` object. @@ -101,18 +85,14 @@ class Stream: This handle is a Python object. To get the memory address of the underlying C handle, call ``int(Stream.handle)``. """ - @property def is_nonblocking(self) -> bool: """Return True if this is a nonblocking stream, otherwise False.""" - @property def priority(self) -> int: """Return the stream priority.""" - def sync(self) -> None: """Synchronize the stream.""" - def record(self, event: Event | None=None, options: EventOptions | None=None) -> Event: """Record an event onto the stream. @@ -131,8 +111,14 @@ class Stream: :obj:`~_event.Event` Newly created event object. - """ + Note + ---- + A default stream (:obj:`LEGACY_DEFAULT_STREAM` or + :obj:`PER_THREAD_DEFAULT_STREAM`) carries no context of its own; it + refers to whichever context is current, so a newly created event is + associated with the current context at call time. + """ def wait(self, event_or_stream: Event | Stream) -> None: """Wait for a CUDA event or a CUDA stream. @@ -150,23 +136,34 @@ class Stream: streams. """ - @property def device(self) -> Device: """Return the :obj:`~_device.Device` singleton associated with this stream. Note ---- - The current context on the device may differ from this - stream's context. This case occurs when a different CUDA - context is set current after a stream is created. + A default stream (:obj:`LEGACY_DEFAULT_STREAM` or + :obj:`PER_THREAD_DEFAULT_STREAM`) carries no context of its own; it + refers to whichever context is current, so this returns the device for + the current context at call time. - """ + For a created stream, the current context on the device may differ from + this stream's context. That case occurs when a different CUDA context is + set current after the stream is created. + """ @property def context(self) -> Context: - """Return the :obj:`~_context.Context` associated with this stream.""" + """Return the :obj:`~_context.Context` associated with this stream. + Note + ---- + A default stream (:obj:`LEGACY_DEFAULT_STREAM` or + :obj:`PER_THREAD_DEFAULT_STREAM`) carries no context of its own; it + refers to whichever context is current, so this returns the current + context at call time. + + """ @property def resources(self) -> DeviceResources: """Query the hardware resources provisioned for this stream's context. @@ -174,8 +171,15 @@ class Stream: For streams created from a green context, returns the resources that context was provisioned with. For streams on the primary context, returns the full device resources. - """ + Note + ---- + A default stream (:obj:`LEGACY_DEFAULT_STREAM` or + :obj:`PER_THREAD_DEFAULT_STREAM`) carries no context of its own; it + refers to whichever context is current, so this queries the current + context at call time. + + """ @staticmethod def from_handle(handle) -> Stream: """Create a new :obj:`~_stream.Stream` object from a foreign stream handle. @@ -200,7 +204,6 @@ class Stream: Newly created stream object. """ - def create_graph_builder(self) -> GraphBuilder: """Create a new :obj:`~graph.GraphBuilder` object. @@ -212,8 +215,6 @@ class Stream: Newly created graph builder object. """ -LEGACY_DEFAULT_STREAM: Stream = Stream._legacy_default() -PER_THREAD_DEFAULT_STREAM: Stream = Stream._per_thread_default() def default_stream() -> Stream: """Return the default CUDA :obj:`~_stream.Stream`. @@ -225,6 +226,4 @@ def default_stream() -> Stream: the legacy stream. """ - -def Stream_accept(arg, allow_stream_protocol: bool=False) -> Stream: - ... \ No newline at end of file +def Stream_accept(arg, allow_stream_protocol: bool=False) -> Stream: ... diff --git a/cuda_core/cuda/core/_stream.pyx b/cuda_core/cuda/core/_stream.pyx index c8c5faf74bc..a376db96e11 100644 --- a/cuda_core/cuda/core/_stream.pyx +++ b/cuda_core/cuda/core/_stream.pyx @@ -493,6 +493,18 @@ cdef inline bint Stream_is_default_token(Stream self) noexcept nogil: return h == <uintptr_t>cydriver.CU_STREAM_LEGACY or h == <uintptr_t>cydriver.CU_STREAM_PER_THREAD +cdef inline bint Stream_is_legacy_default_token(Stream self) noexcept nogil: + """Return True only for CU_STREAM_LEGACY. + + Unlike CU_STREAM_PER_THREAD, the legacy default stream token is rejected + outright (CUDA_ERROR_INVALID_VALUE) by cuMemcpyWithAttributesAsync and + cuMemcpyBatchAsync; CU_STREAM_PER_THREAD is a real stream to those entry + points and is accepted normally. Use this narrower check, not + Stream_is_default_token, wherever that distinction matters. + """ + return <uintptr_t>as_cu(self._h_stream) == <uintptr_t>cydriver.CU_STREAM_LEGACY + + cdef inline int Stream_get_ctx(Stream self, ContextHandle* h_context) except?-1 nogil: """Resolve the stream's context handle into ``h_context``.""" cdef cydriver.CUcontext ctx diff --git a/cuda_core/cuda/core/_tensor_bridge.pyi b/cuda_core/cuda/core/_tensor_bridge.pyi index 22948d5b864..25c13c6458c 100644 --- a/cuda_core/cuda/core/_tensor_bridge.pyi +++ b/cuda_core/cuda/core/_tensor_bridge.pyi @@ -1,4 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_tensor_bridge.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_tensor_bridge.pyx """Tensor bridge: extract PyTorch tensor metadata via the AOTI stable C ABI. @@ -46,13 +46,19 @@ Credit: Emilio Castillo (ecastillo@nvidia.com) – original tensor-bridge POC. ``torch._C`` has been re-opened with ``RTLD_GLOBAL`` *before* importing this module so that the AOTI symbols are visible. """ -from __future__ import annotations +from typing import TypeAlias, TypedDict import numpy from cuda.core._memoryview import StridedMemoryView -AOTITorchError = int +AOTITorchError: TypeAlias = int +class PyObject(TypedDict): ... + +class AtenTensorOpaque(TypedDict): ... + +def resolve_aoti_dtype(dtype_code: int) -> numpy.dtype: + """Python-callable wrapper around _get_aoti_dtype (for lazy resolution).""" def sync_torch_stream(device_index: int, consumer_s: int) -> int: """Establish stream ordering between PyTorch's current CUDA stream and the given consumer stream. @@ -61,10 +67,6 @@ def sync_torch_stream(device_index: int, consumer_s: int) -> int: the consumer stream wait on it. This is a no-op if both streams are the same. """ - -def resolve_aoti_dtype(dtype_code: int) -> numpy.dtype: - """Python-callable wrapper around _get_aoti_dtype (for lazy resolution).""" - def view_as_torch_tensor(obj: object, stream_ptr: object, view: StridedMemoryView | None=None) -> StridedMemoryView: """Create/populate a :class:`StridedMemoryView` from a ``torch.Tensor``. @@ -82,4 +84,4 @@ def view_as_torch_tensor(obj: object, stream_ptr: object, view: StridedMemoryVie view : StridedMemoryView, optional If provided, populate this existing view in-place. Otherwise a new instance is created. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/_tensor_map.pyi b/cuda_core/cuda/core/_tensor_map.pyi index 986ab41549f..2a3dc8a48a3 100644 --- a/cuda_core/cuda/core/_tensor_map.pyi +++ b/cuda_core/cuda/core/_tensor_map.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_tensor_map.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_tensor_map.pyx from dataclasses import dataclass @@ -8,6 +6,22 @@ import numpy from cuda.bindings import cydriver from cuda.core._device import Device +__all__ = ['TensorMapDescriptor', 'TensorMapDescriptorOptions'] +_TMA_DT_UINT8: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT8) +_TMA_DT_UINT16: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT16) +_TMA_DT_UINT32: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT32) +_TMA_DT_INT32: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT32) +_TMA_DT_UINT64: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT64) +_TMA_DT_INT64: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT64) +_TMA_DT_FLOAT16: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT16) +_TMA_DT_FLOAT32: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32) +_TMA_DT_FLOAT64: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT64) +_TMA_DT_BFLOAT16: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16) +_TMA_DT_FLOAT32_FTZ: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ) +_TMA_DT_TFLOAT32: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32) +_TMA_DT_TFLOAT32_FTZ: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ) +_NUMPY_DTYPE_TO_TMA = {numpy.dtype(numpy.uint8): _TMA_DT_UINT8, numpy.dtype(numpy.uint16): _TMA_DT_UINT16, numpy.dtype(numpy.uint32): _TMA_DT_UINT32, numpy.dtype(numpy.int32): _TMA_DT_INT32, numpy.dtype(numpy.uint64): _TMA_DT_UINT64, numpy.dtype(numpy.int64): _TMA_DT_INT64, numpy.dtype(numpy.float16): _TMA_DT_FLOAT16, numpy.dtype(numpy.float32): _TMA_DT_FLOAT32, numpy.dtype(numpy.float64): _TMA_DT_FLOAT64} +_TMA_DATA_TYPE_SIZE = {_TMA_DT_UINT8: 1, _TMA_DT_UINT16: 2, _TMA_DT_UINT32: 4, _TMA_DT_INT32: 4, _TMA_DT_UINT64: 8, _TMA_DT_INT64: 8, _TMA_DT_FLOAT16: 2, _TMA_DT_FLOAT32: 4, _TMA_DT_FLOAT64: 8, _TMA_DT_BFLOAT16: 2, _TMA_DT_FLOAT32_FTZ: 4, _TMA_DT_TFLOAT32: 4, _TMA_DT_TFLOAT32_FTZ: 4} class TensorMapDataType: """Data types for tensor map descriptors. @@ -105,8 +119,7 @@ class TensorMapDescriptorOptions: l2_promotion: TensorMapL2Promotion = TensorMapL2Promotion.NONE oob_fill: TensorMapOOBFill = TensorMapOOBFill.NONE - def __post_init__(self) -> None: - ... + def __post_init__(self) -> None: ... class TensorMapDescriptor: """Describes a TMA (Tensor Memory Accelerator) tensor map for Hopper+ GPUs. @@ -121,16 +134,12 @@ class TensorMapDescriptor: descriptors can be passed directly to :func:`~cuda.core.launch` as a kernel argument. """ - - def __init__(self): - ... - + def __init__(self): ... @property def device(self) -> Device | None: """Return the :obj:`~cuda.core.Device` associated with this descriptor.""" - @classmethod - def _from_tiled(cls, view, box_dim=None, *, options=None, element_strides=None, data_type=None, interleave=..., swizzle=..., l2_promotion=..., oob_fill=...): + def _from_tiled(cls, view, box_dim=None, *, options=None, element_strides=None, data_type=None, interleave=TensorMapInterleave.NONE, swizzle=TensorMapSwizzle.NONE, l2_promotion=TensorMapL2Promotion.NONE, oob_fill=TensorMapOOBFill.NONE): """Create a tiled TMA descriptor from a validated view. Parameters @@ -171,9 +180,8 @@ class TensorMapDescriptor: If the tensor rank is outside [1, 5], the pointer is not 16-byte aligned, or dimension/stride constraints are violated. """ - @classmethod - def _from_im2col(cls, view, pixel_box_lower_corner, pixel_box_upper_corner, channels_per_pixel, pixels_per_column, *, element_strides=None, data_type=None, interleave=..., swizzle=..., l2_promotion=..., oob_fill=...): + def _from_im2col(cls, view, pixel_box_lower_corner, pixel_box_upper_corner, channels_per_pixel, pixels_per_column, *, element_strides=None, data_type=None, interleave=TensorMapInterleave.NONE, swizzle=TensorMapSwizzle.NONE, l2_promotion=TensorMapL2Promotion.NONE, oob_fill=TensorMapOOBFill.NONE): """Create an im2col TMA descriptor from a validated view. Im2col layout is used for convolution-style data access patterns. @@ -219,9 +227,8 @@ class TensorMapDescriptor: If the tensor rank is outside [3, 5], the pointer is not 16-byte aligned, or other constraints are violated. """ - @classmethod - def _from_im2col_wide(cls, view, pixel_box_lower_corner_width, pixel_box_upper_corner_width, channels_per_pixel, pixels_per_column, *, element_strides=None, data_type=None, interleave=..., mode=..., swizzle=..., l2_promotion=..., oob_fill=...): + def _from_im2col_wide(cls, view, pixel_box_lower_corner_width, pixel_box_upper_corner_width, channels_per_pixel, pixels_per_column, *, element_strides=None, data_type=None, interleave=TensorMapInterleave.NONE, mode=TensorMapIm2ColWideMode.W, swizzle=TensorMapSwizzle.SWIZZLE_128B, l2_promotion=TensorMapL2Promotion.NONE, oob_fill=TensorMapOOBFill.NONE): """Create an im2col-wide TMA descriptor from a validated view. Im2col-wide layout loads elements exclusively along the W (width) @@ -267,7 +274,6 @@ class TensorMapDescriptor: If the tensor rank is outside [3, 5], the pointer is not 16-byte aligned, or other constraints are violated. """ - def replace_address(self, tensor: object) -> None: """Replace the global memory address in this tensor map descriptor. @@ -281,43 +287,16 @@ class TensorMapDescriptor: or a :obj:`~cuda.core.StridedMemoryView`. Must refer to device-accessible memory with a 16-byte-aligned pointer. """ + def __repr__(self) -> str: ... - def __repr__(self) -> str: - ... -_TMA_DT_UINT8 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT8) -_TMA_DT_UINT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT16) -_TMA_DT_UINT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT32) -_TMA_DT_INT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT32) -_TMA_DT_UINT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT64) -_TMA_DT_INT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT64) -_TMA_DT_FLOAT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT16) -_TMA_DT_FLOAT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32) -_TMA_DT_FLOAT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT64) -_TMA_DT_BFLOAT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16) -_TMA_DT_FLOAT32_FTZ = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ) -_TMA_DT_TFLOAT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32) -_TMA_DT_TFLOAT32_FTZ = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ) -_NUMPY_DTYPE_TO_TMA = {numpy.dtype(numpy.uint8): _TMA_DT_UINT8, numpy.dtype(numpy.uint16): _TMA_DT_UINT16, numpy.dtype(numpy.uint32): _TMA_DT_UINT32, numpy.dtype(numpy.int32): _TMA_DT_INT32, numpy.dtype(numpy.uint64): _TMA_DT_UINT64, numpy.dtype(numpy.int64): _TMA_DT_INT64, numpy.dtype(numpy.float16): _TMA_DT_FLOAT16, numpy.dtype(numpy.float32): _TMA_DT_FLOAT32, numpy.dtype(numpy.float64): _TMA_DT_FLOAT64} -_TMA_DATA_TYPE_SIZE = {_TMA_DT_UINT8: 1, _TMA_DT_UINT16: 2, _TMA_DT_UINT32: 4, _TMA_DT_INT32: 4, _TMA_DT_UINT64: 8, _TMA_DT_INT64: 8, _TMA_DT_FLOAT16: 2, _TMA_DT_FLOAT32: 4, _TMA_DT_FLOAT64: 8, _TMA_DT_BFLOAT16: 2, _TMA_DT_FLOAT32_FTZ: 4, _TMA_DT_TFLOAT32: 4, _TMA_DT_TFLOAT32_FTZ: 4} - -def _normalize_tensor_map_data_type(data_type): - ... - -def _normalize_tensor_map_sequence(name, values): - ... - -def _require_tensor_map_enum(name, value, enum_type): - ... - -def _coerce_tensor_map_descriptor_options(box_dim, options, *, element_strides, data_type, interleave, swizzle, l2_promotion, oob_fill): - ... - +def _normalize_tensor_map_data_type(data_type): ... +def _normalize_tensor_map_sequence(name, values): ... +def _require_tensor_map_enum(name, value, enum_type): ... +def _coerce_tensor_map_descriptor_options(box_dim, options, *, element_strides, data_type, interleave, swizzle, l2_promotion, oob_fill): ... def _resolve_data_type(view, data_type): """Resolve the TMA data type from an explicit value or the view's dtype.""" - def _get_validated_view(tensor): """Obtain a device-accessible StridedMemoryView with a 16-byte-aligned pointer.""" - def _require_view_device(view, expected_device_id, operation): """Ensure device-local tensors match the current CUDA device. @@ -325,12 +304,10 @@ def _require_view_device(view, expected_device_id, operation): ``kDLCUDAManaged`` with ``device_id=0`` regardless of the current device, so only true ``kDLCUDA`` tensors are rejected by device-id mismatch. """ - def _compute_byte_strides(shape, strides, elem_size): """Compute byte strides from element strides or C-contiguous fallback. Returns a tuple of byte strides in row-major order. """ - def _validate_element_strides(element_strides, rank): - """Validate or default element_strides to all-ones.""" \ No newline at end of file + """Validate or default element_strides to all-ones.""" diff --git a/cuda_core/cuda/core/_tensor_map.pyx b/cuda_core/cuda/core/_tensor_map.pyx index 46c2fa93152..3b8b54dd8f3 100644 --- a/cuda_core/cuda/core/_tensor_map.pyx +++ b/cuda_core/cuda/core/_tensor_map.pyx @@ -132,19 +132,19 @@ ELSE: W128 = 1 -_TMA_DT_UINT8 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT8) -_TMA_DT_UINT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT16) -_TMA_DT_UINT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT32) -_TMA_DT_INT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT32) -_TMA_DT_UINT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT64) -_TMA_DT_INT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT64) -_TMA_DT_FLOAT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT16) -_TMA_DT_FLOAT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32) -_TMA_DT_FLOAT64 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT64) -_TMA_DT_BFLOAT16 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16) -_TMA_DT_FLOAT32_FTZ = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ) -_TMA_DT_TFLOAT32 = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32) -_TMA_DT_TFLOAT32_FTZ = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ) +_TMA_DT_UINT8: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT8) +_TMA_DT_UINT16: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT16) +_TMA_DT_UINT32: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT32) +_TMA_DT_INT32: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT32) +_TMA_DT_UINT64: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_UINT64) +_TMA_DT_INT64: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_INT64) +_TMA_DT_FLOAT16: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT16) +_TMA_DT_FLOAT32: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32) +_TMA_DT_FLOAT64: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT64) +_TMA_DT_BFLOAT16: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_BFLOAT16) +_TMA_DT_FLOAT32_FTZ: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ) +_TMA_DT_TFLOAT32: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32) +_TMA_DT_TFLOAT32_FTZ: int = int(cydriver.CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ) def _normalize_tensor_map_data_type(data_type): diff --git a/cuda_core/cuda/core/_utils/_weak_handles.pyi b/cuda_core/cuda/core/_utils/_weak_handles.pyi index 3cf095d7b87..a795a180504 100644 --- a/cuda_core/cuda/core/_utils/_weak_handles.pyi +++ b/cuda_core/cuda/core/_utils/_weak_handles.pyi @@ -1,4 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_utils/_weak_handles.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_utils/_weak_handles.pyx """Test-only weak handles for resource-handle lifetime checks. @@ -20,9 +20,6 @@ handle field (see ``*.pxd``), assigns to :ctype:`OpaqueHandle`, and extend the Python owners via ``make_opaque_py`` are not covered here -- use :class:`weakref.ref` on a weak-referenceable owner object in tests instead. """ -from __future__ import annotations - - class WeakHandle: """Non-owning weak handle for a resource's shared control block. @@ -30,21 +27,18 @@ class WeakHandle: falsy once the last strong reference is released. Obtain instances via :func:`weak_handle` rather than constructing directly. """ - - def __bool__(self): - ... - + def __bool__(self): ... def expired(self): """Return ``True`` once every strong owner of the handle is gone.""" - def use_count(self): """Number of strong owners currently sharing the handle.""" def weak_handle(obj): """Return a :class:`WeakHandle` observing the resource behind ``obj``. - Currently supports :class:`~cuda.core.Buffer` (device allocation handle). - See the module docstring for how to add more types. + Currently supports :class:`~cuda.core.Buffer` (allocation handle) and + :class:`~cuda.core.graph.GraphDefinition` (graph hierarchy handle). See + the module docstring for how to add more types. Raises ------ @@ -52,4 +46,4 @@ def weak_handle(obj): If ``obj`` is a :class:`~cuda.core.Buffer` with no active allocation. TypeError If ``obj`` is not a supported type. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/_utils/_wsl_locale.pyi b/cuda_core/cuda/core/_utils/_wsl_locale.pyi index 267bdf244f0..790ae71b99d 100644 --- a/cuda_core/cuda/core/_utils/_wsl_locale.pyi +++ b/cuda_core/cuda/core/_utils/_wsl_locale.pyi @@ -1,7 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_utils/_wsl_locale.pyx - -from __future__ import annotations - +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_utils/_wsl_locale.pyx class c_locale_guard: """Context manager that pins the calling thread to the "C" locale. @@ -9,12 +6,6 @@ class c_locale_guard: Uses POSIX newlocale/uselocale/freelocale so other threads' view of the locale is unaffected. Restores the previous thread locale on exit. """ - - def __cinit__(self) -> None: - ... - - def __enter__(self): - ... - - def __exit__(self, exc_type, exc_val, exc_tb): - ... \ No newline at end of file + def __init__(self) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc_val, exc_tb): ... diff --git a/cuda_core/cuda/core/_utils/cuda_utils.pxd b/cuda_core/cuda/core/_utils/cuda_utils.pxd index 11e464e6381..9b485597912 100644 --- a/cuda_core/cuda/core/_utils/cuda_utils.pxd +++ b/cuda_core/cuda/core/_utils/cuda_utils.pxd @@ -18,11 +18,35 @@ ctypedef fused integer_t: cdef const cydriver.CUcontext CU_CONTEXT_INVALID = <cydriver.CUcontext>(-2) -cdef int HANDLE_RETURN(cydriver.CUresult err) except?-1 nogil -cdef int HANDLE_RETURN_NVRTC(cynvrtc.nvrtcProgram prog, cynvrtc.nvrtcResult err) except?-1 nogil -cdef int HANDLE_RETURN_NVVM(cynvvm.nvvmProgram prog, cynvvm.nvvmResult err) except?-1 nogil -cdef int HANDLE_RETURN_NVJITLINK( - cynvjitlink.nvJitLinkHandle handle, cynvjitlink.nvJitLinkResult err) except?-1 nogil +cdef inline int HANDLE_RETURN(cydriver.CUresult err) except?-1 nogil: + if err != cydriver.CUresult.CUDA_SUCCESS: + return _check_driver_error(err) + return 0 + + +cdef inline int HANDLE_RETURN_NVRTC(cynvrtc.nvrtcProgram prog, cynvrtc.nvrtcResult err) except?-1 nogil: + """Handle NVRTC result codes, raising NVRTCError with program log on failure.""" + if err == cynvrtc.nvrtcResult.NVRTC_SUCCESS: + return 0 + with gil: + _raise_nvrtc_error(prog, err) + + +cdef inline int HANDLE_RETURN_NVVM(cynvvm.nvvmProgram prog, cynvvm.nvvmResult err) except?-1 nogil: + """Handle NVVM result codes, raising nvvmError with program log on failure.""" + if err == cynvvm.nvvmResult.NVVM_SUCCESS: + return 0 + with gil: + _raise_nvvm_error(prog, err) + + +cdef inline int HANDLE_RETURN_NVJITLINK( + cynvjitlink.nvJitLinkHandle handle, cynvjitlink.nvJitLinkResult err) except?-1 nogil: + """Handle nvJitLink result codes, raising nvJitLinkError with error log on failure.""" + if err == cynvjitlink.nvJitLinkResult.NVJITLINK_SUCCESS: + return 0 + with gil: + _raise_nvjitlink_error(handle, err) # Helper for retrieving the current CUDA device. Raises if no active context @@ -34,7 +58,9 @@ cdef int _get_current_device_id() except? -1 cpdef int _check_driver_error(cydriver.CUresult error) except?-1 nogil cpdef int _check_runtime_error(error) except?-1 cpdef int _check_nvrtc_error(error) except?-1 - +cdef int _raise_nvrtc_error(cynvrtc.nvrtcProgram prog, cynvrtc.nvrtcResult err) except -1 +cdef int _raise_nvvm_error(cynvvm.nvvmProgram prog, cynvvm.nvvmResult err) except -1 +cdef int _raise_nvjitlink_error(cynvjitlink.nvJitLinkHandle handle, cynvjitlink.nvJitLinkResult err) except -1 cpdef check_or_create_options(type cls, options, str options_description=*, bint keep_none=*) diff --git a/cuda_core/cuda/core/_utils/cuda_utils.pyi b/cuda_core/cuda/core/_utils/cuda_utils.pyi index 87067927724..545b9a9073c 100644 --- a/cuda_core/cuda/core/_utils/cuda_utils.pyi +++ b/cuda_core/cuda/core/_utils/cuda_utils.pyi @@ -1,21 +1,25 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_utils/cuda_utils.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_utils/cuda_utils.pyx -from __future__ import annotations - -from collections import namedtuple -from typing import Any, Callable +from typing import Any, Callable, NamedTuple from cuda.bindings import cydriver from cuda.bindings import driver as driver from cuda.bindings import nvrtc as nvrtc from cuda.bindings import runtime as runtime +_keep_driver_in_stub: driver.CUresult +_keep_nvrtc_in_stub: nvrtc.nvrtcResult +_keep_runtime_in_stub: runtime.cudaError_t +_fork_warning_checked = False + +class CUDAError(Exception): ... -class CUDAError(Exception): - ... +class NVRTCError(CUDAError): ... -class NVRTCError(CUDAError): - ... +class ComputeCapability(NamedTuple): + """A named tuple of (major, minor) CUDA compute capability version numbers.""" + major: int + minor: int class Transaction: """ @@ -35,81 +39,32 @@ class Transaction: append(fn, *args, **kwargs): Register an undo action to be called on rollback. commit(): Disarm all undo actions; nothing will be rolled back on exit. """ - - def __init__(self) -> None: - ... - - def __enter__(self): - ... - - def __exit__(self, exc_type, exc, tb): - ... - + def __init__(self) -> None: ... + def __enter__(self): ... + def __exit__(self, exc_type, exc, tb): ... def append(self, fn: Callable[..., Any], /, *args: Any, **kwargs) -> None: """ Register an undo action (runs if the with-block exits without commit()). Values are bound now via partial so late mutations don't bite you. """ - def commit(self) -> None: """ Disarm all undo actions. After this, exiting the with-block does nothing. """ -_keep_driver_in_stub: 'driver.CUresult' -_keep_nvrtc_in_stub: 'nvrtc.nvrtcResult' -_keep_runtime_in_stub: 'runtime.cudaError_t' -ComputeCapability = namedtuple('ComputeCapability', ('major', 'minor')) -_fork_warning_checked = False - -def _check_driver_error(error: cydriver.CUresult) -> int: - ... - -def _check_runtime_error(error) -> int: - ... - -def _check_nvrtc_error(error, handle=None) -> int: - ... +def cast_to_3_tuple(label: str, cfg: int | tuple[int, ...]) -> tuple[int, int, int]: ... +def _check_driver_error(error: cydriver.CUresult) -> int: ... +def _check_runtime_error(error) -> int: ... +def _check_nvrtc_error(error, handle=None) -> int: ... +def handle_return(result: tuple[Any, ...], handle: object | None=None) -> Any: ... def check_or_create_options(cls: type, options: object, options_description: str='', keep_none: bool=False) -> object: """ Create the specified options dataclass from a dictionary of options or None. """ - -def _parse_fill_value(value) -> tuple: - """Parse a fill/memset value into (raw_value, element_size). - - Parameters - ---------- - value : int or buffer-protocol object - - int: Must be in range [0, 256). Treated as 1-byte fill. - - bytes or buffer-protocol: Must be 1, 2, or 4 bytes. - - Returns - ------- - tuple of (int, int) - (raw_value, element_size) where element_size is 1, 2, or 4. - - Raises - ------ - OverflowError - If int value is outside [0, 256). - TypeError - If value is not an int and does not support the buffer protocol. - ValueError - If value byte length is not 1, 2, or 4. - """ - -def cast_to_3_tuple(label: str, cfg: int | tuple[int, ...]) -> tuple[int, int, int]: - ... - -def handle_return(result: tuple[Any, ...], handle: object=None) -> Any: - ... - def _handle_boolean_option(option: bool) -> str: """ Convert a boolean option to a string representation. """ - def precondition(checker: Callable[..., None], what: str='') -> Callable[..., Any]: """ A decorator that adds checks to ensure any preconditions are met. @@ -122,23 +77,42 @@ def precondition(checker: Callable[..., None], what: str='') -> Callable[..., An Returns: Callable: A decorator that creates the wrapping. """ - def is_sequence(obj: object) -> bool: """ Check if the given object is a sequence (list or tuple). """ - def is_nested_sequence(obj: object) -> bool: """ Check if the given object is a nested sequence (list or tuple with atleast one list or tuple element). """ - def reset_fork_warning() -> None: """Reset the fork warning check flag for testing purposes. This function is intended for use in tests to allow multiple test runs to check the warning behavior. """ +def _parse_fill_value(value) -> tuple[Any, ...]: + """Parse a fill/memset value into (raw_value, element_size). + Parameters + ---------- + value : int or buffer-protocol object + - int: Must be in range [0, 256). Treated as 1-byte fill. + - bytes or buffer-protocol: Must be 1, 2, or 4 bytes. + + Returns + ------- + tuple of (int, int) + (raw_value, element_size) where element_size is 1, 2, or 4. + + Raises + ------ + OverflowError + If int value is outside [0, 256). + TypeError + If value is not an int and does not support the buffer protocol. + ValueError + If value byte length is not 1, 2, or 4. + """ def check_multiprocessing_start_method() -> None: - """Check if multiprocessing start method is 'fork' and warn if so.""" \ No newline at end of file + """Check if multiprocessing start method is 'fork' and warn if so.""" diff --git a/cuda_core/cuda/core/_utils/cuda_utils.pyx b/cuda_core/cuda/core/_utils/cuda_utils.pyx index 318d4466bee..ce75746de56 100644 --- a/cuda_core/cuda/core/_utils/cuda_utils.pyx +++ b/cuda_core/cuda/core/_utils/cuda_utils.pyx @@ -7,10 +7,9 @@ from functools import partial import multiprocessing import platform import warnings -from collections import namedtuple from collections.abc import Sequence from contextlib import ExitStack -from typing import Any, Callable +from typing import Any, Callable, NamedTuple from cuda.bindings import driver as driver, nvrtc as nvrtc, runtime as runtime @@ -42,7 +41,10 @@ class NVRTCError(CUDAError): -ComputeCapability = namedtuple("ComputeCapability", ("major", "minor")) +class ComputeCapability(NamedTuple): + """A named tuple of (major, minor) CUDA compute capability version numbers.""" + major: int + minor: int def cast_to_3_tuple(label: str, cfg: int | tuple[int, ...]) -> tuple[int, int, int]: @@ -63,12 +65,6 @@ def cast_to_3_tuple(label: str, cfg: int | tuple[int, ...]) -> tuple[int, int, i return cfg + (1,) * (3 - len(cfg)) -cdef int HANDLE_RETURN(cydriver.CUresult err) except?-1 nogil: - if err != cydriver.CUresult.CUDA_SUCCESS: - return _check_driver_error(err) - return 0 - - cdef int _get_current_device_id() except? -1: """Return the current thread's bound CUdevice ordinal.""" cdef cydriver.CUdevice dev @@ -77,14 +73,6 @@ cdef int _get_current_device_id() except? -1: return <int>dev -cdef int HANDLE_RETURN_NVRTC(cynvrtc.nvrtcProgram prog, cynvrtc.nvrtcResult err) except?-1 nogil: - """Handle NVRTC result codes, raising NVRTCError with program log on failure.""" - if err == cynvrtc.nvrtcResult.NVRTC_SUCCESS: - return 0 - with gil: - _raise_nvrtc_error(prog, err) - - cdef int _raise_nvrtc_error(cynvrtc.nvrtcProgram prog, cynvrtc.nvrtcResult err) except -1: """Build error message with program log and raise NVRTCError.""" cdef const char* err_str = cynvrtc.nvrtcGetErrorString(err) @@ -103,14 +91,6 @@ cdef int _raise_nvrtc_error(cynvrtc.nvrtcProgram prog, cynvrtc.nvrtcResult err) raise NVRTCError(err_msg) -cdef int HANDLE_RETURN_NVVM(cynvvm.nvvmProgram prog, cynvvm.nvvmResult err) except?-1 nogil: - """Handle NVVM result codes, raising nvvmError with program log on failure.""" - if err == cynvvm.nvvmResult.NVVM_SUCCESS: - return 0 - with gil: - _raise_nvvm_error(prog, err) - - cdef int _raise_nvvm_error(cynvvm.nvvmProgram prog, cynvvm.nvvmResult err) except -1: """Raise nvvmError annotated with the program log.""" cdef size_t logsize = 0 @@ -128,15 +108,6 @@ cdef int _raise_nvvm_error(cynvvm.nvvmProgram prog, cynvvm.nvvmResult err) excep raise exc -cdef int HANDLE_RETURN_NVJITLINK( - cynvjitlink.nvJitLinkHandle handle, cynvjitlink.nvJitLinkResult err) except?-1 nogil: - """Handle nvJitLink result codes, raising nvJitLinkError with error log on failure.""" - if err == cynvjitlink.nvJitLinkResult.NVJITLINK_SUCCESS: - return 0 - with gil: - _raise_nvjitlink_error(handle, err) - - cdef int _raise_nvjitlink_error( cynvjitlink.nvJitLinkHandle handle, cynvjitlink.nvJitLinkResult err) except -1: """Raise nvJitLinkError annotated with the error log.""" diff --git a/cuda_core/cuda/core/_utils/version.pyi b/cuda_core/cuda/core/_utils/version.pyi index bb7f0129917..021d86f1aec 100644 --- a/cuda_core/cuda/core/_utils/version.pyi +++ b/cuda_core/cuda/core/_utils/version.pyi @@ -1,14 +1,18 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/_utils/version.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/_utils/version.pyx import functools +def _parse_version_triple(version_str: str) -> tuple[int, int, int]: + """Parse a PEP 440 version string into a (major, minor, patch) triple. + + Strips local-version identifiers and handles pre-release suffixes such as + ``0b1`` or ``0rc1`` by extracting only the leading integer from each + release segment. + """ @functools.cache def binding_version() -> tuple[int, int, int]: """Return the cuda-bindings version as a (major, minor, patch) triple.""" - @functools.cache def driver_version() -> tuple[int, int, int]: - """Return the CUDA driver version as a (major, minor, patch) triple.""" \ No newline at end of file + """Return the CUDA driver version as a (major, minor, patch) triple.""" diff --git a/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyi b/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyi index 742b3777b04..a434c6d8108 100644 --- a/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyi +++ b/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyi @@ -1,8 +1,6 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx """Mutable-set proxy for graph node predecessors and successors.""" -from __future__ import annotations - from collections.abc import Iterator, Set from typing import Any @@ -12,47 +10,26 @@ from cuda.core.graph._graph_node import GraphNode class AdjacencySetProxy: """Mutable set proxy for a node's predecessors or successors. Mutations write through to the underlying CUDA graph.""" - __slots__ = ('_core',) - - def __init__(self, node: GraphNode, is_fwd: bool) -> None: - ... + __slots__ = '_core' + def __init__(self, node: GraphNode, is_fwd: bool) -> None: ... @classmethod - def _from_iterable(cls, it) -> set[GraphNode]: - ... - - def __contains__(self, x: object) -> bool: - ... - - def __iter__(self) -> Iterator[GraphNode]: - ... - - def __len__(self) -> int: - ... - - def add(self, value: GraphNode) -> None: - ... - - def discard(self, value: GraphNode) -> None: - ... - + def _from_iterable(cls, it) -> set[GraphNode]: ... + def __contains__(self, x: object) -> bool: ... + def __iter__(self) -> Iterator[GraphNode]: ... + def __len__(self) -> int: ... + def add(self, value: GraphNode) -> None: ... + def discard(self, value: GraphNode) -> None: ... def clear(self) -> None: """Remove all edges in a single driver call.""" - - def __isub__(self, it: Set[Any]) -> 'AdjacencySetProxy': + def __isub__(self, it: Set[Any]) -> AdjacencySetProxy: """Remove edges to all nodes in *it* in a single driver call.""" - def update(self, *others) -> None: """Add edges to multiple nodes at once.""" - - def __ior__(self, it: Set[Any]) -> 'AdjacencySetProxy': + def __ior__(self, it: Set[Any]) -> AdjacencySetProxy: """Add edges to all nodes in *it* in a single driver call.""" - - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class _AdjacencySetCore: """Cythonized core implementing AdjacencySetProxy""" - - def __init__(self, node: GraphNode, is_fwd: bool): - ... \ No newline at end of file + def __init__(self, node: GraphNode, is_fwd: bool): ... diff --git a/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx b/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx index e1762321ce0..971e418a428 100644 --- a/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx +++ b/cuda_core/cuda/core/graph/_adjacency_set_proxy.pyx @@ -144,20 +144,23 @@ cdef class _AdjacencySetCore: cdef cydriver.CUgraphNode c_node = as_cu(self._h_node) if c_node == NULL: return [] - cdef cydriver.CUgraphNode buf[16] - cdef size_t count = 16 + cdef cydriver.CUgraphNode stack_buf[16] + cdef cydriver.CUgraphNode* nodes + cdef size_t count = 0 cdef size_t i with nogil: - HANDLE_RETURN(self._query_fn(c_node, buf, &count)) - if count <= 16: - return [GraphNode._create(self._h_graph, buf[i]) - for i in range(count)] + HANDLE_RETURN(self._query_fn(c_node, NULL, &count)) + if count == 0: + return [] cdef vector[cydriver.CUgraphNode] nodes_vec - nodes_vec.resize(count) + if count <= 16: + nodes = stack_buf + else: + nodes_vec.resize(count) + nodes = nodes_vec.data() with nogil: - HANDLE_RETURN(self._query_fn( - c_node, nodes_vec.data(), &count)) - return [GraphNode._create(self._h_graph, nodes_vec[i]) + HANDLE_RETURN(self._query_fn(c_node, nodes, &count)) + return [GraphNode._create(self._h_graph, nodes[i]) for i in range(count)] cdef bint contains(self, GraphNode other): @@ -165,27 +168,24 @@ cdef class _AdjacencySetCore: cdef cydriver.CUgraphNode target = as_cu(other._h_node) if c_node == NULL or target == NULL: return False - cdef cydriver.CUgraphNode buf[16] - cdef size_t count = 16 + cdef cydriver.CUgraphNode stack_buf[16] + cdef cydriver.CUgraphNode* nodes + cdef size_t count = 0 cdef size_t i with nogil: - HANDLE_RETURN(self._query_fn(c_node, buf, &count)) - - # Fast path for small sets. - if count <= 16: - for i in range(count): - if buf[i] == target: - return True + HANDLE_RETURN(self._query_fn(c_node, NULL, &count)) + if count == 0: return False - - # Fallback for large sets. cdef vector[cydriver.CUgraphNode] nodes_vec - nodes_vec.resize(count) + if count <= 16: + nodes = stack_buf + else: + nodes_vec.resize(count) + nodes = nodes_vec.data() with nogil: - HANDLE_RETURN(self._query_fn(c_node, nodes_vec.data(), &count)) - assert count == nodes_vec.size() + HANDLE_RETURN(self._query_fn(c_node, nodes, &count)) for i in range(count): - if nodes_vec[i] == target: + if nodes[i] == target: return True return False diff --git a/cuda_core/cuda/core/graph/_graph_builder.pyi b/cuda_core/cuda/core/graph/_graph_builder.pyi index 4fbc6fb3903..1e286d3277b 100644 --- a/cuda_core/cuda/core/graph/_graph_builder.pyi +++ b/cuda_core/cuda/core/graph/_graph_builder.pyi @@ -1,15 +1,17 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_graph_builder.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/graph/_graph_builder.pyx from dataclasses import dataclass +from typing import TypeAlias from cuda.core._stream import Stream from cuda.core._utils.cuda_utils import driver from cuda.core.graph._graph_definition import GraphCondition, GraphDefinition +from cuda.core.graph._graph_node import GraphNode +from cuda.core.graph._subclasses import ExecutableGraphNode -_BuilderKind = int -_CaptureState = int +_BuilderKind: TypeAlias = int +_CaptureState: TypeAlias = int +__all__ = ['Graph', 'GraphBuilder', 'GraphCompleteOptions', 'GraphDebugPrintOptions'] @dataclass class GraphDebugPrintOptions: @@ -119,28 +121,18 @@ class GraphBuilder: retains the operands it is given. """ - - def __init__(self): - ... - - def __dealloc__(self): - ... - + def __init__(self): ... + def __dealloc__(self): ... @staticmethod - def _init(stream: Stream): - ... - + def _init(stream: Stream): ... def close(self): """Destroy the graph builder.""" - @property def stream(self) -> Stream: """Returns the stream associated with the graph builder.""" - @property def is_join_required(self) -> bool: """Returns True if this graph builder must be joined before building is ended.""" - @property def graph_definition(self) -> GraphDefinition: """The captured graph as an explicit :class:`~graph.GraphDefinition`. @@ -187,7 +179,6 @@ class GraphBuilder: keeps working; only fresh access through this property is rejected once the builder is closed. """ - def begin_building(self, mode: str | None='relaxed') -> GraphBuilder: """Begins the building process. @@ -204,14 +195,11 @@ class GraphBuilder: Default set to use relaxed. """ - @property def is_building(self) -> bool: """Returns True if the graph builder is currently building.""" - def end_building(self) -> GraphBuilder: """Ends the building process.""" - def complete(self, options: GraphCompleteOptions | None=None) -> Graph: """Completes the graph builder and returns the built :obj:`~graph.Graph` object. @@ -226,7 +214,6 @@ class GraphBuilder: The newly built graph. """ - def debug_dot_print(self, path: str, options: GraphDebugPrintOptions | None=None) -> None: """Generates a DOT debug file for the graph builder. @@ -238,7 +225,6 @@ class GraphBuilder: Customizable dataclass for the debug print options. """ - def split(self, count: int) -> tuple[GraphBuilder, ...]: """Splits the original graph builder into multiple graph builders. @@ -257,7 +243,6 @@ class GraphBuilder: is always the original graph builder. """ - @staticmethod def join(*graph_builders: GraphBuilder) -> GraphBuilder: """Joins multiple graph builders into a single graph builder. @@ -275,13 +260,9 @@ class GraphBuilder: The newly joined graph builder. """ - def __cuda_stream__(self) -> tuple[int, int]: """Return an instance of a __cuda_stream__ protocol.""" - - def _get_conditional_context(self) -> driver.CUcontext: - ... - + def _get_conditional_context(self) -> driver.CUcontext: ... def create_condition(self, default_value: int | None=None) -> GraphCondition: """Create a condition variable for use with conditional nodes. @@ -301,7 +282,6 @@ class GraphBuilder: GraphCondition A condition variable for controlling conditional execution. """ - def if_then(self, condition: GraphCondition) -> GraphBuilder: """Adds an if condition branch and returns a new graph builder for it. @@ -322,7 +302,6 @@ class GraphBuilder: The newly created conditional graph builder. """ - def if_else(self, condition: GraphCondition) -> tuple[GraphBuilder, GraphBuilder]: """Adds an if-else condition branch and returns new graph builders for both branches. @@ -343,7 +322,6 @@ class GraphBuilder: A tuple of two new graph builders, one for the if branch and one for the else branch. """ - def switch(self, condition: GraphCondition, count: int) -> tuple[GraphBuilder, ...]: """Adds a switch condition branch and returns new graph builders for all cases. @@ -367,7 +345,6 @@ class GraphBuilder: A tuple of new graph builders, one for each branch. """ - def while_loop(self, condition: GraphCondition) -> GraphBuilder: """Adds a while loop and returns a new graph builder for it. @@ -388,7 +365,6 @@ class GraphBuilder: The newly created while loop graph builder. """ - def embed(self, child: GraphBuilder): """Embed a previously-built :obj:`~graph.GraphBuilder` as a child node. @@ -397,7 +373,6 @@ class GraphBuilder: child : :obj:`~graph.GraphBuilder` The child graph builder. Must have finished building. """ - def callback(self, fn, *, user_data=None) -> None: """Add a host callback to the graph during stream capture. @@ -407,10 +382,12 @@ class GraphBuilder: - **Python callable**: Pass any callable. The GIL is acquired automatically. The callable must take no arguments; use closures or ``functools.partial`` to bind state. - - **ctypes function pointer**: Pass a ``ctypes.CFUNCTYPE`` instance. - The function receives a single ``void*`` argument (the - ``user_data``). The caller must keep the ctypes wrapper alive - for the lifetime of the graph. + - **ctypes function pointer**: The function receives a single + ``void*`` argument (the ``user_data``), and the caller must keep + the ctypes wrapper alive for the lifetime of the graph. Its + declared prototype must match the driver's ``CUhostFn`` + (``void (*)(void*)``): ``ctypes.CFUNCTYPE(None, ctypes.c_void_p)``, + or ``ctypes.WINFUNCTYPE(None, ctypes.c_void_p)`` on Windows. .. warning:: @@ -430,6 +407,14 @@ class GraphBuilder: Only for ctypes function pointers. If ``int``, passed as a raw pointer (caller manages lifetime). If bytes-like, the data is copied and its lifetime is tied to the graph. + + Raises + ------ + TypeError + If ``fn`` is a ctypes function pointer whose declared prototype + does not match ``CUhostFn``. + ValueError + If ``user_data`` is given for a Python callable. """ class Graph: @@ -442,13 +427,9 @@ class Graph: Graphs must be built using a :obj:`~graph.GraphBuilder` object. """ - - def __init__(self): - ... - + def __init__(self): ... def close(self) -> None: """Destroy the graph.""" - @property def handle(self) -> driver.CUgraphExec: """Return the underlying ``CUgraphExec`` object. @@ -459,8 +440,15 @@ class Graph: handle, call ``int()`` on the returned object. """ + def __getitem__(self, node: GraphNode) -> ExecutableGraphNode: + """Return a view for updating *node* in this executable graph. - def update(self, source: 'GraphBuilder | GraphDefinition') -> None: + *node* is a definition node from the graph used to instantiate this + executable. Call ``update()`` on the returned view to replace that + node's parameters for future launches. Kernel, memcpy, and memset + views also support enabling and disabling the node. + """ + def update(self, source: GraphBuilder | GraphDefinition) -> None: """Update the graph using a new graph definition. The topology of the provided source must be identical to this graph. @@ -472,7 +460,6 @@ class Graph: finished building. """ - def upload(self, stream: Stream) -> None: """Uploads the graph in a stream. @@ -482,7 +469,6 @@ class Graph: The stream in which to upload the graph """ - def launch(self, stream: Stream) -> None: """Launches the graph in a stream. @@ -492,10 +478,7 @@ class Graph: The stream in which to launch the graph. """ -__all__ = ['Graph', 'GraphBuilder', 'GraphCompleteOptions', 'GraphDebugPrintOptions'] - -def _instantiate_graph(h_graph, options: GraphCompleteOptions | None=None) -> Graph: - ... +def _instantiate_graph(source, options: GraphCompleteOptions | None=None) -> Graph: ... def _capture_callback_with_tail_failure_for_testing(gb: GraphBuilder, fn, *, user_data=None): - """Exercise anonymous attachment retention after node discovery fails.""" \ No newline at end of file + """Exercise anonymous attachment retention after node discovery fails.""" diff --git a/cuda_core/cuda/core/graph/_graph_builder.pyx b/cuda_core/cuda/core/graph/_graph_builder.pyx index d3053a7261e..8fa8b3a5247 100644 --- a/cuda_core/cuda/core/graph/_graph_builder.pyx +++ b/cuda_core/cuda/core/graph/_graph_builder.pyx @@ -931,11 +931,14 @@ cdef inline void GB_callback( if fail_tail_discovery_for_testing: raise RuntimeError("forced capture tail discovery failure") host_node = _capture_tail_node(c_stream) - except: + except BaseException as orig_exc: # CUDA added the callback, but its node cannot be identified. # Retain its owners anonymously to prevent dangling pointers. commit_status = graph_commit_attachment(prepared, NULL) - HANDLE_RETURN(commit_status) + try: + HANDLE_RETURN(commit_status) + except Exception as commit_exc: + raise commit_exc from orig_exc raise HANDLE_RETURN(graph_commit_attachment(prepared, host_node)) diff --git a/cuda_core/cuda/core/graph/_graph_definition.pyi b/cuda_core/cuda/core/graph/_graph_definition.pyi index 9780b53b586..dd915e555a4 100644 --- a/cuda_core/cuda/core/graph/_graph_definition.pyi +++ b/cuda_core/cuda/core/graph/_graph_definition.pyi @@ -1,8 +1,6 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_graph_definition.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/graph/_graph_definition.pyx """GraphDefinition: explicit CUDA graph definition.""" -from __future__ import annotations - from cuda.core._device import Device from cuda.core._event import Event from cuda.core._launch_config import LaunchConfig @@ -20,6 +18,7 @@ from cuda.core.graph._subclasses import (AllocNode, ChildGraphNode, EmptyNode, WhileNode) from cuda.core.typing import GraphMemoryType +__all__ = ['GraphCondition', 'GraphDefinition'] class GraphCondition: """A condition variable for conditional graph nodes. @@ -36,16 +35,9 @@ class GraphCondition: ``CUgraphConditionalHandle`` value so device code can update the condition. """ - - def __repr__(self) -> str: - ... - - def __eq__(self, other: object) -> bool: - ... - - def __hash__(self) -> int: - ... - + def __repr__(self) -> str: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... @property def handle(self) -> driver.CUgraphConditionalHandle: """The raw CUgraphConditionalHandle as an int.""" @@ -63,47 +55,34 @@ class GraphDefinition: share underlying graph state. Mutations anywhere in that hierarchy must be externally synchronized. """ - def __init__(self): """Create a new empty graph definition.""" - - def __repr__(self) -> str: - ... - - def __eq__(self, other: object) -> bool: - ... - - def __hash__(self) -> int: - ... - + def __repr__(self) -> str: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... @property def _entry(self) -> GraphNode: """Return the internal entry-point GraphNode (no dependencies).""" - - def allocate(self, size: int, *, device: Device | int | None=None, memory_type: GraphMemoryType=..., peer_access: list[Device | int] | None=None) -> AllocNode: + def allocate(self, size: int, *, device: Device | int | None=None, memory_type: GraphMemoryType=GraphMemoryType.DEVICE, peer_access: list[Device | int] | None=None) -> AllocNode: """Add an entry-point memory allocation node (no dependencies). See :meth:`GraphNode.allocate` for full documentation. """ - def deallocate(self, dptr: int) -> FreeNode: """Add an entry-point memory free node (no dependencies). See :meth:`GraphNode.deallocate` for full documentation. """ - def memset(self, dst: Buffer | int, value, width: int, height: int=1, pitch: int=0, *, dst_owner=None) -> MemsetNode: """Add an entry-point memset node (no dependencies). See :meth:`GraphNode.memset` for full documentation. """ - def launch(self, config: LaunchConfig, kernel: Kernel, *args) -> KernelNode: """Add an entry-point kernel launch node (no dependencies). See :meth:`GraphNode.launch` for full documentation. """ - def empty(self) -> EmptyNode: """Add an entry-point empty node (no dependencies). @@ -112,7 +91,6 @@ class GraphDefinition: EmptyNode A new EmptyNode with no dependencies. """ - def join(self, *nodes: GraphNode) -> EmptyNode: """Create an empty node that depends on all given nodes. @@ -126,37 +104,31 @@ class GraphDefinition: EmptyNode A new EmptyNode that depends on all input nodes. """ - def memcpy(self, dst: Buffer | int, src: Buffer | int, size: int, *, dst_owner=None, src_owner=None) -> MemcpyNode: """Add an entry-point memcpy node (no dependencies). See :meth:`GraphNode.memcpy` for full documentation. """ - def embed(self, child: GraphDefinition) -> ChildGraphNode: """Add an entry-point child graph node (no dependencies). See :meth:`GraphNode.embed` for full documentation. """ - def record(self, event: Event) -> EventRecordNode: """Add an entry-point event record node (no dependencies). See :meth:`GraphNode.record` for full documentation. """ - def wait(self, event: Event) -> EventWaitNode: """Add an entry-point event wait node (no dependencies). See :meth:`GraphNode.wait` for full documentation. """ - def callback(self, fn, *, user_data=None) -> HostCallbackNode: """Add an entry-point host callback node (no dependencies). See :meth:`GraphNode.callback` for full documentation. """ - def create_condition(self, default_value: int | None=None) -> GraphCondition: """Create a condition variable for use with conditional nodes. @@ -175,31 +147,26 @@ class GraphDefinition: GraphCondition A condition variable for controlling conditional execution. """ - def if_then(self, condition: GraphCondition) -> IfNode: """Add an entry-point if-conditional node (no dependencies). See :meth:`GraphNode.if_then` for full documentation. """ - def if_else(self, condition: GraphCondition) -> IfElseNode: """Add an entry-point if-else conditional node (no dependencies). See :meth:`GraphNode.if_else` for full documentation. """ - def while_loop(self, condition: GraphCondition) -> WhileNode: """Add an entry-point while-loop conditional node (no dependencies). See :meth:`GraphNode.while_loop` for full documentation. """ - def switch(self, condition: GraphCondition, count: int) -> SwitchNode: """Add an entry-point switch conditional node (no dependencies). See :meth:`GraphNode.switch` for full documentation. """ - def instantiate(self, options: GraphCompleteOptions | None=None) -> Graph: """Instantiate the graph definition into an executable Graph. @@ -213,7 +180,6 @@ class GraphDefinition: Graph An executable graph that can be launched on a stream. """ - def debug_dot_print(self, path: str, options: GraphDebugPrintOptions | None=None) -> None: """Write a GraphViz DOT representation of the graph to a file. @@ -224,7 +190,6 @@ class GraphDefinition: options : GraphDebugPrintOptions, optional Customizable options for the debug print. """ - def nodes(self) -> set[GraphNode]: """Return all nodes in the graph. @@ -233,7 +198,6 @@ class GraphDefinition: set of GraphNode All nodes in the graph. """ - def edges(self) -> set[tuple[GraphNode, GraphNode]]: """Return all edges in the graph as (from_node, to_node) pairs. @@ -243,8 +207,6 @@ class GraphDefinition: Each element is a (from_node, to_node) pair representing a dependency edge in the graph. """ - @property def handle(self) -> driver.CUgraph: """Return the underlying driver CUgraph handle.""" -__all__ = ['GraphCondition', 'GraphDefinition'] \ No newline at end of file diff --git a/cuda_core/cuda/core/graph/_graph_definition.pyx b/cuda_core/cuda/core/graph/_graph_definition.pyx index 46896899ecd..e4bed7eef15 100644 --- a/cuda_core/cuda/core/graph/_graph_definition.pyx +++ b/cuda_core/cuda/core/graph/_graph_definition.pyx @@ -361,19 +361,17 @@ cdef class GraphDefinition: All nodes in the graph. """ cdef vector[cydriver.CUgraphNode] nodes_vec - nodes_vec.resize(128) - cdef size_t num_nodes = 128 + cdef size_t num_nodes = 0 with nogil: - HANDLE_RETURN(cydriver.cuGraphGetNodes(as_cu(self._h_graph), nodes_vec.data(), &num_nodes)) + HANDLE_RETURN(cydriver.cuGraphGetNodes(as_cu(self._h_graph), NULL, &num_nodes)) if num_nodes == 0: return set() - if num_nodes > 128: - nodes_vec.resize(num_nodes) - with nogil: - HANDLE_RETURN(cydriver.cuGraphGetNodes(as_cu(self._h_graph), nodes_vec.data(), &num_nodes)) + nodes_vec.resize(num_nodes) + with nogil: + HANDLE_RETURN(cydriver.cuGraphGetNodes(as_cu(self._h_graph), nodes_vec.data(), &num_nodes)) return {GraphNode._create(self._h_graph, nodes_vec[i]) for i in range(num_nodes)} @@ -388,31 +386,28 @@ cdef class GraphDefinition: """ cdef vector[cydriver.CUgraphNode] from_nodes cdef vector[cydriver.CUgraphNode] to_nodes - from_nodes.resize(128) - to_nodes.resize(128) - cdef size_t num_edges = 128 + cdef size_t num_edges = 0 with nogil: IF CUDA_CORE_BUILD_MAJOR >= 13: HANDLE_RETURN(cydriver.cuGraphGetEdges( - as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), NULL, &num_edges)) + as_cu(self._h_graph), NULL, NULL, NULL, &num_edges)) ELSE: HANDLE_RETURN(cydriver.cuGraphGetEdges( - as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), &num_edges)) + as_cu(self._h_graph), NULL, NULL, &num_edges)) if num_edges == 0: return set() - if num_edges > 128: - from_nodes.resize(num_edges) - to_nodes.resize(num_edges) - with nogil: - IF CUDA_CORE_BUILD_MAJOR >= 13: - HANDLE_RETURN(cydriver.cuGraphGetEdges( - as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), NULL, &num_edges)) - ELSE: - HANDLE_RETURN(cydriver.cuGraphGetEdges( - as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), &num_edges)) + from_nodes.resize(num_edges) + to_nodes.resize(num_edges) + with nogil: + IF CUDA_CORE_BUILD_MAJOR >= 13: + HANDLE_RETURN(cydriver.cuGraphGetEdges( + as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), NULL, &num_edges)) + ELSE: + HANDLE_RETURN(cydriver.cuGraphGetEdges( + as_cu(self._h_graph), from_nodes.data(), to_nodes.data(), &num_edges)) return { (GraphNode._create(self._h_graph, from_nodes[i]), diff --git a/cuda_core/cuda/core/graph/_graph_node.pyi b/cuda_core/cuda/core/graph/_graph_node.pyi index 23bcbf191a3..9c5d9c3a2e0 100644 --- a/cuda_core/cuda/core/graph/_graph_node.pyi +++ b/cuda_core/cuda/core/graph/_graph_node.pyi @@ -1,8 +1,6 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_graph_node.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/graph/_graph_node.pyx """GraphNode base class — factory, properties, and builder methods.""" -from __future__ import annotations - import weakref from collections.abc import Iterable @@ -21,6 +19,8 @@ from cuda.core.graph._subclasses import (AllocNode, ChildGraphNode, EmptyNode, SwitchNode, WhileNode) from cuda.core.typing import GraphMemoryType +__all__ = ['GraphNode'] +_node_registry: weakref.WeakValueDictionary[int, GraphNode] = weakref.WeakValueDictionary() class GraphNode: """A node in a graph definition. @@ -29,16 +29,9 @@ class GraphNode: entry-point nodes with no dependencies) or on other Nodes (for nodes that depend on a predecessor). """ - - def __repr__(self) -> str: - ... - - def __eq__(self, other: object) -> bool: - ... - - def __hash__(self) -> int: - ... - + def __repr__(self) -> str: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... @property def type(self) -> driver.CUgraphNodeType | None: """Return the CUDA graph node type. @@ -48,25 +41,21 @@ class GraphNode: CUgraphNodeType or None The node type enum value, or None for the entry node. """ - @property def graph(self) -> GraphDefinition: """Return the GraphDefinition this node belongs to.""" - @property def handle(self) -> driver.CUgraphNode: """Return the underlying driver CUgraphNode handle. Returns None for the entry node. """ - @property def is_valid(self) -> bool: """Whether this node is valid (not destroyed). Returns ``False`` after :meth:`destroy` has been called. """ - def destroy(self) -> None: """Destroy this node and remove all its edges from the parent graph. @@ -74,26 +63,22 @@ class GraphNode: cannot be re-added to any graph. Safe to call on an already-destroyed node (no-op). """ - @property def pred(self) -> AdjacencySetProxy: """A mutable set-like view of this node's predecessors.""" - @pred.setter - def pred(self, value: Iterable[GraphNode]) -> None: - ... - + def pred(self, value: Iterable[GraphNode]) -> None: ... @property def succ(self) -> AdjacencySetProxy: """A mutable set-like view of this node's successors.""" - @succ.setter - def succ(self, value: Iterable[GraphNode]) -> None: - ... - + def succ(self, value: Iterable[GraphNode]) -> None: ... def launch(self, config: LaunchConfig, kernel: Kernel, *args) -> KernelNode: """Add a kernel launch node depending on this node. + Clustered and cooperative launch configurations are not currently + supported for graph kernel nodes. + .. warning:: Use caution when a retained kernel argument directly or indirectly @@ -115,7 +100,6 @@ class GraphNode: KernelNode A new KernelNode representing the kernel launch. """ - def join(self, *nodes: GraphNode) -> EmptyNode: """Create an empty node that depends on this node and all given nodes. @@ -131,8 +115,7 @@ class GraphNode: EmptyNode A new EmptyNode that depends on all input nodes. """ - - def allocate(self, size: int, *, device: Device | int | None=None, memory_type: GraphMemoryType=..., peer_access: list[Device | int] | None=None) -> AllocNode: + def allocate(self, size: int, *, device: Device | int | None=None, memory_type: GraphMemoryType=GraphMemoryType.DEVICE, peer_access: list[Device | int] | None=None) -> AllocNode: """Add a memory allocation node depending on this node. Parameters @@ -171,7 +154,6 @@ class GraphNode: IPC (inter-process communication) is not supported for graph memory allocation nodes per CUDA documentation. """ - def deallocate(self, dptr: int) -> FreeNode: """Add a memory free node depending on this node. @@ -185,7 +167,6 @@ class GraphNode: FreeNode A new FreeNode representing the free operation. """ - def memset(self, dst: Buffer | int, value, width: int, height: int=1, pitch: int=0, *, dst_owner=None) -> MemsetNode: """Add a memset node depending on this node. @@ -227,7 +208,6 @@ class GraphNode: ValueError If ``dst_owner`` is given together with a :class:`Buffer` ``dst``. """ - def memcpy(self, dst: Buffer | int, src: Buffer | int, size: int, *, dst_owner=None, src_owner=None) -> MemcpyNode: """Add a memcpy node depending on this node. @@ -274,7 +254,6 @@ class GraphNode: If ``dst_owner`` or ``src_owner`` is given together with a :class:`Buffer` ``dst`` or ``src`` respectively. """ - def embed(self, child: GraphDefinition) -> ChildGraphNode: """Add a child graph node depending on this node. @@ -292,7 +271,6 @@ class GraphNode: ChildGraphNode A new ChildGraphNode representing the embedded sub-graph. """ - def record(self, event: Event) -> EventRecordNode: """Add an event record node depending on this node. @@ -306,7 +284,6 @@ class GraphNode: EventRecordNode A new EventRecordNode representing the event record operation. """ - def wait(self, event: Event) -> EventWaitNode: """Add an event wait node depending on this node. @@ -320,7 +297,6 @@ class GraphNode: EventWaitNode A new EventWaitNode representing the event wait operation. """ - def callback(self, fn, *, user_data=None) -> object: """Add a host callback node depending on this node. @@ -330,10 +306,12 @@ class GraphNode: - **Python callable**: Pass any callable. The GIL is acquired automatically. The callable must take no arguments; use closures or ``functools.partial`` to bind state. - - **ctypes function pointer**: Pass a ``ctypes.CFUNCTYPE`` instance. - The function receives a single ``void*`` argument (the - ``user_data``). The caller must keep the ctypes wrapper alive - for the lifetime of the graph. + - **ctypes function pointer**: The function receives a single + ``void*`` argument (the ``user_data``), and the caller must keep + the ctypes wrapper alive for the lifetime of the graph. Its + declared prototype must match the driver's ``CUhostFn`` + (``void (*)(void*)``): ``ctypes.CFUNCTYPE(None, ctypes.c_void_p)``, + or ``ctypes.WINFUNCTYPE(None, ctypes.c_void_p)`` on Windows. .. warning:: @@ -358,8 +336,15 @@ class GraphNode: ------- HostCallbackNode A new HostCallbackNode representing the callback. - """ + Raises + ------ + TypeError + If ``fn`` is a ctypes function pointer whose declared prototype + does not match ``CUhostFn``. + ValueError + If ``user_data`` is given for a Python callable. + """ def if_then(self, condition: GraphCondition) -> IfNode: """Add an if-conditional node depending on this node. @@ -376,7 +361,6 @@ class GraphNode: IfNode A new IfNode with one branch accessible via ``.then``. """ - def if_else(self, condition: GraphCondition) -> IfElseNode: """Add an if-else conditional node depending on this node. @@ -394,7 +378,6 @@ class GraphNode: A new IfElseNode with branches accessible via ``.then`` and ``.else_``. """ - def while_loop(self, condition: GraphCondition) -> WhileNode: """Add a while-loop conditional node depending on this node. @@ -411,7 +394,6 @@ class GraphNode: WhileNode A new WhileNode with body accessible via ``.body``. """ - def switch(self, condition: GraphCondition, count: int) -> SwitchNode: """Add a switch conditional node depending on this node. @@ -430,5 +412,3 @@ class GraphNode: SwitchNode A new SwitchNode with branches accessible via ``.branches``. """ -__all__ = ['GraphNode'] -_node_registry: weakref.WeakValueDictionary[int, GraphNode] = weakref.WeakValueDictionary() \ No newline at end of file diff --git a/cuda_core/cuda/core/graph/_graph_node.pyx b/cuda_core/cuda/core/graph/_graph_node.pyx index 2c9c07e6b3a..c4b6b02bf37 100644 --- a/cuda_core/cuda/core/graph/_graph_node.pyx +++ b/cuda_core/cuda/core/graph/_graph_node.pyx @@ -827,6 +827,7 @@ cdef inline AllocNode GN_alloc(GraphNode self, size_t size, object device, num_deps = 1 cdef vector[cydriver.CUmemAccessDesc] access_descs + cdef cydriver.CUmemAccessDesc access_desc cdef int peer_id cdef list peer_ids = [] @@ -834,13 +835,10 @@ cdef inline AllocNode GN_alloc(GraphNode self, size_t size, object device, for peer_dev in peer_access: peer_id = getattr(peer_dev, 'device_id', peer_dev) peer_ids.append(peer_id) - access_descs.push_back(cydriver.CUmemAccessDesc_st( - cydriver.CUmemLocation_st( - cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE, - peer_id - ), - cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE - )) + access_desc.location.type = cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE + access_desc.location.id = peer_id + access_desc.flags = cydriver.CUmemAccess_flags.CU_MEM_ACCESS_FLAGS_PROT_READWRITE + access_descs.push_back(access_desc) cdef str memory_type_str = "device" if memory_type is None else str(memory_type) diff --git a/cuda_core/cuda/core/graph/_host_callback.pyi b/cuda_core/cuda/core/graph/_host_callback.pyi index 6c9d0ead317..60674fcedc2 100644 --- a/cuda_core/cuda/core/graph/_host_callback.pyi +++ b/cuda_core/cuda/core/graph/_host_callback.pyi @@ -1,3 +1,16 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_host_callback.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/graph/_host_callback.pyx -from __future__ import annotations \ No newline at end of file +import sys + +_CUHOSTFN_HINT = 'ctypes.CFUNCTYPE(None, ctypes.c_void_p)' if sys.platform != 'win32' else 'ctypes.CFUNCTYPE(None, ctypes.c_void_p) or ctypes.WINFUNCTYPE(None, ctypes.c_void_p)' + +def _cuhostfn_type_error(detail): + """Build the rejection message for a non-conforming ctypes callback.""" +def _validate_ctypes_host_callback(fn): + """Reject ctypes callbacks whose declared prototype is not CUhostFn. + + ``restype`` and ``argtypes`` are the prototype the caller declared, and are + what CUDA calls through. A function pointer taken from a shared library + keeps ctypes' defaults -- a ``c_int`` result and unspecified arguments -- + until the caller declares otherwise, so it must be declared to be accepted. + """ diff --git a/cuda_core/cuda/core/graph/_subclasses.pyi b/cuda_core/cuda/core/graph/_subclasses.pyi index 345e6417c4d..7a46b2969b8 100644 --- a/cuda_core/cuda/core/graph/_subclasses.pyi +++ b/cuda_core/cuda/core/graph/_subclasses.pyi @@ -1,21 +1,19 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/graph/_subclasses.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/graph/_subclasses.pyx """GraphNode subclasses — EmptyNode through SwitchNode.""" -from __future__ import annotations - from cuda.core._event import Event from cuda.core._launch_config import LaunchConfig +from cuda.core._memory._buffer import Buffer from cuda.core._module import Kernel from cuda.core.graph._graph_definition import GraphCondition, GraphDefinition from cuda.core.graph._graph_node import GraphNode from cuda.core.typing import GraphConditionalType +__all__ = ['AllocNode', 'ChildGraphNode', 'ConditionalNode', 'EmptyNode', 'EventRecordNode', 'EventWaitNode', 'ExecutableChildGraphNode', 'ExecutableEventRecordNode', 'ExecutableEventWaitNode', 'ExecutableGraphNode', 'ExecutableHostCallbackNode', 'ExecutableKernelNode', 'ExecutableMemcpyNode', 'ExecutableMemsetNode', 'FreeNode', 'HostCallbackNode', 'IfElseNode', 'IfNode', 'KernelNode', 'MemcpyNode', 'MemsetNode', 'SwitchNode', 'WhileNode'] class EmptyNode(GraphNode): """An empty (synchronization) node.""" - - def __repr__(self) -> str: - ... + def __repr__(self) -> str: ... class KernelNode(GraphNode): """A kernel launch node. @@ -33,26 +31,33 @@ class KernelNode(GraphNode): config : LaunchConfig A LaunchConfig reconstructed from this node's parameters. """ + def __repr__(self) -> str: ... + def update(self, *, config: LaunchConfig | None=None, kernel: Kernel | None=None, args=None) -> None: + """Replace selected kernel launch parameters. - def __repr__(self) -> str: - ... + Omitted parameters preserve their current values. Changing ``kernel`` + requires ``args``, including ``args=()`` for a no-argument kernel. + Clustered and cooperative kernel nodes are not supported. + .. warning:: + + Use caution when a retained kernel argument directly or indirectly + owns a graph. Any reference cycle involving the argument and a + graph that retains it cannot be broken by Python's cyclic garbage + collector. Use a weak reference to break such cycles. + """ @property def grid(self) -> tuple[int, int, int]: """Grid dimensions as a 3-tuple (gridDimX, gridDimY, gridDimZ).""" - @property def block(self) -> tuple[int, int, int]: """Block dimensions as a 3-tuple (blockDimX, blockDimY, blockDimZ).""" - @property def shmem_size(self) -> int: """Dynamic shared memory size in bytes.""" - @property def kernel(self) -> Kernel: """The Kernel object for this launch node.""" - @property def config(self) -> LaunchConfig: """A LaunchConfig reconstructed from this node's grid, block, and shmem_size. @@ -77,26 +82,19 @@ class AllocNode(GraphNode): peer_access : tuple of int Device IDs that have read-write access to this allocation. """ - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... @property def dptr(self) -> int: """The device pointer for the allocation.""" - @property def bytesize(self) -> int: """The number of bytes allocated.""" - @property def device_id(self) -> int: """The device on which the allocation was made.""" - @property def memory_type(self) -> str: """The type of memory: ``"device"``, ``"host"``, or ``"managed"``.""" - @property def peer_access(self) -> tuple[int, ...]: """Device IDs with read-write access to this allocation.""" @@ -109,10 +107,7 @@ class FreeNode(GraphNode): dptr : int The device pointer being freed. """ - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... @property def dptr(self) -> int: """The device pointer being freed.""" @@ -135,30 +130,39 @@ class MemsetNode(GraphNode): pitch : int Pitch in bytes (unused if height is 1). """ + def __repr__(self) -> str: ... + def update(self, *, dst: Buffer | int | None=None, value=None, width: int | None=None, height: int | None=None, pitch: int | None=None, dst_owner=None) -> None: + """Replace selected memset parameters. + + Omitted parameters preserve their current values. ``dst_owner`` may + only accompany a raw-address ``dst``. - def __repr__(self) -> str: - ... + With CUDA 12.2 through 13.1, the node's intended CUDA context must be + current when this method is called. CUDA driver and ``cuda.bindings`` + versions 13.2 and newer preserve the recorded context automatically. + .. warning:: + + Use caution when a retained operand owner directly or indirectly + owns a graph. Any reference cycle involving the owner and a graph + that retains it cannot be broken by Python's cyclic garbage + collector. Use a weak reference to break such cycles. + """ @property def dptr(self) -> int: """The destination device pointer.""" - @property def value(self) -> int: """The fill value.""" - @property def element_size(self) -> int: """Element size in bytes (1, 2, or 4).""" - @property def width(self) -> int: """Width of the row in elements.""" - @property def height(self) -> int: """Number of rows.""" - @property def pitch(self) -> int: """Pitch in bytes (unused if height is 1).""" @@ -175,18 +179,32 @@ class MemcpyNode(GraphNode): size : int The number of bytes copied. """ + def __repr__(self) -> str: ... + def update(self, *, dst: Buffer | int | None=None, src: Buffer | int | None=None, size: int | None=None, dst_owner=None, src_owner=None) -> None: + """Replace selected memcpy parameters. + + Omitted parameters preserve their current values. ``dst_owner`` and + ``src_owner`` may only accompany their corresponding raw addresses. + Multidimensional, pitched, offset, and array-backed memcpy nodes are + not supported. + + With CUDA 12.2 through 13.1, the node's intended CUDA context must be + current when this method is called. CUDA driver and ``cuda.bindings`` + versions 13.2 and newer preserve the recorded context automatically. - def __repr__(self) -> str: - ... + .. warning:: + Use caution when a retained operand owner directly or indirectly + owns a graph. Any reference cycle involving the owner and a graph + that retains it cannot be broken by Python's cyclic garbage + collector. Use a weak reference to break such cycles. + """ @property def dst(self) -> int: """The destination pointer.""" - @property def src(self) -> int: """The source pointer.""" - @property def size(self) -> int: """The number of bytes copied.""" @@ -199,10 +217,12 @@ class ChildGraphNode(GraphNode): child_graph : GraphDefinition The embedded graph definition (non-owning wrapper). """ + def __repr__(self) -> str: ... + def update(self, child: GraphDefinition) -> None: + """Replace the embedded graph with a clone of ``child``. - def __repr__(self) -> str: - ... - + ``child`` must belong to an independent graph hierarchy. + """ @property def child_graph(self) -> GraphDefinition: """The embedded graph definition (non-owning wrapper).""" @@ -215,10 +235,9 @@ class EventRecordNode(GraphNode): event : Event The event being recorded. """ - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... + def update(self, event: Event) -> None: + """Replace the event recorded by this node.""" @property def event(self) -> Event: """The event being recorded.""" @@ -231,10 +250,9 @@ class EventWaitNode(GraphNode): event : Event The event being waited on. """ - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... + def update(self, event: Event) -> None: + """Replace the event waited on by this node.""" @property def event(self) -> Event: """The event being waited on.""" @@ -247,10 +265,25 @@ class HostCallbackNode(GraphNode): callback : callable or None The Python callable (None for ctypes function pointer callbacks). """ + def __repr__(self) -> str: ... + def update(self, fn, *, user_data=None) -> None: + """Replace the callback and user-data binding for this node. + + ``fn`` accepts the same forms as :meth:`~graph.GraphNode.callback`: a + Python callable, or a ctypes function pointer whose declared prototype + matches ``CUhostFn`` (``void (*)(void*)``). A mismatched ctypes + prototype raises ``TypeError``. + + .. warning:: - def __repr__(self) -> str: - ... + Callbacks must not call CUDA API functions. Doing so may + deadlock or corrupt driver state. + Use caution when a Python callback retains an object that owns a + graph. Any reference cycle involving the callback and a graph that + retains it cannot be broken by Python's cyclic garbage collector. + Use a weak reference to break such cycles. + """ @property def callback(self): """The Python callable, or None for ctypes function pointer callbacks.""" @@ -273,14 +306,10 @@ class ConditionalNode(GraphNode): branches : tuple of GraphDefinition The body graphs for each branch (empty pre-13.2). """ - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... @property def condition(self) -> GraphCondition | None: """The condition variable controlling execution.""" - @property def cond_type(self) -> GraphConditionalType | None: """The conditional type: GraphConditionalType.IF, .WHILE, or .SWITCH @@ -288,7 +317,6 @@ class ConditionalNode(GraphNode): Returns None when reconstructed from the driver pre-CUDA 13.2, as the conditional type cannot be determined. """ - @property def branches(self) -> tuple[GraphDefinition, ...]: """The body graphs for each branch as a tuple of GraphDefinition. @@ -299,41 +327,109 @@ class ConditionalNode(GraphNode): class IfNode(ConditionalNode): """An if-conditional node.""" - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... @property def then(self) -> GraphDefinition: """The 'then' branch graph.""" class IfElseNode(ConditionalNode): """An if-else conditional node.""" - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... @property def then(self) -> GraphDefinition: """The ``then`` branch graph (executed when condition is non-zero).""" - @property def else_(self) -> GraphDefinition: """The ``else`` branch graph (executed when condition is zero).""" class WhileNode(ConditionalNode): """A while-loop conditional node.""" - - def __repr__(self) -> str: - ... - + def __repr__(self) -> str: ... @property def body(self) -> GraphDefinition: """The loop body graph.""" class SwitchNode(ConditionalNode): """A switch conditional node.""" + def __repr__(self) -> str: ... + +class ExecutableGraphNode: + """A lightweight view pairing an executable graph with a source node. + + Create executable-node views with ``graph[node]``. CUDA validates that the + node identifies a node in the executable graph when an operation is + performed. + """ + def __init__(self): ... + def __repr__(self) -> str: ... + +class ExecutableKernelNode(ExecutableGraphNode): + """An executable kernel-node view.""" + def update(self, *, config: LaunchConfig, kernel: Kernel, args) -> None: + """Replace all kernel launch parameters for future launches. - def __repr__(self) -> str: - ... -__all__ = ['AllocNode', 'ChildGraphNode', 'ConditionalNode', 'EmptyNode', 'EventRecordNode', 'EventWaitNode', 'FreeNode', 'HostCallbackNode', 'IfElseNode', 'IfNode', 'KernelNode', 'MemcpyNode', 'MemsetNode', 'SwitchNode', 'WhileNode'] \ No newline at end of file + ``args`` must contain the complete argument sequence; use ``args=()`` + for a no-argument kernel. Clustered and cooperative launch + configurations are not supported. + """ + @property + def is_enabled(self) -> bool: + """Whether this node is enabled in the executable graph.""" + def enable(self) -> None: + """Enable this node in the executable graph.""" + def disable(self) -> None: + """Disable this node in the executable graph.""" + +class ExecutableMemsetNode(ExecutableGraphNode): + """An executable memset-node view.""" + def update(self, *, dst: Buffer | int, value, width: int, height: int=1, pitch: int=0) -> None: + """Replace all memset parameters for future launches.""" + @property + def is_enabled(self) -> bool: + """Whether this node is enabled in the executable graph.""" + def enable(self) -> None: + """Enable this node in the executable graph.""" + def disable(self) -> None: + """Disable this node in the executable graph.""" + +class ExecutableMemcpyNode(ExecutableGraphNode): + """An executable memcpy-node view.""" + def update(self, *, dst: Buffer | int, src: Buffer | int, size: int) -> None: + """Replace all one-dimensional memcpy parameters for future launches.""" + @property + def is_enabled(self) -> bool: + """Whether this node is enabled in the executable graph.""" + def enable(self) -> None: + """Enable this node in the executable graph.""" + def disable(self) -> None: + """Disable this node in the executable graph.""" + +class ExecutableChildGraphNode(ExecutableGraphNode): + """An executable child-graph-node view.""" + def update(self, child: GraphDefinition) -> None: + """Replace the embedded graph parameters for future launches.""" + +class ExecutableEventRecordNode(ExecutableGraphNode): + """An executable event-record-node view.""" + def update(self, event: Event) -> None: + """Replace the event recorded by future launches.""" + +class ExecutableEventWaitNode(ExecutableGraphNode): + """An executable event-wait-node view.""" + def update(self, event: Event) -> None: + """Replace the event waited on by future launches.""" + +class ExecutableHostCallbackNode(ExecutableGraphNode): + """An executable host-callback-node view.""" + def update(self, fn, *, user_data=None) -> None: + """Replace the callback and user-data binding for future launches. + + ``fn`` may be a Python callable, or a ctypes function pointer whose + declared prototype matches ``CUhostFn`` (``void (*)(void*)``); a + mismatched prototype raises ``TypeError``. + + .. warning:: + + Callbacks must not call CUDA API functions. Doing so may deadlock + or corrupt driver state. + """ diff --git a/cuda_core/cuda/core/system/_device.pyi b/cuda_core/cuda/core/system/_device.pyi index 4e0fa8cbb88..83eea9cbac7 100644 --- a/cuda_core/cuda/core/system/_device.pyi +++ b/cuda_core/cuda/core/system/_device.pyi @@ -1,8 +1,6 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/system/_device.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/system/_device.pyx -from __future__ import annotations - -from typing import Iterable +from typing import Iterable, TypedDict import cuda.core from cuda.bindings import nvml @@ -15,27 +13,57 @@ from cuda.core.system.typing import (AddressingMode, AffinityScope, ClockId, TemperatureThresholds, ThermalController, ThermalTarget) +_CLOCK_ID_MAPPING = {ClockId.CURRENT: nvml.ClockId.CURRENT, ClockId.CUSTOMER_BOOST_MAX: nvml.ClockId.CUSTOMER_BOOST_MAX} +_CLOCKS_EVENT_REASONS_MAPPING = {nvml.ClocksEventReasons.EVENT_REASON_NONE: ClocksEventReasons.NONE, nvml.ClocksEventReasons.EVENT_REASON_GPU_IDLE: ClocksEventReasons.GPU_IDLE, nvml.ClocksEventReasons.EVENT_REASON_APPLICATIONS_CLOCKS_SETTING: ClocksEventReasons.APPLICATIONS_CLOCKS_SETTING, nvml.ClocksEventReasons.EVENT_REASON_SW_POWER_CAP: ClocksEventReasons.SW_POWER_CAP, nvml.ClocksEventReasons.THROTTLE_REASON_HW_SLOWDOWN: ClocksEventReasons.HW_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_SYNC_BOOST: ClocksEventReasons.SYNC_BOOST, nvml.ClocksEventReasons.EVENT_REASON_SW_THERMAL_SLOWDOWN: ClocksEventReasons.SW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_THERMAL_SLOWDOWN: ClocksEventReasons.HW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN: ClocksEventReasons.HW_POWER_BRAKE_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_DISPLAY_CLOCK_SETTING: ClocksEventReasons.DISPLAY_CLOCK_SETTING, getattr(nvml.ClocksEventReasons, 'EVENT_REASON_BOARD_LIMIT', 512): ClocksEventReasons.BOARD_LIMIT, getattr(nvml.ClocksEventReasons, 'EVENT_REASON_RELIABILITY', 1024): ClocksEventReasons.RELIABILITY} +_CLOCK_TYPE_MAPPING = {ClockType.GRAPHICS: nvml.ClockType.CLOCK_GRAPHICS, ClockType.SM: nvml.ClockType.CLOCK_SM, ClockType.MEMORY: nvml.ClockType.CLOCK_MEM, ClockType.VIDEO: nvml.ClockType.CLOCK_VIDEO} +_COOLER_CONTROL_MAPPING = {nvml.CoolerControl.THERMAL_COOLER_SIGNAL_TOGGLE: CoolerControl.TOGGLE, nvml.CoolerControl.THERMAL_COOLER_SIGNAL_VARIABLE: CoolerControl.VARIABLE} +_COOLER_TARGET_MAPPING = {nvml.CoolerTarget.THERMAL_NONE: CoolerTarget.NONE, nvml.CoolerTarget.THERMAL_GPU: CoolerTarget.GPU, nvml.CoolerTarget.THERMAL_MEMORY: CoolerTarget.MEMORY, nvml.CoolerTarget.THERMAL_POWER_SUPPLY: CoolerTarget.POWER_SUPPLY} +_EVENT_TYPE_MAPPING = {nvml.EventType.NONE: EventType.NONE, nvml.EventType.SINGLE_BIT_ECC_ERROR: EventType.SINGLE_BIT_ECC_ERROR, nvml.EventType.DOUBLE_BIT_ECC_ERROR: EventType.DOUBLE_BIT_ECC_ERROR, nvml.EventType.PSTATE: EventType.PSTATE, nvml.EventType.XID_CRITICAL_ERROR: EventType.XID_CRITICAL_ERROR, nvml.EventType.CLOCK: EventType.CLOCK, nvml.EventType.POWER_SOURCE_CHANGE: EventType.POWER_SOURCE_CHANGE, nvml.EventType.MIG_CONFIG_CHANGE: EventType.MIG_CONFIG_CHANGE, nvml.EventType.SINGLE_BIT_ECC_ERROR_STORM: EventType.SINGLE_BIT_ECC_ERROR_STORM, nvml.EventType.DRAM_RETIREMENT_EVENT: EventType.DRAM_RETIREMENT_EVENT, nvml.EventType.DRAM_RETIREMENT_FAILURE: EventType.DRAM_RETIREMENT_FAILURE, nvml.EventType.NON_FATAL_POISON_ERROR: EventType.NON_FATAL_POISON_ERROR, nvml.EventType.FATAL_POISON_ERROR: EventType.FATAL_POISON_ERROR, nvml.EventType.GPU_UNAVAILABLE_ERROR: EventType.GPU_UNAVAILABLE_ERROR, nvml.EventType.GPU_RECOVERY_ACTION: EventType.GPU_RECOVERY_ACTION} +_EVENT_TYPE_INV_MAPPING = ... +_FAN_CONTROL_POLICY_MAPPING = {nvml.FanControlPolicy.TEMPERATURE_CONTINUOUS_SW: FanControlPolicy.TEMPERATURE_CONTROLLED, nvml.FanControlPolicy.MANUAL: FanControlPolicy.MANUAL} +_INFOROM_OBJECT_MAPPING = {InforomObject.OEM: nvml.InforomObject.INFOROM_OEM, InforomObject.ECC: nvml.InforomObject.INFOROM_ECC, InforomObject.POWER: nvml.InforomObject.INFOROM_POWER, InforomObject.DEN: nvml.InforomObject.INFOROM_DEN} +_NVLINK_VERSION_MAPPING = {nvml.NvlinkVersion.VERSION_1_0: (1, 0), nvml.NvlinkVersion.VERSION_2_0: (2, 0), nvml.NvlinkVersion.VERSION_2_2: (2, 2), nvml.NvlinkVersion.VERSION_3_0: (3, 0), nvml.NvlinkVersion.VERSION_3_1: (3, 1), nvml.NvlinkVersion.VERSION_4_0: (4, 0), nvml.NvlinkVersion.VERSION_5_0: (5, 0)} +_TEMPERATURE_THRESHOLD_MAPPING = {TemperatureThresholds.SHUTDOWN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SHUTDOWN, TemperatureThresholds.SLOWDOWN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SLOWDOWN, TemperatureThresholds.MEM_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_MEM_MAX, TemperatureThresholds.GPU_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPU_MAX, TemperatureThresholds.ACOUSTIC_MIN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_MIN, TemperatureThresholds.ACOUSTIC_CURR: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_CURR, TemperatureThresholds.ACOUSTIC_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_MAX, TemperatureThresholds.GPS_CURR: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPS_CURR} +_THERMAL_CONTROLLER_MAPPING = {nvml.ThermalController.GPU_INTERNAL: ThermalController.GPU_INTERNAL, nvml.ThermalController.ADM1032: ThermalController.ADM1032, nvml.ThermalController.ADT7461: ThermalController.ADT7461, nvml.ThermalController.MAX6649: ThermalController.MAX6649, nvml.ThermalController.MAX1617: ThermalController.MAX1617, nvml.ThermalController.LM99: ThermalController.LM99, nvml.ThermalController.LM89: ThermalController.LM89, nvml.ThermalController.LM64: ThermalController.LM64, nvml.ThermalController.G781: ThermalController.G781, nvml.ThermalController.ADT7473: ThermalController.ADT7473, nvml.ThermalController.SBMAX6649: ThermalController.SBMAX6649, nvml.ThermalController.VBIOSEVT: ThermalController.VBIOSEVT, nvml.ThermalController.OS: ThermalController.OS, nvml.ThermalController.NVSYSCON_CANOAS: ThermalController.NVSYSCON_CANOAS, nvml.ThermalController.NVSYSCON_E551: ThermalController.NVSYSCON_E551, nvml.ThermalController.MAX6649R: ThermalController.MAX6649R, nvml.ThermalController.ADT7473S: ThermalController.ADT7473S, nvml.ThermalController.UNKNOWN: ThermalController.UNKNOWN} +_THERMAL_TARGET_MAPPING = {nvml.ThermalTarget.NONE: ThermalTarget.NONE, nvml.ThermalTarget.GPU: ThermalTarget.GPU, nvml.ThermalTarget.MEMORY: ThermalTarget.MEMORY, nvml.ThermalTarget.POWER_SUPPLY: ThermalTarget.POWER_SUPPLY, nvml.ThermalTarget.BOARD: ThermalTarget.BOARD, nvml.ThermalTarget.VCD_BOARD: ThermalTarget.VCD_BOARD, nvml.ThermalTarget.VCD_INLET: ThermalTarget.VCD_INLET, nvml.ThermalTarget.VCD_OUTLET: ThermalTarget.VCD_OUTLET, nvml.ThermalTarget.ALL: ThermalTarget.ALL} +_THERMAL_TARGET_INV_MAPPING = ... +_ADDRESSING_MODE_MAPPING = {nvml.DeviceAddressingModeType.DEVICE_ADDRESSING_MODE_HMM: AddressingMode.HMM, nvml.DeviceAddressingModeType.DEVICE_ADDRESSING_MODE_ATS: AddressingMode.ATS} +_AFFINITY_SCOPE_MAPPING = {AffinityScope.NODE: nvml.AffinityScope.NODE, AffinityScope.SOCKET: nvml.AffinityScope.SOCKET} +_BRAND_TYPE_MAPPING = {nvml.BrandType.BRAND_UNKNOWN: 'Unknown', nvml.BrandType.BRAND_QUADRO: 'Quadro', nvml.BrandType.BRAND_TESLA: 'Tesla', nvml.BrandType.BRAND_NVS: 'NVS', nvml.BrandType.BRAND_GRID: 'GRID', nvml.BrandType.BRAND_GEFORCE: 'GeForce', nvml.BrandType.BRAND_TITAN: 'Titan', nvml.BrandType.BRAND_NVIDIA_VAPPS: 'NVIDIA vApps', nvml.BrandType.BRAND_NVIDIA_VPC: 'NVIDIA VPC', nvml.BrandType.BRAND_NVIDIA_VCS: 'NVIDIA VCS', nvml.BrandType.BRAND_NVIDIA_VWS: 'NVIDIA VWS', nvml.BrandType.BRAND_NVIDIA_CLOUD_GAMING: 'NVIDIA Cloud Gaming', nvml.BrandType.BRAND_NVIDIA_VGAMING: 'NVIDIA vGaming', nvml.BrandType.BRAND_QUADRO_RTX: 'Quadro RTX', nvml.BrandType.BRAND_NVIDIA_RTX: 'NVIDIA RTX', nvml.BrandType.BRAND_NVIDIA: 'NVIDIA', nvml.BrandType.BRAND_GEFORCE_RTX: 'GeForce RTX', nvml.BrandType.BRAND_TITAN_RTX: 'Titan RTX'} +_GPU_P2P_CAPS_INDEX_MAPPING = {GpuP2PCapsIndex.READ: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_READ, GpuP2PCapsIndex.WRITE: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_WRITE, GpuP2PCapsIndex.NVLINK: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_NVLINK, GpuP2PCapsIndex.ATOMICS: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_ATOMICS, GpuP2PCapsIndex.PCI: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PCI, GpuP2PCapsIndex.PROP: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PROP, GpuP2PCapsIndex.UNKNOWN: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_UNKNOWN} +_GPU_P2P_STATUS_MAPPING = {nvml.GpuP2PStatus.P2P_STATUS_OK: GpuP2PStatus.OK, nvml.GpuP2PStatus.P2P_STATUS_CHIPSET_NOT_SUPPORTED: GpuP2PStatus.CHIPSET_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_GPU_NOT_SUPPORTED: GpuP2PStatus.GPU_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED: GpuP2PStatus.IOH_TOPOLOGY_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_DISABLED_BY_REGKEY: GpuP2PStatus.DISABLED_BY_REGKEY, nvml.GpuP2PStatus.P2P_STATUS_NOT_SUPPORTED: GpuP2PStatus.NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_UNKNOWN: GpuP2PStatus.UNKNOWN} +_GPU_TOPOLOGY_LEVEL_MAPPING = {GpuTopologyLevel.INTERNAL: nvml.GpuTopologyLevel.TOPOLOGY_INTERNAL, GpuTopologyLevel.SINGLE: nvml.GpuTopologyLevel.TOPOLOGY_SINGLE, GpuTopologyLevel.MULTIPLE: nvml.GpuTopologyLevel.TOPOLOGY_MULTIPLE, GpuTopologyLevel.HOSTBRIDGE: nvml.GpuTopologyLevel.TOPOLOGY_HOSTBRIDGE, GpuTopologyLevel.NODE: nvml.GpuTopologyLevel.TOPOLOGY_NODE, GpuTopologyLevel.SYSTEM: nvml.GpuTopologyLevel.TOPOLOGY_SYSTEM} +_GPU_TOPOLOGY_LEVEL_INV_MAPPING = ... +__all__ = ['Device', 'get_p2p_status', 'get_topology_common_ancestor', 'NvlinkInfo'] + +class _GpuDynamicPstatesUtilization(TypedDict): + bIsPresent: int + percentage: int + incThreshold: int + decThreshold: int + +class _ThermalSensor(TypedDict): + controller: int + defaultMinTemp: int + defaultMaxTemp: int + currentTemp: int + target: int class ClockOffsets: """ Contains clock offset information. """ - - def __init__(self, clock_offset: nvml.ClockOffset): - ... - + def __init__(self, clock_offset: nvml.ClockOffset): ... @property def clock_offset_mhz(self) -> int: """ The current clock offset in MHz. """ - @property def max_offset_mhz(self) -> int: """ The maximum clock offset in MHz. """ - @property def min_offset_mhz(self) -> int: """ @@ -46,11 +74,8 @@ class ClockInfo: """ Accesses various clock information about a device. """ - - def __init__(self, handle: int, clock_type: ClockType | str): - ... - - def get_current_mhz(self, clock_id: ClockId | str=...) -> int: + def __init__(self, handle: int, clock_type: ClockType | str): ... + def get_current_mhz(self, clock_id: ClockId | str=ClockId.CURRENT) -> int: """ Get the current clock speed of a specific clock domain, in MHz. @@ -66,7 +91,6 @@ class ClockInfo: int The clock speed in MHz. """ - def get_max_mhz(self) -> int: """ Get the maximum clock speed of a specific clock domain, in MHz. @@ -81,7 +105,6 @@ class ClockInfo: int The maximum clock speed in MHz. """ - def get_max_customer_boost_mhz(self) -> int: """ Get the maximum customer boost clock speed of a specific clock, in MHz. @@ -93,7 +116,6 @@ class ClockInfo: int The maximum customer boost clock speed in MHz. """ - def get_min_max_clock_of_pstate_mhz(self, pstate: int) -> tuple[int, int]: """ Get the minimum and maximum clock speeds for this clock domain @@ -111,7 +133,6 @@ class ClockInfo: tuple[int, int] A tuple containing the minimum and maximum clock speeds in MHz. """ - def get_offsets(self, pstate: int) -> ClockOffsets: """ Retrieve min, max and current clock offset of some clock domain for a given Pstate. @@ -132,10 +153,7 @@ class ClockInfo: """ class CoolerInfo: - - def __init__(self, cooler_info: nvml.CoolerInfo): - ... - + def __init__(self, cooler_info: nvml.CoolerInfo): ... @property def signal_type(self) -> CoolerControl | None: """ @@ -143,7 +161,6 @@ class CoolerInfo: The possible types are variable and toggle. """ - @property def target(self) -> list[CoolerTarget]: """ @@ -157,58 +174,47 @@ class DeviceAttributes: """ Various device attributes. """ - - def __init__(self, attributes: nvml.DeviceAttributes): - ... - + def __init__(self, attributes: nvml.DeviceAttributes): ... @property def multiprocessor_count(self) -> int: """ The streaming multiprocessor count """ - @property def shared_copy_engine_count(self) -> int: """ The shared copy engine count """ - @property def shared_decoder_count(self) -> int: """ The shared decoder engine count """ - @property def shared_encoder_count(self) -> int: """ The shared encoder engine count """ - @property def shared_jpeg_count(self) -> int: """ The shared JPEG engine count """ - @property def shared_ofa_count(self) -> int: """ The shared optical flow accelerator (OFA) engine count """ - @property def gpu_instance_slice_count(self) -> int: """ The GPU instance slice count """ - @property def compute_instance_slice_count(self) -> int: """ The compute instance slice count """ - @property def memory_size_mb(self) -> int: """ @@ -219,22 +225,17 @@ class EventData: """ Data about a single event. """ - - def __init__(self, event_data: nvml.EventData): - ... - + def __init__(self, event_data: nvml.EventData): ... @property def device(self) -> Device: """ The device on which the event occurred. """ - @property def event_type(self) -> EventType: """ The type of event that was triggered. """ - @property def event_data(self) -> int: """ @@ -243,7 +244,6 @@ class EventData: Raises :class:`ValueError` for other event types. """ - @property def gpu_instance_id(self) -> int: """ @@ -253,7 +253,6 @@ class EventData: Raises :class:`ValueError` for other event types. """ - @property def compute_instance_id(self) -> int: """ @@ -268,13 +267,8 @@ class DeviceEvents: """ Represents a set of events that can be waited on for a specific device. """ - - def __init__(self, device_handle: int, events: EventType | str | list[EventType | str]): - ... - - def __dealloc__(self) -> None: - ... - + def __init__(self, device_handle: int, events: EventType | str | list[EventType | str]): ... + def __dealloc__(self) -> None: ... def wait(self, timeout_ms: int=0) -> EventData: """ Wait for events in the event set. @@ -322,10 +316,7 @@ class FanInfo: """ Manages information related to a specific fan on a specific device. """ - - def __init__(self, handle: int, fan: int): - ... - + def __init__(self, handle: int, fan: int): ... @property def speed(self) -> int: """ @@ -340,11 +331,8 @@ class FanInfo: The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed. This value may exceed 100% in certain cases. """ - @speed.setter - def speed(self, speed: int) -> None: - ... - + def speed(self, speed: int) -> None: ... @property def speed_rpm(self) -> int: """ @@ -359,7 +347,6 @@ class FanInfo: physically blocked and unable to spin, the output will not match the actual fan speed. """ - @property def target_speed(self) -> int: """ @@ -375,7 +362,6 @@ class FanInfo: The fan speed is expressed as a percentage of the product's maximum noise tolerance fan speed. This value may exceed 100% in certain cases. """ - @property def min_max_speed(self) -> tuple[int, int]: """ @@ -388,7 +374,6 @@ class FanInfo: tuple[int, int] A tuple of (min_speed, max_speed) """ - @property def control_policy(self) -> FanControlPolicy: """ @@ -398,7 +383,6 @@ class FanInfo: For all CUDA-capable discrete products with fans. """ - def set_default_speed(self) -> None: """ Set the speed of the fan control policy to default. @@ -412,29 +396,23 @@ class FieldValue: Use :meth:`Device.get_field_values` to get multiple field values at once. """ - - def __init__(self, field_value: nvml.FieldValue): - ... - + def __init__(self, field_value: nvml.FieldValue): ... @property def field_id(self) -> FieldId: """ The field ID. """ - @property def scope_id(self) -> int: """ The scope ID. """ - @property def timestamp(self) -> int: """ The CPU timestamp (in microseconds since 1970) at which the value was sampled. """ - @property def latency_usec(self) -> int: """ @@ -442,7 +420,6 @@ class FieldValue: be averaged across several fields that are serviced by the same driver call. """ - @property def value(self) -> int | float: """ @@ -458,16 +435,9 @@ class FieldValues: """ Container of multiple field values. """ - - def __init__(self, field_values: nvml.FieldValue): - ... - - def __getitem__(self, idx: int) -> FieldValue: - ... - - def __len__(self) -> int: - ... - + def __init__(self, field_values: nvml.FieldValue): ... + def __getitem__(self, idx: int) -> FieldValue: ... + def __len__(self) -> int: ... def validate(self) -> None: """ Validate that there are no issues in any of the contained field values. @@ -479,7 +449,6 @@ class FieldValues: :class:`cuda.core.system.NvmlError` If any of the contained field values has an associated exception. """ - def get_all_values(self) -> list[int | float]: """ Get all field values as a list. @@ -499,10 +468,7 @@ class FieldValues: """ class InforomInfo: - - def __init__(self, device: Device): - ... - + def __init__(self, device: Device): ... def get_version(self, inforom: InforomObject | str) -> str: """ Retrieves the InfoROM version for a given InfoROM object. @@ -522,7 +488,6 @@ class InforomInfo: str The InfoROM version. """ - @property def image_version(self) -> str: """ @@ -539,7 +504,6 @@ class InforomInfo: str The InfoROM image version. """ - @property def configuration_checksum(self) -> int: """ @@ -557,7 +521,6 @@ class InforomInfo: int The InfoROM checksum. """ - def validate(self) -> None: """ Reads the InfoROM from the flash and verifies the checksums. @@ -569,7 +532,6 @@ class InforomInfo: :class:`cuda.core.system.CorruptedInforomError` If the device's InfoROM is corrupted. """ - @property def bbx_flush_time(self) -> tuple[int, int]: """ @@ -584,7 +546,6 @@ class InforomInfo: - timestamp: The start timestamp of the last BBX flush - duration_us: The duration (in μs) of the last BBX flush """ - @property def board_part_number(self) -> str: """ @@ -595,28 +556,22 @@ class MemoryInfo: """ Memory allocation information for a device. """ - - def __init__(self, memory_info: nvml.Memory_v2): - ... - + def __init__(self, memory_info: nvml.Memory_v2): ... @property def free(self) -> int: """ Unallocated device memory (in bytes) """ - @property def total(self) -> int: """ Total physical device memory (in bytes) """ - @property def used(self) -> int: """ Allocated device memory (in bytes) """ - @property def reserved(self) -> int: """ @@ -627,22 +582,17 @@ class BAR1MemoryInfo(MemoryInfo): """ BAR1 Memory allocation information for a device. """ - - def __init__(self, memory_info: nvml.BAR1Memory): - ... - + def __init__(self, memory_info: nvml.BAR1Memory): ... @property def free(self) -> int: """ Unallocated BAR1 memory (in bytes) """ - @property def total(self) -> int: """ Total BAR1 memory (in bytes) """ - @property def used(self) -> int: """ @@ -650,10 +600,7 @@ class BAR1MemoryInfo(MemoryInfo): """ class MigInfo: - - def __init__(self, device: Device): - ... - + def __init__(self, device: Device): ... @property def is_mig_device(self) -> bool: """ @@ -666,7 +613,6 @@ class MigInfo: For Ampere™ or newer fully supported devices. """ - @property def mode(self) -> bool: """ @@ -682,7 +628,6 @@ class MigInfo: bool `True` if current MIG mode is enabled. """ - @mode.setter def mode(self, mode: bool) -> None: """ @@ -698,7 +643,6 @@ class MigInfo: mode: bool `True` to enable MIG mode, `False` to disable MIG mode. """ - @property def pending_mode(self) -> bool: """ @@ -716,7 +660,6 @@ class MigInfo: bool `True` if pending MIG mode is enabled. """ - @property def device_count(self) -> int: """ @@ -731,7 +674,6 @@ class MigInfo: int The number of MIG devices (compute instances) on this GPU. """ - @property def parent(self) -> Device: """ @@ -744,7 +686,6 @@ class MigInfo: Device The parent GPU device for this MIG device. """ - def get_device_by_index(self, index: int) -> Device: """ Get MIG device for the given index under its parent device. @@ -768,7 +709,6 @@ class MigInfo: Device The MIG device corresponding to the given index. """ - def get_all_devices(self) -> Iterable[Device]: """ Get all MIG devices under its parent device. @@ -788,7 +728,6 @@ class MigInfo: """ class _NvlinkInfoMeta(type): - @property def max_links(cls): """ @@ -807,10 +746,7 @@ class _NvlinkInfo: """ Nvlink information for a device. """ - - def __init__(self, device: Device, link: int): - ... - + def __init__(self, device: Device, link: int): ... @property def version(self) -> tuple[int, int]: """ @@ -823,7 +759,6 @@ class _NvlinkInfo: tuple[int, int] The Nvlink version as a tuple of (major, minor). """ - @property def state(self) -> bool: """ @@ -839,71 +774,58 @@ class _NvlinkInfo: `True` if the Nvlink is active. """ -class NvlinkInfo(_NvlinkInfo, metaclass=_NvlinkInfoMeta): - ... +class NvlinkInfo(_NvlinkInfo, metaclass=_NvlinkInfoMeta): ... class PciInfo: """ PCI information about a GPU device. """ - - def __init__(self, pci_info_ext: nvml.PciInfoExt_v1, handle: int): - ... - + def __init__(self, pci_info_ext: nvml.PciInfoExt_v1, handle: int): ... @property def bus(self) -> int: """ The bus on which the device resides, 0 to 255 """ - @property def bus_id(self) -> str: """ The tuple domain:bus:device.function PCI identifier string """ - @property def device(self) -> int: """ The device's id on the bus, 0 to 31 """ - @property def domain(self) -> int: """ The PCI domain on which the device's bus resides, 0 to 0xffffffff """ - @property def vendor_id(self) -> int: """ The PCI vendor id of the device """ - @property def device_id(self) -> int: """ The PCI device id of the device """ - @property def subsystem_id(self) -> int: """ The subsystem device ID """ - @property def base_class(self) -> int: """ The 8-bit PCI base class code """ - @property def sub_class(self) -> int: """ The 8-bit PCI sub class code """ - @property def link_generation(self) -> int: """ @@ -915,7 +837,6 @@ class PciInfo: PCIe bus, the max link generation this function will report is generation 1. """ - @property def max_link_generation(self) -> int: """ @@ -923,7 +844,6 @@ class PciInfo: For Fermi™ or newer fully supported devices. """ - @property def max_link_width(self) -> int: """ @@ -935,7 +855,6 @@ class PciInfo: PCIe system bus this function will report a max link width of 8. """ - @property def current_link_generation(self) -> int: """ @@ -943,7 +862,6 @@ class PciInfo: For Fermi™ or newer fully supported devices. """ - @property def current_link_width(self) -> int: """ @@ -951,7 +869,6 @@ class PciInfo: For Fermi™ or newer fully supported devices. """ - @property def rx_throughput(self) -> int: """ @@ -965,7 +882,6 @@ class PciInfo: This method is not supported in virtual machines running virtual GPU (vGPU). """ - @property def tx_throughput(self) -> int: """ @@ -979,7 +895,6 @@ class PciInfo: This method is not supported in virtual machines running virtual GPU (vGPU). """ - @property def replay_counter(self) -> int: """ @@ -989,28 +904,22 @@ class PciInfo: """ class GpuDynamicPstatesUtilization: - - def __init__(self, ptr: int, owner: object): - ... - + def __init__(self, ptr: int, owner: object): ... @property def is_present(self) -> bool: """ Set if the utilization domain is present on this GPU. """ - @property def percentage(self) -> int: """ Percentage of time where the domain is considered busy in the last 1-second interval. """ - @property def inc_threshold(self) -> int: """ Utilization threshold that can trigger a perf-increasing P-State change when crossed. """ - @property def dec_threshold(self) -> int: """ @@ -1021,36 +930,25 @@ class GpuDynamicPstatesInfo: """ Handles performance monitor samples from the device. """ - - def __init__(self, gpu_dynamic_pstates_info: nvml.GpuDynamicPstatesInfo): - ... - - def __len__(self) -> int: - ... - - def __getitem__(self, idx: int) -> GpuDynamicPstatesUtilization: - ... + def __init__(self, gpu_dynamic_pstates_info: nvml.GpuDynamicPstatesInfo): ... + def __len__(self) -> int: ... + def __getitem__(self, idx: int) -> GpuDynamicPstatesUtilization: ... class ProcessInfo: """ Information about running compute processes on the GPU. """ - - def __init__(self, device: 'Device', process_info: nvml.ProcessInfo): - ... - + def __init__(self, device: Device, process_info: nvml.ProcessInfo): ... @property def pid(self) -> int: """ The PID of the process. """ - @property def used_gpu_memory(self) -> int: """ The amount of GPU memory (in bytes) used by the process. """ - @property def gpu_instance_id(self) -> int: """ @@ -1058,7 +956,6 @@ class ProcessInfo: Only valid for processes running on MIG devices. """ - @property def compute_instance_id(self) -> int: """ @@ -1071,16 +968,12 @@ class RepairStatus: """ Repair status for TPC/Channel repair. """ - - def __init__(self, handle: int): - ... - + def __init__(self, handle: int): ... @property def channel_repair_pending(self) -> bool: """ `True` if a channel repair is pending. """ - @property def tpc_repair_pending(self) -> bool: """ @@ -1088,46 +981,25 @@ class RepairStatus: """ class ThermalSensor: - - def __init__(self, ptr: int, owner: object): - ... - + def __init__(self, ptr: int, owner: object): ... @property - def controller(self) -> ThermalController: - ... - + def controller(self) -> ThermalController: ... @property - def default_min_temp(self) -> int: - ... - + def default_min_temp(self) -> int: ... @property - def default_max_temp(self) -> int: - ... - + def default_max_temp(self) -> int: ... @property - def current_temp(self) -> int: - ... - + def current_temp(self) -> int: ... @property - def target(self) -> ThermalTarget: - ... + def target(self) -> ThermalTarget: ... class ThermalSettings: - - def __init__(self, thermal_settings: nvml.ThermalSettings): - ... - - def __len__(self) -> int: - ... - - def __getitem__(self, idx: int) -> nvml.ThermalSensor: - ... + def __init__(self, thermal_settings: nvml.ThermalSettings): ... + def __len__(self) -> int: ... + def __getitem__(self, idx: int) -> nvml.ThermalSensor: ... class Temperature: - - def __init__(self, handle: int): - ... - + def __init__(self, handle: int): ... def get_sensor(self) -> int: """ Get the temperature reading from a specific sensor on the device, in @@ -1140,7 +1012,6 @@ class Temperature: int The temperature in degrees Celsius. """ - def get_threshold(self, threshold_type: TemperatureThresholds | str) -> int: """ Retrieves the temperature threshold for this GPU with the specified @@ -1162,13 +1033,11 @@ class Temperature: use :meth:`get_field_values` with ``NVML_FI_DEV_TEMPERATURE_*`` fields to retrieve temperature thresholds on these architectures. """ - @property def margin(self) -> int: """ The thermal margin temperature (distance to nearest slowdown threshold) for the device. """ - def get_thermal_settings(self, sensor_index: ThermalTarget | str) -> ThermalSettings: """ Used to execute a list of thermal system instructions. @@ -1190,16 +1059,12 @@ class Utilization: For devices with compute capability 2.0 or higher. """ - - def __init__(self, utilization: nvml.Utilization): - ... - + def __init__(self, utilization: nvml.Utilization): ... @property def gpu(self) -> int: """ Percent of time over the past sample period during which one or more kernels was executing on the GPU. """ - @property def memory(self) -> int: """ @@ -1240,9 +1105,7 @@ class Device: """ _handle: int - def __init__(self, *, index: int | None=None, uuid: bytes | str | None=None, pci_bus_id: bytes | str | None=None) -> None: - ... - + def __init__(self, *, index: int | None=None, uuid: bytes | str | None=None, pci_bus_id: bytes | str | None=None) -> None: ... @property def index(self) -> int: """ @@ -1260,7 +1123,6 @@ class Device: Note: The NVML index may not correlate with other APIs, such as the CUDA device index. """ - @property def uuid(self) -> str: """ @@ -1272,7 +1134,6 @@ class Device: prefix. If you need a `uuid` without that prefix (for example, to interact with CUDA), use the `uuid_without_prefix` property. """ - @property def uuid_without_prefix(self) -> str: """ @@ -1284,13 +1145,11 @@ class Device: prefix. This property returns it without the prefix, to match the UUIDs used in CUDA. If you need the prefix, use the `uuid` property. """ - @property def pci_bus_id(self) -> str: """ Retrieves the PCI bus ID of this device. """ - @property def numa_node_id(self) -> int: """ @@ -1298,7 +1157,6 @@ class Device: This only applies to platforms where the GPUs are NUMA nodes. """ - @property def arch(self) -> DeviceArch: """ @@ -1308,13 +1166,11 @@ class Device: "VOLTA"``, and RTX A6000 will report ``DeviceArchitecture.name == "AMPERE"``. """ - @property def name(self) -> str: """ Name of the device, e.g.: `"Tesla V100-SXM2-32GB"` """ - @property def brand(self) -> str: """ @@ -1322,7 +1178,6 @@ class Device: Returns "Unknown" if the brand is unknown. """ - @property def serial(self) -> str: """ @@ -1331,7 +1186,6 @@ class Device: For all products with an InfoROM. """ - @property def module_id(self) -> int: """ @@ -1341,7 +1195,6 @@ class Device: on a given baseboard. For non-baseboard products, this ID would always be 0. """ - @property def minor_number(self) -> int: """ @@ -1352,13 +1205,11 @@ class Device: The minor number is used by the Linux device driver to identify the device node in ``/dev/nvidiaX``. """ - @property def is_c2c_enabled(self) -> bool: """ Whether the C2C (Chip-to-Chip) mode is enabled for this device. """ - @property def is_persistence_mode_enabled(self) -> bool: """ @@ -1366,11 +1217,8 @@ class Device: For Linux only. """ - @is_persistence_mode_enabled.setter - def is_persistence_mode_enabled(self, enabled: bool) -> None: - ... - + def is_persistence_mode_enabled(self, enabled: bool) -> None: ... @property def cuda_compute_capability(self) -> tuple[int, int]: """ @@ -1378,8 +1226,7 @@ class Device: Returns a tuple `(major, minor)`. """ - - def to_cuda_device(self) -> 'cuda.core.Device': + def to_cuda_device(self) -> cuda.core.Device: """ Get the corresponding :class:`cuda.core.Device` (which is used for CUDA access) for this :class:`cuda.core.system.Device` (which is used for @@ -1401,7 +1248,6 @@ class Device: available CUDA device, since it can not be used directly, even though it can be enumerated from NVML. """ - @classmethod def get_device_count(cls) -> int: """ @@ -1412,7 +1258,6 @@ class Device: int The number of available devices. """ - @classmethod def get_all_devices(cls) -> Iterable[Device]: """ @@ -1423,13 +1268,11 @@ class Device: Iterator over :obj:`~Device` An iterator over available devices. """ - @property def addressing_mode(self) -> AddressingMode | None: """ Get the :obj:`~AddressingMode` of the device. """ - @property def mig(self) -> MigInfo: """ @@ -1437,7 +1280,6 @@ class Device: For Ampere™ or newer fully supported devices. """ - @classmethod def get_all_devices_with_cpu_affinity(cls, cpu_index: int) -> Iterable[Device]: """ @@ -1455,8 +1297,7 @@ class Device: Iterator of :obj:`~Device` An iterator over available devices. """ - - def get_memory_affinity(self, scope: AffinityScope | str=...) -> list[int]: + def get_memory_affinity(self, scope: AffinityScope | str=AffinityScope.NODE) -> list[int]: """ Retrieves a list of indices of NUMA nodes or CPU sockets with the ideal memory affinity for the device. @@ -1481,8 +1322,7 @@ class Device: A list of indices of NUMA nodes or CPU sockets with the ideal memory affinity for the device. """ - - def get_cpu_affinity(self, scope: AffinityScope | str=...) -> list[int]: + def get_cpu_affinity(self, scope: AffinityScope | str=AffinityScope.NODE) -> list[int]: """ Retrieves a list of indices of NUMA nodes or CPU sockets with the ideal CPU affinity for the device. @@ -1507,7 +1347,6 @@ class Device: A list of indices of NUMA nodes or CPU sockets with the ideal memory affinity for the device. """ - def set_cpu_affinity(self) -> None: """ Sets the ideal affinity for the calling thread and device. @@ -1516,7 +1355,6 @@ class Device: Supported on Linux only. """ - def clear_cpu_affinity(self) -> None: """ Clear all affinity bindings for the calling thread. @@ -1525,12 +1363,10 @@ class Device: Supported on Linux only. """ - def get_clock(self, clock_type: ClockType | str) -> ClockInfo: """ :obj:`~_device.ClockInfo` object to get information about and manage a specific clock on a device. """ - @property def is_auto_boosted_clocks_enabled(self) -> tuple[bool, bool]: """ @@ -1554,7 +1390,6 @@ class Device: The default Auto Boosted clocks behavior """ - @property def current_clock_event_reasons(self) -> list[ClocksEventReasons]: """ @@ -1562,7 +1397,6 @@ class Device: For all fully supported products. """ - @property def supported_clock_event_reasons(self) -> list[ClocksEventReasons]: """ @@ -1573,13 +1407,11 @@ class Device: This method is not supported in virtual machines running virtual GPU (vGPU). """ - @property def cooler(self) -> CoolerInfo: """ :obj:`~_device.CoolerInfo` object with cooler information for the device. """ - @property def attributes(self) -> DeviceAttributes: """ @@ -1588,7 +1420,6 @@ class Device: For Ampere™ or newer fully supported devices. Only available on Linux systems. """ - @property def is_display_connected(self) -> bool: """ @@ -1597,7 +1428,6 @@ class Device: Indicates whether a physical display (e.g. monitor) is currently connected to any of the device's connectors. """ - @property def is_display_active(self) -> bool: """ @@ -1609,7 +1439,6 @@ class Device: Display can be active even when no monitor is physically attached. """ - def register_events(self, events: EventType | str | list[EventType | str]) -> DeviceEvents: """ Starts recording events on this device. @@ -1650,7 +1479,6 @@ class Device: :class:`cuda.core.system.NotSupportedError` None of the requested event types are registered. """ - def get_supported_event_types(self) -> list[EventType]: """ Get the list of event types supported by this device. @@ -1663,18 +1491,15 @@ class Device: list[EventType] The list of supported event types. """ - def get_fan(self, fan: int=0) -> FanInfo: """ :obj:`~_device.FanInfo` object to get information and manage a specific fan on a device. """ - @property def num_fans(self) -> int: """ The number of fans on the device. """ - def get_field_values(self, field_ids: list[int | tuple[int, int]]) -> FieldValues: """ Get multiple field values from the device. @@ -1699,7 +1524,6 @@ class Device: :obj:`~_device.FieldValues` Container of field values corresponding to the requested field IDs. """ - def clear_field_values(self, field_ids: list[int | tuple[int, int]]) -> None: """ Clear multiple field values from the device. @@ -1712,7 +1536,6 @@ class Device: Each item may be either a single value from the :class:`FieldId` enum, or a pair of (:class:`FieldId`, scope ID). """ - @property def inforom(self) -> InforomInfo: """ @@ -1720,7 +1543,6 @@ class Device: For all products with an InfoROM. """ - @property def bar1_memory_info(self) -> BAR1MemoryInfo: """ @@ -1730,13 +1552,11 @@ class Device: accessed by the CPU or by 3rd party devices (peer-to-peer on the PCIE bus). """ - @property def memory_info(self) -> MemoryInfo: """ :obj:`~_device.MemoryInfo` object with memory information. """ - def get_nvlink(self, link: int) -> NvlinkInfo: """ Get :obj:`~NvlinkInfo` about this device. @@ -1746,7 +1566,6 @@ class Device: .. version-changed:: 1.1.0 Any link number not supported by this specific device will raise a `ValueError`. """ - def get_nvlink_count(self) -> int: """ Get the number of NVLink links on this device. @@ -1755,7 +1574,6 @@ class Device: .. version-added:: 1.1.0 """ - def get_nvlinks(self) -> Iterable[NvlinkInfo]: """ Get :obj:`~NvlinkInfo` about all NVLink links on this device. @@ -1764,7 +1582,6 @@ class Device: .. version-added:: 1.1.0 """ - @property def pci_info(self) -> PciInfo: """ @@ -1773,7 +1590,6 @@ class Device: Non-physical devices, such as MIG devices, may not have PCI attributes. In that case, this property will raise a `RuntimeError`. """ - @property def performance_state(self) -> int | None: """ @@ -1788,13 +1604,11 @@ class Device: where 0 is maximum performance and higher numbers are lower performance. Returns `None` if the performance state is unknown. """ - @property def dynamic_pstates_info(self) -> GpuDynamicPstatesInfo: """ :obj:`~_device.GpuDynamicPstatesInfo` object with performance monitor samples from the associated subdevice. """ - @property def supported_pstates(self) -> list[int]: """ @@ -1810,7 +1624,6 @@ class Device: between 0 and 15, where 0 is maximum performance and higher numbers are lower performance. """ - @property def compute_running_processes(self) -> list[ProcessInfo]: """ @@ -1832,7 +1645,6 @@ class Device: Querying per-instance information using MIG device handles is not supported if the device is in vGPU Host virtualization mode. """ - @property def repair_status(self) -> RepairStatus: """ @@ -1840,13 +1652,11 @@ class Device: For Ampere™ or newer fully supported devices. """ - @property def temperature(self) -> Temperature: """ :obj:`~_device.Temperature` object with temperature information for the device. """ - def get_topology_nearest_gpus(self, level: GpuTopologyLevel | str) -> Iterable[Device]: """ Retrieve the GPUs that are nearest to this device at a specific interconnectivity level. @@ -1863,7 +1673,6 @@ class Device: Iterable of :class:`Device` The nearest devices at the given topology level. """ - @property def utilization(self) -> Utilization: """ @@ -1884,35 +1693,11 @@ class Device: Utilization An object containing the current utilization rates for the device. """ -_CLOCK_ID_MAPPING = {ClockId.CURRENT: nvml.ClockId.CURRENT, ClockId.CUSTOMER_BOOST_MAX: nvml.ClockId.CUSTOMER_BOOST_MAX} -_CLOCKS_EVENT_REASONS_MAPPING = {nvml.ClocksEventReasons.EVENT_REASON_NONE: ClocksEventReasons.NONE, nvml.ClocksEventReasons.EVENT_REASON_GPU_IDLE: ClocksEventReasons.GPU_IDLE, nvml.ClocksEventReasons.EVENT_REASON_APPLICATIONS_CLOCKS_SETTING: ClocksEventReasons.APPLICATIONS_CLOCKS_SETTING, nvml.ClocksEventReasons.EVENT_REASON_SW_POWER_CAP: ClocksEventReasons.SW_POWER_CAP, nvml.ClocksEventReasons.THROTTLE_REASON_HW_SLOWDOWN: ClocksEventReasons.HW_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_SYNC_BOOST: ClocksEventReasons.SYNC_BOOST, nvml.ClocksEventReasons.EVENT_REASON_SW_THERMAL_SLOWDOWN: ClocksEventReasons.SW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_THERMAL_SLOWDOWN: ClocksEventReasons.HW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN: ClocksEventReasons.HW_POWER_BRAKE_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_DISPLAY_CLOCK_SETTING: ClocksEventReasons.DISPLAY_CLOCK_SETTING, getattr(nvml.ClocksEventReasons, 'EVENT_REASON_BOARD_LIMIT', 512): ClocksEventReasons.BOARD_LIMIT, getattr(nvml.ClocksEventReasons, 'EVENT_REASON_RELIABILITY', 1024): ClocksEventReasons.RELIABILITY} -_CLOCK_TYPE_MAPPING = {ClockType.GRAPHICS: nvml.ClockType.CLOCK_GRAPHICS, ClockType.SM: nvml.ClockType.CLOCK_SM, ClockType.MEMORY: nvml.ClockType.CLOCK_MEM, ClockType.VIDEO: nvml.ClockType.CLOCK_VIDEO} -_COOLER_CONTROL_MAPPING = {nvml.CoolerControl.THERMAL_COOLER_SIGNAL_TOGGLE: CoolerControl.TOGGLE, nvml.CoolerControl.THERMAL_COOLER_SIGNAL_VARIABLE: CoolerControl.VARIABLE} -_COOLER_TARGET_MAPPING = {nvml.CoolerTarget.THERMAL_NONE: CoolerTarget.NONE, nvml.CoolerTarget.THERMAL_GPU: CoolerTarget.GPU, nvml.CoolerTarget.THERMAL_MEMORY: CoolerTarget.MEMORY, nvml.CoolerTarget.THERMAL_POWER_SUPPLY: CoolerTarget.POWER_SUPPLY} -_EVENT_TYPE_MAPPING = {nvml.EventType.NONE: EventType.NONE, nvml.EventType.SINGLE_BIT_ECC_ERROR: EventType.SINGLE_BIT_ECC_ERROR, nvml.EventType.DOUBLE_BIT_ECC_ERROR: EventType.DOUBLE_BIT_ECC_ERROR, nvml.EventType.PSTATE: EventType.PSTATE, nvml.EventType.XID_CRITICAL_ERROR: EventType.XID_CRITICAL_ERROR, nvml.EventType.CLOCK: EventType.CLOCK, nvml.EventType.POWER_SOURCE_CHANGE: EventType.POWER_SOURCE_CHANGE, nvml.EventType.MIG_CONFIG_CHANGE: EventType.MIG_CONFIG_CHANGE, nvml.EventType.SINGLE_BIT_ECC_ERROR_STORM: EventType.SINGLE_BIT_ECC_ERROR_STORM, nvml.EventType.DRAM_RETIREMENT_EVENT: EventType.DRAM_RETIREMENT_EVENT, nvml.EventType.DRAM_RETIREMENT_FAILURE: EventType.DRAM_RETIREMENT_FAILURE, nvml.EventType.NON_FATAL_POISON_ERROR: EventType.NON_FATAL_POISON_ERROR, nvml.EventType.FATAL_POISON_ERROR: EventType.FATAL_POISON_ERROR, nvml.EventType.GPU_UNAVAILABLE_ERROR: EventType.GPU_UNAVAILABLE_ERROR, nvml.EventType.GPU_RECOVERY_ACTION: EventType.GPU_RECOVERY_ACTION} -_EVENT_TYPE_INV_MAPPING = {v: k for k, v in _EVENT_TYPE_MAPPING.items()} -_FAN_CONTROL_POLICY_MAPPING = {nvml.FanControlPolicy.TEMPERATURE_CONTINUOUS_SW: FanControlPolicy.TEMPERATURE_CONTROLLED, nvml.FanControlPolicy.MANUAL: FanControlPolicy.MANUAL} -_INFOROM_OBJECT_MAPPING = {InforomObject.OEM: nvml.InforomObject.INFOROM_OEM, InforomObject.ECC: nvml.InforomObject.INFOROM_ECC, InforomObject.POWER: nvml.InforomObject.INFOROM_POWER, InforomObject.DEN: nvml.InforomObject.INFOROM_DEN} -_NVLINK_VERSION_MAPPING = {nvml.NvlinkVersion.VERSION_1_0: (1, 0), nvml.NvlinkVersion.VERSION_2_0: (2, 0), nvml.NvlinkVersion.VERSION_2_2: (2, 2), nvml.NvlinkVersion.VERSION_3_0: (3, 0), nvml.NvlinkVersion.VERSION_3_1: (3, 1), nvml.NvlinkVersion.VERSION_4_0: (4, 0), nvml.NvlinkVersion.VERSION_5_0: (5, 0)} -_NVLINK_VERSION_6_0 = getattr(nvml.NvlinkVersion, 'VERSION_6_0', None) -_TEMPERATURE_THRESHOLD_MAPPING = {TemperatureThresholds.SHUTDOWN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SHUTDOWN, TemperatureThresholds.SLOWDOWN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_SLOWDOWN, TemperatureThresholds.MEM_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_MEM_MAX, TemperatureThresholds.GPU_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPU_MAX, TemperatureThresholds.ACOUSTIC_MIN: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_MIN, TemperatureThresholds.ACOUSTIC_CURR: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_CURR, TemperatureThresholds.ACOUSTIC_MAX: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_ACOUSTIC_MAX, TemperatureThresholds.GPS_CURR: nvml.TemperatureThresholds.TEMPERATURE_THRESHOLD_GPS_CURR} -_THERMAL_CONTROLLER_MAPPING = {nvml.ThermalController.GPU_INTERNAL: ThermalController.GPU_INTERNAL, nvml.ThermalController.ADM1032: ThermalController.ADM1032, nvml.ThermalController.ADT7461: ThermalController.ADT7461, nvml.ThermalController.MAX6649: ThermalController.MAX6649, nvml.ThermalController.MAX1617: ThermalController.MAX1617, nvml.ThermalController.LM99: ThermalController.LM99, nvml.ThermalController.LM89: ThermalController.LM89, nvml.ThermalController.LM64: ThermalController.LM64, nvml.ThermalController.G781: ThermalController.G781, nvml.ThermalController.ADT7473: ThermalController.ADT7473, nvml.ThermalController.SBMAX6649: ThermalController.SBMAX6649, nvml.ThermalController.VBIOSEVT: ThermalController.VBIOSEVT, nvml.ThermalController.OS: ThermalController.OS, nvml.ThermalController.NVSYSCON_CANOAS: ThermalController.NVSYSCON_CANOAS, nvml.ThermalController.NVSYSCON_E551: ThermalController.NVSYSCON_E551, nvml.ThermalController.MAX6649R: ThermalController.MAX6649R, nvml.ThermalController.ADT7473S: ThermalController.ADT7473S, nvml.ThermalController.UNKNOWN: ThermalController.UNKNOWN} -_THERMAL_TARGET_MAPPING = {nvml.ThermalTarget.NONE: ThermalTarget.NONE, nvml.ThermalTarget.GPU: ThermalTarget.GPU, nvml.ThermalTarget.MEMORY: ThermalTarget.MEMORY, nvml.ThermalTarget.POWER_SUPPLY: ThermalTarget.POWER_SUPPLY, nvml.ThermalTarget.BOARD: ThermalTarget.BOARD, nvml.ThermalTarget.VCD_BOARD: ThermalTarget.VCD_BOARD, nvml.ThermalTarget.VCD_INLET: ThermalTarget.VCD_INLET, nvml.ThermalTarget.VCD_OUTLET: ThermalTarget.VCD_OUTLET, nvml.ThermalTarget.ALL: ThermalTarget.ALL} -_THERMAL_TARGET_INV_MAPPING = {v: k for k, v in _THERMAL_TARGET_MAPPING.items()} -_ADDRESSING_MODE_MAPPING = {nvml.DeviceAddressingModeType.DEVICE_ADDRESSING_MODE_HMM: AddressingMode.HMM, nvml.DeviceAddressingModeType.DEVICE_ADDRESSING_MODE_ATS: AddressingMode.ATS} -_AFFINITY_SCOPE_MAPPING = {AffinityScope.NODE: nvml.AffinityScope.NODE, AffinityScope.SOCKET: nvml.AffinityScope.SOCKET} -_BRAND_TYPE_MAPPING = {nvml.BrandType.BRAND_UNKNOWN: 'Unknown', nvml.BrandType.BRAND_QUADRO: 'Quadro', nvml.BrandType.BRAND_TESLA: 'Tesla', nvml.BrandType.BRAND_NVS: 'NVS', nvml.BrandType.BRAND_GRID: 'GRID', nvml.BrandType.BRAND_GEFORCE: 'GeForce', nvml.BrandType.BRAND_TITAN: 'Titan', nvml.BrandType.BRAND_NVIDIA_VAPPS: 'NVIDIA vApps', nvml.BrandType.BRAND_NVIDIA_VPC: 'NVIDIA VPC', nvml.BrandType.BRAND_NVIDIA_VCS: 'NVIDIA VCS', nvml.BrandType.BRAND_NVIDIA_VWS: 'NVIDIA VWS', nvml.BrandType.BRAND_NVIDIA_CLOUD_GAMING: 'NVIDIA Cloud Gaming', nvml.BrandType.BRAND_NVIDIA_VGAMING: 'NVIDIA vGaming', nvml.BrandType.BRAND_QUADRO_RTX: 'Quadro RTX', nvml.BrandType.BRAND_NVIDIA_RTX: 'NVIDIA RTX', nvml.BrandType.BRAND_NVIDIA: 'NVIDIA', nvml.BrandType.BRAND_GEFORCE_RTX: 'GeForce RTX', nvml.BrandType.BRAND_TITAN_RTX: 'Titan RTX'} -_GPU_P2P_CAPS_INDEX_MAPPING = {GpuP2PCapsIndex.READ: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_READ, GpuP2PCapsIndex.WRITE: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_WRITE, GpuP2PCapsIndex.NVLINK: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_NVLINK, GpuP2PCapsIndex.ATOMICS: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_ATOMICS, GpuP2PCapsIndex.PCI: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PCI, GpuP2PCapsIndex.PROP: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_PROP, GpuP2PCapsIndex.UNKNOWN: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_UNKNOWN} -_GPU_P2P_STATUS_MAPPING = {nvml.GpuP2PStatus.P2P_STATUS_OK: GpuP2PStatus.OK, nvml.GpuP2PStatus.P2P_STATUS_CHIPSET_NOT_SUPPORTED: GpuP2PStatus.CHIPSET_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_GPU_NOT_SUPPORTED: GpuP2PStatus.GPU_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_IOH_TOPOLOGY_NOT_SUPPORTED: GpuP2PStatus.IOH_TOPOLOGY_NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_DISABLED_BY_REGKEY: GpuP2PStatus.DISABLED_BY_REGKEY, nvml.GpuP2PStatus.P2P_STATUS_NOT_SUPPORTED: GpuP2PStatus.NOT_SUPPORTED, nvml.GpuP2PStatus.P2P_STATUS_UNKNOWN: GpuP2PStatus.UNKNOWN} -_GPU_TOPOLOGY_LEVEL_MAPPING = {GpuTopologyLevel.INTERNAL: nvml.GpuTopologyLevel.TOPOLOGY_INTERNAL, GpuTopologyLevel.SINGLE: nvml.GpuTopologyLevel.TOPOLOGY_SINGLE, GpuTopologyLevel.MULTIPLE: nvml.GpuTopologyLevel.TOPOLOGY_MULTIPLE, GpuTopologyLevel.HOSTBRIDGE: nvml.GpuTopologyLevel.TOPOLOGY_HOSTBRIDGE, GpuTopologyLevel.NODE: nvml.GpuTopologyLevel.TOPOLOGY_NODE, GpuTopologyLevel.SYSTEM: nvml.GpuTopologyLevel.TOPOLOGY_SYSTEM} -_GPU_TOPOLOGY_LEVEL_INV_MAPPING = {v: k for k, v in _GPU_TOPOLOGY_LEVEL_MAPPING.items()} -__all__ = ['Device', 'get_p2p_status', 'get_topology_common_ancestor', 'NvlinkInfo'] def _unpack_bitmask(arr: object) -> list[int]: """ Unpack a list of integers containing bitmasks. """ - def get_topology_common_ancestor(device1: Device, device2: Device) -> GpuTopologyLevel: """ Retrieve the common ancestor for two devices. @@ -1931,7 +1716,6 @@ def get_topology_common_ancestor(device1: Device, device2: Device) -> GpuTopolog :class:`GpuTopologyLevel` The common ancestor level of the two devices. """ - def get_p2p_status(device1: Device, device2: Device, index: GpuP2PCapsIndex | str) -> GpuP2PStatus: """ Retrieve the P2P status between two devices. @@ -1949,4 +1733,4 @@ def get_p2p_status(device1: Device, device2: Device, index: GpuP2PCapsIndex | st ------- :class:`GpuP2PStatus` The P2P status between the two devices. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/system/_nvml_context.pyi b/cuda_core/cuda/core/system/_nvml_context.pyi index e52a803b346..d61f31ddf40 100644 --- a/cuda_core/cuda/core/system/_nvml_context.pyi +++ b/cuda_core/cuda/core/system/_nvml_context.pyi @@ -1,17 +1,14 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/system/_nvml_context.pyx +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/system/_nvml_context.pyx -from __future__ import annotations +from typing import TypeAlias -import threading - -_NVMLState = int -_lock = threading.Lock() +_NVMLState: TypeAlias = int +def _get_nvml_state() -> _NVMLState: ... def _initialize() -> None: """ Initializes NVIDIA Management Library (NVML), ensuring it only happens once per process. """ - def validate() -> None: """ Validate NVML state. @@ -28,6 +25,3 @@ def validate() -> None: nvml.GpuNotFoundError If no GPUs are available. """ - -def _get_nvml_state() -> _NVMLState: - ... \ No newline at end of file diff --git a/cuda_core/cuda/core/system/_system.pyi b/cuda_core/cuda/core/system/_system.pyi index f25ce35be7f..0584101fa96 100644 --- a/cuda_core/cuda/core/system/_system.pyi +++ b/cuda_core/cuda/core/system/_system.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/system/_system.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/system/_system.pyx CUDA_BINDINGS_NVML_IS_COMPATIBLE: bool __all__ = ['get_driver_branch', 'get_kernel_mode_driver_version', 'get_user_mode_driver_version', 'get_nvml_version', 'get_num_devices', 'get_process_name', 'CUDA_BINDINGS_NVML_IS_COMPATIBLE'] @@ -17,7 +15,6 @@ def get_user_mode_driver_version() -> tuple[int, ...]: version : tuple[int, ...] A 2-tuple ``(MAJOR, MINOR)``, e.g. ``(13, 0)`` for CUDA 13.0. """ - def get_kernel_mode_driver_version() -> tuple[int, ...]: """ Get the kernel-mode (KMD / GPU) driver version, e.g. 580.65.06. @@ -33,7 +30,6 @@ def get_kernel_mode_driver_version() -> tuple[int, ...]: RuntimeError If the NVML library is not available. """ - def get_nvml_version() -> tuple[int, ...]: """ The version of the NVML library. @@ -43,7 +39,6 @@ def get_nvml_version() -> tuple[int, ...]: version: tuple[int, ...] Tuple of integers representing the NVML version components. """ - def get_driver_branch() -> str: """ Retrieves the driver branch of the NVIDIA driver installed on the system. @@ -53,12 +48,10 @@ def get_driver_branch() -> str: branch: str The driver branch string (e.g., ``"560"``, ``"open"``, etc.). """ - def get_num_devices() -> int: """ Return the number of devices in the system. """ - def get_process_name(pid: int) -> str: """ The name of process with given PID. @@ -72,4 +65,4 @@ def get_process_name(pid: int) -> str: ------- name: str The process name. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/system/_system_events.pyi b/cuda_core/cuda/core/system/_system_events.pyi index 5ae5b86bc57..ef367602975 100644 --- a/cuda_core/cuda/core/system/_system_events.pyi +++ b/cuda_core/cuda/core/system/_system_events.pyi @@ -1,33 +1,29 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/system/_system_events.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/system/_system_events.pyx from cuda.bindings import nvml from cuda.core.system.typing import SystemEventType from . import _device +_SYSTEM_EVENT_TYPE_MAPPING = {nvml.SystemEventType.GPU_DRIVER_UNBIND: SystemEventType.UNBIND, nvml.SystemEventType.GPU_DRIVER_BIND: SystemEventType.BIND} +_SYSTEM_EVENT_TYPE_INV_MAPPING = ... +__all__ = ['register_events'] class SystemEvent: """ Data about a collection of system events. """ - - def __init__(self, event_data: nvml.SystemEventData_v1): - ... - + def __init__(self, event_data: nvml.SystemEventData_v1): ... @property def event_type(self) -> SystemEventType: """ The :obj:`~SystemEventType` that was triggered. """ - @property def gpu_id(self) -> int: """ The GPU ID in PCI ID format. """ - @property def device(self) -> _device.Device: """ @@ -38,13 +34,8 @@ class SystemEvents: """ Data about a collection of system events. """ - - def __init__(self, event_data: nvml.SystemEventData_v1): - ... - - def __len__(self) -> int: - ... - + def __init__(self, event_data: nvml.SystemEventData_v1): ... + def __len__(self) -> int: ... def __getitem__(self, idx: int) -> SystemEvent: """ Get the :obj:`~_system_events.SystemEvent` at the specified index. @@ -54,13 +45,8 @@ class RegisteredSystemEvents: """ Represents a set of events that can be waited on for a specific device. """ - - def __init__(self, events: SystemEventType | str | list[SystemEventType | str]): - ... - - def __dealloc__(self) -> None: - ... - + def __init__(self, events: SystemEventType | str | list[SystemEventType | str]): ... + def __dealloc__(self) -> None: ... def wait(self, timeout_ms: int=0, buffer_size: int=1) -> SystemEvents: """ Wait for events in the system event set. @@ -95,9 +81,6 @@ class RegisteredSystemEvents: :class:`cuda.core.system.GpuIsLostError` If the GPU has fallen off the bus or is otherwise inaccessible. """ -_SYSTEM_EVENT_TYPE_MAPPING = {nvml.SystemEventType.GPU_DRIVER_UNBIND: SystemEventType.UNBIND, nvml.SystemEventType.GPU_DRIVER_BIND: SystemEventType.BIND} -_SYSTEM_EVENT_TYPE_INV_MAPPING = {v: k for k, v in _SYSTEM_EVENT_TYPE_MAPPING.items()} -__all__ = ['register_events'] def register_events(events: SystemEventType | str | list[SystemEventType | str]) -> RegisteredSystemEvents: """ @@ -130,4 +113,4 @@ def register_events(events: SystemEventType | str | list[SystemEventType | str]) ------ :class:`cuda.core.system.NotSupportedError` None of the requested event types are registered. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/texture/_array.pyi b/cuda_core/cuda/core/texture/_array.pyi index 380c2fe1c10..87b3530c63a 100644 --- a/cuda_core/cuda/core/texture/_array.pyi +++ b/cuda_core/cuda/core/texture/_array.pyi @@ -1,13 +1,14 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/texture/_array.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/texture/_array.pyx from dataclasses import dataclass -import numpy from cuda.bindings import cydriver from cuda.core.typing import ArrayFormatType +_ARRAYFORMAT_TO_CU = {ArrayFormatType.UINT8: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT8), ArrayFormatType.UINT16: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT16), ArrayFormatType.UINT32: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT32), ArrayFormatType.INT8: int(cydriver.CU_AD_FORMAT_SIGNED_INT8), ArrayFormatType.INT16: int(cydriver.CU_AD_FORMAT_SIGNED_INT16), ArrayFormatType.INT32: int(cydriver.CU_AD_FORMAT_SIGNED_INT32), ArrayFormatType.FLOAT16: int(cydriver.CU_AD_FORMAT_HALF), ArrayFormatType.FLOAT32: int(cydriver.CU_AD_FORMAT_FLOAT)} +_CU_TO_ARRAYFORMAT = ... +_NUMPY_DTYPE_TO_ARRAYFORMAT = ... +_FORMAT_ELEM_SIZE = {_ARRAYFORMAT_TO_CU[ArrayFormatType.UINT8]: 1, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT8]: 1, _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.FLOAT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT32]: 4, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT32]: 4, _ARRAYFORMAT_TO_CU[ArrayFormatType.FLOAT32]: 4} @dataclass class OpaqueArrayOptions: @@ -35,8 +36,7 @@ class OpaqueArrayOptions: num_channels: int is_surface_load_store: bool = False - def __post_init__(self): - ... + def __post_init__(self): ... class OpaqueArray: """An opaque, hardware-laid-out GPU allocation for texture/surface access. @@ -61,19 +61,7 @@ class OpaqueArray: .. versionadded:: 1.1.0 """ - - def close(self): - """Release this object's reference to the underlying ``CUarray``. - - Destruction (``cuArrayDestroy``) happens via the handle's deleter when - the last reference is dropped; for a non-owning handle (graphics interop - or a mipmap-level view) nothing is destroyed. Idempotent: a second call - (or destruction after ``close()``) is a no-op. - """ - - def __init__(self, *args, **kwargs): - ... - + def __init__(self, *args, **kwargs): ... @classmethod def _from_handle(cls, handle: int, owning: bool, *, device_id=None): """Wrap an externally-allocated ``CUarray``. @@ -83,40 +71,31 @@ class OpaqueArray: underlying ``CUarray`` is never destroyed by this object. Shape, format, and channel count are queried from the driver. """ - @property def handle(self): """The underlying ``CUarray`` as an integer.""" - @property def shape(self): """Allocation shape, in elements.""" - @property def format(self): """The element :class:`~cuda.core.typing.ArrayFormatType`.""" - @property def num_channels(self): """Channels per element (1, 2, or 4).""" - @property def element_bytes(self): """Bytes per element (format size * channels).""" - @property def device(self): """The :class:`Device` this array was allocated on.""" - @property def is_surface_load_store(self): """True if this array was created with ``CUDA_ARRAY3D_SURFACE_LDST`` and can be bound as a :class:`SurfaceObject`.""" - def _extent_bytes(self): """Return (width_bytes, height, depth) for cuMemcpy3D, with height/depth normalized to >=1 for lower-rank arrays.""" - def copy_from(self, src, *, stream) -> None: """Copy a full-array's worth of data into this array. @@ -129,7 +108,6 @@ class OpaqueArray: Stream to issue the copy on. A :class:`~cuda.core.graph.GraphBuilder` is accepted so the copy can be captured into a graph. """ - def copy_to(self, dst, *, stream): """Copy a full-array's worth of data out of this array. @@ -146,23 +124,20 @@ class OpaqueArray: ------- The ``dst`` object, for parity with :meth:`Buffer.copy_to`. """ - @property def size_bytes(self): """Total bytes of array storage (``prod(shape) * element_bytes``).""" + def close(self): + """Release this object's reference to the underlying ``CUarray``. - def __enter__(self): - ... - - def __exit__(self, exc_type, exc, tb): - ... - - def __repr__(self): - ... -_ARRAYFORMAT_TO_CU = {ArrayFormatType.UINT8: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT8), ArrayFormatType.UINT16: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT16), ArrayFormatType.UINT32: int(cydriver.CU_AD_FORMAT_UNSIGNED_INT32), ArrayFormatType.INT8: int(cydriver.CU_AD_FORMAT_SIGNED_INT8), ArrayFormatType.INT16: int(cydriver.CU_AD_FORMAT_SIGNED_INT16), ArrayFormatType.INT32: int(cydriver.CU_AD_FORMAT_SIGNED_INT32), ArrayFormatType.FLOAT16: int(cydriver.CU_AD_FORMAT_HALF), ArrayFormatType.FLOAT32: int(cydriver.CU_AD_FORMAT_FLOAT)} -_CU_TO_ARRAYFORMAT = {cu: fmt for fmt, cu in _ARRAYFORMAT_TO_CU.items()} -_NUMPY_DTYPE_TO_ARRAYFORMAT = {numpy.dtype(fmt.value): fmt for fmt in ArrayFormatType} -_FORMAT_ELEM_SIZE = {_ARRAYFORMAT_TO_CU[ArrayFormatType.UINT8]: 1, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT8]: 1, _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.FLOAT16]: 2, _ARRAYFORMAT_TO_CU[ArrayFormatType.UINT32]: 4, _ARRAYFORMAT_TO_CU[ArrayFormatType.INT32]: 4, _ARRAYFORMAT_TO_CU[ArrayFormatType.FLOAT32]: 4} + Destruction (``cuArrayDestroy``) happens via the handle's deleter when + the last reference is dropped; for a non-owning handle (graphics interop + or a mipmap-level view) nothing is destroyed. Idempotent: a second call + (or destruction after ``close()``) is a no-op. + """ + def __enter__(self): ... + def __exit__(self, exc_type, exc, tb): ... + def __repr__(self): ... def _normalize_array_format(format): """Coerce ``format`` to an :class:`ArrayFormatType`. @@ -176,16 +151,13 @@ def _normalize_array_format(format): supported formats. Raises :class:`ValueError` on anything else.""" - def _validate_format_channels(format, num_channels): """Validate the ``(format, num_channels)`` pair shared by the array, mipmap, and texture factories. Returns the normalized :class:`ArrayFormatType`. Raises on an invalid combination.""" - def _validate_array_shape(shape): """Coerce ``shape`` to a tuple of ints and validate rank (1-3) and that every extent is >= 1. Returns the normalized tuple.""" - def _create_opaque_array(options): """Allocate a new :class:`OpaqueArray` on the current device. @@ -193,4 +165,4 @@ def _create_opaque_array(options): :class:`OpaqueArrayOptions` (or a mapping accepted by it); it is validated at construction, so ``shape`` is already a normalized tuple and ``format`` an :class:`~cuda.core.typing.ArrayFormatType`. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/texture/_mipmapped_array.pyi b/cuda_core/cuda/core/texture/_mipmapped_array.pyi index db4413dbaf4..51835f8b36e 100644 --- a/cuda_core/cuda/core/texture/_mipmapped_array.pyi +++ b/cuda_core/cuda/core/texture/_mipmapped_array.pyi @@ -1,6 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/texture/_mipmapped_array.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/texture/_mipmapped_array.pyx from dataclasses import dataclass @@ -37,8 +35,7 @@ class MipmappedArrayOptions: num_levels: int is_surface_load_store: bool = False - def __post_init__(self): - ... + def __post_init__(self): ... class MipmappedArray: """A mipmapped CUDA array for texture/surface access across levels. @@ -54,19 +51,7 @@ class MipmappedArray: .. versionadded:: 1.1.0 """ - - def close(self): - """Release this object's reference to the underlying ``CUmipmappedArray``. - - Destruction (``cuMipmappedArrayDestroy``) happens via the handle's - deleter when the last reference is dropped. A level :class:`OpaqueArray` - from :meth:`get_level` holds its own reference to this mipmap's storage, - so it stays valid until both it and this object are released. Idempotent. - """ - - def __init__(self, *args, **kwargs): - ... - + def __init__(self, *args, **kwargs): ... def get_level(self, level): """Return a non-owning :class:`OpaqueArray` view of the given mip level. @@ -83,44 +68,39 @@ class MipmappedArray: returned :class:`OpaqueArray`; the underlying storage is released only when this :class:`MipmappedArray` is destroyed. """ - @property def handle(self): """The underlying ``CUmipmappedArray`` as an integer.""" - @property def shape(self): """Base-level (level 0) allocation shape, in elements.""" - @property def format(self): """The element :class:`~cuda.core.typing.ArrayFormatType`.""" - @property def num_channels(self): """Channels per element (1, 2, or 4).""" - @property def num_levels(self): """Number of mip levels.""" - @property def is_surface_load_store(self): """True if this mipmap (and each of its levels) was created with ``CUDA_ARRAY3D_SURFACE_LDST`` and can back a :class:`SurfaceObject`.""" - @property def device(self): """The :class:`Device` this mipmap was allocated on.""" + def close(self): + """Release this object's reference to the underlying ``CUmipmappedArray``. - def __enter__(self): - ... - - def __exit__(self, exc_type, exc, tb): - ... - - def __repr__(self): - ... + Destruction (``cuMipmappedArrayDestroy``) happens via the handle's + deleter when the last reference is dropped. A level :class:`OpaqueArray` + from :meth:`get_level` holds its own reference to this mipmap's storage, + so it stays valid until both it and this object are released. Idempotent. + """ + def __enter__(self): ... + def __exit__(self, exc_type, exc, tb): ... + def __repr__(self): ... def _create_mipmapped_array(options): """Allocate a new :class:`MipmappedArray` on the current device. @@ -128,4 +108,4 @@ def _create_mipmapped_array(options): Backs :meth:`cuda.core.Device.create_mipmapped_array`. ``options`` is a :class:`MipmappedArrayOptions` (or a mapping accepted by it); its fields are validated at construction. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/texture/_surface.pyi b/cuda_core/cuda/core/texture/_surface.pyi index 977268abd5f..67eae47c9bb 100644 --- a/cuda_core/cuda/core/texture/_surface.pyi +++ b/cuda_core/cuda/core/texture/_surface.pyi @@ -1,7 +1,4 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/texture/_surface.pyx - -from __future__ import annotations - +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/texture/_surface.pyx class SurfaceObject: """A bindless surface handle for kernel-side typed load/store. @@ -19,38 +16,25 @@ class SurfaceObject: .. versionadded:: 1.1.0 """ - - def close(self): - """Release this object's reference to the underlying ``CUsurfObject``. - - Destruction (``cuSurfObjectDestroy``) and release of the backing array - happen via the handle's deleter when the last reference is dropped. - Idempotent. - """ - - def __init__(self, *args, **kwargs): - ... - + def __init__(self, *args, **kwargs): ... @property def handle(self): """The underlying ``CUsurfObject`` as an integer (64-bit kernel arg).""" - @property def resource(self): """The :class:`ResourceDescriptor` this surface was built from.""" - @property - def device(self): - ... - - def __enter__(self): - ... - - def __exit__(self, exc_type, exc, tb): - ... + def device(self): ... + def close(self): + """Release this object's reference to the underlying ``CUsurfObject``. - def __repr__(self): - ... + Destruction (``cuSurfObjectDestroy``) and release of the backing array + happen via the handle's deleter when the last reference is dropped. + Idempotent. + """ + def __enter__(self): ... + def __exit__(self, exc_type, exc, tb): ... + def __repr__(self): ... def _create_surface_object(resource): """Create a :class:`SurfaceObject` on the current device. @@ -59,4 +43,4 @@ def _create_surface_object(resource): :class:`ResourceDescriptor` wrapping an :class:`OpaqueArray` allocated with ``is_surface_load_store=True``; linear/pitch2d resources are not valid surface backings. - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/texture/_texture.pyi b/cuda_core/cuda/core/texture/_texture.pyi index 7840585bb4d..f475d8cb239 100644 --- a/cuda_core/cuda/core/texture/_texture.pyi +++ b/cuda_core/cuda/core/texture/_texture.pyi @@ -1,12 +1,17 @@ -# This file was generated by stubgen-pyx v0.2.6 from cuda_core/cuda/core/texture/_texture.pyx - -from __future__ import annotations +# This file was generated by stubgen-pyx v0.2.19 from cuda_core/cuda/core/texture/_texture.pyx from dataclasses import dataclass from cuda.bindings import cydriver from cuda.core.typing import AddressModeType, FilterModeType, ReadModeType +_TRSF_READ_AS_INTEGER = 1 +_TRSF_NORMALIZED_COORDINATES = 2 +_TRSF_SRGB = 16 +_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32 +_TRSF_SEAMLESS_CUBEMAP = 64 +_ADDRESSMODE_TO_CU = {AddressModeType.WRAP: int(cydriver.CU_TR_ADDRESS_MODE_WRAP), AddressModeType.CLAMP: int(cydriver.CU_TR_ADDRESS_MODE_CLAMP), AddressModeType.MIRROR: int(cydriver.CU_TR_ADDRESS_MODE_MIRROR), AddressModeType.BORDER: int(cydriver.CU_TR_ADDRESS_MODE_BORDER)} +_FILTERMODE_TO_CU = {FilterModeType.POINT: int(cydriver.CU_TR_FILTER_MODE_POINT), FilterModeType.LINEAR: int(cydriver.CU_TR_FILTER_MODE_LINEAR)} class ResourceDescriptor: """Describes the memory backing a :class:`TextureObject`. @@ -30,13 +35,10 @@ class ResourceDescriptor: """ __slots__ = ('_kind', '_source', '_format', '_num_channels', '_size_bytes', '_width', '_height', '_pitch_bytes') - def __init__(self): - ... - + def __init__(self): ... @classmethod def from_opaque_array(cls, array): """Build a resource descriptor backed by a :class:`OpaqueArray`.""" - @classmethod def from_mipmapped_array(cls, mipmapped_array): """Build a resource descriptor backed by a :class:`MipmappedArray`. @@ -46,7 +48,6 @@ class ResourceDescriptor: require a single :class:`OpaqueArray` level (obtain via :meth:`MipmappedArray.get_level`). """ - @classmethod def from_linear(cls, buffer, *, format, num_channels, size_bytes=None): """Build a resource descriptor for a linear (typed 1D) texture fetch. @@ -71,7 +72,6 @@ class ResourceDescriptor: :class:`TextureObjectOptions` addressing/filtering fields — kernels read through a typed 1D fetch with bounds checking only. """ - @classmethod def from_pitch2d(cls, buffer, *, format, num_channels, width, height, pitch_bytes): """Build a resource descriptor for a row-pitched 2D image. @@ -95,41 +95,29 @@ class ResourceDescriptor: ``width * format_size * num_channels`` and meet the driver's ``CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT``. """ - @property - def kind(self): - ... - + def kind(self): ... @property - def source(self): - ... - + def source(self): ... @property def format(self): """The element :class:`~cuda.core.typing.ArrayFormatType` (``None`` for array-backed).""" - @property def num_channels(self): """Channels per element (``None`` for array-backed).""" - @property def size_bytes(self): """Bytes bound for a linear resource (``None`` for other kinds).""" - @property def width(self): """Pitch2D image width, in elements (``None`` for other kinds).""" - @property def height(self): """Pitch2D image height, in rows (``None`` for other kinds).""" - @property def pitch_bytes(self): """Pitch2D row pitch, in bytes (``None`` for other kinds).""" - - def __repr__(self): - ... + def __repr__(self): ... @dataclass class TextureObjectOptions: @@ -182,8 +170,7 @@ class TextureObjectOptions: max_mipmap_level_clamp: float = 0.0 border_color: tuple[float, ...] | None = None - def __post_init__(self): - ... + def __post_init__(self): ... class TextureObject: """A bindless texture handle for kernel-side sampled reads. @@ -197,61 +184,38 @@ class TextureObject: .. versionadded:: 1.1.0 """ - - def close(self): - """Release this object's reference to the underlying ``CUtexObject``. - - Destruction (``cuTexObjectDestroy``) and release of the backing resource - happen via the handle's deleter when the last reference is dropped. - Idempotent. - """ - - def __init__(self, *args, **kwargs): - ... - + def __init__(self, *args, **kwargs): ... @property def handle(self): """The underlying ``CUtexObject`` as an integer (64-bit kernel arg).""" - @property def resource(self): """The :class:`ResourceDescriptor` this texture was built from.""" - @property def options(self): """The :class:`TextureObjectOptions` this texture was built from.""" - @property - def device(self): - ... - - def __enter__(self): - ... - - def __exit__(self, exc_type, exc, tb): - ... + def device(self): ... + def close(self): + """Release this object's reference to the underlying ``CUtexObject``. - def __repr__(self): - ... -_TRSF_READ_AS_INTEGER = 1 -_TRSF_NORMALIZED_COORDINATES = 2 -_TRSF_SRGB = 16 -_TRSF_DISABLE_TRILINEAR_OPTIMIZATION = 32 -_TRSF_SEAMLESS_CUBEMAP = 64 -_ADDRESSMODE_TO_CU = {AddressModeType.WRAP: int(cydriver.CU_TR_ADDRESS_MODE_WRAP), AddressModeType.CLAMP: int(cydriver.CU_TR_ADDRESS_MODE_CLAMP), AddressModeType.MIRROR: int(cydriver.CU_TR_ADDRESS_MODE_MIRROR), AddressModeType.BORDER: int(cydriver.CU_TR_ADDRESS_MODE_BORDER)} -_FILTERMODE_TO_CU = {FilterModeType.POINT: int(cydriver.CU_TR_FILTER_MODE_POINT), FilterModeType.LINEAR: int(cydriver.CU_TR_FILTER_MODE_LINEAR)} + Destruction (``cuTexObjectDestroy``) and release of the backing resource + happen via the handle's deleter when the last reference is dropped. + Idempotent. + """ + def __enter__(self): ... + def __exit__(self, exc_type, exc, tb): ... + def __repr__(self): ... def _normalize_enum(name, value, enum_type): """Coerce ``value`` to ``enum_type`` (a StrEnum), accepting a plain str.""" - def _normalize_address_modes(address_mode): """Return a 3-tuple of :class:`AddressModeType` values from a scalar or 1-3 tuple. Individual entries may be plain strings.""" - def _create_texture_object(resource, options): """Create a :class:`TextureObject` on the current device. Backs :meth:`cuda.core.Device.create_texture_object`. ``resource`` is a :class:`ResourceDescriptor`; ``options`` is a :class:`TextureObjectOptions` (or a mapping accepted by it). - """ \ No newline at end of file + """ diff --git a/cuda_core/cuda/core/utils/__init__.py b/cuda_core/cuda/core/utils/__init__.py index 93a4c14c083..bc0a38f2b40 100644 --- a/cuda_core/cuda/core/utils/__init__.py +++ b/cuda_core/cuda/core/utils/__init__.py @@ -2,6 +2,12 @@ # # SPDX-License-Identifier: Apache-2.0 +from cuda.core._memory._copy_enums import ( + CopyOptions, + MemcpyOverlapMode, + MemcpySrcAccessOrder, +) +from cuda.core._memory._copy_ops import copy_batch from cuda.core._memory._managed_memory_ops import ( discard_batch, discard_prefetch_batch, @@ -19,11 +25,15 @@ ) __all__ = [ + "CopyOptions", "FileStreamProgramCache", "InMemoryProgramCache", + "MemcpyOverlapMode", + "MemcpySrcAccessOrder", "ProgramCacheResource", "StridedMemoryView", "args_viewable_as_strided_memory", + "copy_batch", "discard_batch", "discard_prefetch_batch", "make_program_cache_key", diff --git a/cuda_core/cuda/core/utils/_program_cache/_keys.py b/cuda_core/cuda/core/utils/_program_cache/_keys.py index e170bc18131..2df2d893835 100644 --- a/cuda_core/cuda/core/utils/_program_cache/_keys.py +++ b/cuda_core/cuda/core/utils/_program_cache/_keys.py @@ -499,6 +499,11 @@ def validate(self, options: ProgramOptions, target_type: str, extra_digest: byte raise ValueError( "extra_sources is only valid for code_type='nvvm'; Program() rejects it for code_type='ptx'." ) + # ``numba_debug`` is deliberately not rejected here and is absent from + # ``_LINKER_FIELD_GATES``: for PTX inputs the linker ignores it (with a + # warning from ``_translate_program_options``), so it cannot change the + # generated code and must not perturb the key. Two PTX compiles that + # differ only in ``numba_debug`` are the same compile. # PTX compiles go through the Linker. When the driver (cuLink) # backend is selected (nvJitLink unavailable), ``Program.compile`` # rejects a subset of options that nvJitLink would accept; reject diff --git a/cuda_core/docs/source/api.rst b/cuda_core/docs/source/api.rst index e903a46a7ee..5ee34d34f54 100644 --- a/cuda_core/docs/source/api.rst +++ b/cuda_core/docs/source/api.rst @@ -77,6 +77,14 @@ Memory management ManagedMemoryResourceOptions VirtualMemoryResourceOptions +A :class:`Buffer` records the stream that will order its eventual deallocation. +Use :meth:`Buffer.set_deallocation_stream` to replace that stream without +closing the buffer. Changing the recorded stream does not synchronize streams; +the caller must order allocation and every access before the deallocation, +using events or other CUDA synchronization mechanisms as needed. See +:cuda-core-example:`buffer_deallocation_stream.py <buffer_deallocation_stream.py>` +for a complete example. + CUDA compilation toolchain -------------------------- @@ -377,6 +385,7 @@ Utility functions :toctree: generated/ utils.args_viewable_as_strided_memory + utils.copy_batch utils.prefetch_batch utils.discard_batch utils.discard_prefetch_batch @@ -384,3 +393,20 @@ Utility functions :template: autosummary/cyclass.rst utils.StridedMemoryView + +Data transfer options +````````````````````` + +.. currentmodule:: cuda.core + +.. autosummary:: + :toctree: generated/ + + :template: dataclass.rst + + utils.CopyOptions + + :template: class.rst + + utils.MemcpySrcAccessOrder + utils.MemcpyOverlapMode diff --git a/cuda_core/docs/source/environment_variables.rst b/cuda_core/docs/source/environment_variables.rst index b9201abc505..b7e4418bb58 100644 --- a/cuda_core/docs/source/environment_variables.rst +++ b/cuda_core/docs/source/environment_variables.rst @@ -24,3 +24,10 @@ Runtime Environment Variables warnings about CUDA major version mismatches between ``cuda-bindings`` and the installed driver. This warning occurs when ``cuda-bindings`` was built for a newer CUDA major version than the installed driver supports. + +- ``CUDA_CORE_DONT_FIX_TAB_COMPLETION`` : When set to 1, ``import cuda.core`` + does not patch the standard library's :mod:`rlcompleter` module. The patch + works around a CPython bug (fixed in Python 3.13.13, 3.14.6 and 3.15) that + makes tab completion fail on Cython properties, and it changes global + interpreter state; set this variable to opt out. Unset, empty, and ``0`` + leave the patch enabled; any other value disables it. diff --git a/cuda_core/docs/source/examples.rst b/cuda_core/docs/source/examples.rst index cf13961c6dc..f5ae0c10300 100644 --- a/cuda_core/docs/source/examples.rst +++ b/cuda_core/docs/source/examples.rst @@ -39,6 +39,13 @@ Linking and graphs - :cuda-core-example:`cuda_graphs.py <cuda_graphs.py>` captures and replays a multi-kernel CUDA graph to reduce launch overhead. +Memory management +----------------- + +- :cuda-core-example:`buffer_deallocation_stream.py <buffer_deallocation_stream.py>` + transfers a buffer between streams and safely changes the stream that orders + its deallocation. + Interoperability and memory access ---------------------------------- diff --git a/cuda_core/docs/source/release/1.2.0-notes.rst b/cuda_core/docs/source/release/1.2.0-notes.rst index ef28e7931e4..6676b6ad622 100644 --- a/cuda_core/docs/source/release/1.2.0-notes.rst +++ b/cuda_core/docs/source/release/1.2.0-notes.rst @@ -6,9 +6,63 @@ ``cuda.core`` 1.2.0 Release Notes ================================== +New features +------------ + +- Added :class:`utils.CopyOptions` (source access order, location hints, + overlap mode) for buffer-to-buffer copies. The new + :func:`utils.copy_batch` accepts it and submits many copies in a single + ``cuMemcpyBatchAsync`` call, requiring ``cuda.core`` built against CUDA 13 + plus ``cuda.bindings``/driver 13.0 or newer. :meth:`Buffer.copy_to` and + :meth:`Buffer.copy_from` also accept it now, as a new ``options`` keyword, + submitting a single copy via ``cuMemcpyWithAttributesAsync`` and requiring + ``cuda.bindings``/driver 13.2 or newer. Both reject + ``LEGACY_DEFAULT_STREAM`` with ``TypeError`` (``PER_THREAD_DEFAULT_STREAM`` + is accepted); ``copy_batch`` always rejects graph capture, while + ``Buffer.copy_to``/``copy_from`` reject it only when ``options`` is given. + On an older ``cuda.bindings``/driver install, ``src_access_order`` values + of ``STREAM`` and ``ANY`` silently fall back to plain ``cuMemcpyAsync``; + ``DURING_API_CALL`` raises ``RuntimeError`` instead, since that fallback + cannot honor its guarantee that all source reads complete before the call + returns. Copies within a ``copy_batch`` call must not alias. + (`#1333 <https://github.com/NVIDIA/cuda-python/issues/1333>`__, + `#2365 <https://github.com/NVIDIA/cuda-python/issues/2365>`__) + +- Added the ``programmatic_stream_serialization`` option to + :class:`LaunchConfig`, which sets + ``cudaLaunchAttributeProgrammaticStreamSerialization`` so a kernel can + begin executing before the preceding kernel in the same stream has fully + completed (programmatic dependent launch, PDL). Available starting with + devices of compute capability 9.0. + (`#2456 <https://github.com/NVIDIA/cuda-python/pull/2456>`__, + `#1334 <https://github.com/NVIDIA/cuda-python/issues/1334>`__) + Fixes and enhancements ---------------------- +- A :class:`Buffer` is now freed correctly even when the CUDA context current + at teardown is not the one it was allocated in, or when no context is current + at all. This happens routinely when a buffer is released by the garbage + collector on another thread or by deferred CUDA graph cleanup; previously the + free could fail or be skipped, leaking the allocation. + (`#2497 <https://github.com/NVIDIA/cuda-python/issues/2497>`__) + +- :meth:`Buffer.from_handle` and :meth:`ManagedBuffer.from_handle` accept a + keyword-only ``stream`` that records the stream used to order the buffer's + deallocation when the memory resource owns the pointer. It defaults to + ``default_stream()``, which requires a CUDA context to be current so the + free recipe can pin that context. + (`#2497 <https://github.com/NVIDIA/cuda-python/issues/2497>`__) + +- Added :meth:`Buffer.set_deallocation_stream` to change the stream that orders + a buffer's eventual deallocation without closing the buffer. + (`#2600 <https://github.com/NVIDIA/cuda-python/issues/2600>`__) + +- Explicit calls to ``deallocate()`` on pool-backed memory resources and + :class:`GraphMemoryResource` now propagate errors from the underlying CUDA + free operation. Previously, these errors could be suppressed. Automatic + buffer cleanup remains non-raising and reports failures as warnings. + - Graph node resources are now retained independently across graph clones, executable graphs, updates, node deletion, and in-flight launches. Previously, modifying a graph definition could release resources still used by an @@ -73,6 +127,14 @@ Fixes and enhancements Windows, both ``ctypes.CFUNCTYPE`` and ``ctypes.WINFUNCTYPE`` are accepted. (`#2439 <https://github.com/NVIDIA/cuda-python/issues/2439>`__) +- :meth:`DeviceMemoryResource.register` and + :meth:`PinnedMemoryResource.register` now raise ``RuntimeError`` when the + memory resource does not have IPC enabled. Previously they dereferenced a + ``None`` attribute and terminated the process with a segmentation fault, so + the call could not be guarded with ``try``. A rejected registration no longer + leaves an entry in the memory resource registry. + (`#2568 <https://github.com/NVIDIA/cuda-python/issues/2568>`__) + - Starting with CUDA 13.4, unconstrained SM-resource discovery through :meth:`SMResource.split` with ``SMResourceOptions(count=None)`` may return every available SM, even when that count is not divisible by the device's @@ -85,9 +147,44 @@ Fixes and enhancements ``coscheduled_sm_count`` explicitly when an aligned result is required. (`#2389 <https://github.com/NVIDIA/cuda-python/pull/2389>`__) +- ``ProgramOptions(numba_debug=True)`` now works on the NVVM backend. The + option was emitted to libNVVM as ``--numba-debug``, but libNVVM accepts only + single-dashed options, so every such compile failed with + ``NVVM_ERROR_INVALID_OPTION``. It is now emitted as ``-numba-debug``, matching + what numba-cuda passes on the NVVM path. The NVRTC backend accepts both + spellings and was unaffected. The option itself is only recognized by newer + toolkits; libNVVM from CUDA 12.x does not support it under either spelling and + still reports ``NVVM_ERROR_INVALID_OPTION``. + (closes `#2570 <https://github.com/NVIDIA/cuda-python/issues/2570>`__) + +- ``Program(ptx, "ptx", ProgramOptions(numba_debug=True))`` now warns that the + option is ignored instead of discarding it silently. ``numba_debug`` is an + NVVM/NVRTC *compiler* option: nvJitLink rejects it with + ``ERROR_UNRECOGNIZED_OPTION`` under every spelling, and the driver's + ``cuLink`` API has no corresponding ``CUjit_option``, so no linking backend + can honor it. PTX inputs are handed to the linker, and the option used to be + forwarded into ``LinkerOptions`` and then dropped without a diagnostic. The + warning is a :class:`UserWarning`, not a :class:`DeprecationWarning` -- + ``ProgramOptions.numba_debug`` is not deprecated and remains fully supported + on the NVVM and NVRTC compilation paths, where it takes effect; it is simply + inapplicable to a linking backend. The gate is truthiness, matching how the + NVVM path gates emission, so ``numba_debug=False`` asks for nothing and is + not worth a warning. + (closes `#2640 <https://github.com/NVIDIA/cuda-python/issues/2640>`__) + Deprecation Notices ------------------- +- ``LinkerOptions.numba_debug`` is deprecated and will be removed in + ``cuda.core`` 2.0.0. It was exposed in ``cuda-core`` 1.1.0 but no linking + backend ever read it, so setting it has never had any effect; + ``numba_debug`` is an NVVM/NVRTC compiler option with no linker equivalent. + Setting it now emits a :class:`DeprecationWarning` and the value continues + to be ignored. Removal waits for the next major version because the + :doc:`support policy <../support>` confines breaking API changes to + major-version boundaries. Use :attr:`ProgramOptions.numba_debug` on an NVVM + or NVRTC compilation path instead. + - Support for using ``cuda-core`` with Python 3.10 is deprecated and will be removed in a future version. Python 3.10 reaches end of life in October 2026 per the `CPython support cycle <https://devguide.python.org/versions/>`_. diff --git a/cuda_core/examples/batched_memcpy.py b/cuda_core/examples/batched_memcpy.py new file mode 100644 index 00000000000..bb85b6e7995 --- /dev/null +++ b/cuda_core/examples/batched_memcpy.py @@ -0,0 +1,168 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example demonstrates the batched memory copy API (copy_batch) for +# performing multiple async memory transfers in a single driver call. It +# covers homogeneous batches (all copies share one CopyOptions), +# heterogeneous batches (per-copy attributes), and verifies equivalence +# with sequential Buffer.copy_to calls. +# +# Requires CUDA 13+ (cuMemcpyBatchAsync is not available on CUDA 12). +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings", "cuda_core"] +# /// + +import ctypes +import sys + +from cuda.core import Device, Host, LegacyPinnedMemoryResource, ManagedMemoryResource +from cuda.core.utils import CopyOptions, MemcpySrcAccessOrder, copy_batch + + +def readback(any_buf, pinned_mr, *, stream): + """Copy a buffer to a new pinned buffer and return the bytes.""" + host_buf = pinned_mr.allocate(any_buf.size) + any_buf.copy_to(host_buf, stream=stream) + stream.sync() + + ptr = ctypes.cast(int(host_buf.handle), ctypes.POINTER(ctypes.c_byte)) + data = ctypes.string_at(ptr, host_buf.size) + host_buf.close() + return data + + +def main(dev: Device): + dev.set_current() + stream = dev.create_stream() + pinned_mr = LegacyPinnedMemoryResource() + device_mr = dev.memory_resource + + num_copies = 4 + buf_size = 4096 + + # ---- Allocate source (pinned) and destination (device) buffers ---------- + + srcs = [] + dsts = [] + for i in range(num_copies): + src = pinned_mr.allocate(buf_size) + dst = device_mr.allocate(buf_size, stream=stream) + + # Fill each source with a distinct byte pattern so we can verify + fill_byte = (i + 1) % 256 + src.fill(fill_byte, stream=stream) + + srcs.append(src) + dsts.append(dst) + + # ---- 1. Homogeneous batch: all copies share a single CopyOptions ----- + + print("1. Homogeneous batched H2D copy...", file=sys.stderr) + + options = CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM) + copy_batch(stream, srcs, dsts, options=options) + + for i, dst in enumerate(dsts): + expected_byte = (i + 1) % 256 + data = readback(dst, pinned_mr, stream=stream) + assert all(b == expected_byte for b in data), f"Copy {i}: expected byte {expected_byte}, got {data[:8]!r}..." + + print(" All copies verified.", file=sys.stderr) + + # ---- 2. Equivalence with sequential Buffer.copy_to ---------------------- + + print("2. Verifying batched == sequential copy_to...", file=sys.stderr) + + # Re-fill sources with new patterns + for i, src in enumerate(srcs): + src.fill((i + 100) % 256, stream=stream) + + # Sequential path: individual copy_to calls + seq_dsts = [device_mr.allocate(buf_size, stream=stream) for _ in range(num_copies)] + for src, dst in zip(srcs, seq_dsts): + src.copy_to(dst, stream=stream) + + # Batched path: single copy_batch call + batch_dsts = [device_mr.allocate(buf_size, stream=stream) for _ in range(num_copies)] + copy_batch(stream, srcs, batch_dsts, options=CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM)) + + # Compare results + for i in range(num_copies): + seq_data = readback(seq_dsts[i], pinned_mr, stream=stream) + batch_data = readback(batch_dsts[i], pinned_mr, stream=stream) + assert seq_data == batch_data, f"Copy {i}: sequential and batched results differ" + + print(" Batched and sequential results match.", file=sys.stderr) + + # ---- 3. Heterogeneous batch: per-copy attributes ------------------------ + # + # src_access_order controls how the driver accesses source memory: + # STREAM - source read respects stream ordering (pinned/device memory) + # DURING_API_CALL - source read during the API call itself (ephemeral host ptrs) + # ANY - driver picks best strategy (pageable or HMM-backed memory) + + print("3. Heterogeneous batch with per-copy attributes...", file=sys.stderr) + + per_copy_options = [ + CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM), + CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY), + CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM), + CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY), + ] + hetero_dsts = [device_mr.allocate(buf_size, stream=stream) for _ in range(num_copies)] + copy_batch(stream, srcs, hetero_dsts, options=per_copy_options) + + for i in range(num_copies): + expected_byte = (i + 100) % 256 + data = readback(hetero_dsts[i], pinned_mr, stream=stream) + assert all(b == expected_byte for b in data), f"Heterogeneous copy {i}: expected byte {expected_byte}" + + print(" Heterogeneous batch verified.", file=sys.stderr) + + # ---- 4. Location hints with managed memory ------------------------------ + # + # When copying managed-memory buffers, src_location_hint and + # dst_location_hint tell the driver where the data currently lives and + # where it is going, enabling optimized transfer paths. + + print("4. Batched copy with location hints (managed memory)...", file=sys.stderr) + + managed_mr = ManagedMemoryResource() + managed_srcs = [managed_mr.allocate(buf_size, stream=stream) for _ in range(2)] + managed_dsts = [managed_mr.allocate(buf_size, stream=stream) for _ in range(2)] + + for i, src in enumerate(managed_srcs): + src.fill((i + 200) % 256, stream=stream) + + hint_options = CopyOptions( + src_access_order=MemcpySrcAccessOrder.STREAM, + src_location_hint=dev, + dst_location_hint=Host(), + ) + copy_batch(stream, managed_srcs, managed_dsts, options=hint_options) + + for i in range(2): + expected_byte = (i + 200) % 256 + data = readback(managed_dsts[i], pinned_mr, stream=stream) + assert all(b == expected_byte for b in data), f"Managed copy {i}: expected byte {expected_byte}" + + print(" Location-hinted batch verified.", file=sys.stderr) + + # ---- Cleanup ------------------------------------------------------------ + + all_bufs = srcs + dsts + seq_dsts + batch_dsts + hetero_dsts + managed_srcs + managed_dsts + for buf in all_bufs: + buf.close(stream) + stream.close() + + print("Batched memcpy example completed!") + + +if __name__ == "__main__": + main(Device(0)) diff --git a/cuda_core/examples/buffer_deallocation_stream.py b/cuda_core/examples/buffer_deallocation_stream.py new file mode 100644 index 00000000000..49579040590 --- /dev/null +++ b/cuda_core/examples/buffer_deallocation_stream.py @@ -0,0 +1,76 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# ################################################################################ +# +# This example transfers a buffer from a producer stream to a consumer stream. +# An event orders the consumer after the producer. The buffer then records the +# consumer stream for its eventual deallocation. +# +# ################################################################################ + +# /// script +# dependencies = ["cuda_bindings", "cuda_core"] +# /// + +import ctypes + +from cuda.core import Device, LegacyPinnedMemoryResource + + +def produce_data(device, stream, size, value): + """Allocate and fill a buffer on the producer stream.""" + buffer = device.allocate(size, stream=stream) + buffer.fill(value, stream=stream) + ready = stream.record() + return buffer, ready + + +def consume_data(buffer, ready, output, stream): + """Submit consumer work and transfer the deallocation stream.""" + stream.wait(ready) + buffer.set_deallocation_stream(stream) + buffer.copy_to(output, stream=stream) + + +def main(): + device = Device() + device.set_current() + producer_stream = device.create_stream() + consumer_stream = device.create_stream() + pinned_mr = LegacyPinnedMemoryResource() + + size = 4096 + value = 42 + buffer = None + ready = None + output = None + + try: + output = pinned_mr.allocate(size) + buffer, ready = produce_data(device, producer_stream, size, value) + consume_data(buffer, ready, output, consumer_stream) + + # No stream argument is needed. The buffer now records consumer_stream. + # The free operation runs after the copy on that stream. + buffer.close() + buffer = None + consumer_stream.sync() + + result = ctypes.string_at(int(output.handle), output.size) + assert result == bytes([value]) * size + print("Buffer deallocation stream transfer completed.") + finally: + if buffer is not None: + buffer.close() + if output is not None: + output.close() + if ready is not None: + ready.close() + consumer_stream.close() + producer_stream.close() + + +if __name__ == "__main__": + main() diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index f3afa29241d..4c2c65e9b3f 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -155,6 +155,14 @@ ignore_missing_imports = true module = "cuda.core._utils.cuda_utils" disable_error_code = ["type-arg"] +[[tool.mypy.overrides]] +# stubgen-pyx can't resolve DLPackExchangeAPI's C function-pointer typedef +# fields and emits bare "..." as their annotation, which is invalid outside +# a Callable[...] context. Suppress until upstream is fixed: +# https://github.com/jon-edward/stubgen-pyx/issues (report pending) +module = "cuda.core._dlpack" +disable_error_code = ["misc"] + [tool.cibuildwheel] skip = "*-musllinux_*" build-verbosity = 1 diff --git a/cuda_core/pytest.ini b/cuda_core/pytest.ini index 64fcf312a79..8661d2cdc64 100644 --- a/cuda_core/pytest.ini +++ b/cuda_core/pytest.ini @@ -4,6 +4,7 @@ [pytest] addopts = --showlocals --durations=20 +pythonpath = tests norecursedirs = cython markers = # Keep this authorship marker registry in sync across all pytest config roots. diff --git a/cuda_core/tests/AGENTS.md b/cuda_core/tests/AGENTS.md index 39472d745b5..fe6f100b923 100644 --- a/cuda_core/tests/AGENTS.md +++ b/cuda_core/tests/AGENTS.md @@ -65,3 +65,28 @@ by `cuCtxSynchronize()` before popping the context. Tests should not rely on that as a substitute for cleaning up explicitly: prefer context managers for resources whose lifetime fits a single scope, and keep pool lifetimes inside the test that creates them. + +## Shared test support + +See also: https://docs.pytest.org/en/stable/reference/fixtures.html#conftest-py-sharing-fixtures-across-multiple-files + +Follow these rules when adding or moving shared test code: + +- Never import from a `conftest.py`. +- Put suite-wide fixtures and pytest hooks in `tests/conftest.py`. Put fixtures + needed only by one test subtree in that subtree's nearest `conftest.py`. +- Put a pytest hook in a nested `conftest.py` only if pytest supports that hook + there. If the hook receives suite-wide data, explicitly limit its effects to + the intended subtree. +- Code used only to implement fixtures or hooks may remain in the same + `conftest.py`. Put functions and constants imported by test modules in + `tests/helpers/` instead. +- Import helpers explicitly from the test root, for example: + `from helpers.memory import create_managed_memory_resource_or_skip`. +- Fixtures in a nested `conftest.py` are available to tests in its directory + and descendants; fixtures from applicable parent `conftest.py` files remain + available. +- Do not add `__init__.py` solely because a test directory contains a + `conftest.py`. +- In directories without `__init__.py`, keep test-module basenames unique + within this test suite. diff --git a/cuda_core/tests/conftest.py b/cuda_core/tests/conftest.py index dfe97b265eb..69e774de08d 100644 --- a/cuda_core/tests/conftest.py +++ b/cuda_core/tests/conftest.py @@ -29,9 +29,8 @@ pytest_plugins = ["cuda_python_test_helpers._pytest_plugin"] -from cuda_python_test_helpers.marks import skipif_need_cuda_headers # noqa: F401 (re-exported for tests) -from cuda_python_test_helpers.mempool import xfail_if_mempool_oom from helpers.constants import POOL_SIZE +from helpers.memory import skip_if_pinned_memory_unsupported import cuda.core from cuda.bindings import driver @@ -45,7 +44,7 @@ PinnedMemoryResourceOptions, _device, ) -from cuda.core._utils.cuda_utils import CUDAError, handle_return +from cuda.core._utils.cuda_utils import handle_return def pytest_configure(config): @@ -141,83 +140,6 @@ def pytest_collection_modifyitems(self, config, items): item.obj = _wrap_worker_cuda_test(item.obj) -def skip_if_pinned_memory_unsupported(device): - try: - if not device.properties.host_memory_pools_supported: - pytest.skip("Device does not support host mempool operations") - except AttributeError: - pytest.skip("PinnedMemoryResource requires CUDA 13.0 or later") - - -def skip_if_managed_memory_unsupported(device): - try: - if not device.properties.memory_pools_supported or not device.properties.concurrent_managed_access: - pytest.skip("Device does not support managed memory pool operations") - except AttributeError: - pytest.skip("ManagedMemoryResource requires CUDA 13.0 or later") - try: - ManagedMemoryResource() - except CUDAError as e: - xfail_if_mempool_oom(e, device) - raise - except RuntimeError as e: - if "requires CUDA 13.0" in str(e): - pytest.skip("ManagedMemoryResource requires CUDA 13.0 or later") - raise - - -def create_managed_memory_resource_or_skip(*args, xfail_device=None, **kwargs): - # Keep the established "skip" helper name for call-site readability, even though - # Windows MCDM mempool OOM setup failures are xfailed instead of skipped. - try: - return ManagedMemoryResource(*args, **kwargs) - except CUDAError as e: - xfail_if_mempool_oom(e, _device_id_from_resource_options(xfail_device, args, kwargs)) - if "CUDA_ERROR_NOT_SUPPORTED" in str(e): - pytest.skip("ManagedMemoryResource is not supported on this platform/device") - raise - except RuntimeError as e: - if "requires CUDA 13.0" in str(e): - pytest.skip("ManagedMemoryResource requires CUDA 13.0 or later") - raise - - -def create_pinned_memory_resource_or_xfail(*args, xfail_device=None, **kwargs): - try: - return PinnedMemoryResource(*args, **kwargs) - except CUDAError as e: - xfail_if_mempool_oom(e, xfail_device) - raise - - -@contextmanager -def xfail_on_graph_mempool_oom(device=0): - try: - yield - except CUDAError as e: - xfail_if_mempool_oom(e, "cuGraphAddMemAllocNode", device) - raise - - -def _device_id_from_resource_options(device, args, kwargs): - if device is not None: - return device - options = kwargs.get("options") - if options is None and args: - options = args[0] - if options is None: - return 0 - if isinstance(options, dict): - preferred_location = options.get("preferred_location") - preferred_location_type = options.get("preferred_location_type") - else: - preferred_location = getattr(options, "preferred_location", None) - preferred_location_type = getattr(options, "preferred_location_type", None) - if preferred_location_type in (None, "device") and isinstance(preferred_location, int) and preferred_location >= 0: - return preferred_location - return 0 - - def _require_ipc_mempool_devices(devices): """Return devices if they all support IPC-enabled mempools, otherwise skip.""" from helpers import supports_ipc_mempool diff --git a/cuda_core/tests/example_tests/__init__.py b/cuda_core/tests/example_tests/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/cuda_core/tests/example_tests/test_basic_examples.py b/cuda_core/tests/example_tests/test_basic_examples.py index bf423758366..8cca9e2a7bc 100644 --- a/cuda_core/tests/example_tests/test_basic_examples.py +++ b/cuda_core/tests/example_tests/test_basic_examples.py @@ -76,6 +76,7 @@ def has_recent_memory_pool_support() -> bool: SYSTEM_REQUIREMENTS = { "memory_pool_resources.py": has_recent_memory_pool_support, + "batched_memcpy.py": has_recent_memory_pool_support, "gl_interop_plasma.py": has_display, "gl_interop_fluid.py": has_display, "gl_interop_mipmap_lod.py": has_display, diff --git a/cuda_core/tests/graph/test_graph_builder.py b/cuda_core/tests/graph/test_graph_builder.py index a730c2bd83a..aa1c0f8e8b0 100644 --- a/cuda_core/tests/graph/test_graph_builder.py +++ b/cuda_core/tests/graph/test_graph_builder.py @@ -7,13 +7,16 @@ import time import weakref +import helpers import numpy as np import pytest -from cuda_python_test_helpers.marks import requires_module +from cuda_python_test_helpers.marks import requires_module, skipif_need_cuda_headers from helpers.graph_kernels import compile_common_kernels, compile_conditional_kernels from helpers.misc import try_create_condition +from packaging.version import Version -from cuda.core import Device, LaunchConfig, LegacyPinnedMemoryResource, launch +import cuda.bindings +from cuda.core import Device, LaunchConfig, LegacyPinnedMemoryResource, Program, ProgramOptions, launch from cuda.core.graph import GraphBuilder, GraphDefinition from cuda.core.graph._graph_builder import ( _capture_callback_with_tail_failure_for_testing, @@ -709,3 +712,146 @@ def test_graph_definition_conditional_body_during_capture_raises(init_cuda): finally: body_gb.end_building() gb.end_building() + + +@requires_module(np, "2.2.5", reason="need numpy 2.2.5+ (numpy GH #28632)") +def test_pdl_launch_graph_capture(init_cuda): + """PDL LaunchConfig is graph-compatible via GraphBuilder stream capture. + + Captures a first then a secondary launch with + ``programmatic_stream_serialization=True``, instantiates, and launches. + Asserts functional correctness and that capture maps to a programmatic + dependency edge (see Programming Guide, Programmatic Dependent Launch) — + not kernel overlap. + """ + + def _assert_programmatic_dependency_edge(graph_definition): + """Assert capture of ProgrammaticStreamSerialization produced a programmatic edge. + + Per Programming Guide (Programmatic Dependent Launch): stream-capturing a + secondary launch with ``cudaLaunchAttributeProgrammaticStreamSerialization`` + maps to a programmatic dependency edge from the programmatic kernel port. + """ + from cuda.bindings import driver + + # cuda.bindings before 13.3.0 (before 12.9.7 on the 12.x branch) returned + # CUgraphEdgeData wrappers backed by a scratch buffer that was freed before the + # call returned, so every field reads back as freed heap memory (#1804). + version = Version(cuda.bindings.__version__) + if version < Version("13.3.0" if version.major >= 13 else "12.9.7"): + pytest.skip(f"cuda.bindings {version} returns dangling graph edge data (#1804)") + + h_graph = graph_definition.handle + if driver.CUDA_VERSION >= 13000: + get_edges = driver.cuGraphGetEdges + else: + get_edges = driver.cuGraphGetEdges_v2 + + err, _, _, _, num_edges = get_edges(h_graph) + assert err == driver.CUresult.CUDA_SUCCESS, err + err, _, _, edge_data, num_edges = get_edges(h_graph, num_edges) + assert err == driver.CUresult.CUDA_SUCCESS, err + assert num_edges == 1, f"expected 1 edge, got {num_edges}" + ed = edge_data[0] + # Driver (cuda.h) ↔ Runtime / Programming Guide (driver_types.h): + # CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC ↔ cudaGraphDependencyTypeProgrammatic + # CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC ↔ cudaGraphKernelNodePortProgrammatic + assert ed.type == driver.CUgraphDependencyType.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC, ed.type + assert ed.from_port == driver.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC, ed.from_port + + mod = compile_common_kernels() + dummy_kernel = mod.get_kernel("add_one") + + stream = Device().create_stream() + mr = LegacyPinnedMemoryResource() + buf = mr.allocate(4) + arr = np.from_dlpack(buf).view(np.int32) + arr[0] = 0 + + cfg = LaunchConfig(grid=1, block=1) + pdl = LaunchConfig(grid=1, block=1, programmatic_stream_serialization=True) + + gb = stream.create_graph_builder().begin_building() + launch(gb, cfg, dummy_kernel, arr.ctypes.data) + launch(gb, pdl, dummy_kernel, arr.ctypes.data) + gb.end_building() + _assert_programmatic_dependency_edge(gb.graph_definition) + graph = gb.complete() + + graph.launch(stream) + stream.sync() + assert arr[0] == 2 + + buf.close() + stream.close() + + +@skipif_need_cuda_headers +@requires_module(np, "2.2.5", reason="need numpy 2.2.5+ (numpy GH #28632)") +def test_pdl_same_stream_primary_secondary_overlap_via_graph(init_cuda): + """Same-stream PDL overlap via GraphBuilder stream capture on Hopper+.""" + dev = Device() + if dev.compute_capability < (9, 0): + pytest.skip("Programmatic Dependent Launch requires compute capability >= 9.0") + + code = r""" + #include <cuda_device_runtime_api.h> + + extern "C" __global__ void primary_kernel(int* secondary_started, int* overlapped) { + cudaTriggerProgrammaticLaunchCompletion(); + + const long long deadline = clock64() + 100000000LL; // ~50ms @ ~2GHz + if (threadIdx.x == 0 && blockIdx.x == 0) { + while (clock64() < deadline) { + if (atomicAdd(secondary_started, 0) != 0) { + atomicExch(overlapped, 1); + return; + } + __nanosleep(1000); + } + } + } + + extern "C" __global__ void secondary_kernel(int* secondary_started) { + if (threadIdx.x == 0 && blockIdx.x == 0) { + atomicExch(secondary_started, 1); + } + } + """ + + arch = "".join(f"{i}" for i in dev.compute_capability) + options = ProgramOptions(std="c++17", arch=f"sm_{arch}", include_path=helpers.CUDA_INCLUDE_PATH) + module = Program(code, code_type="c++", options=options).compile("cubin") + primary = module.get_kernel("primary_kernel") + secondary = module.get_kernel("secondary_kernel") + + stream = dev.create_stream(options={"nonblocking": True}) + mr = LegacyPinnedMemoryResource() + secondary_started = np.from_dlpack(mr.allocate(4)).view(np.int32) + overlapped = np.from_dlpack(mr.allocate(4)).view(np.int32) + primary_cfg = LaunchConfig(grid=1, block=1) + secondary_cfg = LaunchConfig(grid=1, block=1, programmatic_stream_serialization=True) + + saw_overlap = False + for _ in range(5): + secondary_started[0] = 0 + overlapped[0] = 0 + + gb = stream.create_graph_builder().begin_building() + launch(gb, primary_cfg, primary, secondary_started.ctypes.data, overlapped.ctypes.data) + launch(gb, secondary_cfg, secondary, secondary_started.ctypes.data) + graph = gb.end_building().complete() + graph.launch(stream) + stream.sync() + graph.close() + gb.close() + + if overlapped[0] == 1: + saw_overlap = True + break + + if not saw_overlap: + pytest.xfail( + "PDL (Programmatic Dependent Launch) graph overlap was not observed. " + "If this keeps xfailing in CI, manually re-check on a quiet Hopper+ GPU." + ) diff --git a/cuda_core/tests/graph/test_graph_definition.py b/cuda_core/tests/graph/test_graph_definition.py index 0aeb5a9d527..4b3122c763e 100644 --- a/cuda_core/tests/graph/test_graph_definition.py +++ b/cuda_core/tests/graph/test_graph_definition.py @@ -9,8 +9,8 @@ from dataclasses import dataclass, field import pytest -from conftest import xfail_on_graph_mempool_oom from helpers.graph_kernels import compile_common_kernels +from helpers.memory import xfail_on_graph_mempool_oom from helpers.misc import try_create_condition from cuda.core import Device, LaunchConfig @@ -633,6 +633,43 @@ def test_succ(nonempty_graph_spec): assert actual == spec.expected_succ[name], f"succ mismatch for node {name}" +@pytest.mark.parametrize("adjacency_name", ("pred", "succ")) +@pytest.mark.agent_authored(model="gpt-5.6") +def test_large_adjacency_set_is_not_truncated(init_cuda, adjacency_name): + """Adjacency queries return and remove edges beyond the old 16-edge buffer.""" + g = GraphDefinition() + hub = g.empty() + neighbors = [g.empty() for _ in range(20)] + adjacency = getattr(hub, adjacency_name) + adjacency.update(neighbors) + + expected_edges = ( + {(node, hub) for node in neighbors} if adjacency_name == "pred" else {(hub, node) for node in neighbors} + ) + assert len(adjacency) == 20 + assert set(adjacency) == set(neighbors) + assert neighbors[-1] in adjacency + assert g.edges() == expected_edges + + adjacency.clear() + assert len(adjacency) == 0 + assert g.edges() == set() + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_large_graph_queries_are_not_truncated(init_cuda): + """Graph queries return nodes and edges beyond the old 128-item buffers.""" + g = GraphDefinition() + nodes = [g.empty() for _ in range(130)] + nodes[0].succ.update(nodes[1:]) + nodes[1].succ.add(nodes[2]) + + expected_edges = {(nodes[0], node) for node in nodes[1:]} + expected_edges.add((nodes[1], nodes[2])) + assert g.nodes() == set(nodes) + assert g.edges() == expected_edges + + def test_node_graph_property(nonempty_graph_spec): """Every node's .graph property returns the parent GraphDefinition.""" spec = nonempty_graph_spec diff --git a/cuda_core/tests/graph/test_graph_definition_errors.py b/cuda_core/tests/graph/test_graph_definition_errors.py index d80118cdf7c..923ea5fb74e 100644 --- a/cuda_core/tests/graph/test_graph_definition_errors.py +++ b/cuda_core/tests/graph/test_graph_definition_errors.py @@ -6,8 +6,8 @@ import ctypes import pytest -from conftest import xfail_on_graph_mempool_oom from helpers.graph_kernels import compile_common_kernels +from helpers.memory import xfail_on_graph_mempool_oom from helpers.misc import try_create_condition from cuda.core import Device, LaunchConfig diff --git a/cuda_core/tests/graph/test_graph_definition_integration.py b/cuda_core/tests/graph/test_graph_definition_integration.py index 58f96e1bab3..629f302bd75 100644 --- a/cuda_core/tests/graph/test_graph_definition_integration.py +++ b/cuda_core/tests/graph/test_graph_definition_integration.py @@ -7,7 +7,7 @@ import numpy as np import pytest -from conftest import xfail_on_graph_mempool_oom +from helpers.memory import xfail_on_graph_mempool_oom from cuda.core import Device, EventOptions, LaunchConfig, Program, ProgramOptions from cuda.core._utils.cuda_utils import driver, handle_return diff --git a/cuda_core/tests/graph/test_graph_definition_lifetime.py b/cuda_core/tests/graph/test_graph_definition_lifetime.py index 93c1453753d..c9ff492a2a8 100644 --- a/cuda_core/tests/graph/test_graph_definition_lifetime.py +++ b/cuda_core/tests/graph/test_graph_definition_lifetime.py @@ -13,8 +13,8 @@ import weakref import pytest -from conftest import xfail_on_graph_mempool_oom from helpers.graph_kernels import compile_common_kernels +from helpers.memory import xfail_on_graph_mempool_oom from helpers.misc import try_create_condition from cuda_python_test_helpers import under_compute_sanitizer diff --git a/cuda_core/tests/graph/test_graph_memory_resource.py b/cuda_core/tests/graph/test_graph_memory_resource.py index 517f9c080b7..7b9c2aaf883 100644 --- a/cuda_core/tests/graph/test_graph_memory_resource.py +++ b/cuda_core/tests/graph/test_graph_memory_resource.py @@ -5,8 +5,8 @@ """Tests for GraphMemoryResource allocation and attributes during graph capture.""" import pytest -from conftest import xfail_on_graph_mempool_oom from helpers.buffers import compare_buffer_to_constant, make_scratch_buffer, set_buffer +from helpers.memory import xfail_on_graph_mempool_oom from cuda.core import ( Device, diff --git a/cuda_core/tests/helpers/buffers.py b/cuda_core/tests/helpers/buffers.py index f4412d57e16..aefb4f04193 100644 --- a/cuda_core/tests/helpers/buffers.py +++ b/cuda_core/tests/helpers/buffers.py @@ -4,6 +4,7 @@ import ctypes from cuda.core import Buffer, Device, MemoryResource +from cuda.core._stream import Stream_accept from cuda.core._utils.cuda_utils import driver, handle_return from . import libc @@ -12,13 +13,82 @@ "DummyDeviceMemoryResource", "DummyUnifiedMemoryResource", "PatternGen", - "TrackingMR", + "StubMemoryResource", "compare_buffer_to_constant", "compare_equal_buffers", + "make_instrumented_memory_resource", "make_scratch_buffer", ] +class StubMemoryResource(MemoryResource): + """Device-only memory resource for tests that supply a fake pointer.""" + + def __init__(self, device): + self.device = device + + def allocate(self, size, *, stream=None): + raise NotImplementedError("StubMemoryResource does not allocate") + + def deallocate(self, ptr, size, *, stream=None): + Stream_accept(stream) + + @property + def is_device_accessible(self): + return True + + @property + def is_host_accessible(self): + return False + + @property + def device_id(self): + return self.device.device_id + + +def make_instrumented_memory_resource( + backing=StubMemoryResource, + *, + record_streams=False, + track_active=False, + deallocate_error=None, +): + """Return an instrumented backing subclass and its shared telemetry. + + Only calls dispatched through the Python ``allocate`` and ``deallocate`` + methods are observed. Some built-in memory resources free their buffers + directly in C++ instead (see issue #2615). + """ + if not isinstance(backing, type) or not issubclass(backing, MemoryResource): + raise TypeError("backing must be a MemoryResource subclass") + + telemetry = {"active": {}, "deallocations": []} + + class InstrumentedMemoryResource(backing): + __slots__ = () + + if track_active: + + def allocate(self, size, *, stream=None): + buffer = super().allocate(size, stream=stream) + telemetry["active"][int(buffer.handle)] = size + return buffer + + if record_streams or track_active or deallocate_error is not None: + + def deallocate(self, ptr, size, *, stream=None): + if record_streams: + telemetry["deallocations"].append({"ptr": int(ptr), "size": size, "stream": stream}) + if deallocate_error is not None: + raise deallocate_error + super().deallocate(ptr, size, stream=stream) + if track_active: + telemetry["active"].pop(int(ptr), None) + + InstrumentedMemoryResource.__name__ = f"Instrumented{backing.__name__}" + return InstrumentedMemoryResource, telemetry + + class DummyDeviceMemoryResource(MemoryResource): # cuMemAlloc / cuMemFree are synchronous; stream is accepted for # interface conformance but ignored. @@ -71,39 +141,6 @@ def device_id(self) -> int: return self.device -class TrackingMR(MemoryResource): - """A MemoryResource that tracks active allocations via a dict. - - Useful for verifying that deallocate is called at the expected time. - """ - - def __init__(self): - self.active = {} - - # cuMemAlloc / cuMemFree are synchronous; stream is accepted for - # interface conformance but ignored. - def allocate(self, size, *, stream=None): - ptr = handle_return(driver.cuMemAlloc(size)) - self.active[int(ptr)] = size - return Buffer.from_handle(ptr=ptr, size=size, mr=self) - - def deallocate(self, ptr, size, *, stream=None): - handle_return(driver.cuMemFree(ptr)) - del self.active[int(ptr)] - - @property - def is_device_accessible(self): - return True - - @property - def is_host_accessible(self): - return False - - @property - def device_id(self): - return 0 - - class PatternGen: """ Provides methods to fill a target buffer with known test patterns and diff --git a/cuda_core/tests/helpers/copy_batch.py b/cuda_core/tests/helpers/copy_batch.py new file mode 100644 index 00000000000..2c517e3c66c --- /dev/null +++ b/cuda_core/tests/helpers/copy_batch.py @@ -0,0 +1,38 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +"""Shared constants and helpers for the ``copy_batch`` tests. + +Fixtures live in ``tests/memory/conftest.py``; this module holds the +pieces that tests import by name. +""" + +from cuda.core import LegacyPinnedMemoryResource +from helpers.buffers import compare_equal_buffers, make_scratch_buffer + +COPY_BATCH_SIZE = 4096 +COPY_BATCH_COUNT = 4 + + +def assert_managed_holds(dev, buf, value, *, stream): + """Assert a managed buffer holds ``value``. + + Reads via an explicit device-to-host copy rather than dereferencing + the managed pointer from the host. Managed pages carry residency and + ``cuMemAdvise`` state that earlier tests in the suite can leave + behind, which makes direct host reads order-dependent. Also avoids + ``compare_buffer_to_constant``, which resolves a ``Device`` from + ``memory_resource.device_id`` -- that is -1 for + ``ManagedMemoryResource``. + """ + host = LegacyPinnedMemoryResource().allocate(buf.size) + expected = make_scratch_buffer(dev, value, buf.size) + try: + buf.copy_to(host, stream=stream) + stream.sync() + assert compare_equal_buffers(expected, host) + finally: + expected.close() + host.close(stream) + stream.sync() diff --git a/cuda_core/tests/helpers/memory.py b/cuda_core/tests/helpers/memory.py new file mode 100644 index 00000000000..5dac58bd03d --- /dev/null +++ b/cuda_core/tests/helpers/memory.py @@ -0,0 +1,91 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Memory-related test helpers (skip/xfail guards and resource factories).""" + +from contextlib import contextmanager + +import pytest +from cuda_python_test_helpers.mempool import xfail_if_mempool_oom + +from cuda.core import ManagedMemoryResource, PinnedMemoryResource +from cuda.core._utils.cuda_utils import CUDAError + + +def skip_if_pinned_memory_unsupported(device): + try: + if not device.properties.host_memory_pools_supported: + pytest.skip("Device does not support host mempool operations") + except AttributeError: + pytest.skip("PinnedMemoryResource requires CUDA 13.0 or later") + + +def skip_if_managed_memory_unsupported(device): + try: + if not device.properties.memory_pools_supported or not device.properties.concurrent_managed_access: + pytest.skip("Device does not support managed memory pool operations") + except AttributeError: + pytest.skip("ManagedMemoryResource requires CUDA 13.0 or later") + try: + ManagedMemoryResource() + except CUDAError as e: + xfail_if_mempool_oom(e, device) + raise + except RuntimeError as e: + if "requires CUDA 13.0" in str(e): + pytest.skip("ManagedMemoryResource requires CUDA 13.0 or later") + raise + + +def _device_id_from_resource_options(device, args, kwargs): + if device is not None: + return device + options = kwargs.get("options") + if options is None and args: + options = args[0] + if options is None: + return 0 + if isinstance(options, dict): + preferred_location = options.get("preferred_location") + preferred_location_type = options.get("preferred_location_type") + else: + preferred_location = getattr(options, "preferred_location", None) + preferred_location_type = getattr(options, "preferred_location_type", None) + if preferred_location_type in (None, "device") and isinstance(preferred_location, int) and preferred_location >= 0: + return preferred_location + return 0 + + +def create_managed_memory_resource_or_skip(*args, xfail_device=None, **kwargs): + # Keep the established "skip" helper name for call-site readability, even though + # Windows MCDM mempool OOM setup failures are xfailed instead of skipped. + try: + return ManagedMemoryResource(*args, **kwargs) + except CUDAError as e: + xfail_if_mempool_oom(e, _device_id_from_resource_options(xfail_device, args, kwargs)) + if "CUDA_ERROR_NOT_SUPPORTED" in str(e): + pytest.skip("ManagedMemoryResource is not supported on this platform/device") + raise + except RuntimeError as e: + if "requires CUDA 13.0" in str(e): + pytest.skip("ManagedMemoryResource requires CUDA 13.0 or later") + if "concurrent managed access is not available" in str(e).lower(): + pytest.skip("Device does not support concurrent managed memory access") + raise + + +def create_pinned_memory_resource_or_xfail(*args, xfail_device=None, **kwargs): + try: + return PinnedMemoryResource(*args, **kwargs) + except CUDAError as e: + xfail_if_mempool_oom(e, xfail_device) + raise + + +@contextmanager +def xfail_on_graph_mempool_oom(device=0): + try: + yield + except CUDAError as e: + xfail_if_mempool_oom(e, "cuGraphAddMemAllocNode", device) + raise diff --git a/cuda_core/tests/memory/conftest.py b/cuda_core/tests/memory/conftest.py new file mode 100644 index 00000000000..ed950df830f --- /dev/null +++ b/cuda_core/tests/memory/conftest.py @@ -0,0 +1,66 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Per-directory conftest for the ``copy_batch`` test modules. + +Provides the device, stream and buffer fixtures shared by +``test_copy_batch.py`` (data movement) and ``test_copy_batch_options.py`` +(options and validation). +""" + +import pytest +from helpers.copy_batch import COPY_BATCH_COUNT, COPY_BATCH_SIZE + +from cuda.core import Device, LegacyPinnedMemoryResource + + +@pytest.fixture +def copy_batch_device(init_cuda): + """``copy_batch`` works on every supported toolkit, so this never skips.""" + device = Device() + device.set_current() + return device + + +@pytest.fixture +def copy_stream(copy_batch_device): + """The single stream used for both allocation and copies in a test. + + Stream-ordered pool allocations are only guaranteed usable on the + stream that allocated them, so tests allocate and copy on this one + stream rather than mixing it with ``device.default_stream``. + """ + s = copy_batch_device.create_stream() + yield s + s.close() + + +@pytest.fixture +def h2d_bufs(copy_batch_device, copy_stream): + """Pinned-host source / device destination pairs.""" + pinned_mr = LegacyPinnedMemoryResource() + device_mr = copy_batch_device.memory_resource + + srcs = [pinned_mr.allocate(COPY_BATCH_SIZE) for _ in range(COPY_BATCH_COUNT)] + dsts = [device_mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(COPY_BATCH_COUNT)] + + yield srcs, dsts + + for buf in srcs + dsts: + buf.close(copy_stream) + copy_stream.sync() + + +@pytest.fixture +def device_bufs(copy_batch_device, copy_stream): + """Device source / device destination pairs.""" + device_mr = copy_batch_device.memory_resource + + srcs = [device_mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(COPY_BATCH_COUNT)] + dsts = [device_mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(COPY_BATCH_COUNT)] + + yield srcs, dsts + + for buf in srcs + dsts: + buf.close(copy_stream) + copy_stream.sync() diff --git a/cuda_core/tests/memory/test_copy_batch.py b/cuda_core/tests/memory/test_copy_batch.py new file mode 100644 index 00000000000..73fb438fc2d --- /dev/null +++ b/cuda_core/tests/memory/test_copy_batch.py @@ -0,0 +1,307 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Data movement behaviour of ``copy_batch``. + +Covers that the right bytes reach the right destination, that batched +results agree with the per-buffer ``Buffer.copy_to`` path, and that the +batch is correctly ordered on its stream. +""" + +import pytest +from helpers.buffers import ( + compare_buffer_to_constant, + compare_equal_buffers, + make_scratch_buffer, + set_buffer, +) +from helpers.copy_batch import COPY_BATCH_SIZE + +from cuda.core import LegacyPinnedMemoryResource +from cuda.core._stream import LEGACY_DEFAULT_STREAM, PER_THREAD_DEFAULT_STREAM +from cuda.core.utils import copy_batch + + +class TestCopyBatchCore: + """Each transfer direction moves the expected bytes.""" + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_h2d_batch(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + for i, src in enumerate(srcs): + set_buffer(src, i + 1) + + copy_batch(copy_stream, srcs, dsts) + copy_stream.sync() + + for i, dst in enumerate(dsts): + assert compare_buffer_to_constant(dst, i + 1) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_d2h_batch(self, copy_batch_device, h2d_bufs, copy_stream): + dev = copy_batch_device + _, device_dsts = h2d_bufs + pinned_mr = LegacyPinnedMemoryResource() + + for i, buf in enumerate(device_dsts): + buf.fill(i + 10, stream=copy_stream) + + host_bufs = [pinned_mr.allocate(COPY_BATCH_SIZE) for _ in device_dsts] + copy_batch(copy_stream, device_dsts, host_bufs) + copy_stream.sync() + + for i, host_buf in enumerate(host_bufs): + expected = make_scratch_buffer(dev, i + 10, COPY_BATCH_SIZE) + assert compare_equal_buffers(expected, host_buf) + expected.close() + host_buf.close(copy_stream) + copy_stream.sync() + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_d2d_batch(self, device_bufs, copy_stream): + srcs, dsts = device_bufs + for i, src in enumerate(srcs): + src.fill(i + 20, stream=copy_stream) + + copy_batch(copy_stream, srcs, dsts) + copy_stream.sync() + + for i, dst in enumerate(dsts): + assert compare_buffer_to_constant(dst, i + 20) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_various_sizes(self, copy_batch_device, copy_stream): + pinned_mr = LegacyPinnedMemoryResource() + device_mr = copy_batch_device.memory_resource + sizes = [1024, 2048, 512, 4096] + + srcs = [pinned_mr.allocate(size) for size in sizes] + dsts = [device_mr.allocate(size, stream=copy_stream) for size in sizes] + for i, src in enumerate(srcs): + set_buffer(src, i + 1) + + copy_batch(copy_stream, srcs, dsts) + copy_stream.sync() + + for i, dst in enumerate(dsts): + assert compare_buffer_to_constant(dst, i + 1) + + for buf in srcs + dsts: + buf.close(copy_stream) + copy_stream.sync() + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_single_element_batch(self, copy_batch_device, copy_stream): + """A one-element batch is legal; only a bare Buffer is rejected.""" + pinned_mr = LegacyPinnedMemoryResource() + src = pinned_mr.allocate(COPY_BATCH_SIZE) + dst = copy_batch_device.memory_resource.allocate(COPY_BATCH_SIZE, stream=copy_stream) + set_buffer(src, 7) + + copy_batch(copy_stream, [src], [dst]) + copy_stream.sync() + + assert compare_buffer_to_constant(dst, 7) + src.close(copy_stream) + dst.close(copy_stream) + copy_stream.sync() + + +class TestCopyBatchEquivalence: + """Batched results must agree with the already-tested per-buffer path. + + ``Buffer.copy_to`` and ``Buffer.copy_from`` have their own coverage in + ``tests/test_memory.py``, so agreement between the two paths is the + property under test here. + """ + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_batch_matches_sequential_copy_to(self, copy_batch_device, h2d_bufs, copy_stream): + srcs, _ = h2d_bufs + device_mr = copy_batch_device.memory_resource + pinned_mr = LegacyPinnedMemoryResource() + + for i, src in enumerate(srcs): + set_buffer(src, i + 50) + + seq_dsts = [device_mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in srcs] + for src, dst in zip(srcs, seq_dsts): + src.copy_to(dst, stream=copy_stream) + + batch_dsts = [device_mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in srcs] + copy_batch(copy_stream, srcs, batch_dsts) + copy_stream.sync() + + for seq_dst, batch_dst in zip(seq_dsts, batch_dsts): + seq_host = pinned_mr.allocate(COPY_BATCH_SIZE) + batch_host = pinned_mr.allocate(COPY_BATCH_SIZE) + seq_dst.copy_to(seq_host, stream=copy_stream) + batch_dst.copy_to(batch_host, stream=copy_stream) + copy_stream.sync() + assert compare_equal_buffers(seq_host, batch_host) + seq_host.close(copy_stream) + batch_host.close(copy_stream) + + for buf in seq_dsts + batch_dsts: + buf.close(copy_stream) + copy_stream.sync() + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_batch_matches_sequential_varied_sizes(self, copy_batch_device, copy_stream): + device_mr = copy_batch_device.memory_resource + pinned_mr = LegacyPinnedMemoryResource() + sizes = [1024, 2048, 512] + + srcs = [pinned_mr.allocate(size) for size in sizes] + for i, src in enumerate(srcs): + set_buffer(src, i + 60) + + seq_dsts = [device_mr.allocate(size, stream=copy_stream) for size in sizes] + for src, dst in zip(srcs, seq_dsts): + src.copy_to(dst, stream=copy_stream) + + batch_dsts = [device_mr.allocate(size, stream=copy_stream) for size in sizes] + copy_batch(copy_stream, srcs, batch_dsts) + copy_stream.sync() + + for size, seq_dst, batch_dst in zip(sizes, seq_dsts, batch_dsts): + seq_host = pinned_mr.allocate(size) + batch_host = pinned_mr.allocate(size) + seq_dst.copy_to(seq_host, stream=copy_stream) + batch_dst.copy_to(batch_host, stream=copy_stream) + copy_stream.sync() + assert compare_equal_buffers(seq_host, batch_host) + seq_host.close(copy_stream) + batch_host.close(copy_stream) + + for buf in srcs + seq_dsts + batch_dsts: + buf.close(copy_stream) + copy_stream.sync() + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_batch_matches_sequential_d2d(self, copy_batch_device, device_bufs, copy_stream): + srcs, seq_dsts = device_bufs + device_mr = copy_batch_device.memory_resource + pinned_mr = LegacyPinnedMemoryResource() + + for i, src in enumerate(srcs): + src.fill(i + 70, stream=copy_stream) + + for src, dst in zip(srcs, seq_dsts): + src.copy_to(dst, stream=copy_stream) + + batch_dsts = [device_mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in srcs] + copy_batch(copy_stream, srcs, batch_dsts) + copy_stream.sync() + + for seq_dst, batch_dst in zip(seq_dsts, batch_dsts): + seq_host = pinned_mr.allocate(COPY_BATCH_SIZE) + batch_host = pinned_mr.allocate(COPY_BATCH_SIZE) + seq_dst.copy_to(seq_host, stream=copy_stream) + batch_dst.copy_to(batch_host, stream=copy_stream) + copy_stream.sync() + assert compare_equal_buffers(seq_host, batch_host) + seq_host.close(copy_stream) + batch_host.close(copy_stream) + + for buf in batch_dsts: + buf.close(copy_stream) + copy_stream.sync() + + +class TestCopyBatchStreamSemantics: + """Where the batch sits in stream order, and what it cannot be part of.""" + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_ordered_between_prior_and_later_stream_work(self, device_bufs, copy_stream): + """The batch must observe prior stream work and precede later work. + + Each source is filled with ``before``, copied, then refilled with + ``after`` -- all enqueued on one stream with no intervening sync. + Destinations holding ``before`` prove the copy ran after the first + fill and before the second, rather than racing either. + """ + srcs, dsts = device_bufs + before, after = 11, 22 + + for src in srcs: + src.fill(before, stream=copy_stream) + copy_batch(copy_stream, srcs, dsts) + for src in srcs: + src.fill(after, stream=copy_stream) + + copy_stream.sync() + + for dst in dsts: + assert compare_buffer_to_constant(dst, before) + for src in srcs: + assert compare_buffer_to_constant(src, after) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_graph_builder_is_rejected(self, copy_batch_device, device_bufs, copy_stream): + """Batched memcpy cannot be captured into a graph. + + ``cuMemcpyBatchAsync`` has no graph-node form and the driver + rejects it mid-capture, so ``copy_batch`` is typed to take only a + ``Stream`` and refuses a ``GraphBuilder`` at the boundary rather + than failing later with ``CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED``. + Use ``GraphNode.memcpy`` or per-buffer ``Buffer.copy_to`` to build + copies into a graph. + """ + srcs, dsts = device_bufs + gb = copy_batch_device.create_graph_builder().begin_building() + try: + with pytest.raises(TypeError, match="Argument 'stream' has incorrect type"): + copy_batch(gb, srcs, dsts) + finally: + # Nothing was captured, so the builder still ends cleanly. + gb.end_building() + gb.close() + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_capturing_stream_is_rejected(self, copy_batch_device, device_bufs): + """Passing the GraphBuilder's underlying stream must also be rejected. + + The GraphBuilder type check is bypassed when the caller passes + ``gb.stream`` directly; the capture-status check closes that loophole. + """ + srcs, dsts = device_bufs + gb = copy_batch_device.create_graph_builder().begin_building() + try: + with pytest.raises(TypeError, match="graph capture"): + copy_batch(gb.stream, srcs, dsts) + finally: + gb.end_building() + gb.close() + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_legacy_default_stream_token_is_rejected(self, init_cuda, h2d_bufs): + """LEGACY_DEFAULT_STREAM must be rejected with a clear TypeError. + + cuMemcpyBatchAsync rejects the legacy token outright + (CUDA_ERROR_INVALID_VALUE); copy_batch surfaces this before ever + calling the driver. + """ + srcs, dsts = h2d_bufs + with pytest.raises(TypeError, match="LEGACY_DEFAULT_STREAM"): + copy_batch(LEGACY_DEFAULT_STREAM, srcs, dsts) + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_per_thread_default_stream_token_is_accepted(self, copy_batch_device): + """PER_THREAD_DEFAULT_STREAM is a real stream to the driver and works + like any explicit stream for copy_batch, unlike LEGACY_DEFAULT_STREAM. + """ + pinned_mr = LegacyPinnedMemoryResource() + device_mr = copy_batch_device.memory_resource + src = pinned_mr.allocate(COPY_BATCH_SIZE) + dst = device_mr.allocate(COPY_BATCH_SIZE, stream=PER_THREAD_DEFAULT_STREAM) + set_buffer(src, 99) + + copy_batch(PER_THREAD_DEFAULT_STREAM, [src], [dst]) + copy_batch_device.sync() + + assert compare_buffer_to_constant(dst, 99) + + src.close(PER_THREAD_DEFAULT_STREAM) + dst.close(PER_THREAD_DEFAULT_STREAM) + copy_batch_device.sync() diff --git a/cuda_core/tests/memory/test_copy_batch_options.py b/cuda_core/tests/memory/test_copy_batch_options.py new file mode 100644 index 00000000000..43e832e4854 --- /dev/null +++ b/cuda_core/tests/memory/test_copy_batch_options.py @@ -0,0 +1,460 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""``CopyOptions`` handling and argument validation for ``copy_batch``. + +Covers how options are encoded into the driver's attribute runs, how each +option field behaves, and every rejection path. +""" + +import pytest +from helpers.buffers import compare_buffer_to_constant, set_buffer +from helpers.copy_batch import ( + COPY_BATCH_SIZE, + assert_managed_holds, +) + +# Shared with test_managed_ops.py: handles the CUDA 13 requirement, mempool +# OOM, and CUDA_ERROR_NOT_SUPPORTED (managed pools are unavailable on +# Windows), so the location-hint tests skip rather than error there. +from helpers.memory import create_managed_memory_resource_or_skip + +from cuda.core import Host, LegacyPinnedMemoryResource +from cuda.core._memory._copy_enums import _attr_run_starts, _reject_unsupported_during_api_call +from cuda.core._memory._copy_ops import ( + _normalize_copy_options, +) +from cuda.core._stream import PER_THREAD_DEFAULT_STREAM +from cuda.core._utils.version import binding_version, driver_version +from cuda.core.utils import ( + CopyOptions, + MemcpyOverlapMode, + MemcpySrcAccessOrder, + copy_batch, +) + + +def _batch_native_available(): + """True when copy_batch will actually use cuMemcpyBatchAsync.""" + return binding_version() >= (13, 0, 0) and driver_version() >= (13, 0, 0) + + +class TestOptionsEncoding: + """How ``options`` becomes the driver's ``attrs`` / ``attrsIdxs`` pair. + + Pure logic, no CUDA. This is the only place the effect of ``options`` + is observable: they are hints that change how the driver stages a + transfer, never the bytes it produces, so no data comparison can + distinguish an option that was applied from one that was dropped. + """ + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_scalar_broadcasts_to_every_copy(self): + """A scalar must reach all N copies, not just the first.""" + n = 4 + scalar = CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY) + + # copy_batch expands the scalar to one entry per copy... + assert _normalize_copy_options(scalar, n) == (scalar,) * n + # ...and the encoder collapses those to a single driver attribute. + assert _attr_run_starts(_normalize_copy_options(scalar, n)) == [0] + + # An explicit list of the same option is indistinguishable. + assert _normalize_copy_options([scalar] * n, n) == _normalize_copy_options(scalar, n) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_none_broadcasts_defaults(self): + assert _normalize_copy_options(None, 3) == (CopyOptions(),) * 3 + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_sequence_is_never_broadcast(self): + """A sequence pairs by index, so a short one is an error.""" + scalar = CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY) + with pytest.raises(ValueError, match="options length"): + _normalize_copy_options([scalar], 4) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_equal_but_distinct_instances_collapse(self): + # Structural equality, not identity, drives the collapse. + attrs = [CopyOptions(src_access_order="stream") for _ in range(3)] + assert len({id(a) for a in attrs}) == 3 + assert _attr_run_starts(attrs) == [0] + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_all_distinct_yields_one_run_each(self): + attrs = [ + CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM), + CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY), + CopyOptions(src_access_order=MemcpySrcAccessOrder.DURING_API_CALL), + ] + assert _attr_run_starts(attrs) == [0, 1, 2] + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_adjacent_runs_are_grouped(self): + stream_attr = CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM) + any_attr = CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY) + attrs = [stream_attr, stream_attr, any_attr, any_attr, stream_attr] + # Runs start at 0 (stream), 2 (any) and 4 (stream again). + assert _attr_run_starts(attrs) == [0, 2, 4] + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_single_element(self): + assert _attr_run_starts([CopyOptions()]) == [0] + + +class TestRejectUnsupportedDuringApiCall: + """``_reject_unsupported_during_api_call`` guards the one hazardous fallback. + + Pure logic, no CUDA: this is what both ``Buffer.copy_to``/``copy_from`` + and ``copy_batch`` call before falling back to a plain ``cuMemcpyAsync`` + when the native attributes path is unavailable. STREAM and ANY never + promise access sooner than stream order, so cuMemcpyAsync satisfies them + silently; DURING_API_CALL promises all source reads complete before the + call returns, which cuMemcpyAsync cannot provide, so it must raise + instead of silently downgrading that guarantee. + """ + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_during_api_call_raises(self): + with pytest.raises(RuntimeError, match="src_access_order=DURING_API_CALL"): + _reject_unsupported_during_api_call(MemcpySrcAccessOrder.DURING_API_CALL, "some requirement") + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_during_api_call_message_names_requirement_and_index(self): + with pytest.raises(RuntimeError, match="requires some requirement") as exc_info: + _reject_unsupported_during_api_call(MemcpySrcAccessOrder.DURING_API_CALL, "some requirement", index=5) + assert "at index 5" in str(exc_info.value) + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_during_api_call_message_omits_index_when_not_given(self): + with pytest.raises(RuntimeError) as exc_info: + _reject_unsupported_during_api_call(MemcpySrcAccessOrder.DURING_API_CALL, "some requirement") + assert "at index" not in str(exc_info.value) + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + @pytest.mark.parametrize("order", [MemcpySrcAccessOrder.STREAM, MemcpySrcAccessOrder.ANY]) + def test_stream_and_any_do_not_raise(self, order): + """Stream-ordered access satisfies both, so no fallback hazard exists.""" + _reject_unsupported_during_api_call(order, "some requirement") + _reject_unsupported_during_api_call(order, "some requirement", index=0) + + +class TestCopyBatchOptions: + """Each ``CopyOptions`` field is accepted and does not corrupt the copy.""" + + @pytest.mark.agent_authored(model="Claude Opus 5") + @pytest.mark.parametrize( + ("order", "marker"), + [ + (MemcpySrcAccessOrder.STREAM, 31), + (MemcpySrcAccessOrder.ANY, 33), + ], + ) + def test_src_access_order(self, h2d_bufs, copy_stream, order, marker): + """STREAM and ANY are accepted and never corrupt the copy. + + Both are satisfied by stream-ordered access at worst, so this holds + whether the native cuMemcpyBatchAsync path is used or the copy falls + back to a per-copy cuMemcpyAsync loop. DURING_API_CALL is different + (see test_during_api_call): its stronger guarantee cannot be + silently downgraded, so it is tested separately. + """ + srcs, dsts = h2d_bufs + for i, src in enumerate(srcs): + set_buffer(src, i + marker) + + copy_batch(copy_stream, srcs, dsts, options=CopyOptions(src_access_order=order)) + copy_stream.sync() + + for i, dst in enumerate(dsts): + assert compare_buffer_to_constant(dst, i + marker) + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_during_api_call(self, h2d_bufs, copy_stream): + """DURING_API_CALL is honored on the native cuMemcpyBatchAsync path. + + On the per-copy cuMemcpyAsync fallback (pre-CUDA-13 build, or + driver/bindings older than 13.0) it must raise RuntimeError instead + of silently downgrading to stream-ordered access, which cannot honor + the guarantee that all source reads complete before the call + returns (see TestRejectUnsupportedDuringApiCall). CI runs both + generations (see ci/test-matrix.yml), so this test must handle both + outcomes rather than assuming the native path is available. + """ + srcs, dsts = h2d_bufs + marker = 32 + for i, src in enumerate(srcs): + set_buffer(src, i + marker) + + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.DURING_API_CALL) + if _batch_native_available(): + copy_batch(copy_stream, srcs, dsts, options=opts) + copy_stream.sync() + for i, dst in enumerate(dsts): + assert compare_buffer_to_constant(dst, i + marker) + else: + with pytest.raises(RuntimeError, match="DURING_API_CALL"): + copy_batch(copy_stream, srcs, dsts, options=opts) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_per_copy_options(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + for i, src in enumerate(srcs): + set_buffer(src, i + 40) + + # DURING_API_CALL is deliberately excluded here: it raises RuntimeError + # rather than silently falling back on pre-CUDA-13 driver/bindings (see + # test_during_api_call), which CI also exercises (ci/test-matrix.yml). + # STREAM and ANY are enough to prove distinct per-copy options don't + # corrupt the data; the encoding itself is covered by TestOptionsEncoding. + per_copy_options = [ + CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM), + CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY), + CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY), + CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM), + ] + copy_batch(copy_stream, srcs, dsts, options=per_copy_options) + copy_stream.sync() + + for i, dst in enumerate(dsts): + assert compare_buffer_to_constant(dst, i + 40) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_location_hints_do_not_corrupt_copy(self, copy_batch_device, copy_stream): + """Device and host hints are accepted and leave the bytes intact. + + Hints only steer how the driver stages a transfer, so no data + comparison can show one was *applied*; what this catches is a hint + that errors or corrupts. It is also the only test that drives the + ``device`` and ``host`` branches of ``to_cumemlocation`` and the + ``src_location_hint`` path through ``copy_batch``. + """ + dev = copy_batch_device + mr = create_managed_memory_resource_or_skip() + srcs = [mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(2)] + dsts = [mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(2)] + + for i, src in enumerate(srcs): + src.fill(i + 80, stream=copy_stream) + + options = CopyOptions( + src_access_order=MemcpySrcAccessOrder.STREAM, + src_location_hint=dev, + dst_location_hint=Host(), + ) + copy_batch(copy_stream, srcs, dsts, options=options) + copy_stream.sync() + + for i, dst in enumerate(dsts): + assert_managed_holds(dev, dst, i + 80, stream=copy_stream) + + for buf in srcs + dsts: + buf.close(copy_stream) + copy_stream.sync() + mr.close() + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_host_numa_location_hint(self, copy_batch_device, copy_stream): + """A NUMA-specific host hint is accepted and does not corrupt the copy.""" + dev = copy_batch_device + numa_id = dev.properties.host_numa_id + if numa_id < 0: + pytest.skip("System does not report a host NUMA node for this device") + mr = create_managed_memory_resource_or_skip() + srcs = [mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(2)] + dsts = [mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(2)] + for i, src in enumerate(srcs): + src.fill(i + 85, stream=copy_stream) + + copy_batch(copy_stream, srcs, dsts, options=CopyOptions(dst_location_hint=Host(numa_id=numa_id))) + copy_stream.sync() + for i, dst in enumerate(dsts): + assert_managed_holds(dev, dst, i + 85, stream=copy_stream) + + for buf in srcs + dsts: + buf.close(copy_stream) + copy_stream.sync() + mr.close() + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_host_numa_current_location_hint(self, copy_batch_device, copy_stream): + """Host.numa_current() as a location hint is accepted and does not corrupt the copy.""" + dev = copy_batch_device + if dev.properties.host_numa_id < 0: + pytest.skip("System does not report a host NUMA node for this device") + mr = create_managed_memory_resource_or_skip() + srcs = [mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(2)] + dsts = [mr.allocate(COPY_BATCH_SIZE, stream=copy_stream) for _ in range(2)] + for i, src in enumerate(srcs): + src.fill(i + 86, stream=copy_stream) + + copy_batch(copy_stream, srcs, dsts, options=CopyOptions(dst_location_hint=Host.numa_current())) + copy_stream.sync() + for i, dst in enumerate(dsts): + assert_managed_holds(dev, dst, i + 86, stream=copy_stream) + + for buf in srcs + dsts: + buf.close(copy_stream) + copy_stream.sync() + mr.close() + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_overlap_mode_copies_correctly(self, h2d_bufs, copy_stream): + """The overlap hint is advisory and must not change the bytes copied.""" + srcs, dsts = h2d_bufs + for i, src in enumerate(srcs): + set_buffer(src, i + 90) + + copy_batch( + copy_stream, + srcs, + dsts, + options=CopyOptions(overlap_mode=MemcpyOverlapMode.PREFER_OVERLAP_WITH_COMPUTE), + ) + copy_stream.sync() + + for i, dst in enumerate(dsts): + assert compare_buffer_to_constant(dst, i + 90) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_default_overlap_mode_does_not_warn(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + copy_batch(copy_stream, srcs, dsts, options=CopyOptions()) + copy_stream.sync() + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_options_on_per_thread_default_stream(self, copy_batch_device): + """CopyOptions work on PER_THREAD_DEFAULT_STREAM like any explicit stream. + + Unlike LEGACY_DEFAULT_STREAM (rejected outright, see + TestCopyBatchStreamSemantics in test_copy_batch.py), + PER_THREAD_DEFAULT_STREAM is a real stream to cuMemcpyBatchAsync. + """ + pinned_mr = LegacyPinnedMemoryResource() + device_mr = copy_batch_device.memory_resource + src = pinned_mr.allocate(COPY_BATCH_SIZE) + dst = device_mr.allocate(COPY_BATCH_SIZE, stream=PER_THREAD_DEFAULT_STREAM) + set_buffer(src, 44) + + copy_batch( + PER_THREAD_DEFAULT_STREAM, + [src], + [dst], + options=CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY), + ) + copy_batch_device.sync() + + assert compare_buffer_to_constant(dst, 44) + + src.close(PER_THREAD_DEFAULT_STREAM) + dst.close(PER_THREAD_DEFAULT_STREAM) + copy_batch_device.sync() + + +class TestCopyOptionsValidation: + """``CopyOptions`` rejects invalid enum values at construction.""" + + @pytest.mark.agent_authored(model="Claude Sonnet 4.6") + def test_type_hints_resolvable(self): + """All annotations on CopyOptions must resolve without NameError.""" + import typing + + typing.get_type_hints(CopyOptions) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_invalid_access_order(self): + with pytest.raises(ValueError, match="invalid src_access_order"): + CopyOptions(src_access_order="invalid_order") + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_invalid_overlap_mode(self): + with pytest.raises(ValueError, match="invalid overlap_mode"): + CopyOptions(overlap_mode="invalid_mode") + + +class TestCopyBatchValidation: + """``copy_batch`` rejects malformed buffer and option arguments.""" + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_rejects_single_buffer(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + + with pytest.raises(TypeError, match="sequence of Buffers"): + copy_batch(copy_stream, srcs[0], dsts) + + with pytest.raises(TypeError, match="sequence of Buffers"): + copy_batch(copy_stream, srcs, dsts[0]) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_rejects_empty_sequence(self, h2d_bufs, copy_stream): + srcs, _ = h2d_bufs + + with pytest.raises(ValueError, match="empty buffers sequence"): + copy_batch(copy_stream, [], []) + + with pytest.raises(ValueError, match="empty buffers sequence"): + copy_batch(copy_stream, srcs, []) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_rejects_non_buffer_element(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + + with pytest.raises(TypeError, match="expected Buffer, got int"): + copy_batch(copy_stream, [srcs[0], 42], dsts[:2]) + + with pytest.raises(TypeError, match="expected Buffer, got NoneType"): + copy_batch(copy_stream, srcs[:2], [dsts[0], None]) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_rejects_non_sequence(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + + with pytest.raises(TypeError, match="must be a sequence of Buffer"): + copy_batch(copy_stream, 42, dsts) + + with pytest.raises(TypeError, match="must be a sequence of Buffer"): + copy_batch(copy_stream, srcs, None) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_length_mismatch(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + + with pytest.raises(ValueError, match="does not match dsts length"): + copy_batch(copy_stream, srcs[:2], dsts[:3]) + + @pytest.mark.agent_authored(model="Claude Opus 5") + @pytest.mark.parametrize(("src_size", "dst_size"), [(1024, 2048), (2048, 1024)]) + def test_size_mismatch(self, copy_batch_device, copy_stream, src_size, dst_size): + """Sizes come from the buffers, so any inequality is an error.""" + pinned_mr = LegacyPinnedMemoryResource() + src = pinned_mr.allocate(src_size) + dst = copy_batch_device.memory_resource.allocate(dst_size, stream=copy_stream) + + with pytest.raises(ValueError, match="size mismatch at index 0"): + copy_batch(copy_stream, [src], [dst]) + + src.close(copy_stream) + dst.close(copy_stream) + copy_stream.sync() + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_options_length_mismatch(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + + with pytest.raises(ValueError, match="options length"): + copy_batch(copy_stream, srcs, dsts, options=[CopyOptions()] * 3) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_rejects_bad_options_type(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + + with pytest.raises(TypeError, match="options must be CopyOptions"): + copy_batch(copy_stream, srcs, dsts, options=42) + + @pytest.mark.agent_authored(model="Claude Opus 5") + def test_rejects_bad_options_element(self, h2d_bufs, copy_stream): + srcs, dsts = h2d_bufs + bad = [CopyOptions()] * (len(srcs) - 1) + ["nope"] + + with pytest.raises(TypeError, match="each options element must be CopyOptions"): + copy_batch(copy_stream, srcs, dsts, options=bad) diff --git a/cuda_core/tests/memory/test_copy_single_options.py b/cuda_core/tests/memory/test_copy_single_options.py new file mode 100644 index 00000000000..1df17a1f758 --- /dev/null +++ b/cuda_core/tests/memory/test_copy_single_options.py @@ -0,0 +1,476 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""CopyOptions support for Buffer.copy_to / Buffer.copy_from (issue #2365).""" + +import pytest +from helpers.buffers import compare_equal_buffers, make_scratch_buffer, set_buffer +from helpers.copy_batch import assert_managed_holds +from helpers.memory import create_managed_memory_resource_or_skip + +from cuda.core import Device, Host, LegacyPinnedMemoryResource +from cuda.core._stream import LEGACY_DEFAULT_STREAM, PER_THREAD_DEFAULT_STREAM +from cuda.core._utils.version import binding_version, driver_version +from cuda.core.utils import CopyOptions, MemcpyOverlapMode, MemcpySrcAccessOrder + +SIZE = 4096 + + +def _options_honored(): + """True when cuMemcpyWithAttributesAsync will actually be used for options. + + Mirrors _with_attributes_available() in _buffer.pyx. CI runs a matrix + that includes pre-CUDA-13.2 driver/bindings combinations (see + ci/test-matrix.yml), where this is False and the DURING_API_CALL tests + below must expect a RuntimeError instead of a successful copy. + """ + return driver_version() >= (13, 2, 0) and binding_version() >= (13, 2, 0) + + +@pytest.fixture +def single_copy_device(init_cuda): + device = Device() + device.set_current() + return device + + +@pytest.fixture +def single_copy_stream(single_copy_device): + s = single_copy_device.create_stream() + yield s + s.close() + + +@pytest.fixture +def pinned_mr(): + return LegacyPinnedMemoryResource() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_options_none_copy_to_data_correct(single_copy_device, single_copy_stream, pinned_mr): + """options=None (default) continues to copy the right bytes.""" + src = make_scratch_buffer(single_copy_device, 0x55, SIZE) + dst = pinned_mr.allocate(SIZE) + + src.copy_to(dst, stream=single_copy_stream) + single_copy_stream.sync() + + assert compare_equal_buffers(src, dst) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_options_none_copy_from_data_correct(single_copy_device, single_copy_stream, pinned_mr): + """copy_from with options=None copies the right bytes.""" + src = make_scratch_buffer(single_copy_device, 0xAA, SIZE) + dst = pinned_mr.allocate(SIZE) + + dst.copy_from(src, stream=single_copy_stream) + single_copy_stream.sync() + + assert compare_equal_buffers(src, dst) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +@pytest.mark.parametrize( + ("order", "marker"), + [ + (MemcpySrcAccessOrder.STREAM, 0x31), + (MemcpySrcAccessOrder.ANY, 0x33), + ], +) +def test_src_access_order_copy_to(single_copy_device, single_copy_stream, pinned_mr, order, marker): + """STREAM and ANY are accepted and never corrupt copy_to. + + Both are satisfied by stream-ordered access at worst, so whether + cuMemcpyWithAttributesAsync actually honors the hint (CUDA 13.2+ driver + and cuda.bindings) or the call silently falls back to cuMemcpyAsync, the + copied bytes must be identical either way. DURING_API_CALL is different + (see test_during_api_call_copy_to): its stronger guarantee cannot be + silently downgraded, so it is tested separately. + """ + src = make_scratch_buffer(single_copy_device, marker, SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=order) + + src.copy_to(dst, stream=single_copy_stream, options=opts) + single_copy_stream.sync() + + assert compare_equal_buffers(src, dst) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +@pytest.mark.parametrize( + ("order", "marker"), + [ + (MemcpySrcAccessOrder.STREAM, 0x41), + (MemcpySrcAccessOrder.ANY, 0x43), + ], +) +def test_src_access_order_copy_from(single_copy_device, single_copy_stream, pinned_mr, order, marker): + """STREAM and ANY are accepted and never corrupt copy_from. See + test_src_access_order_copy_to for why DURING_API_CALL is tested + separately. + """ + src = make_scratch_buffer(single_copy_device, marker, SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=order) + + dst.copy_from(src, stream=single_copy_stream, options=opts) + single_copy_stream.sync() + + assert compare_equal_buffers(src, dst) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_during_api_call_copy_to(single_copy_device, single_copy_stream, pinned_mr): + """DURING_API_CALL is honored on the native (CUDA 13.2+) path. + + On the pre-13.2 fallback it must raise RuntimeError instead of silently + downgrading to stream-ordered cuMemcpyAsync, which cannot honor the + guarantee that all source reads complete before the call returns (see + TestRejectUnsupportedDuringApiCall in test_copy_batch_options.py). CI + runs both driver generations (see ci/test-matrix.yml), so this test must + handle both outcomes rather than assuming the native path is available. + """ + src = make_scratch_buffer(single_copy_device, 0x32, SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.DURING_API_CALL) + + if _options_honored(): + src.copy_to(dst, stream=single_copy_stream, options=opts) + single_copy_stream.sync() + assert compare_equal_buffers(src, dst) + else: + with pytest.raises(RuntimeError, match="DURING_API_CALL"): + src.copy_to(dst, stream=single_copy_stream, options=opts) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_during_api_call_copy_from(single_copy_device, single_copy_stream, pinned_mr): + """Same as test_during_api_call_copy_to, exercising copy_from instead.""" + src = make_scratch_buffer(single_copy_device, 0x42, SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.DURING_API_CALL) + + if _options_honored(): + dst.copy_from(src, stream=single_copy_stream, options=opts) + single_copy_stream.sync() + assert compare_equal_buffers(src, dst) + else: + with pytest.raises(RuntimeError, match="DURING_API_CALL"): + dst.copy_from(src, stream=single_copy_stream, options=opts) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_overlap_mode_copies_correctly(single_copy_device, single_copy_stream, pinned_mr): + """The overlap hint is advisory and must not change the bytes copied.""" + src = make_scratch_buffer(single_copy_device, 0x77, SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(overlap_mode=MemcpyOverlapMode.PREFER_OVERLAP_WITH_COMPUTE) + + src.copy_to(dst, stream=single_copy_stream, options=opts) + single_copy_stream.sync() + + assert compare_equal_buffers(src, dst) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_legacy_default_stream_token_rejected_with_options(single_copy_device): + """LEGACY_DEFAULT_STREAM with options raises TypeError, matching copy_batch. + + cuMemcpyWithAttributesAsync rejects the legacy default-stream token + outright with CUDA_ERROR_INVALID_VALUE on every driver version, so + copy_to / copy_from surface this before ever calling the driver, just + like copy_batch does. options=None is unaffected: it never touches the + attributes path, so LEGACY_DEFAULT_STREAM keeps working as it always has. + """ + pinned_mr = LegacyPinnedMemoryResource() + src = pinned_mr.allocate(SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY) + + with pytest.raises(TypeError, match="LEGACY_DEFAULT_STREAM"): + src.copy_to(dst, stream=LEGACY_DEFAULT_STREAM, options=opts) + + with pytest.raises(TypeError, match="LEGACY_DEFAULT_STREAM"): + dst.copy_from(src, stream=LEGACY_DEFAULT_STREAM, options=opts) + + # options=None never reaches the attributes path, so this keeps working. + src.copy_to(dst, stream=LEGACY_DEFAULT_STREAM) + single_copy_device.sync() + + src.close() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_per_thread_default_stream_token_accepted_with_options(single_copy_device): + """PER_THREAD_DEFAULT_STREAM is a real stream to the driver, so options are + honored on it just like an explicit stream (subject to the usual CUDA + 13.2+ attributes gate), unlike LEGACY_DEFAULT_STREAM. + """ + pinned_mr = LegacyPinnedMemoryResource() + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY) + + src = pinned_mr.allocate(SIZE) + set_buffer(src, 0x22) + dst = pinned_mr.allocate(SIZE) + src.copy_to(dst, stream=PER_THREAD_DEFAULT_STREAM, options=opts) + single_copy_device.sync() + assert compare_equal_buffers(src, dst) + + set_buffer(src, 0x23) + dst.copy_from(src, stream=PER_THREAD_DEFAULT_STREAM, options=opts) + single_copy_device.sync() + assert compare_equal_buffers(src, dst) + + src.close() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_location_hints_do_not_corrupt_copy(single_copy_device, single_copy_stream): + """Device and host location hints are accepted and leave the bytes intact. + + Hints are only honored by the driver for managed memory; for other + allocation types they are silently ignored. This exercises the + src_location_hint / dst_location_hint → to_cumemlocation path through + cuMemcpyWithAttributesAsync rather than cuMemcpyBatchAsync. + """ + dev = single_copy_device + mr = create_managed_memory_resource_or_skip() + src = mr.allocate(SIZE, stream=single_copy_stream) + dst = mr.allocate(SIZE, stream=single_copy_stream) + + src.fill(0x88, stream=single_copy_stream) + + opts = CopyOptions( + src_access_order=MemcpySrcAccessOrder.STREAM, + src_location_hint=dev, + dst_location_hint=Host(), + ) + src.copy_to(dst, stream=single_copy_stream, options=opts) + + assert_managed_holds(dev, dst, 0x88, stream=single_copy_stream) + + src.close(single_copy_stream) + dst.close(single_copy_stream) + single_copy_stream.sync() + mr.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_host_numa_location_hint(single_copy_device, single_copy_stream): + """A NUMA-specific host hint is accepted and does not corrupt the copy.""" + dev = single_copy_device + numa_id = dev.properties.host_numa_id + if numa_id < 0: + pytest.skip("System does not report a host NUMA node for this device") + mr = create_managed_memory_resource_or_skip() + src = mr.allocate(SIZE, stream=single_copy_stream) + dst = mr.allocate(SIZE, stream=single_copy_stream) + + src.fill(0x99, stream=single_copy_stream) + + opts = CopyOptions(dst_location_hint=Host(numa_id=numa_id)) + src.copy_to(dst, stream=single_copy_stream, options=opts) + + assert_managed_holds(dev, dst, 0x99, stream=single_copy_stream) + + src.close(single_copy_stream) + dst.close(single_copy_stream) + single_copy_stream.sync() + mr.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_host_numa_current_location_hint(single_copy_device, single_copy_stream): + """Host.numa_current() as a location hint is accepted and does not corrupt the copy.""" + dev = single_copy_device + if dev.properties.host_numa_id < 0: + pytest.skip("System does not report a host NUMA node for this device") + mr = create_managed_memory_resource_or_skip() + src = mr.allocate(SIZE, stream=single_copy_stream) + dst = mr.allocate(SIZE, stream=single_copy_stream) + + src.fill(0xAB, stream=single_copy_stream) + + opts = CopyOptions(dst_location_hint=Host.numa_current()) + src.copy_to(dst, stream=single_copy_stream, options=opts) + + assert_managed_holds(dev, dst, 0xAB, stream=single_copy_stream) + + src.close(single_copy_stream) + dst.close(single_copy_stream) + single_copy_stream.sync() + mr.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_options_copy_to_data_correct(single_copy_device, single_copy_stream, pinned_mr): + """copy_to with non-None options copies the right bytes on all driver versions.""" + src = make_scratch_buffer(single_copy_device, 0x77, SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY) + + src.copy_to(dst, stream=single_copy_stream, options=opts) + single_copy_stream.sync() + + assert compare_equal_buffers(src, dst) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_options_copy_from_data_correct(single_copy_device, single_copy_stream, pinned_mr): + """copy_from with non-None options copies the right bytes on all driver versions.""" + src = make_scratch_buffer(single_copy_device, 0x33, SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM) + + dst.copy_from(src, stream=single_copy_stream, options=opts) + single_copy_stream.sync() + + assert compare_equal_buffers(src, dst) + + src.close(single_copy_stream) + single_copy_stream.sync() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_options_copy_to_rejected_under_graph_capture(single_copy_stream, pinned_mr): + """copy_to with options raises TypeError when the stream is capturing, + matching copy_batch. Use GraphNode.memcpy to build attributed copies + into a graph instead; options=None keeps working under capture as it + always has (captured as a plain cuMemcpyAsync node). + """ + src = pinned_mr.allocate(SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY) + + gb = single_copy_stream.create_graph_builder().begin_building() + try: + with pytest.raises(TypeError, match="graph capture"): + src.copy_to(dst, stream=gb, options=opts) + finally: + gb.end_building() + gb.close() + + src.close() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_options_copy_from_rejected_under_graph_capture(single_copy_stream, pinned_mr): + """Same as the copy_to variant, exercising copy_from instead.""" + src = pinned_mr.allocate(SIZE) + dst = pinned_mr.allocate(SIZE) + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.STREAM) + + gb = single_copy_stream.create_graph_builder().begin_building() + try: + with pytest.raises(TypeError, match="graph capture"): + dst.copy_from(src, stream=gb, options=opts) + finally: + gb.end_building() + gb.close() + + src.close() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_options_none_copy_to_still_works_under_graph_capture(single_copy_stream, pinned_mr): + """options=None never touches the attributes path, so copy_to keeps + working under graph capture exactly as it did before options existed. + """ + src = pinned_mr.allocate(SIZE) + set_buffer(src, 0xBB) + dst = pinned_mr.allocate(SIZE) + + gb = single_copy_stream.create_graph_builder().begin_building() + src.copy_to(dst, stream=gb) + graph = gb.end_building().complete() + graph.launch(single_copy_stream) + single_copy_stream.sync() + + assert compare_equal_buffers(src, dst) + + src.close() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 5") +@pytest.mark.parametrize("bad_options", [42, "not-copyoptions", object()]) +def test_copy_to_rejects_invalid_options_type(single_copy_stream, pinned_mr, bad_options): + src = pinned_mr.allocate(SIZE) + dst = pinned_mr.allocate(SIZE) + + with pytest.raises(TypeError, match="options must be CopyOptions"): + src.copy_to(dst, stream=single_copy_stream, options=bad_options) + + with pytest.raises(TypeError, match="options must be CopyOptions"): + dst.copy_from(src, stream=single_copy_stream, options=bad_options) + + with pytest.raises(TypeError, match="options must be CopyOptions"): + src.copy_to(dst, stream=LEGACY_DEFAULT_STREAM, options="not-copyoptions") + + src.close() + dst.close() + + +@pytest.mark.agent_authored(model="Claude Sonnet 4.6") +def test_dst_none_with_options(single_copy_device, single_copy_stream, pinned_mr): + """dst=None auto-allocation works correctly with options on all driver versions.""" + mr = single_copy_device.memory_resource + src = mr.allocate(SIZE, stream=single_copy_stream) + src.fill(0xF0, stream=single_copy_stream) + opts = CopyOptions(src_access_order=MemcpySrcAccessOrder.ANY) + + dst = src.copy_to(stream=single_copy_stream, options=opts) + + # Read back via pinned buffer to verify bytes. + host = pinned_mr.allocate(SIZE) + dst.copy_to(host, stream=single_copy_stream) + single_copy_stream.sync() + + ref = make_scratch_buffer(single_copy_device, 0xF0, SIZE) + assert compare_equal_buffers(ref, host) + + src.close(single_copy_stream) + dst.close(single_copy_stream) + single_copy_stream.sync() + host.close() + ref.close(single_copy_stream) + single_copy_stream.sync() diff --git a/cuda_core/tests/memory/test_managed_ops.py b/cuda_core/tests/memory/test_managed_ops.py index ed7f44a97f4..cb686026c7e 100644 --- a/cuda_core/tests/memory/test_managed_ops.py +++ b/cuda_core/tests/memory/test_managed_ops.py @@ -4,8 +4,8 @@ import mmap import pytest -from conftest import create_managed_memory_resource_or_skip from helpers.buffers import DummyDeviceMemoryResource, DummyUnifiedMemoryResource +from helpers.memory import create_managed_memory_resource_or_skip from cuda.bindings import driver from cuda.core import Device, Host, ManagedBuffer @@ -37,9 +37,10 @@ def _page_base(buf): def _skip_if_raw_managed_alloc_unsupported(device): - # Raw `cuMemAllocManaged` capability — distinct from conftest's - # `skip_if_managed_memory_unsupported`, which gates `ManagedMemoryResource` - # pool creation. Used by tests that exercise `DummyUnifiedMemoryResource`. + # Raw `cuMemAllocManaged` capability — distinct from + # `helpers.memory.skip_if_managed_memory_unsupported`, which gates + # `ManagedMemoryResource` pool creation. Used by tests that exercise + # `DummyUnifiedMemoryResource`. try: if not device.properties.managed_memory: pytest.skip("Device does not support managed memory operations") diff --git a/cuda_core/tests/memory_ipc/__init__.py b/cuda_core/tests/memory_ipc/__init__.py deleted file mode 100644 index 27422b3cb7e..00000000000 --- a/cuda_core/tests/memory_ipc/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 diff --git a/cuda_core/tests/memory_ipc/test_errors.py b/cuda_core/tests/memory_ipc/test_errors.py index 0aac9f9a297..a9107a07c7b 100644 --- a/cuda_core/tests/memory_ipc/test_errors.py +++ b/cuda_core/tests/memory_ipc/test_errors.py @@ -4,6 +4,7 @@ import multiprocessing import pickle import re +import uuid import pytest from helpers.child_processes import child_timeout_sec, kill_subprocesses @@ -51,6 +52,21 @@ def test_ipc_allocation_handle_rejects_negative_fd(): IPCAllocationHandle._init(-1, None) +@pytest.mark.human_authored +def test_register_rejects_non_ipc_memory_resource(mempool_device): + """register() on a resource without IPC enabled raises instead of dereferencing None.""" + mr = DeviceMemoryResource(mempool_device) + assert not mr.is_ipc_enabled + + key = uuid.uuid4() + with pytest.raises(RuntimeError, match="Memory resource is not IPC-enabled"): + mr.register(key) + + # The rejected registration must not leave the resource in the registry. + with pytest.raises(RuntimeError, match=r"Memory resource [a-z0-9-]+ was not found"): + DeviceMemoryResource.from_registry(key) + + class ChildErrorHarness: """Test harness for checking errors in child processes. Subclasses override PARENT_ACTION, CHILD_ACTION, and ASSERT (see below for examples).""" diff --git a/cuda_core/tests/system/__init__.py b/cuda_core/tests/system/__init__.py deleted file mode 100644 index 79599c77db0..00000000000 --- a/cuda_core/tests/system/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# -# SPDX-License-Identifier: Apache-2.0 diff --git a/cuda_core/tests/system/test_system_device.py b/cuda_core/tests/system/test_system_device.py index 2ec2d5fb41c..5eab916952d 100644 --- a/cuda_core/tests/system/test_system_device.py +++ b/cuda_core/tests/system/test_system_device.py @@ -11,7 +11,6 @@ import multiprocessing import os import re -import warnings import helpers import pytest @@ -32,23 +31,6 @@ def check_gpu_available(): pytest.skip("No GPUs available to run device tests", allow_module_level=True) -def test_devices_are_the_same_architecture(): - # 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 = {device.arch for device in system.Device.get_all_devices()} - - if len(all_arches) > 1: - warnings.warn( - f"System has devices of multiple architectures ({', '.join(x.name for x in all_arches)}). " - f" Some tests may be skipped unexpectedly", - UserWarning, - ) - - def test_device_count(): assert system.Device.get_device_count() == system.get_num_devices() @@ -81,55 +63,69 @@ def test_device_architecture(): assert isinstance(device_arch, typing.DeviceArch) -def test_device_bar1_memory(): +def test_device_bar1_memory(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - bar1_memory_info = device.bar1_memory_info - free, total, used = ( - bar1_memory_info.free, - bar1_memory_info.total, - bar1_memory_info.used, - ) - - assert isinstance(bar1_memory_info, _device.BAR1MemoryInfo) - assert isinstance(free, int) - assert isinstance(total, int) - assert isinstance(used, int) - - assert free >= 0 - assert total >= 0 - assert used >= 0 - assert free + used == total + with subtests.test(device_index=device.index): + with unsupported_before(device, None): + bar1_memory_info = device.bar1_memory_info + free, total, used = ( + bar1_memory_info.free, + bar1_memory_info.total, + bar1_memory_info.used, + ) + assert isinstance(bar1_memory_info, _device.BAR1MemoryInfo) + assert isinstance(free, int) + assert isinstance(total, int) + assert isinstance(used, int) -@pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Device attributes not supported on WSL or Windows") -def test_device_cpu_affinity(): - for device in system.Device.get_all_devices(): - with unsupported_before(device, typing.DeviceArch.KEPLER): - affinity = device.get_cpu_affinity(typing.AffinityScope.NODE) - assert isinstance(affinity, list) - os.sched_setaffinity(0, affinity) - assert os.sched_getaffinity(0) == set(affinity) + assert free >= 0 + assert total >= 0 + assert used >= 0 + assert free + used == total @pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Device attributes not supported on WSL or Windows") -def test_affinity(): +def test_device_cpu_affinity(subtests): for device in system.Device.get_all_devices(): - for scope in typing.AffinityScope.__members__.values(): + with subtests.test(device_index=device.index): with unsupported_before(device, typing.DeviceArch.KEPLER): - affinity = device.get_cpu_affinity(scope) - assert isinstance(affinity, list) - - affinity = device.get_memory_affinity(scope) + affinity = device.get_cpu_affinity(typing.AffinityScope.NODE) assert isinstance(affinity, list) + os.sched_setaffinity(0, affinity) + assert os.sched_getaffinity(0) == set(affinity) -def test_numa_node_id(): +@pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Device attributes not supported on WSL or Windows") +def test_affinity(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - numa_node_id = device.numa_node_id - assert isinstance(numa_node_id, int) - assert numa_node_id >= -1 + for scope in typing.AffinityScope.__members__.values(): + with subtests.test( + device_index=device.index, + affinity_scope=scope.value, + affinity_api="get_cpu_affinity", + ): + with unsupported_before(device, typing.DeviceArch.KEPLER): + affinity = device.get_cpu_affinity(scope) + assert isinstance(affinity, list) + + with subtests.test( + device_index=device.index, + affinity_scope=scope.value, + affinity_api="get_memory_affinity", + ): + with unsupported_before(device, typing.DeviceArch.KEPLER): + affinity = device.get_memory_affinity(scope) + assert isinstance(affinity, list) + + +def test_numa_node_id(subtests): + for device in system.Device.get_all_devices(): + with subtests.test(device_index=device.index): + with unsupported_before(device, None): + numa_node_id = device.numa_node_id + assert isinstance(numa_node_id, int) + assert numa_node_id >= -1 def test_device_cuda_compute_capability(): @@ -143,23 +139,24 @@ def test_device_cuda_compute_capability(): assert 0 <= cuda_compute_capability[1] <= 9 -def test_device_memory(): +def test_device_memory(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - memory_info = device.memory_info - free, total, used, reserved = memory_info.free, memory_info.total, memory_info.used, memory_info.reserved + with subtests.test(device_index=device.index): + with unsupported_before(device, None): + memory_info = device.memory_info + free, total, used, reserved = memory_info.free, memory_info.total, memory_info.used, memory_info.reserved - assert isinstance(memory_info, _device.MemoryInfo) - assert isinstance(free, int) - assert isinstance(total, int) - assert isinstance(used, int) - assert isinstance(reserved, int) + assert isinstance(memory_info, _device.MemoryInfo) + assert isinstance(free, int) + assert isinstance(total, int) + assert isinstance(used, int) + assert isinstance(reserved, int) - assert free >= 0 - assert total >= 0 - assert used >= 0 - assert reserved >= 0 - assert free + used + reserved == total + assert free >= 0 + assert total >= 0 + assert used >= 0 + assert reserved >= 0 + assert free + used + reserved == total def test_device_name(): @@ -169,72 +166,74 @@ def test_device_name(): assert len(name) > 0 -def test_device_pci_info(): +def test_device_pci_info(subtests): for device in system.Device.get_all_devices(): - pci_info = device.pci_info - assert isinstance(pci_info, _device.PciInfo) + with subtests.test(device_index=device.index): + pci_info = device.pci_info + assert isinstance(pci_info, _device.PciInfo) - assert isinstance(pci_info.bus_id, str) - assert re.match("[a-f0-9]{8}:[a-f0-9]{2}:[a-f0-9]{2}.[a-f0-9]", pci_info.bus_id.lower()) - bus_id_domain = int(pci_info.bus_id.split(":")[0], 16) - bus_id_bus = int(pci_info.bus_id.split(":")[1], 16) - bus_id_device = int(pci_info.bus_id.split(":")[2][:2], 16) + assert isinstance(pci_info.bus_id, str) + assert re.match("[a-f0-9]{8}:[a-f0-9]{2}:[a-f0-9]{2}.[a-f0-9]", pci_info.bus_id.lower()) + bus_id_domain = int(pci_info.bus_id.split(":")[0], 16) + bus_id_bus = int(pci_info.bus_id.split(":")[1], 16) + bus_id_device = int(pci_info.bus_id.split(":")[2][:2], 16) - assert isinstance(pci_info.domain, int) - assert 0x00 <= pci_info.domain <= 0xFFFFFFFF - assert pci_info.domain == bus_id_domain + assert isinstance(pci_info.domain, int) + assert 0x00 <= pci_info.domain <= 0xFFFFFFFF + assert pci_info.domain == bus_id_domain - assert isinstance(pci_info.bus, int) - assert 0x00 <= pci_info.bus <= 0xFF - assert pci_info.bus == bus_id_bus + assert isinstance(pci_info.bus, int) + assert 0x00 <= pci_info.bus <= 0xFF + assert pci_info.bus == bus_id_bus - assert isinstance(pci_info.device, int) - assert 0x00 <= pci_info.device <= 0xFF - assert pci_info.device == bus_id_device + assert isinstance(pci_info.device, int) + assert 0x00 <= pci_info.device <= 0xFF + assert pci_info.device == bus_id_device - assert isinstance(pci_info.vendor_id, int) - assert 0x0000 <= pci_info.vendor_id <= 0xFFFF + assert isinstance(pci_info.vendor_id, int) + assert 0x0000 <= pci_info.vendor_id <= 0xFFFF - assert isinstance(pci_info.device_id, int) - assert 0x0000 <= pci_info.device_id <= 0xFFFF + assert isinstance(pci_info.device_id, int) + assert 0x0000 <= pci_info.device_id <= 0xFFFF - assert isinstance(pci_info.subsystem_id, int) - assert 0x00000000 <= pci_info.subsystem_id <= 0xFFFFFFFF + assert isinstance(pci_info.subsystem_id, int) + assert 0x00000000 <= pci_info.subsystem_id <= 0xFFFFFFFF - assert isinstance(pci_info.base_class, int) - assert 0x00 <= pci_info.base_class <= 0xFF + assert isinstance(pci_info.base_class, int) + assert 0x00 <= pci_info.base_class <= 0xFF - assert isinstance(pci_info.sub_class, int) - assert 0x00 <= pci_info.sub_class <= 0xFF + assert isinstance(pci_info.sub_class, int) + assert 0x00 <= pci_info.sub_class <= 0xFF - assert isinstance(pci_info.link_generation, int) - assert 0 <= pci_info.link_generation <= 0xFF + assert isinstance(pci_info.link_generation, int) + assert 0 <= pci_info.link_generation <= 0xFF - assert isinstance(pci_info.max_link_generation, int) - assert 0 <= pci_info.max_link_generation <= 0xFF + assert isinstance(pci_info.max_link_generation, int) + assert 0 <= pci_info.max_link_generation <= 0xFF - assert isinstance(pci_info.max_link_width, int) - assert 0 <= pci_info.max_link_width <= 0xFF + assert isinstance(pci_info.max_link_width, int) + assert 0 <= pci_info.max_link_width <= 0xFF - assert isinstance(pci_info.current_link_generation, int) - assert 0 <= pci_info.current_link_generation <= 0xFF + assert isinstance(pci_info.current_link_generation, int) + assert 0 <= pci_info.current_link_generation <= 0xFF - assert isinstance(pci_info.current_link_width, int) - assert 0 <= pci_info.current_link_width <= 0xFF + assert isinstance(pci_info.current_link_width, int) + assert 0 <= pci_info.current_link_width <= 0xFF - with unsupported_before(device, None): - assert isinstance(pci_info.tx_throughput, int) - assert isinstance(pci_info.rx_throughput, int) + with unsupported_before(device, None): + assert isinstance(pci_info.tx_throughput, int) + assert isinstance(pci_info.rx_throughput, int) - assert isinstance(pci_info.replay_counter, int) + assert isinstance(pci_info.replay_counter, int) -def test_device_serial(): +def test_device_serial(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, "HAS_INFOROM"): - serial = device.serial - assert isinstance(serial, str) - assert len(serial) > 0 + with subtests.test(device_index=device.index): + with unsupported_before(device, "HAS_INFOROM"): + serial = device.serial + assert isinstance(serial, str) + assert len(serial) > 0 def test_device_uuid_without_prefix(): @@ -322,109 +321,117 @@ def test_device_pci_bus_id(): @pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Device attributes not supported on WSL or Windows") -def test_device_attributes(): +def test_device_attributes(subtests): for device in system.Device.get_all_devices(): - # Docs say this should work on AMPERE or newer, but experimentally - # that's not the case. - with unsupported_before(device, None): - attributes = device.attributes - assert isinstance(attributes, _device.DeviceAttributes) + with subtests.test(device_index=device.index): + # Docs say this should work on AMPERE or newer, but experimentally + # that's not the case. + with unsupported_before(device, None): + attributes = device.attributes + assert isinstance(attributes, _device.DeviceAttributes) - assert isinstance(attributes.multiprocessor_count, int) - assert attributes.multiprocessor_count > 0 + assert isinstance(attributes.multiprocessor_count, int) + assert attributes.multiprocessor_count > 0 - assert isinstance(attributes.shared_copy_engine_count, int) - assert isinstance(attributes.shared_decoder_count, int) - assert isinstance(attributes.shared_encoder_count, int) - assert isinstance(attributes.shared_jpeg_count, int) - assert isinstance(attributes.shared_ofa_count, int) - assert isinstance(attributes.gpu_instance_slice_count, int) - assert isinstance(attributes.compute_instance_slice_count, int) - assert isinstance(attributes.memory_size_mb, int) - assert attributes.memory_size_mb > 0 + assert isinstance(attributes.shared_copy_engine_count, int) + assert isinstance(attributes.shared_decoder_count, int) + assert isinstance(attributes.shared_encoder_count, int) + assert isinstance(attributes.shared_jpeg_count, int) + assert isinstance(attributes.shared_ofa_count, int) + assert isinstance(attributes.gpu_instance_slice_count, int) + assert isinstance(attributes.compute_instance_slice_count, int) + assert isinstance(attributes.memory_size_mb, int) + assert attributes.memory_size_mb > 0 -def test_c2c_mode_enabled(): +def test_c2c_mode_enabled(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - is_enabled = device.is_c2c_enabled - assert isinstance(is_enabled, bool) + with subtests.test(device_index=device.index): + with unsupported_before(device, None): + is_enabled = device.is_c2c_enabled + assert isinstance(is_enabled, bool) @pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Persistence mode not supported on WSL or Windows") -def test_persistence_mode_enabled(): +def test_persistence_mode_enabled(subtests): for device in system.Device.get_all_devices(): - is_enabled = device.is_persistence_mode_enabled - assert isinstance(is_enabled, bool) - try: - device.is_persistence_mode_enabled = False - except nvml.NoPermissionError as e: - pytest.xfail(f"nvml.NoPermissionError: {e}") - try: - assert device.is_persistence_mode_enabled is False - finally: - device.is_persistence_mode_enabled = is_enabled + with subtests.test(device_index=device.index): + is_enabled = device.is_persistence_mode_enabled + assert isinstance(is_enabled, bool) + try: + device.is_persistence_mode_enabled = False + except nvml.NoPermissionError as e: + pytest.xfail(f"nvml.NoPermissionError: {e}") + try: + assert device.is_persistence_mode_enabled is False + finally: + device.is_persistence_mode_enabled = is_enabled -def test_field_values(): +def test_field_values(subtests): for device in system.Device.get_all_devices(): - # TODO: Are there any fields that return double's? It would be good to - # test those. + with subtests.test(device_index=device.index): + # TODO: Are there any fields that return double's? It would be good to + # test those. - assert len(device.get_field_values([])) == 0 + assert len(device.get_field_values([])) == 0 - field_ids = [ - typing.FieldId.DEV_TOTAL_ENERGY_CONSUMPTION, - typing.FieldId.DEV_PCIE_COUNT_TX_BYTES, - ] - field_values = device.get_field_values(field_ids) - with unsupported_before(device, None): - field_values.validate() + field_ids = [ + typing.FieldId.DEV_TOTAL_ENERGY_CONSUMPTION, + typing.FieldId.DEV_PCIE_COUNT_TX_BYTES, + ] + field_values = device.get_field_values(field_ids) + with unsupported_before(device, None): + field_values.validate() - with pytest.raises(TypeError): - field_values["invalid_index"] + with pytest.raises(TypeError): + field_values["invalid_index"] - assert isinstance(field_values, _device.FieldValues) - assert len(field_values) == len(field_ids) + assert isinstance(field_values, _device.FieldValues) + assert len(field_values) == len(field_ids) - raw_values = field_values.get_all_values() - assert all(x == y.value for x, y in zip(raw_values, field_values)) + raw_values = field_values.get_all_values() + assert all(x == y.value for x, y in zip(raw_values, field_values)) - for field_id, field_value in zip(field_ids, field_values): - assert field_value.field_id == field_id - assert type(field_value.value) is int - assert field_value.latency_usec >= 0 - assert field_value.timestamp >= 0 + for field_id, field_value in zip(field_ids, field_values): + assert field_value.field_id == field_id + assert type(field_value.value) is int + assert field_value.latency_usec >= 0 + assert field_value.timestamp >= 0 - orig_timestamp = field_values[0].timestamp - field_values = device.get_field_values(field_ids) - assert field_values[0].timestamp >= orig_timestamp + orig_timestamp = field_values[0].timestamp + field_values = device.get_field_values(field_ids) + assert field_values[0].timestamp >= orig_timestamp - # Test only one element, because that's weirdly a special case - field_ids = [ - typing.FieldId.DEV_PCIE_REPLAY_COUNTER, - ] - field_values = device.get_field_values(field_ids) - assert len(field_values) == 1 - field_values.validate() - old_value = field_values[0].value + # Test only one element, because that's weirdly a special case + field_ids = [ + typing.FieldId.DEV_PCIE_REPLAY_COUNTER, + ] + field_values = device.get_field_values(field_ids) + assert len(field_values) == 1 + field_values.validate() + old_value = field_values[0].value - # Test clear_field_values - device.clear_field_values(field_ids) - field_values = device.get_field_values(field_ids) - field_values.validate() - assert len(field_values) == 1 - assert field_values[0].value <= old_value + # Test clear_field_values + device.clear_field_values(field_ids) + field_values = device.get_field_values(field_ids) + field_values.validate() + assert len(field_values) == 1 + assert field_values[0].value <= old_value @pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Device attributes not supported on WSL or Windows") -def test_get_all_devices_with_cpu_affinity(): +def test_get_all_devices_with_cpu_affinity(subtests): for i in range(multiprocessing.cpu_count()): - for device in system.Device.get_all_devices_with_cpu_affinity(i): - with unsupported_before(device, DeviceArch.KEPLER): - affinity = device.get_cpu_affinity() - assert isinstance(affinity, list) - assert i in affinity + devices = [] + with subtests.test(cpu_index=i, affinity_api="get_all_devices_with_cpu_affinity"): + devices = list(system.Device.get_all_devices_with_cpu_affinity(i)) + for device in devices: + with subtests.test(cpu_index=i, device_index=device.index): + with unsupported_before(device, DeviceArch.KEPLER): + affinity = device.get_cpu_affinity() + assert isinstance(affinity, list) + assert i in affinity def test_index(): @@ -434,21 +441,23 @@ def test_index(): assert index == i -def test_module_id(): +def test_module_id(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - module_id = device.module_id - assert isinstance(module_id, int) - assert module_id >= 0 + with subtests.test(device_index=device.index): + with unsupported_before(device, None): + module_id = device.module_id + assert isinstance(module_id, int) + assert module_id >= 0 -def test_addressing_mode(): +def test_addressing_mode(subtests): for device in system.Device.get_all_devices(): - # By docs, should be supported on TURING or newer, but experimentally, - # is also unsupported on other hardware. - with unsupported_before(device, None): - addressing_mode = device.addressing_mode - assert addressing_mode is None or addressing_mode in typing.AddressingMode.__members__.values() + with subtests.test(device_index=device.index): + # By docs, should be supported on TURING or newer, but experimentally, + # is also unsupported on other hardware. + with unsupported_before(device, None): + addressing_mode = device.addressing_mode + assert addressing_mode is None or addressing_mode in typing.AddressingMode.__members__.values() def test_display_mode(): @@ -460,16 +469,17 @@ def test_display_mode(): assert isinstance(is_display_active, bool) -def test_repair_status(): +def test_repair_status(subtests): for device in system.Device.get_all_devices(): - # By docs, should be supported on AMPERE or newer, but experimentally, - # this seems to also work on some TURING systems. - with unsupported_before(device, None): - repair_status = device.repair_status - assert isinstance(repair_status, _device.RepairStatus) + with subtests.test(device_index=device.index): + # By docs, should be supported on AMPERE or newer, but experimentally, + # this seems to also work on some TURING systems. + with unsupported_before(device, None): + repair_status = device.repair_status + assert isinstance(repair_status, _device.RepairStatus) - assert isinstance(repair_status.channel_repair_pending, bool) - assert isinstance(repair_status.tpc_repair_pending, bool) + assert isinstance(repair_status.channel_repair_pending, bool) + assert isinstance(repair_status.tpc_repair_pending, bool) @pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="Device attributes not supported on WSL or Windows") @@ -520,213 +530,254 @@ def test_get_minor_number(): assert minor_number >= 0 -def test_get_inforom_version(): +def test_get_inforom_version(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, "HAS_INFOROM"): - inforom = device.inforom + with subtests.test(device_index=device.index): + with unsupported_before(device, "HAS_INFOROM"): + inforom = device.inforom - with unsupported_before(device, "HAS_INFOROM"): - inforom_image_version = inforom.image_version - assert isinstance(inforom_image_version, str) - assert len(inforom_image_version) > 0 + with unsupported_before(device, "HAS_INFOROM"): + inforom_image_version = inforom.image_version + assert isinstance(inforom_image_version, str) + assert len(inforom_image_version) > 0 - inforom_version = inforom.get_version(typing.InforomObject.OEM) - assert isinstance(inforom_version, str) - assert len(inforom_version) > 0 + inforom_version = inforom.get_version(typing.InforomObject.OEM) + assert isinstance(inforom_version, str) + assert len(inforom_version) > 0 - checksum = inforom.configuration_checksum - assert isinstance(checksum, int) + checksum = inforom.configuration_checksum + assert isinstance(checksum, int) - # TODO: This is untested locally. - try: - timestamp, duration_us = inforom.bbx_flush_time - except (system.NotSupportedError, system.NotReadyError): - pass - else: - assert isinstance(timestamp, int) - assert timestamp > 0 - assert isinstance(duration_us, int) - assert duration_us > 0 + # TODO: This is untested locally. + try: + timestamp, duration_us = inforom.bbx_flush_time + except (system.NotSupportedError, system.NotReadyError): + pass + else: + assert isinstance(timestamp, int) + assert timestamp > 0 + assert isinstance(duration_us, int) + assert duration_us > 0 - with unsupported_before(device, "HAS_INFOROM"): - board_part_number = inforom.board_part_number - assert isinstance(board_part_number, str) + with unsupported_before(device, "HAS_INFOROM"): + board_part_number = inforom.board_part_number + assert isinstance(board_part_number, str) - # Some boards (e.g. NVIDIA T4G) do not program a board part number - assert board_part_number == "" or board_part_number.strip() == board_part_number + # Some boards (e.g. NVIDIA T4G) do not program a board part number + assert board_part_number == "" or board_part_number.strip() == board_part_number - inforom.validate() + inforom.validate() -def test_auto_boosted_clocks_enabled(): +def test_auto_boosted_clocks_enabled(subtests): for device in system.Device.get_all_devices(): - # This API is supported on KEPLER and newer, but it also seems - # unsupported elsewhere. - with unsupported_before(device, None): - current, default = device.is_auto_boosted_clocks_enabled - assert isinstance(current, bool) - assert isinstance(default, bool) + with subtests.test(device_index=device.index): + # This API is supported on KEPLER and newer, but it also seems + # unsupported elsewhere. + with unsupported_before(device, None): + current, default = device.is_auto_boosted_clocks_enabled + assert isinstance(current, bool) + assert isinstance(default, bool) -def test_clock(): +def test_clock(subtests): for device in system.Device.get_all_devices(): for clock_type in typing.ClockType: - clock = device.get_clock(clock_type) - assert isinstance(clock, _device.ClockInfo) - - # These are ordered from oldest API to newest API so we test as much - # as we can on each hardware architecture. - - with unsupported_before(device, None): - pstate = device.performance_state + with subtests.test(device_index=device.index, clock_type=clock_type.value): + clock = device.get_clock(clock_type) + assert isinstance(clock, _device.ClockInfo) - min_, max_ = clock.get_min_max_clock_of_pstate_mhz(pstate) - assert isinstance(min_, int) - assert min_ >= 0 - assert isinstance(max_, int) - assert max_ >= 0 + # These are ordered from oldest API to newest API so we test as much + # as we can on each hardware architecture. - with unsupported_before(device, "FERMI"): - max_mhz = clock.get_max_mhz() - assert isinstance(max_mhz, int) - assert max_mhz >= 0 + with unsupported_before(device, None): + pstate = device.performance_state - with unsupported_before(device, DeviceArch.KEPLER): - current_mhz = clock.get_current_mhz() - assert isinstance(current_mhz, int) - assert current_mhz >= 0 + # Individual queries may be unsupported for a clock domain even + # on newer devices. + with unsupported_before(device, None): + min_, max_ = clock.get_min_max_clock_of_pstate_mhz(pstate) + assert isinstance(min_, int) + assert min_ >= 0 + assert isinstance(max_, int) + assert max_ >= 0 - # Docs say this should work on PASCAL or newer, but experimentally, - # is also unsupported on other hardware. - with unsupported_before(device, DeviceArch.MAXWELL): - try: - offsets = clock.get_offsets(pstate) - except (system.InvalidArgumentError, system.NotFoundError): - pass - else: - assert isinstance(offsets, _device.ClockOffsets) - assert isinstance(offsets.clock_offset_mhz, int) - assert isinstance(offsets.max_offset_mhz, int) - assert isinstance(offsets.min_offset_mhz, int) + with unsupported_before(device, "FERMI"): + max_mhz = clock.get_max_mhz() + assert isinstance(max_mhz, int) + assert max_mhz >= 0 - # By docs, should be supported on PASCAL or newer, but experimentally, - # is also unsupported on other hardware. - with unsupported_before(device, None): - max_customer_boost = clock.get_max_customer_boost_mhz() - assert isinstance(max_customer_boost, int) - assert max_customer_boost >= 0 + with unsupported_before(device, None): + current_mhz = clock.get_current_mhz() + assert isinstance(current_mhz, int) + assert current_mhz >= 0 + + # Docs say this should work on PASCAL or newer, but experimentally, + # is also unsupported on other hardware. + with unsupported_before(device, DeviceArch.MAXWELL): + try: + offsets = clock.get_offsets(pstate) + except (system.InvalidArgumentError, system.NotFoundError): + pass + else: + assert isinstance(offsets, _device.ClockOffsets) + assert isinstance(offsets.clock_offset_mhz, int) + assert isinstance(offsets.max_offset_mhz, int) + assert isinstance(offsets.min_offset_mhz, int) + + # By docs, should be supported on PASCAL or newer, but experimentally, + # is also unsupported on other hardware. + with unsupported_before(device, None): + max_customer_boost = clock.get_max_customer_boost_mhz() + assert isinstance(max_customer_boost, int) + assert max_customer_boost >= 0 -def test_clock_event_reasons(): +def test_clock_event_reasons(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - reasons = device.current_clock_event_reasons - assert all(isinstance(reason, typing.ClocksEventReasons) for reason in reasons) + with subtests.test(device_index=device.index): + with unsupported_before(device, None): + reasons = device.current_clock_event_reasons + assert all(isinstance(reason, typing.ClocksEventReasons) for reason in reasons) - with unsupported_before(device, None): - reasons = device.supported_clock_event_reasons - assert all(isinstance(reason, typing.ClocksEventReasons) for reason in reasons) + with unsupported_before(device, None): + reasons = device.supported_clock_event_reasons + assert all(isinstance(reason, typing.ClocksEventReasons) for reason in reasons) -def test_fan(): +def test_fan(subtests): for device in system.Device.get_all_devices(): + device_index = device.index + num_fans = None # The fan APIs are only supported on discrete devices with fans, # but when they are not available `device.num_fans` returns 0. - if device.num_fans == 0: - pytest.skip("Device has no fans to test") + with subtests.test(device_index=device_index, fan_api="get_num_fans"): + value = device.num_fans + assert isinstance(value, int) + assert value >= 0 + num_fans = value + if num_fans == 0: + pytest.skip("Device has no fans to test") + if not num_fans: + continue - for fan_idx in range(device.num_fans): - fan_info = device.get_fan(fan_idx) - assert isinstance(fan_info, _device.FanInfo) + for fan_idx in range(num_fans): + with subtests.test(device_index=device_index, fan_index=fan_idx): + fan_info = device.get_fan(fan_idx) + assert isinstance(fan_info, _device.FanInfo) - speed = fan_info.speed - assert isinstance(speed, int) - assert 0 <= speed <= 200 - try: - fan_info.speed = 50 - except nvml.NoPermissionError as e: - pytest.xfail(f"nvml.NoPermissionError: {e}") - try: - fan_info.speed = speed + speed = fan_info.speed + assert isinstance(speed, int) + assert 0 <= speed <= 200 + try: + fan_info.speed = 50 + except nvml.NoPermissionError as e: + pytest.xfail(f"nvml.NoPermissionError: {e}") + try: + fan_info.speed = speed - speed_rpm = fan_info.speed_rpm - assert isinstance(speed_rpm, int) - assert speed_rpm >= 0 + speed_rpm = fan_info.speed_rpm + assert isinstance(speed_rpm, int) + assert speed_rpm >= 0 - target_speed = fan_info.target_speed - assert isinstance(target_speed, int) - assert speed <= target_speed * 2 + target_speed = fan_info.target_speed + assert isinstance(target_speed, int) + assert speed <= target_speed * 2 - min_, max_ = fan_info.min_max_speed - assert isinstance(min_, int) - assert isinstance(max_, int) - assert min_ <= max_ + min_, max_ = fan_info.min_max_speed + assert isinstance(min_, int) + assert isinstance(max_, int) + assert min_ <= max_ - control_policy = fan_info.control_policy - assert isinstance(control_policy, typing.FanControlPolicy) - finally: - fan_info.set_default_speed() + control_policy = fan_info.control_policy + assert isinstance(control_policy, typing.FanControlPolicy) + finally: + fan_info.set_default_speed() -def test_cooler(): +def test_cooler(subtests): for device in system.Device.get_all_devices(): - # The cooler APIs are only supported on discrete devices with fans, - # but when they are not available `device.num_fans` returns 0. - if device.num_fans == 0: - pytest.skip("Device has no coolers to test") + with subtests.test(device_index=device.index): + # The cooler APIs are only supported on discrete devices with fans, + # but when they are not available `device.num_fans` returns 0. + if device.num_fans == 0: + pytest.skip("Device has no coolers to test") - with unsupported_before(device, DeviceArch.MAXWELL): - cooler_info = device.cooler + with unsupported_before(device, DeviceArch.MAXWELL): + cooler_info = device.cooler - assert isinstance(cooler_info, _device.CoolerInfo) + assert isinstance(cooler_info, _device.CoolerInfo) - signal_type = cooler_info.signal_type - assert isinstance(signal_type, (typing.CoolerControl, type(None))) + signal_type = cooler_info.signal_type + assert isinstance(signal_type, (typing.CoolerControl, type(None))) - target = cooler_info.target - assert all(isinstance(t, typing.CoolerTarget) for t in target) + target = cooler_info.target + assert all(isinstance(t, typing.CoolerTarget) for t in target) @pytest.mark.filterwarnings("ignore::DeprecationWarning") -def test_temperature(): - for device in system.Device.get_all_devices(): - temperature = device.temperature - assert isinstance(temperature, _device.Temperature) +def test_temperature(subtests): + for device in system.Device.get_all_devices(): + device_index = device.index + temperature = None + with subtests.test(device_index=device_index, temperature_api="temperature"): + value = device.temperature + assert isinstance(value, _device.Temperature) + temperature = value + if temperature is None: + continue - sensor = temperature.get_sensor() - assert isinstance(sensor, int) - assert sensor >= 0 + with subtests.test(device_index=device_index, temperature_api="get_sensor"): + sensor = temperature.get_sensor() + assert isinstance(sensor, int) + assert sensor >= 0 # By docs, should be supported on KEPLER or newer, but experimentally, # is also unsupported on other hardware. # get_threshold emits DeprecationWarning for some thresholds on Ada+; # that behaviour is tested separately in # test_temperature_threshold_unrecognized_device_arch. - with unsupported_before(device, None): - for threshold in list(typing.TemperatureThresholds): - t = temperature.get_threshold(threshold) + for threshold in typing.TemperatureThresholds: + with subtests.test( + device_index=device_index, + temperature_api="get_threshold", + threshold=threshold.value, + ): + with unsupported_before(device, None): + t = temperature.get_threshold(threshold) assert isinstance(t, int) assert t >= 0 - with unsupported_before(device, None): - margin = temperature.margin - assert isinstance(margin, int) - assert margin >= 0 + with subtests.test(device_index=device_index, temperature_api="margin"): + with unsupported_before(device, None): + margin = temperature.margin + assert isinstance(margin, int) + assert margin >= 0 - with unsupported_before(device, None): - thermals = temperature.get_thermal_settings(typing.ThermalTarget.ALL) - assert isinstance(thermals, _device.ThermalSettings) + thermals = None + with subtests.test(device_index=device_index, temperature_api="get_thermal_settings"): + with unsupported_before(device, None): + value = temperature.get_thermal_settings(typing.ThermalTarget.ALL) + assert isinstance(value, _device.ThermalSettings) + thermals = value + if thermals is None: + continue for i, sensor in enumerate(thermals): - assert isinstance(sensor, _device.ThermalSensor) - assert isinstance(sensor.target, typing.ThermalTarget) - assert isinstance(sensor.controller, typing.ThermalController) - assert isinstance(sensor.default_min_temp, int) - assert sensor.default_min_temp >= 0 - assert isinstance(sensor.default_max_temp, int) - assert sensor.default_max_temp >= sensor.default_min_temp - assert isinstance(sensor.current_temp, int) - assert sensor.default_min_temp <= sensor.current_temp <= sensor.default_max_temp + with subtests.test( + device_index=device_index, + temperature_api="thermal_sensor", + sensor_index=i, + ): + assert isinstance(sensor, _device.ThermalSensor) + assert isinstance(sensor.target, typing.ThermalTarget) + assert isinstance(sensor.controller, typing.ThermalController) + assert isinstance(sensor.default_min_temp, int) + assert sensor.default_min_temp >= 0 + assert isinstance(sensor.default_max_temp, int) + assert sensor.default_max_temp >= sensor.default_min_temp + assert isinstance(sensor.current_temp, int) + assert sensor.default_min_temp <= sensor.current_temp <= sensor.default_max_temp @pytest.mark.thread_unsafe(reason="Temporarily replaces process-global NVML functions") @@ -781,51 +832,64 @@ def test_device_arg_validation(): system.get_p2p_status(device, device, "not-an-index") -def test_pstates(): +def test_pstates(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - pstate = device.performance_state - assert isinstance(pstate, int) + with subtests.test(device_index=device.index): + with unsupported_before(device, None): + pstate = device.performance_state + assert isinstance(pstate, int) - pstates = device.supported_pstates - assert all(isinstance(p, int) for p in pstates) + pstates = device.supported_pstates + assert all(isinstance(p, int) for p in pstates) - dynamic_pstates_info = device.dynamic_pstates_info - assert isinstance(dynamic_pstates_info, _device.GpuDynamicPstatesInfo) + dynamic_pstates_info = device.dynamic_pstates_info + assert isinstance(dynamic_pstates_info, _device.GpuDynamicPstatesInfo) - assert len(dynamic_pstates_info) == nvml.MAX_GPU_UTILIZATIONS + assert len(dynamic_pstates_info) == nvml.MAX_GPU_UTILIZATIONS - for utilization in dynamic_pstates_info: - assert isinstance(utilization.is_present, bool) - assert isinstance(utilization.percentage, int) - assert isinstance(utilization.inc_threshold, int) - assert isinstance(utilization.dec_threshold, int) + for utilization in dynamic_pstates_info: + assert isinstance(utilization.is_present, bool) + assert isinstance(utilization.percentage, int) + assert isinstance(utilization.inc_threshold, int) + assert isinstance(utilization.dec_threshold, int) -def test_compute_running_processes(): +def test_compute_running_processes(subtests): for cuda_device in CudaDevice.get_all_devices(): device = cuda_device.to_system_device() - with unsupported_before(device, "FERMI"): - processes = device.compute_running_processes - assert isinstance(processes, list) - for proc in processes: - assert isinstance(proc, _device.ProcessInfo) - assert isinstance(proc.pid, int) - assert isinstance(proc.used_gpu_memory, int) - if device.mig.is_mig_device: - assert isinstance(proc.gpu_instance_id, int) - assert isinstance(proc.compute_instance_id, int) - else: - with pytest.raises(nvml.NotSupportedError): - proc.gpu_instance_id # noqa: B018 - with pytest.raises(nvml.NotSupportedError): - proc.compute_instance_id # noqa: B018 - - -def test_nvlink(): - for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - for link in range(device.get_nvlink_count()): + with subtests.test(device_index=device.index): + with unsupported_before(device, "FERMI"): + processes = device.compute_running_processes + assert isinstance(processes, list) + for proc in processes: + assert isinstance(proc, _device.ProcessInfo) + assert isinstance(proc.pid, int) + assert isinstance(proc.used_gpu_memory, int) + if device.mig.is_mig_device: + assert isinstance(proc.gpu_instance_id, int) + assert isinstance(proc.compute_instance_id, int) + else: + with pytest.raises(nvml.NotSupportedError): + proc.gpu_instance_id # noqa: B018 + with pytest.raises(nvml.NotSupportedError): + proc.compute_instance_id # noqa: B018 + + +def test_nvlink(subtests): + for device in system.Device.get_all_devices(): + device_index = device.index + link_count = 0 + with ( + subtests.test(device_index=device_index, nvlink_api="get_nvlink_count"), + unsupported_before(device, None), + ): + value = device.get_nvlink_count() + assert isinstance(value, int) + assert value >= 0 + link_count = value + + for link in range(link_count): + with subtests.test(device_index=device_index, nvlink_api="get_nvlink", link_index=link): with unsupported_before(device, None): nvlink_info = device.get_nvlink(link) assert isinstance(nvlink_info, _device.NvlinkInfo) @@ -843,7 +907,15 @@ def test_nvlink(): assert len(version) == 2 assert all(isinstance(i, int) for i in version) - for nvlink_info in device.get_nvlinks(): + nvlink_infos = [] + with ( + subtests.test(device_index=device_index, nvlink_api="get_nvlinks"), + unsupported_before(device, None), + ): + nvlink_infos = list(device.get_nvlinks()) + + for link, nvlink_info in enumerate(nvlink_infos): + with subtests.test(device_index=device_index, nvlink_api="get_nvlinks", link_index=link): assert isinstance(nvlink_info, _device.NvlinkInfo) with unsupported_before(device, None): @@ -865,25 +937,26 @@ def test_nvlink_max_links_deprecated(): _ = _device.NvlinkInfo.max_links -def test_utilization(): +def test_utilization(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): - utilization = device.utilization - assert isinstance(utilization, _device.Utilization) + with subtests.test(device_index=device.index): + with unsupported_before(device, None): + utilization = device.utilization + assert isinstance(utilization, _device.Utilization) - gpu = utilization.gpu - assert isinstance(gpu, int) - assert 0 <= gpu <= 100 + gpu = utilization.gpu + assert isinstance(gpu, int) + assert 0 <= gpu <= 100 - memory = utilization.memory - assert isinstance(memory, int) - assert 0 <= memory <= 100 + memory = utilization.memory + assert isinstance(memory, int) + assert 0 <= memory <= 100 @pytest.mark.skipif(helpers.IS_WSL or helpers.IS_WINDOWS, reason="MIG not supported on WSL or Windows") -def test_mig(): +def test_mig(subtests): for device in system.Device.get_all_devices(): - with unsupported_before(device, None): + with subtests.test(device_index=device.index), unsupported_before(device, None): mig = device.mig assert isinstance(mig.is_mig_device, bool) diff --git a/cuda_core/tests/test_enum_coverage.py b/cuda_core/tests/test_enum_coverage.py index a121d9c1d9f..2c83d1a1f21 100644 --- a/cuda_core/tests/test_enum_coverage.py +++ b/cuda_core/tests/test_enum_coverage.py @@ -132,6 +132,15 @@ _MODULES.append(system_typing) + _CLOCKS_EVENT_REASONS_STR_UNMAPPED = { + core_member + for binding_member, core_member in ( + ("EVENT_REASON_BOARD_LIMIT", "BOARD_LIMIT"), + ("EVENT_REASON_RELIABILITY", "RELIABILITY"), + ) + if binding_member not in nvml.ClocksEventReasons.__members__ + } + _CASES.extend( [ ( @@ -164,7 +173,7 @@ system_typing.ClocksEventReasons, _device._CLOCKS_EVENT_REASONS_MAPPING, set(), - set(), + _CLOCKS_EVENT_REASONS_STR_UNMAPPED, ), ( nvml.EventType, diff --git a/cuda_core/tests/test_event.py b/cuda_core/tests/test_event.py index 79f0090ace6..3e765a9e0d0 100644 --- a/cuda_core/tests/test_event.py +++ b/cuda_core/tests/test_event.py @@ -222,6 +222,7 @@ def test_event_ipc_descriptor_non_ipc(init_cuda): _ = event.ipc_descriptor +@pytest.mark.skipif(Device().compute_capability.major < 7, reason="__nanosleep is only available starting Volta (sm70)") def test_event_is_done_false(init_cuda): """Event.is_done returns False when captured work has not yet completed.""" device = Device() diff --git a/cuda_core/tests/test_launcher.py b/cuda_core/tests/test_launcher.py index e5cf05b435d..a71ee2d7b4f 100644 --- a/cuda_core/tests/test_launcher.py +++ b/cuda_core/tests/test_launcher.py @@ -4,7 +4,7 @@ import ctypes import helpers -from cuda_python_test_helpers.marks import requires_module +from cuda_python_test_helpers.marks import requires_module, skipif_need_cuda_headers from helpers.misc import StreamWrapper try: @@ -13,7 +13,6 @@ cp = None import numpy as np import pytest -from conftest import skipif_need_cuda_headers from cuda.core import ( Device, diff --git a/cuda_core/tests/test_linker.py b/cuda_core/tests/test_linker.py index 4f4433a1a1a..c875cfc0318 100644 --- a/cuda_core/tests/test_linker.py +++ b/cuda_core/tests/test_linker.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import inspect +import warnings import pytest @@ -436,6 +437,41 @@ def test_prepare_driver_options_unsupported_raises(driver_binding, kwargs, match opts._prepare_driver_options() +@pytest.mark.agent_authored(model="claude-opus-5") +@pytest.mark.parametrize("value", [True, False]) +def test_numba_debug_warns_and_is_ignored(value): + """No linking backend reads ``numba_debug``, so it is ignored -- but not + silently, which was the bug in #2640. + + The gate is ``is not None``, not truthiness: it is the field itself that is + deprecated, so ``numba_debug=False`` earns the notice too even though it + asks for nothing. + """ + with pytest.warns(DeprecationWarning, match="numba_debug is not supported by any linking backend"): + opts = LinkerOptions(arch="sm_80", debug=True, numba_debug=value) + # Warned, not rejected, and the rest of the option set is untouched. + assert opts._prepare_nvjitlink_options(as_bytes=True) == [b"-arch=sm_80", b"-g"] + + +@pytest.mark.agent_authored(model="claude-opus-5") +def test_numba_debug_unset_does_not_warn(): + """The deprecation notice fires only when the field is explicitly set.""" + with warnings.catch_warnings(): + warnings.simplefilter("error", DeprecationWarning) + options = LinkerOptions(arch="sm_80", debug=True)._prepare_nvjitlink_options(as_bytes=True) + assert options == [b"-arch=sm_80", b"-g"] + + +@pytest.mark.agent_authored(model="claude-opus-5") +def test_numba_debug_ignored_by_driver_backend_too(driver_binding): + """The cuLink driver API has no CUjit_option for numba_debug either, so it + is ignored there as well rather than reaching the driver.""" + with pytest.warns(DeprecationWarning, match="numba_debug"): + opts = LinkerOptions(arch="sm_80", numba_debug=True) + formatted_options, option_keys = opts._prepare_driver_options() + assert not any("NUMBA" in str(key) for key in option_keys) + + def test_linker_empty_object_codes_raises(): """Linker with no ObjectCode raises ValueError.""" with pytest.raises(ValueError, match="At least one ObjectCode object must be provided"): diff --git a/cuda_core/tests/test_managed_memory_warning.py b/cuda_core/tests/test_managed_memory_warning.py index f0596db2fdf..6edf2b7c05a 100644 --- a/cuda_core/tests/test_managed_memory_warning.py +++ b/cuda_core/tests/test_managed_memory_warning.py @@ -11,7 +11,8 @@ import warnings import pytest -from conftest import create_managed_memory_resource_or_skip, xfail_if_mempool_oom +from cuda_python_test_helpers.mempool import xfail_if_mempool_oom +from helpers.memory import create_managed_memory_resource_or_skip import cuda.bindings from cuda.core import Device, ManagedMemoryResource, ManagedMemoryResourceOptions diff --git a/cuda_core/tests/test_memory.py b/cuda_core/tests/test_memory.py index dff42239bd4..99aaf938721 100644 --- a/cuda_core/tests/test_memory.py +++ b/cuda_core/tests/test_memory.py @@ -14,15 +14,20 @@ import re import pytest -from conftest import ( +from helpers import supports_ipc_mempool +from helpers.buffers import ( + DummyDeviceMemoryResource, + DummyUnifiedMemoryResource, + StubMemoryResource, + make_instrumented_memory_resource, +) +from helpers.constants import POOL_SIZE +from helpers.memory import ( create_managed_memory_resource_or_skip, create_pinned_memory_resource_or_xfail, skip_if_managed_memory_unsupported, skip_if_pinned_memory_unsupported, ) -from helpers import supports_ipc_mempool -from helpers.buffers import DummyDeviceMemoryResource, DummyUnifiedMemoryResource, TrackingMR -from helpers.constants import POOL_SIZE from cuda.core import ( Buffer, @@ -31,6 +36,7 @@ DeviceMemoryResourceOptions, GraphMemoryResource, LegacyPinnedMemoryResource, + ManagedBuffer, ManagedMemoryResource, ManagedMemoryResourceOptions, MemoryResource, @@ -41,6 +47,7 @@ ) from cuda.core._dlpack import DLDeviceType from cuda.core._memory._ipc import IPCBufferDescriptor +from cuda.core._stream import default_stream from cuda.core._utils.cuda_utils import CUDAError, handle_return from cuda.core.typing import ( ManagedMemoryLocationType, @@ -233,6 +240,36 @@ def test_buffer_copy_from(): buffer_copy_from(DummyPinnedMemoryResource(device), device, check=True) +def test_buffer_copy_to_size_mismatch_raises(): + device = Device() + device.set_current() + mr = DummyDeviceMemoryResource(device) + stream = device.create_stream() + src_buffer = mr.allocate(size=1024) + dst_buffer = mr.allocate(size=2048) + + with pytest.raises(ValueError, match="buffer sizes mismatch"): + src_buffer.copy_to(dst_buffer, stream=stream) + + dst_buffer.close() + src_buffer.close() + + +def test_buffer_copy_from_size_mismatch_raises(): + device = Device() + device.set_current() + mr = DummyDeviceMemoryResource(device) + stream = device.create_stream() + src_buffer = mr.allocate(size=1024) + dst_buffer = mr.allocate(size=2048) + + with pytest.raises(ValueError, match="buffer sizes mismatch"): + dst_buffer.copy_from(src_buffer, stream=stream) + + dst_buffer.close() + src_buffer.close() + + def _bytes_repeat(pattern: bytes, size: int) -> bytes: assert len(pattern) > 0 assert size % len(pattern) == 0 @@ -471,11 +508,12 @@ def test_mr_deallocate_called_on_close(): """Buffer.from_handle(mr=mr) calls mr.deallocate() on close (issue #1619).""" device = Device() device.set_current() - mr = TrackingMR() + TrackingMR, telemetry = make_instrumented_memory_resource(DummyDeviceMemoryResource, track_active=True) + mr = TrackingMR(device) buf = mr.allocate(1024) - assert len(mr.active) == 1 + assert len(telemetry["active"]) == 1 buf.close() - assert len(mr.active) == 0 + assert len(telemetry["active"]) == 0 def test_mr_deallocate_called_on_gc(): @@ -484,12 +522,13 @@ def test_mr_deallocate_called_on_gc(): device = Device() device.set_current() - mr = TrackingMR() + TrackingMR, telemetry = make_instrumented_memory_resource(DummyDeviceMemoryResource, track_active=True) + mr = TrackingMR(device) buf = mr.allocate(1024) - assert len(mr.active) == 1 + assert len(telemetry["active"]) == 1 del buf gc.collect() - assert len(mr.active) == 0 + assert len(telemetry["active"]) == 0 def test_mr_deallocate_receives_stream(): @@ -497,67 +536,330 @@ def test_mr_deallocate_receives_stream(): device = Device() device.set_current() stream = device.create_stream() - received = {} - - class StreamCaptureMR(TrackingMR): - def deallocate(self, ptr, size, *, stream=None): - received["stream"] = stream - super().deallocate(ptr, size, stream=stream) - - mr = StreamCaptureMR() + CapturingMR, telemetry = make_instrumented_memory_resource(DummyDeviceMemoryResource, record_streams=True) + mr = CapturingMR(device) buf = mr.allocate(1024) buf.close(stream) - assert received["stream"].handle == stream.handle - - -def test_mr_dealloc_callback_falls_back_to_default_stream(): - """When a Buffer's device-pointer handle has no attached deallocation - stream (e.g. buffers minted via :meth:`Buffer.from_handle` from DLPack - import, IPC import, or third-party adapters), the C++ deleter callback - must fall back to the default stream rather than passing ``stream=None`` - to ``mr.deallocate``. Stream-ordered MRs validate the stream and would - otherwise raise ``TypeError`` from inside the ``noexcept`` callback, - which only logs a warning and silently leaks the allocation. See - `#2001 <https://github.com/NVIDIA/cuda-python/issues/2001>`__. - """ + assert telemetry["deallocations"][-1]["stream"].handle == stream.handle + + +@pytest.mark.agent_authored(model="gpt-5.6") +@pytest.mark.parametrize( + ("configuration", "destruction"), + [ + ("initialization", "close"), + ("initialization", "gc"), + ("setter", "close"), + ("setter", "gc"), + ("close", "close"), + ], +) +def test_buffer_deallocation_stream_configuration_paths(configuration, destruction): + """Creation, mutation, and close overrides use the requested stream.""" import gc - from cuda.core._stream import Stream_accept, default_stream + device = Device() + device.set_current() + initial_stream = device.create_stream() + target_stream = device.create_stream() + CapturingMR, telemetry = make_instrumented_memory_resource(record_streams=True) + mr = CapturingMR(device) + + stream = target_stream if configuration == "initialization" else initial_stream + buf = Buffer.from_handle(1, 1024, mr=mr, stream=stream) + if configuration == "setter": + handle = buf.handle + buf.set_deallocation_stream(target_stream) + assert buf.handle == handle + assert buf.size == 1024 + + if destruction == "close": + buf.close(stream=target_stream if configuration == "close" else None) + else: + del buf + gc.collect() + + assert len(telemetry["deallocations"]) == 1 + assert telemetry["deallocations"][0]["stream"].handle == target_stream.handle + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_set_deallocation_stream_rejects_none_and_closed_buffer(): device = Device() device.set_current() - captured = {} + stream = device.create_stream() + mr = StubMemoryResource(device) + buf = Buffer.from_handle(1, 1024, mr=mr, stream=stream) + + with pytest.raises(TypeError, match="stream is required"): + buf.set_deallocation_stream(None) - class StrictCapturingMR(MemoryResource): - # Models a stream-ordered MR: deallocate validates the stream - # the same way DeviceMemoryResource.deallocate does. - @property - def is_device_accessible(self): - return True + buf.close() + with pytest.raises(RuntimeError, match="closed Buffer"): + buf.set_deallocation_stream(stream) - @property - def is_host_accessible(self): - return False - @property - def device_id(self): - return device.device_id +@pytest.mark.parametrize("buffer_type", [Buffer, ManagedBuffer]) +def test_from_handle_mr_records_default_stream(buffer_type): + """When a Buffer/ManagedBuffer is minted via :meth:`from_handle` with ``mr`` + but without an explicit ``stream=``, the deallocation stream is recorded at + creation as ``default_stream()`` (not chosen later in the destructor). + See `#2497`. + """ + import gc + + device = Device() + device.set_current() + CapturingMR, telemetry = make_instrumented_memory_resource(record_streams=True) + mr = CapturingMR(device) + # ptr=1 is fine because StubMemoryResource.deallocate does not free. + buf = buffer_type.from_handle(1, 1024, mr=mr) + del buf + gc.collect() - def allocate(self, size, *, stream): - raise NotImplementedError # not used; we use from_handle below + assert telemetry["deallocations"], "deallocate was not invoked (callback raised and leaked)" + assert telemetry["deallocations"][-1]["stream"].handle == default_stream().handle - def deallocate(self, ptr, size, *, stream): - captured["stream"] = Stream_accept(stream) - mr = StrictCapturingMR() - # Buffer.from_handle binds mr but does not attach a deallocation stream. - # ptr=1 is fine because StrictCapturingMR.deallocate does not free. - buf = Buffer.from_handle(1, 1024, mr=mr) +@pytest.mark.agent_authored(model="cursor-grok-4.5") +@pytest.mark.parametrize("buffer_type", [Buffer, ManagedBuffer]) +def test_from_handle_mr_records_explicit_stream(buffer_type): + """Buffer/ManagedBuffer.from_handle(..., mr=mr, stream=s) stores s for teardown.""" + import gc + + device = Device() + device.set_current() + stream = device.create_stream() + CapturingMR, telemetry = make_instrumented_memory_resource(record_streams=True) + mr = CapturingMR(device) + buf = buffer_type.from_handle(1, 1024, mr=mr, stream=stream) del buf gc.collect() - assert "stream" in captured, "deallocate was not invoked (callback raised and leaked)" - assert captured["stream"].handle == default_stream().handle + assert telemetry["deallocations"][-1]["stream"].handle == stream.handle + + +@pytest.mark.agent_authored(model="cursor-grok-4.5") +@pytest.mark.parametrize("buffer_type", [Buffer, ManagedBuffer]) +def test_from_handle_stream_requires_mr(buffer_type): + device = Device() + device.set_current() + stream = device.create_stream() + with pytest.raises(ValueError, match="stream requires a memory resource"): + buffer_type.from_handle(1, 1024, stream=stream) + + +@pytest.mark.agent_authored(model="claude-sonnet-4-6") +def test_close_with_default_stream_requires_context(): + """Buffer.close(stream=default_stream()) raises when no context is current. + + ``default_stream()`` has no bound context, so the close path must find + a current context to anchor the free. Without one it should raise rather + than silently record an unusable stream handle. + """ + device = Device() + device.set_current() + stream = device.create_stream() + mr = StubMemoryResource(device) + # Use a real stream at creation so _init succeeds without a current context later. + buf = Buffer.from_handle(1, 1024, mr=mr, stream=stream) + + previous = handle_return(driver.cuCtxPopCurrent()) + assert int(previous) != 0 + try: + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + with pytest.raises(RuntimeError, match="no CUDA context is current"): + buf.close(stream=default_stream()) + finally: + handle_return(driver.cuCtxSetCurrent(previous)) + + buf.close() # clean up using the recorded stream (which carries a context) + + +@pytest.mark.agent_authored(model="cursor-grok-4.5") +@pytest.mark.parametrize("buffer_type", [Buffer, ManagedBuffer]) +def test_from_handle_mr_default_stream_requires_context(buffer_type): + """Owning from_handle with the default stream needs a current context.""" + device = Device() + device.set_current() + mr = StubMemoryResource(device) + previous = handle_return(driver.cuCtxPopCurrent()) + assert int(previous) != 0 + try: + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + with pytest.raises(RuntimeError, match="no CUDA context is current"): + buffer_type.from_handle(1, 1024, mr=mr) + finally: + handle_return(driver.cuCtxSetCurrent(previous)) + + +@pytest.mark.agent_authored(model="gpt-5.6") +@pytest.mark.parametrize("buffer_type", [Buffer, ManagedBuffer]) +def test_from_handle_mr_explicit_stream_without_current_context(buffer_type): + """A context-bound stream makes owning from_handle context-independent.""" + device = Device() + device.set_current() + stream = device.create_stream() + CapturingMR, telemetry = make_instrumented_memory_resource(record_streams=True) + mr = CapturingMR(device) + previous = handle_return(driver.cuCtxPopCurrent()) + assert int(previous) != 0 + try: + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + buf = buffer_type.from_handle(1, 1024, mr=mr, stream=stream) + buf.close() + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + finally: + handle_return(driver.cuCtxSetCurrent(previous)) + + assert telemetry["deallocations"][-1]["stream"].handle == stream.handle + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_mr_deallocation_failure_warns(capfd): + """Destructor-path MR failures are contained and reported.""" + device = Device() + device.set_current() + FailingMR, _ = make_instrumented_memory_resource(deallocate_error=RuntimeError("expected deallocation failure")) + buf = Buffer.from_handle(1, 1024, mr=FailingMR(device)) + buf.close() + + assert ( + "Warning: mr.deallocate() failed during Buffer destruction: expected deallocation failure" + ) in capfd.readouterr().err + + +@pytest.mark.agent_authored(model="cursor-grok-4.5") +@pytest.mark.parametrize("replace_stream", [False, True]) +def test_mr_deallocation_without_current_context(init_cuda, capsys, replace_stream): + """MR-backed Buffer teardown activates the recorded context when none is current.""" + TrackingMR, telemetry = make_instrumented_memory_resource(DummyDeviceMemoryResource, track_active=True) + mr = TrackingMR(init_cuda) + buf = mr.allocate(1024) + stream = init_cuda.create_stream() if replace_stream else None + assert len(telemetry["active"]) == 1 + + previous = handle_return(driver.cuCtxPopCurrent()) + assert int(previous) != 0 + try: + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + + buf.close(stream) + + assert len(telemetry["active"]) == 0 + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + assert "mr.deallocate() failed" not in capsys.readouterr().err + finally: + handle_return(driver.cuCtxSetCurrent(previous)) + + +@pytest.mark.agent_authored(model="cursor-grok-4.5") +@pytest.mark.parametrize("replace_stream", [False, True]) +def test_mr_deallocation_with_foreign_context(capsys, replace_stream): + """MR-backed Buffer teardown switches away from an unrelated current context.""" + if len(Device.get_all_devices()) < 2: + pytest.skip("Test requires at least 2 GPUs") + + alloc_dev = Device(0) + alloc_dev.set_current() + TrackingMR, telemetry = make_instrumented_memory_resource(DummyDeviceMemoryResource, track_active=True) + mr = TrackingMR(alloc_dev) + buf = mr.allocate(1024) + stream = alloc_dev.create_stream() if replace_stream else None + assert len(telemetry["active"]) == 1 + alloc_ctx = int(handle_return(driver.cuCtxGetCurrent())) + + foreign_dev = Device(1) + foreign_dev.set_current() + foreign_ctx = int(handle_return(driver.cuCtxGetCurrent())) + assert foreign_ctx != 0 + assert foreign_ctx != alloc_ctx + + try: + buf.close(stream) + + assert len(telemetry["active"]) == 0 + assert int(handle_return(driver.cuCtxGetCurrent())) == foreign_ctx + assert "mr.deallocate() failed" not in capsys.readouterr().err + finally: + alloc_dev.set_current() + + +@pytest.mark.agent_authored(model="claude-opus-5") +def test_mr_deallocate_raises_on_driver_error(mempool_device): + """An explicit mr.deallocate() call propagates driver errors to the caller. + + Buffer teardown must not raise, so the containment lives in the destruction + callback rather than in deallocate() itself. See `#2497`. + """ + dev = mempool_device + stream = dev.create_stream() + mr = DeviceMemoryResource(dev, DeviceMemoryResourceOptions(max_size=POOL_SIZE)) + + with pytest.raises(CUDAError): + mr.deallocate(0xDEADBEEF, 256, stream=stream) + + +@pytest.mark.agent_authored(model="cursor-grok-4.5") +def test_pool_buffer_deallocates_without_current_context(mempool_device, capfd): + """Pool Buffer.close frees on the recorded stream with no current context.""" + dev = mempool_device + stream = dev.create_stream() + mr = DeviceMemoryResource(dev, DeviceMemoryResourceOptions(max_size=POOL_SIZE)) + size = 256 + buf = mr.allocate(size, stream=stream) + stream.sync() + used_after_alloc = mr.attributes.used_mem_current + + previous = handle_return(driver.cuCtxPopCurrent()) + assert int(previous) != 0 + try: + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + + buf.close() + stream.sync() + + assert mr.attributes.used_mem_current < used_after_alloc + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + err = capfd.readouterr().err + assert "failed during resource destruction" not in err + assert "mr.deallocate() failed" not in err + finally: + handle_return(driver.cuCtxSetCurrent(previous)) + + +@pytest.mark.agent_authored(model="cursor-grok-4.5") +def test_pool_buffer_deallocates_with_foreign_context(mempool_device_x2, capfd): + """Pool Buffer.close frees under the recorded context while another is current.""" + alloc_dev, foreign_dev = mempool_device_x2 + alloc_dev.set_current() + stream = alloc_dev.create_stream() + mr = DeviceMemoryResource(alloc_dev, DeviceMemoryResourceOptions(max_size=POOL_SIZE)) + size = 256 + buf = mr.allocate(size, stream=stream) + stream.sync() + used_after_alloc = mr.attributes.used_mem_current + alloc_ctx = int(handle_return(driver.cuCtxGetCurrent())) + + foreign_dev.set_current() + foreign_ctx = int(handle_return(driver.cuCtxGetCurrent())) + assert foreign_ctx != 0 + assert foreign_ctx != alloc_ctx + + try: + buf.close() + assert int(handle_return(driver.cuCtxGetCurrent())) == foreign_ctx + + # Observe the free on the allocation device, then restore the foreign context. + alloc_dev.set_current() + stream.sync() + assert mr.attributes.used_mem_current < used_after_alloc + foreign_dev.set_current() + + err = capfd.readouterr().err + assert "failed during resource destruction" not in err + finally: + alloc_dev.set_current() def test_memory_resource_and_owner_disallowed(): @@ -615,6 +917,8 @@ def test_buffer_dunder_dlpack_device_success(DummyMR, expected): def test_buffer_dunder_dlpack_device_failure(): + # avoids an error capturing the default stream with no context + Device().set_current() dummy_mr = NullMemoryResource() buffer = dummy_mr.allocate(size=1024) with pytest.raises(BufferError, match=r"^buffer is neither device-accessible nor host-accessible$"): @@ -622,6 +926,8 @@ def test_buffer_dunder_dlpack_device_failure(): def test_buffer_dlpack_failure_clean_up(): + # avoids an error capturing the default stream with no context + Device().set_current() dummy_mr = NullMemoryResource() buffer = dummy_mr.allocate(size=1024) before = sys.getrefcount(buffer) @@ -1640,11 +1946,11 @@ def test_mempool_attributes_repr(memory_resource_factory): device.set_current() if MR is DeviceMemoryResource: - mr = MR(device, options={"max_size": 2048}) + mr = MR(device, options=DeviceMemoryResourceOptions(max_size=2048)) elif MR is PinnedMemoryResource: - mr = MR(options={"max_size": 2048}) + mr = MR(options=PinnedMemoryResourceOptions(max_size=2048)) elif MR is ManagedMemoryResource: - mr = create_managed_memory_resource_or_skip(options={}) + mr = create_managed_memory_resource_or_skip(options=ManagedMemoryResourceOptions()) buffer1 = mr.allocate(64, stream=device.default_stream) buffer2 = mr.allocate(64, stream=device.default_stream) @@ -1677,11 +1983,11 @@ def test_mempool_attributes_ownership(memory_resource_factory): device.set_current() if MR is DeviceMemoryResource: - mr = MR(device, {"max_size": POOL_SIZE}) + mr = MR(device, DeviceMemoryResourceOptions(max_size=POOL_SIZE)) elif MR is PinnedMemoryResource: - mr = MR({"max_size": POOL_SIZE}) + mr = MR(PinnedMemoryResourceOptions(max_size=POOL_SIZE)) elif MR is ManagedMemoryResource: - mr = create_managed_memory_resource_or_skip({}) + mr = create_managed_memory_resource_or_skip(ManagedMemoryResourceOptions()) attributes = mr.attributes mr.close() diff --git a/cuda_core/tests/test_object_protocols.py b/cuda_core/tests/test_object_protocols.py index 8dec0ccb604..66163cadc5a 100644 --- a/cuda_core/tests/test_object_protocols.py +++ b/cuda_core/tests/test_object_protocols.py @@ -13,9 +13,9 @@ import weakref import pytest -from conftest import xfail_on_graph_mempool_oom from helpers.constants import POOL_SIZE from helpers.graph_kernels import compile_common_kernels +from helpers.memory import xfail_on_graph_mempool_oom from helpers.misc import try_create_condition from cuda.core import ( diff --git a/cuda_core/tests/test_program.py b/cuda_core/tests/test_program.py index 28465425c0e..72f8b8f5942 100644 --- a/cuda_core/tests/test_program.py +++ b/cuda_core/tests/test_program.py @@ -93,12 +93,16 @@ def _check_nvvm_arch(arch: str) -> bool: def _check_nvvm_supports_numba_debug() -> bool: - """Check if the installed libNVVM recognizes --numba-debug (CTK 13.2+).""" + """Check if the installed libNVVM recognizes -numba-debug. + + libNVVM only accepts single-dashed options, so the double-dashed spelling + used by NVRTC is rejected by every libNVVM version. + """ if not _has_check_nvvm_compiler_options(): return False from cuda.bindings.utils import check_nvvm_compiler_options - return check_nvvm_compiler_options(["--numba-debug"]) + return check_nvvm_compiler_options(["-numba-debug"]) @pytest.fixture(scope="session") @@ -312,8 +316,10 @@ def test_cpp_program_pch_status_none_without_pch(init_cuda): ProgramOptions(prec_div=True), ProgramOptions(prec_sqrt=True), ProgramOptions(fma=True), - # Plumb-through; no-op at link time. See #1287. - ProgramOptions(debug=True, numba_debug=True), + # ``numba_debug`` is deliberately absent: it was listed here as a link-time + # no-op (#1287), but no linker backend accepts it, so it was dropped + # silently (#2640). The PTX path now warns; see + # test_ptx_program_numba_debug_warns_and_is_ignored. ] if not is_culink_backend: options += [ @@ -762,18 +768,53 @@ def test_program_options_as_bytes_nvvm_unsupported_option(): @nvvm_available def test_nvvm_program_options_as_bytes_numba_debug(): - """numba_debug must be plumbed through to libNVVM as --numba-debug - (see #1287).""" + """numba_debug must be plumbed through to libNVVM as -numba-debug + (see #1287, #2570). libNVVM rejects the double-dashed spelling.""" options = ProgramOptions(arch="sm_80", debug=True, numba_debug=True) nvvm_bytes = options.as_bytes("nvvm") - assert b"--numba-debug" in nvvm_bytes + assert b"-numba-debug" in nvvm_bytes + assert b"--numba-debug" not in nvvm_bytes assert b"-g" in nvvm_bytes +@pytest.mark.agent_authored(model="claude-opus-5[1m]") +def test_nvvm_options_reject_double_dash(): + """The guard must name a double-dashed option rather than let libNVVM + reject it with an opaque error (see #2570).""" + from cuda.core._program import _assert_single_dashed_nvvm_options + + _assert_single_dashed_nvvm_options(["-arch=compute_80", "-g", "-numba-debug"]) + + with pytest.raises(RuntimeError, match=r"--numba-debug.*double-dashed"): + _assert_single_dashed_nvvm_options(["-arch=compute_80", "--numba-debug"]) + + +@nvvm_available +@pytest.mark.agent_authored(model="claude-opus-5[1m]") +def test_nvvm_program_options_as_bytes_all_single_dashed(): + """Every option cuda.core emits to libNVVM must be single-dashed, because + libNVVM rejects the double-dashed spelling of all of them (see #2570). + This covers every NVVM-supported field of ProgramOptions.""" + options = ProgramOptions( + arch="sm_80", + debug=True, + numba_debug=True, + device_code_optimize=True, + ftz=True, + prec_sqrt=True, + prec_div=True, + fma=True, + ) + nvvm_bytes = options.as_bytes("nvvm") + assert nvvm_bytes, "expected at least one emitted option" + offenders = [o for o in nvvm_bytes if o.startswith(b"--")] + assert not offenders, f"double-dashed options are rejected by libNVVM: {offenders}" + + @nvvm_available @pytest.mark.skipif( not _check_nvvm_supports_numba_debug(), - reason="installed libNVVM does not recognize --numba-debug (needs CTK 13.2+)", + reason="installed libNVVM does not recognize -numba-debug", ) def test_nvvm_program_numba_debug(init_cuda, nvvm_ir): options = ProgramOptions(arch="sm_80", debug=True, numba_debug=True) @@ -831,6 +872,34 @@ def test_ptx_program_extra_sources_unsupported(ptx_code_object): Program(ptx_code_object.code.decode(), "ptx", options) +@pytest.mark.agent_authored(model="claude-opus-5") +def test_ptx_program_numba_debug_warns_and_is_ignored(init_cuda, ptx_code_object): + """PTX inputs go to the linker, which cannot honor numba_debug (#2640). + + It used to be forwarded into ``LinkerOptions`` and dropped without a word, + so the compile appeared to succeed with the option applied. It is still + ignored -- no linker can do anything with it -- but no longer silently. + + ``UserWarning``, not ``DeprecationWarning``: ``ProgramOptions.numba_debug`` + is not deprecated, it is supported on NVVM/NVRTC and merely inapplicable to + this backend. + """ + with pytest.warns(UserWarning, match="numba_debug is ignored for code_type='ptx'"): + program = Program(ptx_code_object.code.decode(), "ptx", ProgramOptions(numba_debug=True)) + assert program.compile("cubin") is not None + + +@pytest.mark.agent_authored(model="claude-opus-5") +@pytest.mark.parametrize("value", [None, False]) +def test_ptx_program_numba_debug_unset_or_false_does_not_warn(init_cuda, ptx_code_object, value): + """The gate is truthiness: only an enabled ``numba_debug`` asks for + something the PTX path cannot deliver, so ``False`` is not worth a warning.""" + with warnings.catch_warnings(): + warnings.simplefilter("error", UserWarning) + program = Program(ptx_code_object.code.decode(), "ptx", ProgramOptions(numba_debug=value)) + assert program.compile("cubin") is not None + + def test_ptx_program_handle_is_linker_handle(init_cuda, ptx_code_object): """Program.handle for the PTX backend delegates to the linker handle.""" program = Program(ptx_code_object.code.decode(), "ptx") diff --git a/cuda_core/tests/test_program_cache.py b/cuda_core/tests/test_program_cache.py index a8d3fc85f7e..2b5402374a6 100644 --- a/cuda_core/tests/test_program_cache.py +++ b/cuda_core/tests/test_program_cache.py @@ -319,6 +319,20 @@ def test_make_program_cache_key_rejects_extra_sources_outside_nvvm(code_type, co ) +@pytest.mark.agent_authored(model="claude-opus-5") +@pytest.mark.parametrize("value", [True, False]) +def test_make_program_cache_key_ignores_numba_debug_for_ptx(value): + """``numba_debug`` cannot change PTX-path output -- no linker backend reads + it -- so it must not perturb the cache key (#2640). + + If it did, two compiles producing byte-identical cubins would miss each + other in the cache. + """ + baseline = _make_key(code=".version 7.0", code_type="ptx", target_type="cubin", options=_opts()) + with_flag = _make_key(code=".version 7.0", code_type="ptx", target_type="cubin", options=_opts(numba_debug=value)) + assert with_flag == baseline + + @pytest.mark.parametrize( "kwargs, exc_type, match", [ diff --git a/cuda_core/tests/test_rlcompleter_patch.py b/cuda_core/tests/test_rlcompleter_patch.py index 68bd7b6e4f7..50283e62a31 100644 --- a/cuda_core/tests/test_rlcompleter_patch.py +++ b/cuda_core/tests/test_rlcompleter_patch.py @@ -107,3 +107,61 @@ def test_opt_out_env_var_disables_patch_even_when_interactive(): result = _run_probe(pythoninspect=True, opt_out=True) assert result.returncode == 0, f"stderr: {result.stderr}\nstdout: {result.stdout}" assert "crash: RuntimeError" in result.stdout, result.stdout + + +# Imports cuda.core and reports whether the rlcompleter patch was installed. +# No CUDA device is needed: the opt-out is evaluated at import time. The +# stdlib rlcompleter module has no `property` attribute of its own, so its +# presence is exactly the signal that the patch ran. +_OPT_OUT_PROBE_SCRIPT = textwrap.dedent(""" + import rlcompleter + + import cuda.core # noqa: F401 + + print(f"patched: {hasattr(rlcompleter, 'property')}") +""") + + +@pytest.mark.agent_authored(model="claude-opus-5") +@pytest.mark.parametrize( + ("value", "expect_patched"), + [ + # Empty / whitespace-only means "not set": `export VAR=` is the usual + # way to neutralize a variable in a shell profile or container spec. + ("", True), + (" ", True), + # Integer values keep their long-standing meaning. + ("0", True), + ("00", True), + ("1", False), + ("2", False), + # Non-integer values are honored as an opt-out. + ("true", False), + ("yes", False), + ], +) +def test_opt_out_env_var_values(value, expect_patched): + """`CUDA_CORE_DONT_FIX_TAB_COMPLETION` must never break `import cuda.core`. + + The opt-out used to be read with a bare `int(...)` at import time, so any + value that is not a base-10 integer -- including the empty string -- raised + `ValueError: invalid literal for int() with base 10: ''` out of + `cuda/core/__init__.py` and made the package unimportable. + """ + env = os.environ.copy() + env.pop("PYTHONPATH", None) + env["CUDA_CORE_DONT_FIX_TAB_COMPLETION"] = value + # Run from a neutral directory so a source tree next to the test run + # cannot shadow the installed package (see _run_probe). + with tempfile.TemporaryDirectory() as tmpdir: + result = subprocess.run( # noqa: S603 + [sys.executable, "-c", _OPT_OUT_PROBE_SCRIPT], + capture_output=True, + text=True, + env=env, + check=False, + stdin=subprocess.DEVNULL, + cwd=tmpdir, + ) + assert result.returncode == 0, f"stderr: {result.stderr}\nstdout: {result.stdout}" + assert result.stdout.strip() == f"patched: {expect_patched}", result.stdout diff --git a/cuda_core/tests/test_tensor_map.py b/cuda_core/tests/test_tensor_map.py index a9e6432b33e..06433792a61 100644 --- a/cuda_core/tests/test_tensor_map.py +++ b/cuda_core/tests/test_tensor_map.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from conftest import create_managed_memory_resource_or_skip, skip_if_managed_memory_unsupported +from helpers.memory import create_managed_memory_resource_or_skip, skip_if_managed_memory_unsupported from cuda.core import ( Device, diff --git a/cuda_pathfinder/LICENSE b/cuda_pathfinder/LICENSE index a4baaa2d3fa..3b3fdce8194 100644 --- a/cuda_pathfinder/LICENSE +++ b/cuda_pathfinder/LICENSE @@ -176,3 +176,28 @@ Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 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_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py b/cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py index 834db8fe8fa..42dcfda1cfb 100644 --- a/cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py +++ b/cuda_pathfinder/cuda/pathfinder/_binaries/find_nvidia_binary_utility.py @@ -3,8 +3,9 @@ import functools import os +from collections.abc import Iterable -from cuda.pathfinder._binaries import supported_nvidia_binaries +from cuda.pathfinder._binaries import supported_nvidia_binaries, windows_nsight from cuda.pathfinder._utils.ctk_root_canary import CTK_ROOT_CANARY_ANCHOR_LIBNAMES from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages @@ -46,6 +47,27 @@ def _ctk_bin_subdirs(root: str) -> list[str]: return [os.path.join(root, "bin")] +def _resolve_candidate_paths(candidates: Iterable[str]) -> str | None: + """Return the first executable candidate, preserving candidate order.""" + seen: set[str] = set() + for candidate in candidates: + if candidate in seen: + continue + seen.add(candidate) + if _is_executable_candidate(candidate): + return os.path.abspath(candidate) + return None + + +def _find_windows_compute_sanitizer(ctk_root: str) -> str | None: + return _resolve_candidate_paths( + ( + os.path.join(ctk_root, "bin", "compute-sanitizer.bat"), + os.path.join(ctk_root, "compute-sanitizer", "compute-sanitizer.exe"), + ) + ) + + def _resolve_ctk_root_via_canary() -> str | None: from cuda.pathfinder._dynamic_libs.load_nvidia_dynamic_lib import resolve_ctk_root_via_canary @@ -69,6 +91,20 @@ def _resolve_in_trusted_dirs(normalized_name: str, dirs: list[str]) -> str | Non return None +def _resolve_names_in_trusted_dirs(candidate_names: tuple[str, ...], dirs: list[str]) -> str | None: + """Resolve ordered candidate names within each trusted directory.""" + seen: set[str] = set() + for directory in dirs: + if directory in seen: + continue + assert directory + seen.add(directory) + found = _resolve_candidate_paths(os.path.join(directory, name) for name in candidate_names) + if found is not None: + return found + return None + + @functools.cache def find_nvidia_binary_utility(utility_name: str) -> str | None: """Locate a CUDA binary utility executable. @@ -87,6 +123,19 @@ def find_nvidia_binary_utility(utility_name: str) -> str | None: Raises: UnsupportedBinaryError: If ``utility_name`` is not in the supported set (see ``SUPPORTED_BINARY_UTILITIES``). + RuntimeError: If a native Windows architecture needed for an + architecture-specific utility layout cannot be determined, or an + installed Nsight product has incomplete or invalid registry data. + + Windows on ARM (WoA) Note: + Binary utilities execute in separate processes and do not need to match + the Python process architecture. When choosing among architecture-specific + Windows layouts, this API deliberately targets the native machine + architecture rather than the Python interpreter architecture. For + example, standalone ``nsys`` and ``ncu`` discovery under x64 Python on an + Arm64 machine selects the Arm64 target. This differs from + ``load_nvidia_dynamic_lib`` and ``find_static_lib``, which target the + Python interpreter architecture. Search order: 1. **NVIDIA Python wheels** @@ -100,17 +149,27 @@ def find_nvidia_binary_utility(utility_name: str) -> str | None: environment variable, which use platform-specific bin directory layouts (``Library/bin`` on Windows, ``bin`` on Linux). - 3. **CUDA Toolkit environment variables** + 3. **Library-specific standalone installations** - - Use ``CUDA_HOME`` or ``CUDA_PATH`` (in that order), searching - ``bin/x64``, ``bin/x86_64``, and ``bin`` subdirectories on Windows, - or just ``bin`` on Linux. + - Search the installation paths for the CUDA Toolkit, Nsight Systems, + and Nsight Compute. + + 3.1. **Nsight installations**: On Windows, locate Nsight Systems and + Nsight Compute from their installer registry entries. Select + architecture-specific binaries using the native machine + architecture, independent of Python. Lookup of the standalone + ``nsys`` and ``ncu`` CLIs is terminal; a miss does not fall + through to CUDA Toolkit locations. + + 3.2. **CUDA Toolkit installation**: Use ``CUDA_PATH`` or ``CUDA_HOME`` + (in that order), searching ``bin/x64``, ``bin/x86_64``, and + ``bin`` subdirectories on Windows, or just ``bin`` on Linux. 4. **CTK-root canary fallback** - - Only when steps 1-3 miss: resolve the ``cudart`` library through the - OS dynamic loader, derive the CUDA Toolkit root from it, and search - that root's bin layout. + - For utilities that reach this step after the earlier searches miss, + resolve the ``cudart`` library through the OS dynamic loader, derive + the CUDA Toolkit root from it, and search that root's bin layout. Note: Results are cached using ``@functools.cache`` for performance. The cache @@ -146,17 +205,35 @@ def find_nvidia_binary_utility(utility_name: str) -> str | None: else: dirs.append(os.path.join(conda_prefix, "bin")) - # 3. Search in CUDA Toolkit (CUDA_HOME/CUDA_PATH) - if (cuda_home := get_cuda_path_or_home()) is not None: - dirs.extend(_ctk_bin_subdirs(cuda_home)) - normalized_name = _normalize_utility_name(utility_name) - found = _resolve_in_trusted_dirs(normalized_name, dirs) + if IS_WINDOWS and utility_name in ("compute-sanitizer", "ncu"): + candidate_names = (f"{utility_name}.bat", normalized_name) + found = _resolve_names_in_trusted_dirs(candidate_names, dirs) + else: + found = _resolve_in_trusted_dirs(normalized_name, dirs) if found is not None: return found + # 3. Search library-specific standalone installations. + # 3.1. Standalone Nsight CLI lookup is terminal; CTK does not contain nsys/ncu. + if IS_WINDOWS and utility_name == "nsys": + return _resolve_candidate_paths(windows_nsight.nsys_candidate_paths()) + if IS_WINDOWS and utility_name == "ncu": + return _resolve_candidate_paths(windows_nsight.ncu_candidate_paths()) + + # 3.2. Search in CUDA Toolkit (CUDA_PATH/CUDA_HOME). + if (cuda_path := get_cuda_path_or_home()) is not None: + if IS_WINDOWS and utility_name == "compute-sanitizer": + found = _find_windows_compute_sanitizer(cuda_path) + else: + found = _resolve_in_trusted_dirs(normalized_name, _ctk_bin_subdirs(cuda_path)) + if found is not None: + return found + # 4. CTK-root canary fallback. ctk_root = _resolve_ctk_root_via_canary() if ctk_root is not None: + if IS_WINDOWS and utility_name == "compute-sanitizer": + return _find_windows_compute_sanitizer(ctk_root) return _resolve_in_trusted_dirs(normalized_name, _ctk_bin_subdirs(ctk_root)) return None diff --git a/cuda_pathfinder/cuda/pathfinder/_binaries/windows_nsight.py b/cuda_pathfinder/cuda/pathfinder/_binaries/windows_nsight.py new file mode 100644 index 00000000000..c5944c39e64 --- /dev/null +++ b/cuda_pathfinder/cuda/pathfinder/_binaries/windows_nsight.py @@ -0,0 +1,74 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import importlib +import os +from collections.abc import Iterator +from typing import Any + +from cuda.pathfinder._utils.windows_arch import windows_machine_arch + +_REGISTRY_ROOT = r"SOFTWARE\NVIDIA Corporation\Installed Products\Nsight" + +_NSYS_TARGET_DIR_BY_ARCH = { + "x64": "target-windows-x64", + "arm64": "target-windows-armv8", +} + +_NCU_TARGET_DIR_BY_ARCH = { + "x64": os.path.join("target", "windows-desktop-win7-x64"), + "arm64": os.path.join("target", "windows-desktop-win10-t23x-a64"), +} + + +def _installed_product_root(product: str) -> str | None: + """Return the active Nsight product installation recorded by its MSI.""" + # ``winreg`` attributes are absent from the type stubs on non-Windows hosts. + winreg: Any = importlib.import_module("winreg") + + access = winreg.KEY_READ | winreg.KEY_WOW64_64KEY + product_key_path = rf"{_REGISTRY_ROOT}\{product}" + try: + product_context = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, product_key_path, 0, access) + except FileNotFoundError: + return None + + try: + with product_context as product_key: + current_version, _ = winreg.QueryValueEx(product_key, "CurrentVersion") + if not isinstance(current_version, str) or not current_version.strip(): + raise RuntimeError( + f"Invalid CurrentVersion value {current_version!r} in " + f"Nsight {product!r} registry registration at {product_key_path!r}" + ) + with winreg.OpenKey(product_key, current_version, 0, access) as version_key: + install_root, _ = winreg.QueryValueEx(version_key, None) + except FileNotFoundError as exc: + raise RuntimeError(f"Incomplete Nsight {product!r} registry registration at {product_key_path!r}") from exc + + if not isinstance(install_root, str) or not install_root.strip(): + raise RuntimeError( + f"Invalid installation directory {install_root!r} in Nsight {product!r} " + f"registry registration at {product_key_path!r} version {current_version!r}" + ) + return install_root + + +def nsys_candidate_paths() -> Iterator[str]: + install_root = _installed_product_root("Systems") + if install_root is None: + return + + target_dir = _NSYS_TARGET_DIR_BY_ARCH[windows_machine_arch()] + yield os.path.join(install_root, target_dir, "nsys.exe") + + +def ncu_candidate_paths() -> Iterator[str]: + install_root = _installed_product_root("Compute") + if install_root is None: + return + + yield os.path.join(install_root, "ncu.bat") + + target_dir = _NCU_TARGET_DIR_BY_ARCH[windows_machine_arch()] + yield os.path.join(install_root, target_dir, "ncu.exe") diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py index 53446107da3..61bf31720d3 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py @@ -231,6 +231,15 @@ def load_nvidia_dynamic_lib(libname: str) -> LoadedDL: DynamicLibNotFoundError: If the library cannot be found or loaded. RuntimeError: If Python is not 64-bit. + Windows on ARM (WoA) Note: + On Windows, this API aims to load a dynamic library whose architecture + matches the Python interpreter architecture. For example, x64 Python + running on an Arm64 machine targets an x64 DLL, while native Arm64 Python + targets an Arm64 DLL. A library loaded into the Python process must be + compatible with that process. This differs from + ``find_nvidia_binary_utility``, which targets the native machine + architecture when selecting architecture-specific executables. + Search order: 0. **Already loaded in the current process** diff --git a/cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py b/cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py index ac038aadfe7..803abecaaae 100644 --- a/cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_static_libs/find_bitcode_lib.py @@ -4,6 +4,7 @@ import functools import os from dataclasses import dataclass +from pathlib import Path from typing import NoReturn, TypedDict from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home @@ -35,7 +36,7 @@ class _BitcodeLibInfo(TypedDict): _SUPPORTED_BITCODE_LIBS_INFO: dict[str, _BitcodeLibInfo] = { "device": { "filename": "libdevice.10.bc", - "rel_path": os.path.join("nvvm", "libdevice"), + "rel_path": "nvvm/libdevice", "site_packages_dirs": ( "nvidia/cu13/nvvm/libdevice", "nvidia/cuda_nvcc/nvvm/libdevice", @@ -64,14 +65,14 @@ class _BitcodeLibInfo(TypedDict): ) -def _no_such_file_in_dir(dir_path: str, filename: str, error_messages: list[str], attachments: list[str]) -> None: - error_messages.append(f"No such file: {os.path.join(dir_path, filename)}") - if os.path.isdir(dir_path): - attachments.append(f' listdir("{dir_path}"):') - for node in sorted(os.listdir(dir_path)): +def _no_such_file_in_dir(directory: Path, filename: str, error_messages: list[str], attachments: list[str]) -> None: + error_messages.append(f"No such file: {directory / filename}") + if directory.is_dir(): + attachments.append(f' listdir("{directory}"):') + for node in sorted(node_path.name for node_path in directory.iterdir()): attachments.append(f" {node}") else: - attachments.append(f' Directory does not exist: "{dir_path}"') + attachments.append(f' Directory does not exist: "{directory}"') class _FindBitcodeLib: @@ -86,38 +87,39 @@ def __init__(self, name: str) -> None: self.error_messages: list[str] = [] self.attachments: list[str] = [] - def try_site_packages(self) -> str | None: + def try_site_packages(self) -> Path | None: for rel_dir in self.site_packages_dirs: sub_dir = tuple(rel_dir.split("/")) for abs_dir in find_sub_dirs_all_sitepackages(sub_dir): - file_path = os.path.join(abs_dir, self.filename) - if os.path.isfile(file_path): + file_path = Path(abs_dir, self.filename) + if file_path.is_file(): return file_path return None - def try_with_conda_prefix(self) -> str | None: + def try_with_conda_prefix(self) -> Path | None: conda_prefix = os.environ.get("CONDA_PREFIX") if not conda_prefix: return None - anchor = os.path.join(conda_prefix, "Library") if IS_WINDOWS else conda_prefix - file_path = os.path.join(anchor, self.rel_path, self.filename) - if os.path.isfile(file_path): + anchor = Path(conda_prefix, "Library") if IS_WINDOWS else Path(conda_prefix) + file_path = anchor / self.rel_path / self.filename + if file_path.is_file(): return file_path return None - def try_with_cuda_home(self) -> str | None: + def try_with_cuda_home(self) -> Path | None: cuda_home = get_cuda_path_or_home() if cuda_home is None: self.error_messages.append("CUDA_HOME/CUDA_PATH not set") return None - file_path = os.path.join(cuda_home, self.rel_path, self.filename) - if os.path.isfile(file_path): + anchor = Path(cuda_home) + file_path = anchor / self.rel_path / self.filename + if file_path.is_file(): return file_path _no_such_file_in_dir( - os.path.join(cuda_home, self.rel_path), + anchor / self.rel_path, self.filename, self.error_messages, self.attachments, @@ -143,7 +145,7 @@ def locate_bitcode_lib(name: str) -> LocatedBitcodeLib: if abs_path is not None: return LocatedBitcodeLib( name=name, - abs_path=abs_path, + abs_path=str(abs_path), filename=finder.filename, found_via="site-packages", ) @@ -152,7 +154,7 @@ def locate_bitcode_lib(name: str) -> LocatedBitcodeLib: if abs_path is not None: return LocatedBitcodeLib( name=name, - abs_path=abs_path, + abs_path=str(abs_path), filename=finder.filename, found_via="conda", ) @@ -161,7 +163,7 @@ def locate_bitcode_lib(name: str) -> LocatedBitcodeLib: if abs_path is not None: return LocatedBitcodeLib( name=name, - abs_path=abs_path, + abs_path=str(abs_path), filename=finder.filename, found_via="CUDA_PATH", ) diff --git a/cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py b/cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py index ea5a740aec4..a5b1e84fc42 100644 --- a/cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_static_libs/find_static_lib.py @@ -4,6 +4,7 @@ import functools import os from dataclasses import dataclass +from pathlib import Path from typing import NoReturn, TypedDict from cuda.pathfinder._utils.env_vars import get_cuda_path_or_home @@ -47,8 +48,8 @@ def _cudadevrt_info() -> _StaticLibInfo: conda_fallback_dirs = ("lib",) if arch_dir == "x64" else () return { "filename": "cudadevrt.lib", - "ctk_rel_paths": (os.path.join("lib", arch_dir),), - "conda_rel_paths": (os.path.join("lib", arch_dir), *conda_fallback_dirs), + "ctk_rel_paths": (str(Path("lib", arch_dir)),), + "conda_rel_paths": (str(Path("lib", arch_dir)), *conda_fallback_dirs), "site_packages_dirs": (f"nvidia/cu13/lib/{arch_dir}", *component_wheel_dirs), } @@ -60,14 +61,14 @@ def _cudadevrt_info() -> _StaticLibInfo: SUPPORTED_STATIC_LIBS: tuple[str, ...] = tuple(sorted(_SUPPORTED_STATIC_LIBS_INFO.keys())) -def _no_such_file_in_dir(dir_path: str, filename: str, error_messages: list[str], attachments: list[str]) -> None: - error_messages.append(f"No such file: {os.path.join(dir_path, filename)}") - if os.path.isdir(dir_path): - attachments.append(f' listdir("{dir_path}"):') - for node in sorted(os.listdir(dir_path)): +def _no_such_file_in_dir(directory: Path, filename: str, error_messages: list[str], attachments: list[str]) -> None: + error_messages.append(f"No such file: {directory / filename}") + if directory.is_dir(): + attachments.append(f' listdir("{directory}"):') + for node in sorted(node_path.name for node_path in directory.iterdir()): attachments.append(f" {node}") else: - attachments.append(f' Directory does not exist: "{dir_path}"') + attachments.append(f' Directory does not exist: "{directory}"') class _FindStaticLib: @@ -83,40 +84,41 @@ def __init__(self, name: str) -> None: self.error_messages: list[str] = [] self.attachments: list[str] = [] - def try_site_packages(self) -> str | None: + def try_site_packages(self) -> Path | None: for rel_dir in self.site_packages_dirs: sub_dir = tuple(rel_dir.split("/")) for abs_dir in find_sub_dirs_all_sitepackages(sub_dir): - file_path = os.path.join(abs_dir, self.filename) - if os.path.isfile(file_path): + file_path = Path(abs_dir, self.filename) + if file_path.is_file(): return file_path return None - def try_with_conda_prefix(self) -> str | None: + def try_with_conda_prefix(self) -> Path | None: conda_prefix = os.environ.get("CONDA_PREFIX") if not conda_prefix: return None - anchor = os.path.join(conda_prefix, "Library") if IS_WINDOWS else conda_prefix + anchor = Path(conda_prefix, "Library") if IS_WINDOWS else Path(conda_prefix) for rel_path in self.conda_rel_paths: - file_path = os.path.join(anchor, rel_path, self.filename) - if os.path.isfile(file_path): + file_path = anchor / rel_path / self.filename + if file_path.is_file(): return file_path return None - def try_with_cuda_home(self) -> str | None: + def try_with_cuda_home(self) -> Path | None: cuda_home = get_cuda_path_or_home() if cuda_home is None: self.error_messages.append("CUDA_HOME/CUDA_PATH not set") return None + anchor = Path(cuda_home) for rel_path in self.ctk_rel_paths: - file_path = os.path.join(cuda_home, rel_path, self.filename) - if os.path.isfile(file_path): + file_path = anchor / rel_path / self.filename + if file_path.is_file(): return file_path _no_such_file_in_dir( - os.path.join(cuda_home, self.ctk_rel_paths[0]), + anchor / self.ctk_rel_paths[0], self.filename, self.error_messages, self.attachments, @@ -142,7 +144,7 @@ def locate_static_lib(name: str) -> LocatedStaticLib: if abs_path is not None: return LocatedStaticLib( name=name, - abs_path=abs_path, + abs_path=str(abs_path), filename=finder.filename, found_via="site-packages", ) @@ -151,7 +153,7 @@ def locate_static_lib(name: str) -> LocatedStaticLib: if abs_path is not None: return LocatedStaticLib( name=name, - abs_path=abs_path, + abs_path=str(abs_path), filename=finder.filename, found_via="conda", ) @@ -160,7 +162,7 @@ def locate_static_lib(name: str) -> LocatedStaticLib: if abs_path is not None: return LocatedStaticLib( name=name, - abs_path=abs_path, + abs_path=str(abs_path), filename=finder.filename, found_via="CUDA_PATH", ) @@ -175,5 +177,13 @@ def find_static_lib(name: str) -> str: Raises: ValueError: If ``name`` is not a supported static library. StaticLibNotFoundError: If the static library cannot be found. + + Windows on ARM (WoA) Note: + On Windows, this API aims to return the path to a static library whose + architecture matches the Python interpreter architecture. For example, + x64 Python running on an Arm64 machine targets the x64 library, while + native Arm64 Python targets the Arm64 library. This differs from + ``find_nvidia_binary_utility``, which targets the native machine + architecture when selecting architecture-specific executables. """ return locate_static_lib(name).abs_path diff --git a/cuda_pathfinder/cuda/pathfinder/_utils/windows_arch.py b/cuda_pathfinder/cuda/pathfinder/_utils/windows_arch.py index 9313f3a9f17..fc802db370f 100644 --- a/cuda_pathfinder/cuda/pathfinder/_utils/windows_arch.py +++ b/cuda_pathfinder/cuda/pathfinder/_utils/windows_arch.py @@ -3,6 +3,7 @@ from __future__ import annotations +import platform import sysconfig WINDOWS_PE_MACHINE_BY_ARCH = { @@ -10,6 +11,8 @@ "arm64": 0xAA64, } +_WINDOWS_ARCH_BY_PE_MACHINE = {machine: arch for arch, machine in WINDOWS_PE_MACHINE_BY_ARCH.items()} + class UnsupportedArchError(RuntimeError): """Raised when Python reports an unsupported Windows architecture.""" @@ -35,6 +38,76 @@ def windows_python_arch() -> str: raise UnsupportedArchError(raw_platform_tag) +def _windows_machine_arch_from_platform() -> str: + """Return the Windows architecture reported by Python's platform module.""" + raw_machine = platform.machine() + machine = raw_machine.lower().replace("_", "-") + + if machine in ("amd64", "x86-64"): + return "x64" + + if machine in ("arm64", "aarch64"): + return "arm64" + + raise RuntimeError(f"Unsupported Windows machine architecture: {raw_machine!r}") + + +def _windows_native_machine() -> int | None: + """Return the native Windows PE machine type, or None on older Windows.""" + import ctypes + from ctypes import wintypes + + try: + # These ctypes attributes are absent from the type stubs on non-Windows hosts. + kernel32 = ctypes.WinDLL("kernel32", use_last_error=True) # type: ignore[attr-defined, unused-ignore] + except OSError as exc: + raise RuntimeError("Failed to load kernel32 while detecting the native Windows architecture") from exc + + get_current_process = kernel32.GetCurrentProcess + try: + is_wow64_process2 = kernel32.IsWow64Process2 + except AttributeError: + return None + + get_current_process.argtypes = () + get_current_process.restype = wintypes.HANDLE + is_wow64_process2.argtypes = ( + wintypes.HANDLE, + ctypes.POINTER(wintypes.USHORT), + ctypes.POINTER(wintypes.USHORT), + ) + is_wow64_process2.restype = wintypes.BOOL + + process_machine = wintypes.USHORT() + native_machine = wintypes.USHORT() + if not is_wow64_process2( + get_current_process(), + ctypes.byref(process_machine), + ctypes.byref(native_machine), + ): + error_code = ctypes.get_last_error() # type: ignore[attr-defined, unused-ignore] + error = ctypes.WinError(error_code) # type: ignore[attr-defined, unused-ignore] + raise RuntimeError( + f"IsWow64Process2 failed while detecting the native Windows architecture " + f"(Windows error {error_code}): {error}" + ) from error + return native_machine.value + + +def windows_machine_arch() -> str: + """Return the native Windows machine architecture, ignoring process emulation.""" + native_machine = _windows_native_machine() + if native_machine is None: + # IsWow64Process2 predates x64-on-Arm emulation, so this fallback is only + # needed on older Windows versions where platform.machine() is sufficient. + return _windows_machine_arch_from_platform() + + try: + return _WINDOWS_ARCH_BY_PE_MACHINE[native_machine] + except KeyError: + raise RuntimeError(f"Unsupported native Windows PE machine type: 0x{native_machine:04x}") from None + + def windows_pe_matches_arch(path: str, target_arch: str) -> bool: """Return whether a Windows Portable Executable (PE) targets the requested architecture. diff --git a/cuda_pathfinder/docs/source/install.rst b/cuda_pathfinder/docs/source/install.rst index 53f11ebbf18..078abf47ee3 100644 --- a/cuda_pathfinder/docs/source/install.rst +++ b/cuda_pathfinder/docs/source/install.rst @@ -9,7 +9,7 @@ Runtime Requirements ``cuda.pathfinder`` is a pure-Python package with no runtime dependencies: -* Linux (x86-64, arm64) and Windows (x86-64) +* Linux (x86-64, arm64) and Windows (x86-64, arm64) * Python 3.10 - 3.14 Installing from PyPI diff --git a/cuda_pathfinder/docs/source/release/1.6.1-notes.rst b/cuda_pathfinder/docs/source/release/1.6.1-notes.rst index 919963802ff..59638c40afe 100644 --- a/cuda_pathfinder/docs/source/release/1.6.1-notes.rst +++ b/cuda_pathfinder/docs/source/release/1.6.1-notes.rst @@ -15,19 +15,47 @@ Highlights CTK libraries available for that architecture through ``SUPPORTED_NVIDIA_LIBNAMES``. A known library unavailable for the current architecture raises ``DynamicLibNotAvailableError``. + (`PR #2393 <https://github.com/NVIDIA/cuda-python/pull/2393>`_) * Add Windows Arm64 discovery for CUDA 13.4 layouts while retaining legacy CUDA 12 wheel directories as x64-only fallbacks. This includes corrected architecture-specific locations for cuDLA, NVVM, CUPTI, and cuSPARSELt. NVVM binaries found in an unqualified legacy directory are checked for a matching PE machine architecture before loading. + (`PR #2393 <https://github.com/NVIDIA/cuda-python/pull/2393>`_) * Add ``UnsupportedArchError`` for unsupported Windows Python platform tags. + (`PR #2393 <https://github.com/NVIDIA/cuda-python/pull/2393>`_) * Make Windows static-library discovery architecture-aware. Searches now use the current Python interpreter architecture to select the matching ``lib/x64`` or ``lib/arm64`` CUDA Toolkit and wheel directories. CUDA 12 component-wheel and legacy Conda fallbacks remain x64-only. + (`PR #2491 <https://github.com/NVIDIA/cuda-python/pull/2491>`_) + +* Fix Windows binary-utility discovery for CUDA 13.4 Arm64 layouts. Prefer the + Compute Sanitizer launcher, locate standalone Nsight Systems and Nsight + Compute through their installer registry entries, and select + architecture-specific executable targets using the native Windows machine + architecture. + (`PR #2586 <https://github.com/NVIDIA/cuda-python/pull/2586>`_) + +Bugfixes +-------- + +* Ensure :func:`find_nvidia_binary_utility` returns an absolute path when a + configured search root is relative. On Windows, dynamic-library loading now + warns when registering a dependent-DLL directory fails before falling back + to updating ``PATH``. + (`PR #2399 <https://github.com/NVIDIA/cuda-python/pull/2399>`_) + +Documentation +------------- + +* Document that source builds require Git history and + ``cuda-pathfinder-v*`` tags so ``setuptools-scm`` can derive the package + version. + (`PR #2424 <https://github.com/NVIDIA/cuda-python/pull/2424>`_) Internal maintenance -------------------- @@ -37,7 +65,17 @@ Internal maintenance internal ``SUPPORTED_LIBNAMES_WINDOWS*`` and ``SITE_PACKAGES_LIBDIRS_WINDOWS*`` tables. Unsuffixed names remain x64 aliases for backward compatibility. + (`PR #2393 <https://github.com/NVIDIA/cuda-python/pull/2393>`_) * Remove the obsolete descriptor-catalog writer and its catalog-update tools. The site-packages collection scripts remain available for gathering library paths. + (`PR #2393 <https://github.com/NVIDIA/cuda-python/pull/2393>`_) + +* Use ``pathlib.Path`` internally for static- and bitcode-library discovery + while preserving the public string return types. + (`PR #2493 <https://github.com/NVIDIA/cuda-python/pull/2493>`_) + +* Isolate Windows Nsight registry discovery in a dedicated internal module and + add focused tests; runtime behavior is unchanged. + (`PR #2614 <https://github.com/NVIDIA/cuda-python/pull/2614>`_) diff --git a/cuda_pathfinder/tests/test_find_nvidia_binaries.py b/cuda_pathfinder/tests/test_find_nvidia_binaries.py index 2784633ff38..9d08f5f4d5c 100644 --- a/cuda_pathfinder/tests/test_find_nvidia_binaries.py +++ b/cuda_pathfinder/tests/test_find_nvidia_binaries.py @@ -128,6 +128,256 @@ def test_find_binary_windows_extension_and_search_dirs(monkeypatch, mocker): assert checked == [os.path.join(d, "nvcc.exe") for d in expected_dirs] +@pytest.mark.parametrize( + ("launcher_exists", "expected_rel", "checked_rels"), + ( + (True, os.path.join("bin", "compute-sanitizer.bat"), (os.path.join("bin", "compute-sanitizer.bat"),)), + ( + False, + os.path.join("compute-sanitizer", "compute-sanitizer.exe"), + ( + os.path.join("bin", "compute-sanitizer.bat"), + os.path.join("compute-sanitizer", "compute-sanitizer.exe"), + ), + ), + ), +) +@pytest.mark.usefixtures("clear_find_binary_cache") +@pytest.mark.agent_authored(model="gpt-5.6") +def test_find_compute_sanitizer_prefers_ctk_launcher_with_executable_fallback( + monkeypatch, mocker, launcher_exists, expected_rel, checked_rels +): + cuda_home = os.path.join(os.sep, "cuda") + launcher = os.path.join(cuda_home, "bin", "compute-sanitizer.bat") + executable = os.path.join(cuda_home, "compute-sanitizer", "compute-sanitizer.exe") + + mocker.patch.object(binary_finder_module, "IS_WINDOWS", new=True) + mocker.patch.object(binary_finder_module.supported_nvidia_binaries, "SITE_PACKAGES_BINDIRS", {}) + monkeypatch.delenv("CONDA_PREFIX", raising=False) + mocker.patch.object(binary_finder_module, "get_cuda_path_or_home", return_value=cuda_home) + canary_mock = mocker.patch.object(binary_finder_module, "_resolve_ctk_root_via_canary") + existing = [executable] + if launcher_exists: + existing.append(launcher) + checked = _patch_exec_probe(mocker, existing=existing) + + assert find_nvidia_binary_utility("compute-sanitizer") == os.path.abspath(os.path.join(cuda_home, expected_rel)) + assert checked == [os.path.join(cuda_home, rel) for rel in checked_rels] + canary_mock.assert_not_called() + + +@pytest.mark.usefixtures("clear_find_binary_cache") +@pytest.mark.agent_authored(model="gpt-5.6") +def test_find_compute_sanitizer_uses_canary_ctk_root(monkeypatch, mocker): + ctk_root = os.path.join(os.sep, "cuda") + launcher = os.path.join(ctk_root, "bin", "compute-sanitizer.bat") + + mocker.patch.object(binary_finder_module, "IS_WINDOWS", new=True) + mocker.patch.object(binary_finder_module.supported_nvidia_binaries, "SITE_PACKAGES_BINDIRS", {}) + monkeypatch.delenv("CONDA_PREFIX", raising=False) + mocker.patch.object(binary_finder_module, "get_cuda_path_or_home", return_value=None) + canary = mocker.patch.object(binary_finder_module, "_resolve_ctk_root_via_canary", return_value=ctk_root) + checked = _patch_exec_probe(mocker, existing=[launcher]) + + assert find_nvidia_binary_utility("compute-sanitizer") == os.path.abspath(launcher) + assert checked == [launcher] + canary.assert_called_once_with() + + +@pytest.mark.parametrize( + ("utility_name", "candidate_names"), + ( + ("nsys", ("nsys.exe",)), + ("ncu", ("ncu.bat", "ncu.exe")), + ), +) +@pytest.mark.usefixtures("clear_find_binary_cache") +@pytest.mark.agent_authored(model="gpt-5.6") +def test_find_binary_windows_nsight_conda_precedes_registry(monkeypatch, mocker, utility_name, candidate_names): + site_dir = os.path.join(os.sep, "site-packages", utility_name, "bin") + conda_prefix = os.path.join(os.sep, "conda") + conda_bin = os.path.join(conda_prefix, "Library", "bin") + expected = os.path.join(conda_bin, candidate_names[0]) + + mocker.patch.object(binary_finder_module, "IS_WINDOWS", new=True) + mocker.patch.object(binary_finder_module, "find_sub_dirs_all_sitepackages", return_value=[site_dir]) + monkeypatch.setenv("CONDA_PREFIX", conda_prefix) + candidate_paths = mocker.patch.object(binary_finder_module.windows_nsight, f"{utility_name}_candidate_paths") + get_cuda_path = mocker.patch.object(binary_finder_module, "get_cuda_path_or_home") + canary = mocker.patch.object(binary_finder_module, "_resolve_ctk_root_via_canary") + checked = _patch_exec_probe(mocker, existing=[expected]) + + assert find_nvidia_binary_utility(utility_name) == os.path.abspath(expected) + assert checked == [ + *(os.path.join(site_dir, name) for name in candidate_names), + os.path.join(conda_bin, candidate_names[0]), + ] + candidate_paths.assert_not_called() + get_cuda_path.assert_not_called() + canary.assert_not_called() + + +@pytest.mark.parametrize( + ("utility_name", "product", "machine_arch", "target_rel", "candidate_names"), + ( + ("nsys", "Systems", "x64", os.path.join("target-windows-x64", "nsys.exe"), ("nsys.exe",)), + ("nsys", "Systems", "arm64", os.path.join("target-windows-armv8", "nsys.exe"), ("nsys.exe",)), + ( + "ncu", + "Compute", + "x64", + os.path.join("target", "windows-desktop-win7-x64", "ncu.exe"), + ("ncu.bat", "ncu.exe"), + ), + ( + "ncu", + "Compute", + "arm64", + os.path.join("target", "windows-desktop-win10-t23x-a64", "ncu.exe"), + ("ncu.bat", "ncu.exe"), + ), + ), +) +@pytest.mark.usefixtures("clear_find_binary_cache") +@pytest.mark.agent_authored(model="gpt-5.6") +def test_find_binary_windows_nsight_composes_registry_and_native_target( + monkeypatch, mocker, utility_name, product, machine_arch, target_rel, candidate_names +): + site_dir = os.path.join(os.sep, "site-packages", utility_name, "bin") + conda_prefix = os.path.join(os.sep, "conda") + conda_bin = os.path.join(conda_prefix, "Library", "bin") + install_root = os.path.join(os.sep, "Program Files", utility_name) + expected = os.path.join(install_root, target_rel) + + mocker.patch.object(binary_finder_module, "IS_WINDOWS", new=True) + mocker.patch.object(binary_finder_module, "find_sub_dirs_all_sitepackages", return_value=[site_dir]) + monkeypatch.setenv("CONDA_PREFIX", conda_prefix) + registry_root = mocker.patch.object( + binary_finder_module.windows_nsight, "_installed_product_root", return_value=install_root + ) + machine_arch_mock = mocker.patch.object( + binary_finder_module.windows_nsight, "windows_machine_arch", return_value=machine_arch + ) + get_cuda_path = mocker.patch.object(binary_finder_module, "get_cuda_path_or_home") + canary = mocker.patch.object(binary_finder_module, "_resolve_ctk_root_via_canary") + checked = _patch_exec_probe(mocker, existing=[expected]) + + assert find_nvidia_binary_utility(utility_name) == os.path.abspath(expected) + assert checked == [ + *(os.path.join(directory, name) for directory in (site_dir, conda_bin) for name in candidate_names), + *((os.path.join(install_root, "ncu.bat"),) if utility_name == "ncu" else ()), + expected, + ] + registry_root.assert_called_once_with(product) + machine_arch_mock.assert_called_once_with() + get_cuda_path.assert_not_called() + canary.assert_not_called() + + +@pytest.mark.usefixtures("clear_find_binary_cache") +@pytest.mark.agent_authored(model="gpt-5.6") +def test_find_binary_windows_ncu_launcher_hit_does_not_resolve_machine_arch(monkeypatch, mocker): + install_root = os.path.join(os.sep, "Program Files", "Nsight Compute") + launcher = os.path.join(install_root, "ncu.bat") + + mocker.patch.object(binary_finder_module, "IS_WINDOWS", new=True) + mocker.patch.object(binary_finder_module.supported_nvidia_binaries, "SITE_PACKAGES_BINDIRS", {}) + monkeypatch.delenv("CONDA_PREFIX", raising=False) + registry_root = mocker.patch.object( + binary_finder_module.windows_nsight, "_installed_product_root", return_value=install_root + ) + machine_arch = mocker.patch.object(binary_finder_module.windows_nsight, "windows_machine_arch") + get_cuda_path = mocker.patch.object(binary_finder_module, "get_cuda_path_or_home") + canary = mocker.patch.object(binary_finder_module, "_resolve_ctk_root_via_canary") + checked = _patch_exec_probe(mocker, existing=[launcher]) + + assert find_nvidia_binary_utility("ncu") == os.path.abspath(launcher) + assert checked == [launcher] + registry_root.assert_called_once_with("Compute") + machine_arch.assert_not_called() + get_cuda_path.assert_not_called() + canary.assert_not_called() + + +@pytest.mark.parametrize(("utility_name", "product"), (("nsys", "Systems"), ("ncu", "Compute"))) +@pytest.mark.usefixtures("clear_find_binary_cache") +@pytest.mark.agent_authored(model="gpt-5.6") +def test_find_binary_windows_nsight_registry_miss_is_terminal(monkeypatch, mocker, utility_name, product): + mocker.patch.object(binary_finder_module, "IS_WINDOWS", new=True) + mocker.patch.object(binary_finder_module.supported_nvidia_binaries, "SITE_PACKAGES_BINDIRS", {}) + monkeypatch.delenv("CONDA_PREFIX", raising=False) + registry_root = mocker.patch.object( + binary_finder_module.windows_nsight, "_installed_product_root", return_value=None + ) + machine_arch = mocker.patch.object(binary_finder_module.windows_nsight, "windows_machine_arch") + get_cuda_path = mocker.patch.object(binary_finder_module, "get_cuda_path_or_home") + canary = mocker.patch.object(binary_finder_module, "_resolve_ctk_root_via_canary") + + assert find_nvidia_binary_utility(utility_name) is None + registry_root.assert_called_once_with(product) + machine_arch.assert_not_called() + get_cuda_path.assert_not_called() + canary.assert_not_called() + + +@pytest.mark.parametrize("utility_name", ("nsight-sys", "nsight-compute")) +@pytest.mark.usefixtures("clear_find_binary_cache") +@pytest.mark.agent_authored(model="gpt-5.6") +def test_find_windows_nsight_legacy_names_remain_literal_in_early_search(monkeypatch, mocker, utility_name): + site_key = os.path.join("nvidia", utility_name, "bin") + site_dir = os.path.join(os.sep, "site-packages", utility_name, "bin") + conda_prefix = os.path.join(os.sep, "conda") + conda_bin = os.path.join(conda_prefix, "Library", "bin") + expected = os.path.join(conda_bin, f"{utility_name}.exe") + + mocker.patch.object(binary_finder_module, "IS_WINDOWS", new=True) + mocker.patch.object( + binary_finder_module.supported_nvidia_binaries, + "SITE_PACKAGES_BINDIRS", + {utility_name: (site_key,)}, + ) + find_sub_dirs = mocker.patch.object(binary_finder_module, "find_sub_dirs_all_sitepackages", return_value=[site_dir]) + monkeypatch.setenv("CONDA_PREFIX", conda_prefix) + get_cuda_path = mocker.patch.object(binary_finder_module, "get_cuda_path_or_home") + nsys_candidates = mocker.patch.object(binary_finder_module.windows_nsight, "nsys_candidate_paths") + ncu_candidates = mocker.patch.object(binary_finder_module.windows_nsight, "ncu_candidate_paths") + checked = _patch_exec_probe(mocker, existing=[expected]) + + assert find_nvidia_binary_utility(utility_name) == os.path.abspath(expected) + assert checked == [os.path.join(site_dir, f"{utility_name}.exe"), expected] + find_sub_dirs.assert_called_once_with(site_key.split(os.sep)) + get_cuda_path.assert_not_called() + nsys_candidates.assert_not_called() + ncu_candidates.assert_not_called() + + +@pytest.mark.parametrize("utility_name", ("nsight-sys", "nsight-compute")) +@pytest.mark.usefixtures("clear_find_binary_cache") +@pytest.mark.agent_authored(model="gpt-5.6") +def test_find_windows_nsight_legacy_names_remain_literal_in_ctk(monkeypatch, mocker, utility_name): + cuda_home = os.path.join(os.sep, "cuda") + expected = os.path.join(cuda_home, "bin", f"{utility_name}.exe") + + mocker.patch.object(binary_finder_module, "IS_WINDOWS", new=True) + mocker.patch.object(binary_finder_module.supported_nvidia_binaries, "SITE_PACKAGES_BINDIRS", {}) + monkeypatch.delenv("CONDA_PREFIX", raising=False) + mocker.patch.object(binary_finder_module, "get_cuda_path_or_home", return_value=cuda_home) + nsys_candidates = mocker.patch.object(binary_finder_module.windows_nsight, "nsys_candidate_paths") + ncu_candidates = mocker.patch.object(binary_finder_module.windows_nsight, "ncu_candidate_paths") + canary = mocker.patch.object(binary_finder_module, "_resolve_ctk_root_via_canary") + checked = _patch_exec_probe(mocker, existing=[expected]) + + assert find_nvidia_binary_utility(utility_name) == os.path.abspath(expected) + assert checked == [ + os.path.join(cuda_home, "bin", "x64", f"{utility_name}.exe"), + os.path.join(cuda_home, "bin", "x86_64", f"{utility_name}.exe"), + expected, + ] + nsys_candidates.assert_not_called() + ncu_candidates.assert_not_called() + canary.assert_not_called() + + @pytest.mark.usefixtures("clear_find_binary_cache") def test_find_binary_first_matching_dir_wins(monkeypatch, mocker): conda_prefix = os.path.join(os.sep, "conda") diff --git a/cuda_pathfinder/tests/test_search_steps.py b/cuda_pathfinder/tests/test_search_steps.py index 54136dc34e1..fc78e22c708 100644 --- a/cuda_pathfinder/tests/test_search_steps.py +++ b/cuda_pathfinder/tests/test_search_steps.py @@ -5,7 +5,9 @@ from __future__ import annotations +import ctypes import os +from ctypes import wintypes import pytest @@ -147,6 +149,85 @@ def test_rejects_unknown_sysconfig_tag(self, mocker): assert exc_info.value.platform_tag == "custom-win" +class TestWindowsMachineArch: + @pytest.mark.parametrize( + ("native_machine", "expected"), + ((0x8664, "x64"), (0xAA64, "arm64")), + ) + @pytest.mark.agent_authored(model="gpt-5.6") + def test_uses_native_pe_machine(self, mocker, native_machine, expected): + mocker.patch.object(windows_arch_mod, "_windows_native_machine", return_value=native_machine) + platform_machine = mocker.patch.object(windows_arch_mod.platform, "machine", return_value="AMD64") + + assert windows_arch_mod.windows_machine_arch() == expected + platform_machine.assert_not_called() + + @pytest.mark.agent_authored(model="gpt-5.6") + def test_rejects_unknown_native_pe_machine(self, mocker): + mocker.patch.object(windows_arch_mod, "_windows_native_machine", return_value=0x014C) + + with pytest.raises(RuntimeError, match=r"Unsupported native Windows PE machine type: 0x014c"): + windows_arch_mod.windows_machine_arch() + + @pytest.mark.parametrize( + ("reported_machine", "expected"), + (("AMD64", "x64"), ("x86_64", "x64"), ("ARM64", "arm64"), ("aarch64", "arm64")), + ) + @pytest.mark.agent_authored(model="gpt-5.6") + def test_old_windows_fallback_normalizes_platform_machine(self, mocker, reported_machine, expected): + mocker.patch.object(windows_arch_mod, "_windows_native_machine", return_value=None) + mocker.patch.object(windows_arch_mod.platform, "machine", return_value=reported_machine) + + assert windows_arch_mod.windows_machine_arch() == expected + + @pytest.mark.agent_authored(model="gpt-5.6") + def test_native_machine_returns_none_when_is_wow64_process2_is_unavailable(self, mocker): + kernel32 = mocker.Mock(spec=["GetCurrentProcess"]) + mocker.patch.object(ctypes, "WinDLL", create=True, return_value=kernel32) + + assert windows_arch_mod._windows_native_machine() is None + + @pytest.mark.agent_authored(model="gpt-5.6") + def test_native_machine_configures_api_and_returns_native_machine(self, mocker): + kernel32 = mocker.Mock() + kernel32.GetCurrentProcess.return_value = wintypes.HANDLE(1) + + def report_native_machine(_process, _process_machine, native_machine): + native_machine._obj.value = 0xAA64 + return True + + kernel32.IsWow64Process2.side_effect = report_native_machine + mocker.patch.object(ctypes, "WinDLL", create=True, return_value=kernel32) + + assert windows_arch_mod._windows_native_machine() == 0xAA64 + assert kernel32.GetCurrentProcess.argtypes == () + assert kernel32.GetCurrentProcess.restype is wintypes.HANDLE + assert kernel32.IsWow64Process2.argtypes == ( + wintypes.HANDLE, + ctypes.POINTER(wintypes.USHORT), + ctypes.POINTER(wintypes.USHORT), + ) + assert kernel32.IsWow64Process2.restype is wintypes.BOOL + + @pytest.mark.agent_authored(model="gpt-5.6") + def test_native_machine_raises_contextual_error_when_api_call_fails(self, mocker): + kernel32 = mocker.Mock() + kernel32.GetCurrentProcess.return_value = wintypes.HANDLE(1) + kernel32.IsWow64Process2.return_value = False + mocker.patch.object(ctypes, "WinDLL", create=True, return_value=kernel32) + mocker.patch.object(ctypes, "get_last_error", create=True, return_value=87) + windows_error = OSError(87, "The parameter is incorrect") + mocker.patch.object(ctypes, "WinError", create=True, return_value=windows_error) + + with pytest.raises( + RuntimeError, + match=r"IsWow64Process2 failed while detecting the native Windows architecture \(Windows error 87\)", + ) as exc_info: + windows_arch_mod._windows_native_machine() + + assert exc_info.value.__cause__ is windows_error + + @pytest.mark.parametrize( ("machine", "target_arch", "expected"), ( diff --git a/cuda_pathfinder/tests/test_windows_nsight.py b/cuda_pathfinder/tests/test_windows_nsight.py new file mode 100644 index 00000000000..78da205988b --- /dev/null +++ b/cuda_pathfinder/tests/test_windows_nsight.py @@ -0,0 +1,196 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import os + +import pytest + +from cuda.pathfinder._binaries import windows_nsight + + +def _patch_winreg(mocker): + winreg = mocker.MagicMock() + winreg.HKEY_LOCAL_MACHINE = object() + winreg.KEY_READ = 0x20019 + winreg.KEY_WOW64_64KEY = 0x0100 + mocker.patch.object(windows_nsight.importlib, "import_module", return_value=winreg) + return winreg + + +@pytest.mark.parametrize( + ("machine_arch", "target_dir"), + ( + ("x64", "target-windows-x64"), + ("arm64", "target-windows-armv8"), + ), +) +@pytest.mark.agent_authored(model="gpt-5.6") +def test_nsys_candidate_paths_use_machine_arch(mocker, machine_arch, target_dir): + install_root = os.path.join(os.sep, "Program Files", "Nsight Systems") + expected = os.path.join(install_root, target_dir, "nsys.exe") + mocker.patch.object(windows_nsight, "_installed_product_root", return_value=install_root) + mocker.patch.object(windows_nsight, "windows_machine_arch", return_value=machine_arch) + + assert tuple(windows_nsight.nsys_candidate_paths()) == (expected,) + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_nsys_candidate_paths_do_not_include_other_arch(mocker): + install_root = os.path.join(os.sep, "Program Files", "Nsight Systems") + arm64 = os.path.join(install_root, "target-windows-armv8", "nsys.exe") + mocker.patch.object(windows_nsight, "_installed_product_root", return_value=install_root) + mocker.patch.object(windows_nsight, "windows_machine_arch", return_value="arm64") + + assert tuple(windows_nsight.nsys_candidate_paths()) == (arm64,) + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_ncu_candidate_paths_yield_launcher_before_resolving_machine_arch(mocker): + install_root = os.path.join(os.sep, "Program Files", "Nsight Compute") + launcher = os.path.join(install_root, "ncu.bat") + mocker.patch.object(windows_nsight, "_installed_product_root", return_value=install_root) + machine_arch = mocker.patch.object(windows_nsight, "windows_machine_arch") + + candidates = windows_nsight.ncu_candidate_paths() + + assert next(candidates) == launcher + machine_arch.assert_not_called() + + +@pytest.mark.parametrize( + ("machine_arch", "target_dir"), + ( + ("x64", os.path.join("target", "windows-desktop-win7-x64")), + ("arm64", os.path.join("target", "windows-desktop-win10-t23x-a64")), + ), +) +@pytest.mark.agent_authored(model="gpt-5.6") +def test_ncu_candidate_paths_fall_back_to_machine_binary(mocker, machine_arch, target_dir): + install_root = os.path.join(os.sep, "Program Files", "Nsight Compute") + launcher = os.path.join(install_root, "ncu.bat") + expected = os.path.join(install_root, target_dir, "ncu.exe") + mocker.patch.object(windows_nsight, "_installed_product_root", return_value=install_root) + mocker.patch.object(windows_nsight, "windows_machine_arch", return_value=machine_arch) + + assert tuple(windows_nsight.ncu_candidate_paths()) == (launcher, expected) + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_installed_product_root_reads_64_bit_registry(mocker): + install_root = os.path.join(os.sep, "Program Files", "Nsight Systems") + product_key = mocker.MagicMock() + version_key = mocker.MagicMock() + product_context = mocker.MagicMock() + product_context.__enter__.return_value = product_key + version_context = mocker.MagicMock() + version_context.__enter__.return_value = version_key + winreg = _patch_winreg(mocker) + winreg.OpenKey.side_effect = (product_context, version_context) + winreg.QueryValueEx.side_effect = (("2026.1.3", 1), (install_root, 1)) + + assert windows_nsight._installed_product_root("Systems") == install_root + access = winreg.KEY_READ | winreg.KEY_WOW64_64KEY + winreg.OpenKey.assert_has_calls( + ( + mocker.call( + winreg.HKEY_LOCAL_MACHINE, + rf"{windows_nsight._REGISTRY_ROOT}\Systems", + 0, + access, + ), + mocker.call(product_key, "2026.1.3", 0, access), + ) + ) + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_installed_product_root_returns_none_when_product_key_is_absent(mocker): + winreg = _patch_winreg(mocker) + winreg.OpenKey.side_effect = FileNotFoundError("Nsight Systems is not installed") + + assert windows_nsight._installed_product_root("Systems") is None + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_installed_product_root_rejects_missing_current_version(mocker): + product_context = mocker.MagicMock() + product_context.__enter__.return_value = mocker.MagicMock() + winreg = _patch_winreg(mocker) + winreg.OpenKey.return_value = product_context + winreg.QueryValueEx.side_effect = FileNotFoundError("CurrentVersion is missing") + + with pytest.raises(RuntimeError, match=r"Incomplete Nsight 'Systems' registry registration") as exc_info: + windows_nsight._installed_product_root("Systems") + + assert isinstance(exc_info.value.__cause__, FileNotFoundError) + + +@pytest.mark.parametrize("current_version", (None, "", " ", 2026)) +@pytest.mark.agent_authored(model="gpt-5.6") +def test_installed_product_root_rejects_invalid_current_version(mocker, current_version): + product_context = mocker.MagicMock() + product_context.__enter__.return_value = mocker.MagicMock() + winreg = _patch_winreg(mocker) + winreg.OpenKey.return_value = product_context + winreg.QueryValueEx.return_value = (current_version, 1) + + with pytest.raises(RuntimeError, match=r"Invalid CurrentVersion value .*Nsight 'Systems' registry registration"): + windows_nsight._installed_product_root("Systems") + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_installed_product_root_rejects_missing_version_key(mocker): + product_key = mocker.MagicMock() + product_context = mocker.MagicMock() + product_context.__enter__.return_value = product_key + winreg = _patch_winreg(mocker) + winreg.OpenKey.side_effect = (product_context, FileNotFoundError("Version key is missing")) + winreg.QueryValueEx.return_value = ("2026.1.3", 1) + + with pytest.raises(RuntimeError, match=r"Incomplete Nsight 'Systems' registry registration") as exc_info: + windows_nsight._installed_product_root("Systems") + + assert isinstance(exc_info.value.__cause__, FileNotFoundError) + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_installed_product_root_rejects_missing_installation_directory(mocker): + product_context = mocker.MagicMock() + product_context.__enter__.return_value = mocker.MagicMock() + version_context = mocker.MagicMock() + version_context.__enter__.return_value = mocker.MagicMock() + winreg = _patch_winreg(mocker) + winreg.OpenKey.side_effect = (product_context, version_context) + winreg.QueryValueEx.side_effect = (("2026.1.3", 1), FileNotFoundError("Installation directory is missing")) + + with pytest.raises(RuntimeError, match=r"Incomplete Nsight 'Systems' registry registration") as exc_info: + windows_nsight._installed_product_root("Systems") + + assert isinstance(exc_info.value.__cause__, FileNotFoundError) + + +@pytest.mark.parametrize("install_root", (None, "", " ", 2026)) +@pytest.mark.agent_authored(model="gpt-5.6") +def test_installed_product_root_rejects_invalid_installation_directory(mocker, install_root): + product_context = mocker.MagicMock() + product_context.__enter__.return_value = mocker.MagicMock() + version_context = mocker.MagicMock() + version_context.__enter__.return_value = mocker.MagicMock() + winreg = _patch_winreg(mocker) + winreg.OpenKey.side_effect = (product_context, version_context) + winreg.QueryValueEx.side_effect = (("2026.1.3", 1), (install_root, 1)) + + with pytest.raises( + RuntimeError, + match=r"Invalid installation directory .*Nsight 'Systems' registry registration.*version '2026.1.3'", + ): + windows_nsight._installed_product_root("Systems") + + +@pytest.mark.agent_authored(model="gpt-5.6") +def test_installed_product_root_propagates_access_errors(mocker): + winreg = _patch_winreg(mocker) + winreg.OpenKey.side_effect = PermissionError("Registry access denied") + + with pytest.raises(PermissionError, match="Registry access denied"): + windows_nsight._installed_product_root("Systems") diff --git a/cuda_python/LICENSE b/cuda_python/LICENSE index d6f74778be8..f3fe76ecadf 100644 --- a/cuda_python/LICENSE +++ b/cuda_python/LICENSE @@ -176,3 +176,28 @@ Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. 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/toolshed/build_static_bitcode_input.py b/toolshed/build_static_bitcode_input.py index e2400100dde..843ff9459fa 100755 --- a/toolshed/build_static_bitcode_input.py +++ b/toolshed/build_static_bitcode_input.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ @@ -14,9 +14,9 @@ """ import binascii -import os import sys import textwrap +from pathlib import Path import llvmlite.binding # HINT: pip install llvmlite @@ -24,11 +24,9 @@ def get_minimal_nvvmir_txt_template(): - cuda_bindings_tests_dir = os.path.normpath("cuda_bindings/tests") - assert os.path.isdir(cuda_bindings_tests_dir), ( - "Please run this helper script from the cuda-python top-level directory." - ) - sys.path.insert(0, os.path.abspath(cuda_bindings_tests_dir)) + cuda_bindings_tests_dir = Path("cuda_bindings/tests") + assert cuda_bindings_tests_dir.is_dir(), "Please run this helper script from the cuda-python top-level directory." + sys.path.insert(0, str(cuda_bindings_tests_dir.resolve())) import test_nvvm return test_nvvm.MINIMAL_NVVMIR_TXT_TEMPLATE diff --git a/toolshed/check_generated_file_seals.py b/toolshed/check_generated_file_seals.py index 1a9c45de61b..4863fe32d61 100644 --- a/toolshed/check_generated_file_seals.py +++ b/toolshed/check_generated_file_seals.py @@ -2,7 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 import hashlib -import os import re import subprocess import sys @@ -17,7 +16,10 @@ assert GENERATED_FILE_MARKER_FRAGMENT in GENERATED_FILE_SEAL_TOKEN _TOKEN_BYTES = GENERATED_FILE_SEAL_TOKEN.encode("ascii") _MARKER_REGEX = re.compile( - rb"^(?P<prefix>#|\.\.) " + # Keep the alternation in sync with the values of _COMMENT_CHARS below: + # a prefix that is not matched here can never reach the + # expected_comment_prefix() comparison in validate_generated_file_seal(). + rb"^(?P<prefix>#|\.\.|//) " + re.escape(_TOKEN_BYTES) + rb" format=(?P<format>[0-9]+); content-sha256=(?P<digest>[0-9a-f]{64})\n$" ) @@ -142,7 +144,7 @@ def main(args): returncode = 0 for filepath in args: - if not os.path.isfile(filepath): + if not Path(filepath).is_file(): continue if not validate_generated_file_seal(filepath, previously_sealed_paths): returncode = 1 diff --git a/toolshed/check_spdx.py b/toolshed/check_spdx.py index a2d0c041546..d4c9430673c 100644 --- a/toolshed/check_spdx.py +++ b/toolshed/check_spdx.py @@ -2,11 +2,10 @@ # SPDX-License-Identifier: Apache-2.0 import datetime -import os import re import subprocess import sys -from pathlib import PureWindowsPath +from pathlib import Path, PureWindowsPath import pathspec @@ -22,6 +21,7 @@ # Every top-level directory needs to have an entry here, so new paths # can't slip in without a reviewed license decision. TOP_LEVEL_DIRS_LICENSE_IDENTIFIERS = { + ".agents": "Apache-2.0", ".github": "Apache-2.0", "benchmarks": "Apache-2.0", "ci": "Apache-2.0", @@ -39,7 +39,7 @@ def load_spdx_ignore(): - if os.path.exists(SPDX_IGNORE_FILENAME): + if Path(SPDX_IGNORE_FILENAME).exists(): with open(SPDX_IGNORE_FILENAME, encoding="utf-8") as f: lines = f.readlines() else: @@ -50,7 +50,7 @@ def load_spdx_ignore(): COPYRIGHT_REGEX = ( rb"Copyright \(c\) (?P<years>[0-9]{4}(-[0-9]{4})?) " - rb"(?P<affiliation>NVIDIA CORPORATION( & AFFILIATES\. All rights reserved\.)?)" + rb"(?P<affiliation>NVIDIA CORPORATION & AFFILIATES\. All rights reserved\.)" ) COPYRIGHT_SUB = r"Copyright (c) {} \g<affiliation>" CURRENT_YEAR = str(datetime.datetime.now(tz=datetime.timezone.utc).year) diff --git a/toolshed/conda_create_for_pathfinder_testing.ps1 b/toolshed/conda_create_for_pathfinder_testing.ps1 index fbdbb5a0362..0f93c3ab026 100644 --- a/toolshed/conda_create_for_pathfinder_testing.ps1 +++ b/toolshed/conda_create_for_pathfinder_testing.ps1 @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 param( diff --git a/toolshed/dump_cutile_b64.py b/toolshed/dump_cutile_b64.py index 422bf95232b..8e58e452e02 100644 --- a/toolshed/dump_cutile_b64.py +++ b/toolshed/dump_cutile_b64.py @@ -9,9 +9,9 @@ """ import base64 -import glob import os import sys +from pathlib import Path import cupy @@ -54,13 +54,13 @@ def main(): raise # Find the .cutile file in current directory - cutile_files = glob.glob("./*.cutile") + cutile_files = list(Path().glob("*.cutile")) if not cutile_files: print("No .cutile file found in current directory", file=sys.stderr) sys.exit(1) # Use the most recently modified one if multiple exist - cutile_path = max(cutile_files, key=os.path.getmtime) + cutile_path = max(cutile_files, key=lambda path: path.stat().st_mtime) # Read the binary content with open(cutile_path, "rb") as f: diff --git a/toolshed/find_skipped_tests.py b/toolshed/find_skipped_tests.py index af44d7c0ad5..c2cb1c9777d 100755 --- a/toolshed/find_skipped_tests.py +++ b/toolshed/find_skipped_tests.py @@ -36,7 +36,10 @@ ANSI_ESCAPE = re.compile(r"\x1B\[[0-9;]*[A-Za-z]") PYTEST_NODE_ID = re.compile(r"tests/\S+\.py::\S+") -PYTEST_TEST_OUTCOME = re.compile(r"(tests/\S+\.py::\S+)\s+(PASSED|FAILED|ERROR|SKIPPED|XFAIL|XPASS)\b") +PYTEST_TEST_OUTCOME = re.compile( + r"(tests/\S+\.py::\S+)\s+" + r"(PASSED|FAILED|ERROR|SKIPPED|XFAIL|XPASS|SUBPASSED|SUBFAILED|SUBERROR|SUBSKIPPED|SUBXFAIL|SUBXPASS)\b" +) # GHA log format markers used to identify which test suite is active. # `gh api` logs: ##[group]<step-name> opens a section, ##[endgroup] closes it. @@ -194,6 +197,8 @@ def extract_test_status_sets(text: str) -> tuple[set[str], set[str], dict[str, s """Parse pytest output and return (skipped, non_skipped, test_id->suite).""" skipped: set[str] = set() non_skipped: set[str] = set() + passed: set[str] = set() + subtest_seen: set[str] = set() test_suites: dict[str, str] = {} current_suite = "" @@ -216,10 +221,20 @@ def extract_test_status_sets(text: str) -> tuple[set[str], set[str], dict[str, s # Parse per-test outcomes first so PASS/FAIL lines disqualify tests. for test_id, outcome in PYTEST_TEST_OUTCOME.findall(line): - if outcome == "SKIPPED": + if outcome.startswith("SUB"): + subtest_seen.add(test_id) + if outcome == "SUBSKIPPED": + skipped.add(test_id) + if current_suite: + test_suites.setdefault(test_id, current_suite) + else: + non_skipped.add(test_id) + elif outcome == "SKIPPED": skipped.add(test_id) if current_suite: test_suites.setdefault(test_id, current_suite) + elif outcome == "PASSED": + passed.add(test_id) else: non_skipped.add(test_id) @@ -233,6 +248,11 @@ def extract_test_status_sets(text: str) -> tuple[set[str], set[str], dict[str, s if current_suite: test_suites.setdefault(test_id, current_suite) + # Pytest reports a passing parent after its subtests even when every + # subtest skipped. Only treat that parent pass as execution evidence when + # the test did not emit subtest outcomes of its own. + non_skipped.update(passed - subtest_seen) + return skipped, non_skipped, test_suites diff --git a/toolshed/run_stubgen_pyx.py b/toolshed/run_stubgen_pyx.py deleted file mode 100644 index 1a163ff0778..00000000000 --- a/toolshed/run_stubgen_pyx.py +++ /dev/null @@ -1,54 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -"""Run stubgen-pyx for cuda_core and normalize the generated stub headers. - -stubgen-pyx emits a path using the OS path separator in the first-line comment -(e.g. "# This file was generated by stubgen-pyx from cuda_core\\cuda\\..."). -This wrapper rewrites that separator to "/" so committed stubs are identical -across platforms. Line-ending normalization is handled by .gitattributes. - -This also forces stubgen-pyx to write files with UTF-8 encoding, which is not -the default on Windows. - -This wrapper can be removed once these stubgen-pyx issues are resolved: - https://github.com/jon-edward/stubgen-pyx/issues/41 - https://github.com/jon-edward/stubgen-pyx/issues/42 -""" - -from __future__ import annotations - -import os -import pathlib -import subprocess -import sys - -_HEADER_PREFIX = b"# This file was generated by stubgen-pyx" - - -def _normalize_stub_headers(root: pathlib.Path) -> None: - for stub in root.rglob("*.pyi"): - data = stub.read_bytes() - newline = data.find(b"\n") - first_line = data[:newline] if newline != -1 else data - if not first_line.startswith(_HEADER_PREFIX) or b"\\" not in first_line: - continue - stub.write_bytes(first_line.replace(b"\\", b"/") + data[newline:]) - - -def main() -> int: - env = os.environ.copy() - env.setdefault("PYTHONUTF8", "1") - env.setdefault("PYTHONIOENCODING", "utf-8") - result = subprocess.run( - ["stubgen-pyx", "cuda_core/cuda", "--continue-on-error", "--include-private"], # noqa: S607 - env=env, - ) - if result.returncode != 0: - return result.returncode - _normalize_stub_headers(pathlib.Path("cuda_core/cuda")) - return 0 - - -if __name__ == "__main__": - sys.exit(main())