diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 20b71e2515..96b4e501da 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -30,6 +30,9 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.13t" + - "3.14" + - "3.14t" name: py${{ matrix.python-version }} runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') || (inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || @@ -116,6 +119,7 @@ jobs: CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}" CIBW_ENVIRONMENT: > CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} + CIBW_ENABLE: "cpython-freethreading" with: package-dir: ./cuda_core/ output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} @@ -157,14 +161,13 @@ jobs: # CIBW mounts the host filesystem under /host CIBW_ENVIRONMENT_LINUX: > CUDA_PATH=/host/${{ env.CUDA_PATH }} - LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CIBW_ENVIRONMENT_WINDOWS: > CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" - LIB="${CUDA_HOME}\\lib\\x64;${LIB}" CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --namespace-pkg cuda -w {dest_dir} {wheel}" + CIBW_ENABLE: "cpython-freethreading" with: package-dir: ./cuda_bindings/ output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} @@ -224,6 +227,12 @@ jobs: with: # workaround for actions/runner-images#12377 (the cached 3.13.4 is buggy on Windows) python-version: ${{ matrix.python-version == '3.13' && '3.13.5' || matrix.python-version }} + # allow prereleases only fetches prereleases for unreleased versions of Python + allow-prereleases: true + + - name: verify free-threaded build + if: endsWith(matrix.python-verison, 't') + run: python -c 'import sys; assert not sys._is_gil_enabled()' - name: Set up Python include paths run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ccabde7a29..c2f4981b8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ on: push: branches: - "pull-request/[0-9]+" - - "main" + - "12.9.x" jobs: ci-vars: @@ -23,7 +23,7 @@ jobs: CUDA_BUILD_VER: ${{ steps.get-vars.outputs.cuda_build_ver }} steps: - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 - name: Get CUDA build version @@ -32,89 +32,153 @@ jobs: cuda_build_ver=$(jq -r .cuda.build.version ci/versions.json) echo "cuda_build_ver=$cuda_build_ver" >> $GITHUB_OUTPUT - build: + should-skip: + runs-on: ubuntu-latest + outputs: + skip: ${{ steps.get-should-skip.outputs.skip }} + steps: + - name: Checkout repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + - name: Compute whether to skip builds and tests + id: get-should-skip + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euxo pipefail + if ${{ startsWith(github.ref_name, 'pull-request/') }}; then + skip="$(gh pr view "$(grep -Po '(\d+)$' <<< '${{ github.ref_name }}')" --json title --jq '.title | contains("[no-ci]")')" + else + skip=false + fi + echo "skip=${skip}" >> "$GITHUB_OUTPUT" + + # WARNING: make sure all of the build jobs are in sync + build-linux-64: needs: - ci-vars + - should-skip strategy: fail-fast: false matrix: host-platform: - linux-64 + name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }} + secrets: inherit + uses: ./.github/workflows/build-wheel.yml + with: + host-platform: ${{ matrix.host-platform }} + cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + + # WARNING: make sure all of the build jobs are in sync + build-linux-aarch64: + needs: + - ci-vars + - should-skip + strategy: + fail-fast: false + matrix: + host-platform: - linux-aarch64 + name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }} + secrets: inherit + uses: ./.github/workflows/build-wheel.yml + with: + host-platform: ${{ matrix.host-platform }} + cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + + # WARNING: make sure all of the build jobs are in sync + build-windows: + needs: + - ci-vars + - should-skip + strategy: + fail-fast: false + matrix: + host-platform: - win-64 name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} - if: ${{ github.repository_owner == 'nvidia' }} + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) }} secrets: inherit uses: ./.github/workflows/build-wheel.yml with: host-platform: ${{ matrix.host-platform }} cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} - test-linux: + # WARNING: make sure both Linux test jobs are in sync + test-linux-64: strategy: fail-fast: false matrix: host-platform: - linux-64 - - linux-aarch64 name: Test ${{ matrix.host-platform }} if: ${{ github.repository_owner == 'nvidia' }} permissions: contents: read # This is required for actions/checkout needs: - ci-vars - - build + - build-linux-64 secrets: inherit uses: ./.github/workflows/test-wheel-linux.yml with: build-type: pull-request host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + matrix_filter: "map(select([.CUDA_VER // empty | split(\".\")[] | tonumber] as $v | ($v[0] < 13)))" - test-windows: + # WARNING: make sure both Linux test jobs are in sync + test-linux-aarch64: strategy: fail-fast: false matrix: host-platform: - - win-64 + - linux-aarch64 name: Test ${{ matrix.host-platform }} if: ${{ github.repository_owner == 'nvidia' }} permissions: contents: read # This is required for actions/checkout needs: - ci-vars - - build + - build-linux-aarch64 secrets: inherit - uses: ./.github/workflows/test-wheel-windows.yml + uses: ./.github/workflows/test-wheel-linux.yml with: build-type: pull-request host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + matrix_filter: "map(select([.CUDA_VER // empty | split(\".\")[] | tonumber] as $v | ($v[0] < 13)))" - doc: - name: Docs + test-windows: + strategy: + fail-fast: false + matrix: + host-platform: + - win-64 + name: Test ${{ matrix.host-platform }} if: ${{ github.repository_owner == 'nvidia' }} - # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - id-token: write - contents: write - pull-requests: write + contents: read # This is required for actions/checkout needs: - ci-vars - - build + - build-windows secrets: inherit - uses: ./.github/workflows/build-docs.yml + uses: ./.github/workflows/test-wheel-windows.yml with: + build-type: pull-request + host-platform: ${{ matrix.host-platform }} build-ctk-ver: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + matrix_filter: "map(select([.CUDA_VER // empty | split(\".\")[] | tonumber] as $v | ($v[0] < 13)))" checks: name: Check job status - permissions: - checks: read + runs-on: ubuntu-latest needs: - - build - - test-linux + - test-linux-64 + - test-linux-aarch64 - test-windows - - doc - secrets: inherit - uses: ./.github/workflows/status-check.yml + # we don't build docs on the backport branch, see #809 + steps: + - name: Exit + run: exit 0 diff --git a/.github/workflows/guess_latest.sh b/.github/workflows/guess_latest.sh index d2e8427eb2..8a0a13034c 100644 --- a/.github/workflows/guess_latest.sh +++ b/.github/workflows/guess_latest.sh @@ -6,18 +6,27 @@ # URL to search URL="https://developer.download.nvidia.com/compute/cuda/redist/" +# Ensure exactly one argument is provided +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +# Accept major version as the first argument +MAJOR_VERSION="$1" + # Fetch the directory listing and extract the latest version number get_latest_version() { # Get the HTML content of the page local html_content=$(wget -q -O - "$URL") # Extract links matching the pattern redistrib_?.?.?.json - local files=$(echo "$html_content" | grep -oP 'redistrib_[0-9]+\.[0-9]+\.[0-9]+\.json' | cut -d'"' -f2) + local files=$(echo "$html_content" | grep -oP "redistrib_${MAJOR_VERSION}\.[0-9]+\.[0-9]+\.json" | cut -d'"' -f2) # If files were found, extract the version numbers and find the latest if [ -n "$files" ]; then # Extract just the version numbers using regex - local versions=$(echo "$files" | grep -oP 'redistrib_\K[0-9]+\.[0-9]+\.[0-9]+(?=\.json)') + local versions=$(echo "$files" | grep -oP "redistrib_\K${MAJOR_VERSION}\.[0-9]+\.[0-9]+(?=\.json)") # Sort the versions and get the latest local latest_version=$(echo "$versions" | sort -V | tail -n 1) diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 546e6aa956..0653f99e52 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -34,88 +34,43 @@ jobs: outputs: MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 1 + - name: Validate Test Type run: | if [[ "$BUILD_TYPE" != "pull-request" ]] && [[ "$BUILD_TYPE" != "nightly" ]] && [[ "$BUILD_TYPE" != "branch" ]]; then echo "Invalid build type! Must be one of 'nightly', 'pull-request', or 'branch'." exit 1 fi + - name: Compute Python Test Matrix id: compute-matrix run: | - # Set a default GPU based upon architecture. - gpu="l4" - if [[ "${ARCH}" == "arm64" ]]; then - gpu="a100" - fi - # Add a special entry for the H100 runner on amd64. - special_runner="" - if [[ "${ARCH}" == "amd64" ]]; then - special_runner="- { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: 'H100', DRIVER: 'latest' }" - fi - - # Please keep the matrices sorted in ascending order by the following: - # - # [PY_VER, CUDA_VER, LOCAL_CTK, GPU, DRIVER] - # - # Note that DRIVER: `earliest` does not work with CUDA 12.9.0 and LOCAL_CTK: 0 does not work with CUDA 12.0.1. - # - export MATRICES=" - pull-request: - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - ${special_runner} - nightly: - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.9', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.10', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.11', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '11.8.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'earliest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '11.8.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.0.1', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '0', GPU: ${gpu}, DRIVER: 'latest' } - - { ARCH: ${ARCH}, PY_VER: '3.13', CUDA_VER: '12.9.0', LOCAL_CTK: '1', GPU: ${gpu}, DRIVER: 'latest' } - ${special_runner} - " - # Use the nightly matrix for branch tests MATRIX_TYPE="${BUILD_TYPE}" if [[ "${MATRIX_TYPE}" == "branch" ]]; then MATRIX_TYPE="nightly" fi - export MATRIX_TYPE - TEST_MATRIX=$(yq -n 'env(MATRICES) | .[strenv(MATRIX_TYPE)]') - export TEST_MATRIX + + # Read base matrix from JSON file for the specific architecture + TEST_MATRIX=$(jq --arg arch "$ARCH" --arg matrix_type "$MATRIX_TYPE" ' + .linux[$matrix_type] | + map(select(.ARCH == $arch)) + ' ci/test-matrix.json) + + # Add special runner for amd64 if applicable + if [[ "${ARCH}" == "amd64" ]]; then + SPECIAL_RUNNERS=$(jq ' + .linux.special_runners.amd64 + ' ci/test-matrix.json) + TEST_MATRIX=$(jq --argjson special "$SPECIAL_RUNNERS" '. + $special' <<< "$TEST_MATRIX") + fi MATRIX="$( - yq -n -o json 'env(TEST_MATRIX)' | \ - jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end' + jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end' <<< "$TEST_MATRIX" )" echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" @@ -163,11 +118,35 @@ jobs: SHA: ${{ github.sha }} run: ./ci/tools/env-vars test - - name: Download cuda-pathfinder build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: cuda-pathfinder-wheel - path: ./cuda_pathfinder + - name: Install GitHub CLI + # gh is needed for artifact fetching in subsequent steps + run: | + # See https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt. + mkdir -p -m 755 /etc/apt/keyrings \ + && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ + && cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ + && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && apt update \ + && apt install gh -y + + - name: Download cuda-pathfinder build artifacts from main branch + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + MAIN_BRANCH="main" + PATHFINDER_BASENAME="cuda-pathfinder-wheel" + LATEST_MAIN_RUN_ID=$(gh run list -b ${MAIN_BRANCH} -L 1 -w "CI" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId') + if [[ "$LATEST_MAIN_RUN_ID" == "" ]]; then + echo "LATEST_MAIN_RUN_ID not found!" + exit 1 + fi + + gh run download $LATEST_MAIN_RUN_ID -p ${PATHFINDER_BASENAME} -R NVIDIA/cuda-python + ls -al $PATHFINDER_BASENAME + mkdir -p ./cuda_pathfinder + mv $PATHFINDER_BASENAME/*.whl ./cuda_pathfinder/ + rmdir $PATHFINDER_BASENAME - name: Download cuda-python build artifacts if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} @@ -188,16 +167,6 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # See https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt. - # gh is needed for artifact fetching. - mkdir -p -m 755 /etc/apt/keyrings \ - && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ - && cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ - && chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ - && apt update \ - && apt install gh -y - OLD_BRANCH=$(cat .github/BACKPORT_BRANCH) OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "build-and-test.yml" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId') @@ -240,34 +209,13 @@ jobs: pwd ls -lahR $CUDA_BINDINGS_CYTHON_TESTS_DIR - - name: Download cuda.core build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} - path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - - name: Display structure of downloaded cuda.core build artifacts - run: | - pwd - ls -lahR $CUDA_CORE_ARTIFACTS_DIR - - - name: Download cuda.core Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests - path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} - - - name: Display structure of downloaded cuda.core Cython tests - if: ${{ env.SKIP_CYTHON_TEST == '0' }} - run: | - pwd - ls -lahR $CUDA_CORE_CYTHON_TESTS_DIR - name: Set up Python ${{ matrix.PY_VER }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.PY_VER }} + allow-prereleases: true env: # we use self-hosted runners on which setup-python behaves weirdly... AGENT_TOOLSDIRECTORY: "/opt/hostedtoolcache" @@ -292,11 +240,6 @@ jobs: - name: Set up compute-sanitizer run: setup-sanitizer - - name: Run cuda.pathfinder tests with see_what_works - env: - CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works - run: run-tests pathfinder - - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} env: @@ -304,11 +247,7 @@ jobs: LOCAL_CTK: ${{ matrix.LOCAL_CTK }} run: run-tests bindings - - name: Run cuda.core tests - env: - CUDA_VER: ${{ matrix.CUDA_VER }} - LOCAL_CTK: ${{ matrix.LOCAL_CTK }} - run: run-tests core + - name: Ensure cuda-python installable run: | @@ -317,17 +256,3 @@ jobs: else pip install $(ls cuda_python*.whl)[all] fi - - - name: Install cuda.pathfinder nvidia_wheels_cu12 - if: startsWith(matrix.CUDA_VER, '12.') - run: | - pushd cuda_pathfinder - pip install -v .[nvidia_wheels_cu12] - pip freeze - popd - - - name: Run cuda.pathfinder tests with all_must_work - if: startsWith(matrix.CUDA_VER, '12.') - env: - CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work - run: run-tests pathfinder diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 0f175af78b..7c3fa73fbf 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -32,6 +32,11 @@ jobs: outputs: MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 1 + - name: Validate Test Type run: | if [[ "$BUILD_TYPE" != "pull-request" ]] && [[ "$BUILD_TYPE" != "nightly" ]] && [[ "$BUILD_TYPE" != "branch" ]]; then @@ -41,54 +46,43 @@ jobs: - name: Compute Python Test Matrix id: compute-matrix run: | - # Please keep the matrices sorted in ascending order by the following: - # - # [PY_VER, CUDA_VER, LOCAL_CTK] - # - export MATRICES=" - pull-request: - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1' } - nightly: - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '11.8.0', LOCAL_CTK: '1' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '0' } - - { ARCH: ${ARCH}, PY_VER: '3.12', CUDA_VER: '12.9.0', LOCAL_CTK: '1' } - " - # Use the nightly matrix for branch tests MATRIX_TYPE="${BUILD_TYPE}" if [[ "${MATRIX_TYPE}" == "branch" ]]; then MATRIX_TYPE="nightly" fi - export MATRIX_TYPE - TEST_MATRIX=$(yq -n 'env(MATRICES) | .[strenv(MATRIX_TYPE)]') - export TEST_MATRIX + + # Read base matrix from JSON file for the specific architecture + TEST_MATRIX=$(jq --arg arch "$ARCH" --arg matrix_type "$MATRIX_TYPE" ' + .windows[$matrix_type] | + map(select(.ARCH == $arch)) + ' ci/test-matrix.json) MATRIX="$( - yq -n -o json 'env(TEST_MATRIX)' | \ - jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end' + jq -c '${{ inputs.matrix_filter }} | if (. | length) > 0 then {include: .} else "Error: Empty matrix\n" | halt_error(1) end' <<< "$TEST_MATRIX" )" echo "MATRIX=${MATRIX}" | tee --append "${GITHUB_OUTPUT}" test: - name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }} + name: py${{ matrix.PY_VER }}, ${{ matrix.CUDA_VER }}, ${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}, GPU ${{ matrix.GPU }} # The build stage could fail but we want the CI to keep moving. needs: compute-matrix strategy: fail-fast: false matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }} if: ${{ github.repository_owner == 'nvidia' && !cancelled() }} - runs-on: 'cuda-python-windows-gpu-github' + runs-on: "windows-${{ matrix.ARCH }}-gpu-${{ matrix.GPU }}-${{ matrix.DRIVER }}-1" steps: - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: fetch-depth: 0 + - name: Setup proxy cache + uses: nv-gha-runners/setup-proxy-cache@main + continue-on-error: true + - name: Update driver run: | .github/workflows/install_gpu_driver.ps1 @@ -96,20 +90,6 @@ jobs: - name: Ensure GPU is working run: nvidia-smi - - name: Install Git for Windows - # the GPU runner image does not have Git Bash pre-installed... - env: - # doesn't seem there's an easy way to avoid hard-coding it? - GFW_EXE_URL: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe - run: | - Invoke-WebRequest -Uri "$env:GFW_EXE_URL" -OutFile "PortableGit.7z.exe" - # Self-extracting, see https://gitforwindows.org/zip-archives-extracting-the-released-archives.html - Start-Process .\PortableGit.7z.exe -Wait -Verbose -ArgumentList '-y -gm2' - ls -l PortableGit - echo "$((Get-Location).Path)\\PortableGit\\bin" >> $env:GITHUB_PATH - $env:Path += ";$((Get-Location).Path)\\PortableGit\\bin" - bash --version - - name: Set environment variables env: BUILD_CUDA_VER: ${{ inputs.build-ctk-ver }} @@ -121,12 +101,6 @@ jobs: shell: bash --noprofile --norc -xeuo pipefail {0} run: ./ci/tools/env-vars test - - name: Download cuda-pathfinder build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: cuda-pathfinder-wheel - path: ./cuda_pathfinder - - name: Download cuda-python build artifacts if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 @@ -141,20 +115,24 @@ jobs: name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - - name: Install gh cli - # the GPU runner image does not have gh pre-installed... + - name: Download cuda-pathfinder build artifacts from main branch env: - # doesn't seem there's an easy way to avoid hard-coding it? - GH_MSI_URL: https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_windows_amd64.msi + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - Invoke-WebRequest -Uri "$env:GH_MSI_URL" -OutFile "gh_installer.msi" - Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "gh_installer.msi" /qn' - $GH_POSSIBLE_PATHS = "C:\\Program Files\\GitHub CLI", "C:\\Program Files (x86)\\GitHub CLI" - foreach ($p in $GH_POSSIBLE_PATHS) { - echo "$p" >> $env:GITHUB_PATH - $env:Path += ";$p" + $MAIN_BRANCH = "main" + $PATHFINDER_BASENAME = "cuda-pathfinder-wheel" + $runData = gh run list -b $MAIN_BRANCH -L 1 -w "CI" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json + if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) { + Write-Host "LATEST_MAIN_RUN_ID not found!" + exit 1 } - gh --version + $LATEST_MAIN_RUN_ID = $runData[0].databaseId + + gh run download $LATEST_MAIN_RUN_ID -p $PATHFINDER_BASENAME -R NVIDIA/cuda-python + Get-ChildItem -Path $PATHFINDER_BASENAME + New-Item -Path "./cuda_pathfinder" -ItemType Directory -Force + Move-Item -Path "$PATHFINDER_BASENAME/*.whl" -Destination "./cuda_pathfinder/" + Remove-Item -Path $PATHFINDER_BASENAME -Force - name: Install zstd # the GPU runner image does not have zstd pre-installed... and it's needed by actions/cache @@ -219,34 +197,13 @@ jobs: Get-Location Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_CYTHON_TESTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - - name: Download cuda.core build artifacts - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} - path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - - name: Display structure of downloaded cuda.core build artifacts - 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' }} - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests - path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }} - - - name: Display structure of downloaded cuda.core Cython tests - if: ${{ 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: Set up Python ${{ matrix.PY_VER }} uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.PY_VER }} + allow-prereleases: true - name: Set up mini CTK if: ${{ matrix.LOCAL_CTK == '1' }} @@ -256,12 +213,6 @@ jobs: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ matrix.CUDA_VER }} - - name: Run cuda.pathfinder tests with see_what_works - env: - CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works - shell: bash --noprofile --norc -xeuo pipefail {0} - run: run-tests pathfinder - - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} env: @@ -270,12 +221,7 @@ jobs: shell: bash --noprofile --norc -xeuo pipefail {0} run: run-tests bindings - - name: Run cuda.core tests - env: - CUDA_VER: ${{ matrix.CUDA_VER }} - LOCAL_CTK: ${{ matrix.LOCAL_CTK }} - shell: bash --noprofile --norc -xeuo pipefail {0} - run: run-tests core + - name: Ensure cuda-python installable run: | @@ -285,18 +231,3 @@ jobs: pip install "$((Get-ChildItem -Filter cuda_python*.whl).FullName)[all]" } - - name: Install cuda.pathfinder nvidia_wheels_cu12 - if: startsWith(matrix.CUDA_VER, '12.') - shell: bash --noprofile --norc -xeuo pipefail {0} - run: | - pushd cuda_pathfinder - pip install -v .[nvidia_wheels_cu12] - pip freeze - popd - - - name: Run cuda.pathfinder tests with all_must_work - if: startsWith(matrix.CUDA_VER, '12.') - env: - CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work - shell: bash --noprofile --norc -xeuo pipefail {0} - run: run-tests pathfinder diff --git a/.gitignore b/.gitignore index 656dd89169..64c77d166e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__/ cache_driver cache_runtime cache_nvrtc +cuda_bindings/cuda/bindings/_lib/utils.pxi # CUDA Python specific (auto-generated) cuda_bindings/cuda/bindings/_bindings/cydriver.pxd @@ -28,10 +29,6 @@ cuda_bindings/cuda/bindings/_bindings/cynvrtc.pxd cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx cuda_bindings/cuda/bindings/_internal/nvjitlink.pyx cuda_bindings/cuda/bindings/_internal/nvvm.pyx -cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd -cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx -cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd -cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx cuda_bindings/cuda/bindings/_lib/utils.pxd cuda_bindings/cuda/bindings/_lib/utils.pyx cuda_bindings/cuda/bindings/cydriver.pxd @@ -114,6 +111,7 @@ instance/ # Sphinx documentation docs_src/_build/ +*/docs/source/generated/ # PyBuilder .pybuilder/ diff --git a/ci/test-matrix.json b/ci/test-matrix.json new file mode 100644 index 0000000000..e30ac1878c --- /dev/null +++ b/ci/test-matrix.json @@ -0,0 +1,110 @@ +{ + "_description": "Test matrix configurations for CUDA Python CI workflows. This file consolidates the test matrices that were previously hardcoded in the workflow files. All GPU and ARCH values are hard-coded for each architecture: l4 GPU for amd64, a100 GPU for arm64.", + "_sorted_by": "Please keep matrices sorted in ascending order by [ARCH, PY_VER, CUDA_VER, LOCAL_CTK, GPU, DRIVER]", + "_notes": "DRIVER: 'earliest' does not work with CUDA 12.9.1 and LOCAL_CTK: 0 does not work with CUDA 12.0.1", + "linux": { + "pull-request": [ + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.14", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.14t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.14", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.14t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" } + ], + "nightly": [ + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, + { "ARCH": "arm64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" } + ], + "special_runners": { + "amd64": [ + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "H100", "DRIVER": "latest" } + ] + } + }, + "windows": { + "pull-request": [ + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } + ], + "nightly": [ + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.12", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "t4", "DRIVER": "latest" }, + { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" } + ] + } +} diff --git a/ci/tools/env-vars b/ci/tools/env-vars index 8b68540fc4..3dcb81a4c0 100755 --- a/ci/tools/env-vars +++ b/ci/tools/env-vars @@ -60,7 +60,7 @@ elif [[ "${1}" == "test" ]]; then # We only test compute-sanitizer on python 3.12 arbitrarily; we don't need to use sanitizer on the entire matrix # Only local ctk installs have compute-sanitizer; there is no wheel for it if [[ "${PY_VER}" == "3.12" && "${CUDA_VER}" != "11.8.0" && "${LOCAL_CTK}" == 1 && "${HOST_PLATFORM}" == linux* ]]; then - echo "LATEST_CUDA_VERSION=$(bash .github/workflows/guess_latest.sh)" >> $GITHUB_ENV + echo "LATEST_CUDA_VERSION=$(bash .github/workflows/guess_latest.sh $TEST_CUDA_MAJOR)" >> $GITHUB_ENV SETUP_SANITIZER=1 else SETUP_SANITIZER=0 diff --git a/ci/tools/run-tests b/ci/tools/run-tests index ad1dbd6a9e..e8317d40c9 100755 --- a/ci/tools/run-tests +++ b/ci/tools/run-tests @@ -75,12 +75,18 @@ elif [[ "${test_module}" == "core" ]]; then echo "Installing core wheel" pwd ls + + FREE_THREADING="" + if python -c 'import sys; assert not sys._is_gil_enabled()' 2> /dev/null; then + FREE_THREADING+="-ft" + fi + if [[ "${LOCAL_CTK}" == 1 ]]; then # We already installed cuda-bindings, and all CTK components exist locally, # so just install the test dependencies. - pip install $(ls *.whl)["test-cu${TEST_CUDA_MAJOR}"] + pip install $(ls *.whl)["test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}"] else - pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}"] + pip install $(ls *.whl)["cu${TEST_CUDA_MAJOR}","test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}"] fi popd pushd ./cuda_core diff --git a/ci/versions.json b/ci/versions.json index 5608eeb1d9..54f22b3bcd 100644 --- a/ci/versions.json +++ b/ci/versions.json @@ -1,7 +1,7 @@ { "cuda": { "build": { - "version": "12.9.0" + "version": "12.9.1" } } } diff --git a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in index 9bdf78dd54..e8e213de21 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in @@ -4,15 +4,17 @@ # This code was automatically generated with version 12.9.0. Do not modify it directly. {{if 'Windows' == platform.system()}} import os -import win32api -from pywintypes import error +cimport cuda.bindings._lib.windll as windll {{else}} cimport cuda.bindings._lib.dlfcn as dlfcn {{endif}} -from libc.stdint cimport intptr_t +from libc.stdint cimport intptr_t, uintptr_t import os import sys cimport cuda.bindings._bindings.loader as loader +import threading + +cdef object __symbol_lock = threading.Lock() cdef bint __cuPythonInit = False {{if 'cuGetErrorString' in found_functions}}cdef void *__cuGetErrorString = NULL{{endif}} {{if 'cuGetErrorName' in found_functions}}cdef void *__cuGetErrorName = NULL{{endif}} @@ -488,19 +490,21 @@ cdef bint __cuPythonInit = False {{if True}}cdef void *__cuGraphicsVDPAURegisterVideoSurface = NULL{{endif}} {{if True}}cdef void *__cuGraphicsVDPAURegisterOutputSurface = NULL{{endif}} -cdef int cuPythonInit() except -1 nogil: +# To make cuPythonInit reentrant +ctypedef CUresult (*__cuGetProcAddress_v2_T)(const char*, void**, int, cuuint64_t, CUdriverProcAddressQueryResult*) except?CUDA_ERROR_NOT_FOUND nogil +cdef __cuGetProcAddress_v2_T _F_cuGetProcAddress_v2 = NULL + +cdef int _cuPythonInit() except -1 nogil: global __cuPythonInit + cdef bint usePTDS - if __cuPythonInit: - return 0 - __cuPythonInit = True - with gil: + cdef char libPath[260] + + with gil, __symbol_lock: usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=0) - # Load library - cdef char libPath[260] - libPath[0] = 0 - with gil: + # Load library + libPath[0] = 0 status = loader.getCUDALibraryPath(libPath, sys.maxsize > 2**32) if status == 0 and len(libPath) != 0: path = libPath.decode('utf-8') @@ -512,8431 +516,6760 @@ cdef int cuPythonInit() except -1 nogil: {{endif}} {{if 'Windows' == platform.system()}} - LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 - try: - handle = win32api.LoadLibraryEx(path, 0, LOAD_LIBRARY_SEARCH_SYSTEM32) - except error as e: + handle = windll.LoadLibraryExW(path, NULL, windll.LOAD_LIBRARY_SEARCH_SYSTEM32) + if handle == 0: raise RuntimeError('Failed to LoadLibraryEx ' + path) {{else}} handle = dlfcn.dlopen(bytes(path, encoding='utf-8'), dlfcn.RTLD_NOW) - if (handle == NULL): + if handle == NULL: raise RuntimeError('Failed to dlopen ' + path) {{endif}} - # Get latest __cuGetProcAddress_v2 - {{if 'Windows' == platform.system()}} - with gil: - try: - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = win32api.GetProcAddress(handle, 'cuGetProcAddress_v2') - except: - pass - {{else}} - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') - {{endif}} + # Get latest __cuGetProcAddress_v2 + global __cuGetProcAddress_v2 + {{if 'Windows' == platform.system()}} + __cuGetProcAddress_v2 = windll.GetProcAddress(handle, 'cuGetProcAddress_v2') + {{else}} + __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') + {{endif}} - # Load using cuGetProcAddress if available - if __cuGetProcAddress_v2 != NULL: - if usePTDS: - # Get all PTDS version of functions - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - cuGetProcAddress('cuMemcpy', &__cuMemcpy, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + # Load using cuGetProcAddress if available + if __cuGetProcAddress_v2 != NULL: + _F_cuGetProcAddress_v2 = <__cuGetProcAddress_v2_T>__cuGetProcAddress_v2 + if usePTDS: + # Get all PTDS version of functions + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + _F_cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + _F_cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + _F_cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + _F_cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + _F_cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + _F_cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + _F_cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + _F_cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpyBatchAsync' in found_functions}} + global __cuMemcpyBatchAsync + _F_cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemcpy3DBatchAsync' in found_functions}} + global __cuMemcpy3DBatchAsync + _F_cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + _F_cuGetProcAddress_v2('cuMemsetD8', &__cuMemsetD8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + _F_cuGetProcAddress_v2('cuMemsetD16', &__cuMemsetD16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + _F_cuGetProcAddress_v2('cuMemsetD32', &__cuMemsetD32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D8', &__cuMemsetD2D8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D16', &__cuMemsetD2D16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + _F_cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + _F_cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + _F_cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + _F_cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + _F_cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + _F_cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + _F_cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + _F_cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + _F_cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + _F_cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + _F_cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemPrefetchAsync' in found_functions}} + global __cuMemPrefetchAsync + _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + _F_cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + _F_cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + _F_cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + _F_cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + _F_cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + _F_cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + _F_cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + _F_cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + _F_cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + _F_cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} + global __cuStreamGetCaptureInfo_v2 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} + global __cuStreamUpdateCaptureDependencies + _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + _F_cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + _F_cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + _F_cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + _F_cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + _F_cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + _F_cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + _F_cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + _F_cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + _F_cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + _F_cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + _F_cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + _F_cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + _F_cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + _F_cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + _F_cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + _F_cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{endif}} + else: + # Else get the regular version + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + _F_cuGetProcAddress_v2('cuMemcpy', &__cuMemcpy, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + _F_cuGetProcAddress_v2('cuMemcpyPeer', &__cuMemcpyPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + _F_cuGetProcAddress_v2('cuMemcpy2D', &__cuMemcpy2D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + _F_cuGetProcAddress_v2('cuMemcpy3D', &__cuMemcpy3D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + _F_cuGetProcAddress_v2('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + _F_cuGetProcAddress_v2('cuMemcpyAsync', &__cuMemcpyAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + _F_cuGetProcAddress_v2('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + _F_cuGetProcAddress_v2('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + _F_cuGetProcAddress_v2('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpyBatchAsync' in found_functions}} + global __cuMemcpyBatchAsync + _F_cuGetProcAddress_v2('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemcpy3DBatchAsync' in found_functions}} + global __cuMemcpy3DBatchAsync + _F_cuGetProcAddress_v2('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + _F_cuGetProcAddress_v2('cuMemsetD8', &__cuMemsetD8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + _F_cuGetProcAddress_v2('cuMemsetD16', &__cuMemsetD16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + _F_cuGetProcAddress_v2('cuMemsetD32', &__cuMemsetD32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D8', &__cuMemsetD2D8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D16', &__cuMemsetD2D16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + _F_cuGetProcAddress_v2('cuMemsetD2D32', &__cuMemsetD2D32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + _F_cuGetProcAddress_v2('cuMemsetD8Async', &__cuMemsetD8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + _F_cuGetProcAddress_v2('cuMemsetD16Async', &__cuMemsetD16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + _F_cuGetProcAddress_v2('cuMemsetD32Async', &__cuMemsetD32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + _F_cuGetProcAddress_v2('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + _F_cuGetProcAddress_v2('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + _F_cuGetProcAddress_v2('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + _F_cuGetProcAddress_v2('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + _F_cuGetProcAddress_v2('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + _F_cuGetProcAddress_v2('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + _F_cuGetProcAddress_v2('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + _F_cuGetProcAddress_v2('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemPrefetchAsync' in found_functions}} + global __cuMemPrefetchAsync + _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + _F_cuGetProcAddress_v2('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + _F_cuGetProcAddress_v2('cuStreamGetPriority', &__cuStreamGetPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + _F_cuGetProcAddress_v2('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + _F_cuGetProcAddress_v2('cuStreamGetFlags', &__cuStreamGetFlags, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + _F_cuGetProcAddress_v2('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + _F_cuGetProcAddress_v2('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + _F_cuGetProcAddress_v2('cuStreamWaitEvent', &__cuStreamWaitEvent, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + _F_cuGetProcAddress_v2('cuStreamAddCallback', &__cuStreamAddCallback, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + _F_cuGetProcAddress_v2('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + _F_cuGetProcAddress_v2('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + _F_cuGetProcAddress_v2('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + _F_cuGetProcAddress_v2('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} + global __cuStreamGetCaptureInfo_v2 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + _F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} + global __cuStreamUpdateCaptureDependencies + _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + _F_cuGetProcAddress_v2('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + _F_cuGetProcAddress_v2('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + _F_cuGetProcAddress_v2('cuStreamQuery', &__cuStreamQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + _F_cuGetProcAddress_v2('cuStreamSynchronize', &__cuStreamSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + _F_cuGetProcAddress_v2('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + _F_cuGetProcAddress_v2('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + _F_cuGetProcAddress_v2('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + _F_cuGetProcAddress_v2('cuEventRecord', &__cuEventRecord, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + _F_cuGetProcAddress_v2('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + _F_cuGetProcAddress_v2('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + _F_cuGetProcAddress_v2('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + _F_cuGetProcAddress_v2('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + _F_cuGetProcAddress_v2('cuLaunchKernel', &__cuLaunchKernel, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + _F_cuGetProcAddress_v2('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + _F_cuGetProcAddress_v2('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + _F_cuGetProcAddress_v2('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + _F_cuGetProcAddress_v2('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + _F_cuGetProcAddress_v2('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + _F_cuGetProcAddress_v2('cuGraphicsMapResources', &__cuGraphicsMapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + _F_cuGetProcAddress_v2('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + # Get remaining functions + {{if 'cuGetErrorString' in found_functions}} + global __cuGetErrorString + _F_cuGetProcAddress_v2('cuGetErrorString', &__cuGetErrorString, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - cuGetProcAddress('cuMemcpyPeer', &__cuMemcpyPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuGetErrorName' in found_functions}} + global __cuGetErrorName + _F_cuGetProcAddress_v2('cuGetErrorName', &__cuGetErrorName, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - cuGetProcAddress('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuInit' in found_functions}} + global __cuInit + _F_cuGetProcAddress_v2('cuInit', &__cuInit, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - cuGetProcAddress('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDriverGetVersion' in found_functions}} + global __cuDriverGetVersion + _F_cuGetProcAddress_v2('cuDriverGetVersion', &__cuDriverGetVersion, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - cuGetProcAddress('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGet' in found_functions}} + global __cuDeviceGet + _F_cuGetProcAddress_v2('cuDeviceGet', &__cuDeviceGet, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - cuGetProcAddress('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetCount' in found_functions}} + global __cuDeviceGetCount + _F_cuGetProcAddress_v2('cuDeviceGetCount', &__cuDeviceGetCount, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - cuGetProcAddress('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetName' in found_functions}} + global __cuDeviceGetName + _F_cuGetProcAddress_v2('cuDeviceGetName', &__cuDeviceGetName, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - cuGetProcAddress('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetUuid' in found_functions}} + global __cuDeviceGetUuid + _F_cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - cuGetProcAddress('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetUuid_v2' in found_functions}} + global __cuDeviceGetUuid_v2 + _F_cuGetProcAddress_v2('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - cuGetProcAddress('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetLuid' in found_functions}} + global __cuDeviceGetLuid + _F_cuGetProcAddress_v2('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - cuGetProcAddress('cuMemcpy2D', &__cuMemcpy2D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceTotalMem_v2' in found_functions}} + global __cuDeviceTotalMem_v2 + _F_cuGetProcAddress_v2('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - cuGetProcAddress('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} + global __cuDeviceGetTexture1DLinearMaxWidth + _F_cuGetProcAddress_v2('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - cuGetProcAddress('cuMemcpy3D', &__cuMemcpy3D_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetAttribute' in found_functions}} + global __cuDeviceGetAttribute + _F_cuGetProcAddress_v2('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - cuGetProcAddress('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} + global __cuDeviceGetNvSciSyncAttributes + _F_cuGetProcAddress_v2('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - cuGetProcAddress('cuMemcpyAsync', &__cuMemcpyAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceSetMemPool' in found_functions}} + global __cuDeviceSetMemPool + _F_cuGetProcAddress_v2('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - cuGetProcAddress('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetMemPool' in found_functions}} + global __cuDeviceGetMemPool + _F_cuGetProcAddress_v2('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - cuGetProcAddress('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetDefaultMemPool' in found_functions}} + global __cuDeviceGetDefaultMemPool + _F_cuGetProcAddress_v2('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - cuGetProcAddress('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} + global __cuDeviceGetExecAffinitySupport + _F_cuGetProcAddress_v2('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - cuGetProcAddress('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} + global __cuFlushGPUDirectRDMAWrites + _F_cuGetProcAddress_v2('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - cuGetProcAddress('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceGetProperties' in found_functions}} + global __cuDeviceGetProperties + _F_cuGetProcAddress_v2('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - cuGetProcAddress('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDeviceComputeCapability' in found_functions}} + global __cuDeviceComputeCapability + _F_cuGetProcAddress_v2('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - cuGetProcAddress('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxRetain' in found_functions}} + global __cuDevicePrimaryCtxRetain + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - cuGetProcAddress('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} + global __cuDevicePrimaryCtxRelease_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - cuGetProcAddress('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} + global __cuDevicePrimaryCtxSetFlags_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - cuGetProcAddress('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxGetState' in found_functions}} + global __cuDevicePrimaryCtxGetState + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - cuGetProcAddress('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} + global __cuDevicePrimaryCtxReset_v2 + _F_cuGetProcAddress_v2('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - cuGetProcAddress('cuMemsetD8', &__cuMemsetD8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxCreate_v2' in found_functions}} + global __cuCtxCreate_v2 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - cuGetProcAddress('cuMemsetD16', &__cuMemsetD16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxCreate_v3' in found_functions}} + global __cuCtxCreate_v3 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v3, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - cuGetProcAddress('cuMemsetD32', &__cuMemsetD32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxCreate_v4' in found_functions}} + global __cuCtxCreate_v4 + _F_cuGetProcAddress_v2('cuCtxCreate', &__cuCtxCreate_v4, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - cuGetProcAddress('cuMemsetD2D8', &__cuMemsetD2D8_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxDestroy_v2' in found_functions}} + global __cuCtxDestroy_v2 + _F_cuGetProcAddress_v2('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - cuGetProcAddress('cuMemsetD2D16', &__cuMemsetD2D16_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxPushCurrent_v2' in found_functions}} + global __cuCtxPushCurrent_v2 + _F_cuGetProcAddress_v2('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - cuGetProcAddress('cuMemsetD2D32', &__cuMemsetD2D32_v2, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxPopCurrent_v2' in found_functions}} + global __cuCtxPopCurrent_v2 + _F_cuGetProcAddress_v2('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - cuGetProcAddress('cuMemsetD8Async', &__cuMemsetD8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetCurrent' in found_functions}} + global __cuCtxSetCurrent + _F_cuGetProcAddress_v2('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - cuGetProcAddress('cuMemsetD16Async', &__cuMemsetD16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetCurrent' in found_functions}} + global __cuCtxGetCurrent + _F_cuGetProcAddress_v2('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - cuGetProcAddress('cuMemsetD32Async', &__cuMemsetD32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetDevice' in found_functions}} + global __cuCtxGetDevice + _F_cuGetProcAddress_v2('cuCtxGetDevice', &__cuCtxGetDevice, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - cuGetProcAddress('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetFlags' in found_functions}} + global __cuCtxGetFlags + _F_cuGetProcAddress_v2('cuCtxGetFlags', &__cuCtxGetFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - cuGetProcAddress('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetFlags' in found_functions}} + global __cuCtxSetFlags + _F_cuGetProcAddress_v2('cuCtxSetFlags', &__cuCtxSetFlags, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - cuGetProcAddress('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetId' in found_functions}} + global __cuCtxGetId + _F_cuGetProcAddress_v2('cuCtxGetId', &__cuCtxGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - cuGetProcAddress('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSynchronize' in found_functions}} + global __cuCtxSynchronize + _F_cuGetProcAddress_v2('cuCtxSynchronize', &__cuCtxSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - cuGetProcAddress('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetLimit' in found_functions}} + global __cuCtxSetLimit + _F_cuGetProcAddress_v2('cuCtxSetLimit', &__cuCtxSetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - cuGetProcAddress('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetLimit' in found_functions}} + global __cuCtxGetLimit + _F_cuGetProcAddress_v2('cuCtxGetLimit', &__cuCtxGetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - cuGetProcAddress('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetCacheConfig' in found_functions}} + global __cuCtxGetCacheConfig + _F_cuGetProcAddress_v2('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - cuGetProcAddress('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetCacheConfig' in found_functions}} + global __cuCtxSetCacheConfig + _F_cuGetProcAddress_v2('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetApiVersion' in found_functions}} + global __cuCtxGetApiVersion + _F_cuGetProcAddress_v2('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetStreamPriorityRange' in found_functions}} + global __cuCtxGetStreamPriorityRange + _F_cuGetProcAddress_v2('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - cuGetProcAddress('cuStreamGetPriority', &__cuStreamGetPriority, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxResetPersistingL2Cache' in found_functions}} + global __cuCtxResetPersistingL2Cache + _F_cuGetProcAddress_v2('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - cuGetProcAddress('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetExecAffinity' in found_functions}} + global __cuCtxGetExecAffinity + _F_cuGetProcAddress_v2('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - cuGetProcAddress('cuStreamGetFlags', &__cuStreamGetFlags, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxRecordEvent' in found_functions}} + global __cuCtxRecordEvent + _F_cuGetProcAddress_v2('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - cuGetProcAddress('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxWaitEvent' in found_functions}} + global __cuCtxWaitEvent + _F_cuGetProcAddress_v2('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - cuGetProcAddress('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxAttach' in found_functions}} + global __cuCtxAttach + _F_cuGetProcAddress_v2('cuCtxAttach', &__cuCtxAttach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - cuGetProcAddress('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxDetach' in found_functions}} + global __cuCtxDetach + _F_cuGetProcAddress_v2('cuCtxDetach', &__cuCtxDetach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - cuGetProcAddress('cuStreamWaitEvent', &__cuStreamWaitEvent, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxGetSharedMemConfig' in found_functions}} + global __cuCtxGetSharedMemConfig + _F_cuGetProcAddress_v2('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - cuGetProcAddress('cuStreamAddCallback', &__cuStreamAddCallback, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuCtxSetSharedMemConfig' in found_functions}} + global __cuCtxSetSharedMemConfig + _F_cuGetProcAddress_v2('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - cuGetProcAddress('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleLoad' in found_functions}} + global __cuModuleLoad + _F_cuGetProcAddress_v2('cuModuleLoad', &__cuModuleLoad, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - cuGetProcAddress('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleLoadData' in found_functions}} + global __cuModuleLoadData + _F_cuGetProcAddress_v2('cuModuleLoadData', &__cuModuleLoadData, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - cuGetProcAddress('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleLoadDataEx' in found_functions}} + global __cuModuleLoadDataEx + _F_cuGetProcAddress_v2('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - cuGetProcAddress('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleLoadFatBinary' in found_functions}} + global __cuModuleLoadFatBinary + _F_cuGetProcAddress_v2('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleUnload' in found_functions}} + global __cuModuleUnload + _F_cuGetProcAddress_v2('cuModuleUnload', &__cuModuleUnload, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetLoadingMode' in found_functions}} + global __cuModuleGetLoadingMode + _F_cuGetProcAddress_v2('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetFunction' in found_functions}} + global __cuModuleGetFunction + _F_cuGetProcAddress_v2('cuModuleGetFunction', &__cuModuleGetFunction, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetFunctionCount' in found_functions}} + global __cuModuleGetFunctionCount + _F_cuGetProcAddress_v2('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - cuGetProcAddress('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleEnumerateFunctions' in found_functions}} + global __cuModuleEnumerateFunctions + _F_cuGetProcAddress_v2('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - cuGetProcAddress('cuStreamQuery', &__cuStreamQuery, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetGlobal_v2' in found_functions}} + global __cuModuleGetGlobal_v2 + _F_cuGetProcAddress_v2('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - cuGetProcAddress('cuStreamSynchronize', &__cuStreamSynchronize, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkCreate_v2' in found_functions}} + global __cuLinkCreate_v2 + _F_cuGetProcAddress_v2('cuLinkCreate', &__cuLinkCreate_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - cuGetProcAddress('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkAddData_v2' in found_functions}} + global __cuLinkAddData_v2 + _F_cuGetProcAddress_v2('cuLinkAddData', &__cuLinkAddData_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - cuGetProcAddress('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkAddFile_v2' in found_functions}} + global __cuLinkAddFile_v2 + _F_cuGetProcAddress_v2('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - cuGetProcAddress('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkComplete' in found_functions}} + global __cuLinkComplete + _F_cuGetProcAddress_v2('cuLinkComplete', &__cuLinkComplete, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - cuGetProcAddress('cuEventRecord', &__cuEventRecord, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLinkDestroy' in found_functions}} + global __cuLinkDestroy + _F_cuGetProcAddress_v2('cuLinkDestroy', &__cuLinkDestroy, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - cuGetProcAddress('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetTexRef' in found_functions}} + global __cuModuleGetTexRef + _F_cuGetProcAddress_v2('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - cuGetProcAddress('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuModuleGetSurfRef' in found_functions}} + global __cuModuleGetSurfRef + _F_cuGetProcAddress_v2('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - cuGetProcAddress('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryLoadData' in found_functions}} + global __cuLibraryLoadData + _F_cuGetProcAddress_v2('cuLibraryLoadData', &__cuLibraryLoadData, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - cuGetProcAddress('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryLoadFromFile' in found_functions}} + global __cuLibraryLoadFromFile + _F_cuGetProcAddress_v2('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - cuGetProcAddress('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryUnload' in found_functions}} + global __cuLibraryUnload + _F_cuGetProcAddress_v2('cuLibraryUnload', &__cuLibraryUnload, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - cuGetProcAddress('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetKernel' in found_functions}} + global __cuLibraryGetKernel + _F_cuGetProcAddress_v2('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - cuGetProcAddress('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetKernelCount' in found_functions}} + global __cuLibraryGetKernelCount + _F_cuGetProcAddress_v2('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - cuGetProcAddress('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryEnumerateKernels' in found_functions}} + global __cuLibraryEnumerateKernels + _F_cuGetProcAddress_v2('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - cuGetProcAddress('cuLaunchKernel', &__cuLaunchKernel, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetModule' in found_functions}} + global __cuLibraryGetModule + _F_cuGetProcAddress_v2('cuLibraryGetModule', &__cuLibraryGetModule, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - cuGetProcAddress('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelGetFunction' in found_functions}} + global __cuKernelGetFunction + _F_cuGetProcAddress_v2('cuKernelGetFunction', &__cuKernelGetFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - cuGetProcAddress('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelGetLibrary' in found_functions}} + global __cuKernelGetLibrary + _F_cuGetProcAddress_v2('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - cuGetProcAddress('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetGlobal' in found_functions}} + global __cuLibraryGetGlobal + _F_cuGetProcAddress_v2('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - cuGetProcAddress('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetManaged' in found_functions}} + global __cuLibraryGetManaged + _F_cuGetProcAddress_v2('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - cuGetProcAddress('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuLibraryGetUnifiedFunction' in found_functions}} + global __cuLibraryGetUnifiedFunction + _F_cuGetProcAddress_v2('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - cuGetProcAddress('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelGetAttribute' in found_functions}} + global __cuKernelGetAttribute + _F_cuGetProcAddress_v2('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - cuGetProcAddress('cuGraphicsMapResources', &__cuGraphicsMapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelSetAttribute' in found_functions}} + global __cuKernelSetAttribute + _F_cuGetProcAddress_v2('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - cuGetProcAddress('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 7000, CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM, NULL) + {{if 'cuKernelSetCacheConfig' in found_functions}} + global __cuKernelSetCacheConfig + _F_cuGetProcAddress_v2('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - else: - # Else get the regular version - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - cuGetProcAddress('cuMemcpy', &__cuMemcpy, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuKernelGetName' in found_functions}} + global __cuKernelGetName + _F_cuGetProcAddress_v2('cuKernelGetName', &__cuKernelGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - cuGetProcAddress('cuMemcpyPeer', &__cuMemcpyPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuKernelGetParamInfo' in found_functions}} + global __cuKernelGetParamInfo + _F_cuGetProcAddress_v2('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - cuGetProcAddress('cuMemcpyHtoD', &__cuMemcpyHtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetInfo_v2' in found_functions}} + global __cuMemGetInfo_v2 + _F_cuGetProcAddress_v2('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - cuGetProcAddress('cuMemcpyDtoH', &__cuMemcpyDtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAlloc_v2' in found_functions}} + global __cuMemAlloc_v2 + _F_cuGetProcAddress_v2('cuMemAlloc', &__cuMemAlloc_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - cuGetProcAddress('cuMemcpyDtoD', &__cuMemcpyDtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAllocPitch_v2' in found_functions}} + global __cuMemAllocPitch_v2 + _F_cuGetProcAddress_v2('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - cuGetProcAddress('cuMemcpyDtoA', &__cuMemcpyDtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemFree_v2' in found_functions}} + global __cuMemFree_v2 + _F_cuGetProcAddress_v2('cuMemFree', &__cuMemFree_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - cuGetProcAddress('cuMemcpyAtoD', &__cuMemcpyAtoD_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetAddressRange_v2' in found_functions}} + global __cuMemGetAddressRange_v2 + _F_cuGetProcAddress_v2('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - cuGetProcAddress('cuMemcpyHtoA', &__cuMemcpyHtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAllocHost_v2' in found_functions}} + global __cuMemAllocHost_v2 + _F_cuGetProcAddress_v2('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - cuGetProcAddress('cuMemcpyAtoH', &__cuMemcpyAtoH_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemFreeHost' in found_functions}} + global __cuMemFreeHost + _F_cuGetProcAddress_v2('cuMemFreeHost', &__cuMemFreeHost, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - cuGetProcAddress('cuMemcpyAtoA', &__cuMemcpyAtoA_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostAlloc' in found_functions}} + global __cuMemHostAlloc + _F_cuGetProcAddress_v2('cuMemHostAlloc', &__cuMemHostAlloc, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - cuGetProcAddress('cuMemcpy2D', &__cuMemcpy2D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} + global __cuMemHostGetDevicePointer_v2 + _F_cuGetProcAddress_v2('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - cuGetProcAddress('cuMemcpy2DUnaligned', &__cuMemcpy2DUnaligned_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostGetFlags' in found_functions}} + global __cuMemHostGetFlags + _F_cuGetProcAddress_v2('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - cuGetProcAddress('cuMemcpy3D', &__cuMemcpy3D_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAllocManaged' in found_functions}} + global __cuMemAllocManaged + _F_cuGetProcAddress_v2('cuMemAllocManaged', &__cuMemAllocManaged, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - cuGetProcAddress('cuMemcpy3DPeer', &__cuMemcpy3DPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} + global __cuDeviceRegisterAsyncNotification + _F_cuGetProcAddress_v2('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - cuGetProcAddress('cuMemcpyAsync', &__cuMemcpyAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} + global __cuDeviceUnregisterAsyncNotification + _F_cuGetProcAddress_v2('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - cuGetProcAddress('cuMemcpyPeerAsync', &__cuMemcpyPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuDeviceGetByPCIBusId' in found_functions}} + global __cuDeviceGetByPCIBusId + _F_cuGetProcAddress_v2('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - cuGetProcAddress('cuMemcpyHtoDAsync', &__cuMemcpyHtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuDeviceGetPCIBusId' in found_functions}} + global __cuDeviceGetPCIBusId + _F_cuGetProcAddress_v2('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - cuGetProcAddress('cuMemcpyDtoHAsync', &__cuMemcpyDtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcGetEventHandle' in found_functions}} + global __cuIpcGetEventHandle + _F_cuGetProcAddress_v2('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - cuGetProcAddress('cuMemcpyDtoDAsync', &__cuMemcpyDtoDAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcOpenEventHandle' in found_functions}} + global __cuIpcOpenEventHandle + _F_cuGetProcAddress_v2('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - cuGetProcAddress('cuMemcpyHtoAAsync', &__cuMemcpyHtoAAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcGetMemHandle' in found_functions}} + global __cuIpcGetMemHandle + _F_cuGetProcAddress_v2('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - cuGetProcAddress('cuMemcpyAtoHAsync', &__cuMemcpyAtoHAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcOpenMemHandle_v2' in found_functions}} + global __cuIpcOpenMemHandle_v2 + _F_cuGetProcAddress_v2('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - cuGetProcAddress('cuMemcpy2DAsync', &__cuMemcpy2DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuIpcCloseMemHandle' in found_functions}} + global __cuIpcCloseMemHandle + _F_cuGetProcAddress_v2('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - cuGetProcAddress('cuMemcpy3DAsync', &__cuMemcpy3DAsync_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostRegister_v2' in found_functions}} + global __cuMemHostRegister_v2 + _F_cuGetProcAddress_v2('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - cuGetProcAddress('cuMemcpy3DPeerAsync', &__cuMemcpy3DPeerAsync, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemHostUnregister' in found_functions}} + global __cuMemHostUnregister + _F_cuGetProcAddress_v2('cuMemHostUnregister', &__cuMemHostUnregister, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - cuGetProcAddress('cuMemcpyBatchAsync', &__cuMemcpyBatchAsync, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayCreate_v2' in found_functions}} + global __cuArrayCreate_v2 + _F_cuGetProcAddress_v2('cuArrayCreate', &__cuArrayCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - cuGetProcAddress('cuMemcpy3DBatchAsync', &__cuMemcpy3DBatchAsync, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayGetDescriptor_v2' in found_functions}} + global __cuArrayGetDescriptor_v2 + _F_cuGetProcAddress_v2('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - cuGetProcAddress('cuMemsetD8', &__cuMemsetD8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayGetSparseProperties' in found_functions}} + global __cuArrayGetSparseProperties + _F_cuGetProcAddress_v2('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - cuGetProcAddress('cuMemsetD16', &__cuMemsetD16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} + global __cuMipmappedArrayGetSparseProperties + _F_cuGetProcAddress_v2('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - cuGetProcAddress('cuMemsetD32', &__cuMemsetD32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayGetMemoryRequirements' in found_functions}} + global __cuArrayGetMemoryRequirements + _F_cuGetProcAddress_v2('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - cuGetProcAddress('cuMemsetD2D8', &__cuMemsetD2D8_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} + global __cuMipmappedArrayGetMemoryRequirements + _F_cuGetProcAddress_v2('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - cuGetProcAddress('cuMemsetD2D16', &__cuMemsetD2D16_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayGetPlane' in found_functions}} + global __cuArrayGetPlane + _F_cuGetProcAddress_v2('cuArrayGetPlane', &__cuArrayGetPlane, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - cuGetProcAddress('cuMemsetD2D32', &__cuMemsetD2D32_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArrayDestroy' in found_functions}} + global __cuArrayDestroy + _F_cuGetProcAddress_v2('cuArrayDestroy', &__cuArrayDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - cuGetProcAddress('cuMemsetD8Async', &__cuMemsetD8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArray3DCreate_v2' in found_functions}} + global __cuArray3DCreate_v2 + _F_cuGetProcAddress_v2('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - cuGetProcAddress('cuMemsetD16Async', &__cuMemsetD16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuArray3DGetDescriptor_v2' in found_functions}} + global __cuArray3DGetDescriptor_v2 + _F_cuGetProcAddress_v2('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - cuGetProcAddress('cuMemsetD32Async', &__cuMemsetD32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayCreate' in found_functions}} + global __cuMipmappedArrayCreate + _F_cuGetProcAddress_v2('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - cuGetProcAddress('cuMemsetD2D8Async', &__cuMemsetD2D8Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayGetLevel' in found_functions}} + global __cuMipmappedArrayGetLevel + _F_cuGetProcAddress_v2('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - cuGetProcAddress('cuMemsetD2D16Async', &__cuMemsetD2D16Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMipmappedArrayDestroy' in found_functions}} + global __cuMipmappedArrayDestroy + _F_cuGetProcAddress_v2('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - cuGetProcAddress('cuMemsetD2D32Async', &__cuMemsetD2D32Async, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetHandleForAddressRange' in found_functions}} + global __cuMemGetHandleForAddressRange + _F_cuGetProcAddress_v2('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - cuGetProcAddress('cuMemBatchDecompressAsync', &__cuMemBatchDecompressAsync, 12060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAddressReserve' in found_functions}} + global __cuMemAddressReserve + _F_cuGetProcAddress_v2('cuMemAddressReserve', &__cuMemAddressReserve, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - cuGetProcAddress('cuMemMapArrayAsync', &__cuMemMapArrayAsync, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAddressFree' in found_functions}} + global __cuMemAddressFree + _F_cuGetProcAddress_v2('cuMemAddressFree', &__cuMemAddressFree, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - cuGetProcAddress('cuMemFreeAsync', &__cuMemFreeAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemCreate' in found_functions}} + global __cuMemCreate + _F_cuGetProcAddress_v2('cuMemCreate', &__cuMemCreate, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - cuGetProcAddress('cuMemAllocAsync', &__cuMemAllocAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemRelease' in found_functions}} + global __cuMemRelease + _F_cuGetProcAddress_v2('cuMemRelease', &__cuMemRelease, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - cuGetProcAddress('cuMemAllocFromPoolAsync', &__cuMemAllocFromPoolAsync, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemMap' in found_functions}} + global __cuMemMap + _F_cuGetProcAddress_v2('cuMemMap', &__cuMemMap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemUnmap' in found_functions}} + global __cuMemUnmap + _F_cuGetProcAddress_v2('cuMemUnmap', &__cuMemUnmap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - cuGetProcAddress('cuMemPrefetchAsync', &__cuMemPrefetchAsync_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemSetAccess' in found_functions}} + global __cuMemSetAccess + _F_cuGetProcAddress_v2('cuMemSetAccess', &__cuMemSetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - cuGetProcAddress('cuStreamGetPriority', &__cuStreamGetPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetAccess' in found_functions}} + global __cuMemGetAccess + _F_cuGetProcAddress_v2('cuMemGetAccess', &__cuMemGetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - cuGetProcAddress('cuStreamGetDevice', &__cuStreamGetDevice, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemExportToShareableHandle' in found_functions}} + global __cuMemExportToShareableHandle + _F_cuGetProcAddress_v2('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - cuGetProcAddress('cuStreamGetFlags', &__cuStreamGetFlags, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemImportFromShareableHandle' in found_functions}} + global __cuMemImportFromShareableHandle + _F_cuGetProcAddress_v2('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - cuGetProcAddress('cuStreamGetId', &__cuStreamGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetAllocationGranularity' in found_functions}} + global __cuMemGetAllocationGranularity + _F_cuGetProcAddress_v2('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - cuGetProcAddress('cuStreamGetCtx', &__cuStreamGetCtx, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} + global __cuMemGetAllocationPropertiesFromHandle + _F_cuGetProcAddress_v2('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - cuGetProcAddress('cuStreamGetCtx', &__cuStreamGetCtx_v2, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemRetainAllocationHandle' in found_functions}} + global __cuMemRetainAllocationHandle + _F_cuGetProcAddress_v2('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - cuGetProcAddress('cuStreamWaitEvent', &__cuStreamWaitEvent, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolTrimTo' in found_functions}} + global __cuMemPoolTrimTo + _F_cuGetProcAddress_v2('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - cuGetProcAddress('cuStreamAddCallback', &__cuStreamAddCallback, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolSetAttribute' in found_functions}} + global __cuMemPoolSetAttribute + _F_cuGetProcAddress_v2('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - cuGetProcAddress('cuStreamBeginCapture', &__cuStreamBeginCapture_v2, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolGetAttribute' in found_functions}} + global __cuMemPoolGetAttribute + _F_cuGetProcAddress_v2('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - cuGetProcAddress('cuStreamBeginCaptureToGraph', &__cuStreamBeginCaptureToGraph, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolSetAccess' in found_functions}} + global __cuMemPoolSetAccess + _F_cuGetProcAddress_v2('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - cuGetProcAddress('cuStreamEndCapture', &__cuStreamEndCapture, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolGetAccess' in found_functions}} + global __cuMemPoolGetAccess + _F_cuGetProcAddress_v2('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - cuGetProcAddress('cuStreamIsCapturing', &__cuStreamIsCapturing, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolCreate' in found_functions}} + global __cuMemPoolCreate + _F_cuGetProcAddress_v2('cuMemPoolCreate', &__cuMemPoolCreate, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v2, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolDestroy' in found_functions}} + global __cuMemPoolDestroy + _F_cuGetProcAddress_v2('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - cuGetProcAddress('cuStreamGetCaptureInfo', &__cuStreamGetCaptureInfo_v3, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolExportToShareableHandle' in found_functions}} + global __cuMemPoolExportToShareableHandle + _F_cuGetProcAddress_v2('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} + global __cuMemPoolImportFromShareableHandle + _F_cuGetProcAddress_v2('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - cuGetProcAddress('cuStreamUpdateCaptureDependencies', &__cuStreamUpdateCaptureDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolExportPointer' in found_functions}} + global __cuMemPoolExportPointer + _F_cuGetProcAddress_v2('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - cuGetProcAddress('cuStreamAttachMemAsync', &__cuStreamAttachMemAsync, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemPoolImportPointer' in found_functions}} + global __cuMemPoolImportPointer + _F_cuGetProcAddress_v2('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - cuGetProcAddress('cuStreamQuery', &__cuStreamQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastCreate' in found_functions}} + global __cuMulticastCreate + _F_cuGetProcAddress_v2('cuMulticastCreate', &__cuMulticastCreate, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - cuGetProcAddress('cuStreamSynchronize', &__cuStreamSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastAddDevice' in found_functions}} + global __cuMulticastAddDevice + _F_cuGetProcAddress_v2('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - cuGetProcAddress('cuStreamCopyAttributes', &__cuStreamCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastBindMem' in found_functions}} + global __cuMulticastBindMem + _F_cuGetProcAddress_v2('cuMulticastBindMem', &__cuMulticastBindMem, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - cuGetProcAddress('cuStreamGetAttribute', &__cuStreamGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastBindAddr' in found_functions}} + global __cuMulticastBindAddr + _F_cuGetProcAddress_v2('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - cuGetProcAddress('cuStreamSetAttribute', &__cuStreamSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastUnbind' in found_functions}} + global __cuMulticastUnbind + _F_cuGetProcAddress_v2('cuMulticastUnbind', &__cuMulticastUnbind, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - cuGetProcAddress('cuEventRecord', &__cuEventRecord, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMulticastGetGranularity' in found_functions}} + global __cuMulticastGetGranularity + _F_cuGetProcAddress_v2('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - cuGetProcAddress('cuEventRecordWithFlags', &__cuEventRecordWithFlags, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuPointerGetAttribute' in found_functions}} + global __cuPointerGetAttribute + _F_cuGetProcAddress_v2('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - cuGetProcAddress('cuSignalExternalSemaphoresAsync', &__cuSignalExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAdvise' in found_functions}} + global __cuMemAdvise + _F_cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - cuGetProcAddress('cuWaitExternalSemaphoresAsync', &__cuWaitExternalSemaphoresAsync, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemAdvise_v2' in found_functions}} + global __cuMemAdvise_v2 + _F_cuGetProcAddress_v2('cuMemAdvise', &__cuMemAdvise_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - cuGetProcAddress('cuStreamWaitValue32', &__cuStreamWaitValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemRangeGetAttribute' in found_functions}} + global __cuMemRangeGetAttribute + _F_cuGetProcAddress_v2('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - cuGetProcAddress('cuStreamWaitValue64', &__cuStreamWaitValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuMemRangeGetAttributes' in found_functions}} + global __cuMemRangeGetAttributes + _F_cuGetProcAddress_v2('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - cuGetProcAddress('cuStreamWriteValue32', &__cuStreamWriteValue32_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuPointerSetAttribute' in found_functions}} + global __cuPointerSetAttribute + _F_cuGetProcAddress_v2('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - cuGetProcAddress('cuStreamWriteValue64', &__cuStreamWriteValue64_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuPointerGetAttributes' in found_functions}} + global __cuPointerGetAttributes + _F_cuGetProcAddress_v2('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - cuGetProcAddress('cuStreamBatchMemOp', &__cuStreamBatchMemOp_v2, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuStreamCreate' in found_functions}} + global __cuStreamCreate + _F_cuGetProcAddress_v2('cuStreamCreate', &__cuStreamCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - cuGetProcAddress('cuLaunchKernel', &__cuLaunchKernel, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuStreamCreateWithPriority' in found_functions}} + global __cuStreamCreateWithPriority + _F_cuGetProcAddress_v2('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - cuGetProcAddress('cuLaunchKernelEx', &__cuLaunchKernelEx, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} + global __cuThreadExchangeStreamCaptureMode + _F_cuGetProcAddress_v2('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - cuGetProcAddress('cuLaunchCooperativeKernel', &__cuLaunchCooperativeKernel, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuStreamDestroy_v2' in found_functions}} + global __cuStreamDestroy_v2 + _F_cuGetProcAddress_v2('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - cuGetProcAddress('cuLaunchHostFunc', &__cuLaunchHostFunc, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventCreate' in found_functions}} + global __cuEventCreate + _F_cuGetProcAddress_v2('cuEventCreate', &__cuEventCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - cuGetProcAddress('cuGraphInstantiateWithParams', &__cuGraphInstantiateWithParams, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventQuery' in found_functions}} + global __cuEventQuery + _F_cuGetProcAddress_v2('cuEventQuery', &__cuEventQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - cuGetProcAddress('cuGraphUpload', &__cuGraphUpload, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventSynchronize' in found_functions}} + global __cuEventSynchronize + _F_cuGetProcAddress_v2('cuEventSynchronize', &__cuEventSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - cuGetProcAddress('cuGraphLaunch', &__cuGraphLaunch, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventDestroy_v2' in found_functions}} + global __cuEventDestroy_v2 + _F_cuGetProcAddress_v2('cuEventDestroy', &__cuEventDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - cuGetProcAddress('cuGraphicsMapResources', &__cuGraphicsMapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventElapsedTime' in found_functions}} + global __cuEventElapsedTime + _F_cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - cuGetProcAddress('cuGraphicsUnmapResources', &__cuGraphicsUnmapResources, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{if 'cuEventElapsedTime_v2' in found_functions}} + global __cuEventElapsedTime_v2 + _F_cuGetProcAddress_v2('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) {{endif}} - # Get remaining functions - {{if 'cuGetErrorString' in found_functions}} - global __cuGetErrorString - cuGetProcAddress('cuGetErrorString', &__cuGetErrorString, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGetErrorName' in found_functions}} - global __cuGetErrorName - cuGetProcAddress('cuGetErrorName', &__cuGetErrorName, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuInit' in found_functions}} - global __cuInit - cuGetProcAddress('cuInit', &__cuInit, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDriverGetVersion' in found_functions}} - global __cuDriverGetVersion - cuGetProcAddress('cuDriverGetVersion', &__cuDriverGetVersion, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGet' in found_functions}} - global __cuDeviceGet - cuGetProcAddress('cuDeviceGet', &__cuDeviceGet, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetCount' in found_functions}} - global __cuDeviceGetCount - cuGetProcAddress('cuDeviceGetCount', &__cuDeviceGetCount, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetName' in found_functions}} - global __cuDeviceGetName - cuGetProcAddress('cuDeviceGetName', &__cuDeviceGetName, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetUuid' in found_functions}} - global __cuDeviceGetUuid - cuGetProcAddress('cuDeviceGetUuid', &__cuDeviceGetUuid, 9020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} - global __cuDeviceGetUuid_v2 - cuGetProcAddress('cuDeviceGetUuid', &__cuDeviceGetUuid_v2, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetLuid' in found_functions}} - global __cuDeviceGetLuid - cuGetProcAddress('cuDeviceGetLuid', &__cuDeviceGetLuid, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceTotalMem_v2' in found_functions}} - global __cuDeviceTotalMem_v2 - cuGetProcAddress('cuDeviceTotalMem', &__cuDeviceTotalMem_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - global __cuDeviceGetTexture1DLinearMaxWidth - cuGetProcAddress('cuDeviceGetTexture1DLinearMaxWidth', &__cuDeviceGetTexture1DLinearMaxWidth, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetAttribute' in found_functions}} - global __cuDeviceGetAttribute - cuGetProcAddress('cuDeviceGetAttribute', &__cuDeviceGetAttribute, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - global __cuDeviceGetNvSciSyncAttributes - cuGetProcAddress('cuDeviceGetNvSciSyncAttributes', &__cuDeviceGetNvSciSyncAttributes, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceSetMemPool' in found_functions}} - global __cuDeviceSetMemPool - cuGetProcAddress('cuDeviceSetMemPool', &__cuDeviceSetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetMemPool' in found_functions}} - global __cuDeviceGetMemPool - cuGetProcAddress('cuDeviceGetMemPool', &__cuDeviceGetMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - global __cuDeviceGetDefaultMemPool - cuGetProcAddress('cuDeviceGetDefaultMemPool', &__cuDeviceGetDefaultMemPool, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - global __cuDeviceGetExecAffinitySupport - cuGetProcAddress('cuDeviceGetExecAffinitySupport', &__cuDeviceGetExecAffinitySupport, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - global __cuFlushGPUDirectRDMAWrites - cuGetProcAddress('cuFlushGPUDirectRDMAWrites', &__cuFlushGPUDirectRDMAWrites, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetProperties' in found_functions}} - global __cuDeviceGetProperties - cuGetProcAddress('cuDeviceGetProperties', &__cuDeviceGetProperties, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceComputeCapability' in found_functions}} - global __cuDeviceComputeCapability - cuGetProcAddress('cuDeviceComputeCapability', &__cuDeviceComputeCapability, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - global __cuDevicePrimaryCtxRetain - cuGetProcAddress('cuDevicePrimaryCtxRetain', &__cuDevicePrimaryCtxRetain, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - global __cuDevicePrimaryCtxRelease_v2 - cuGetProcAddress('cuDevicePrimaryCtxRelease', &__cuDevicePrimaryCtxRelease_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - global __cuDevicePrimaryCtxSetFlags_v2 - cuGetProcAddress('cuDevicePrimaryCtxSetFlags', &__cuDevicePrimaryCtxSetFlags_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - global __cuDevicePrimaryCtxGetState - cuGetProcAddress('cuDevicePrimaryCtxGetState', &__cuDevicePrimaryCtxGetState, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - global __cuDevicePrimaryCtxReset_v2 - cuGetProcAddress('cuDevicePrimaryCtxReset', &__cuDevicePrimaryCtxReset_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxCreate_v2' in found_functions}} - global __cuCtxCreate_v2 - cuGetProcAddress('cuCtxCreate', &__cuCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxCreate_v3' in found_functions}} - global __cuCtxCreate_v3 - cuGetProcAddress('cuCtxCreate', &__cuCtxCreate_v3, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} - global __cuCtxCreate_v4 - cuGetProcAddress('cuCtxCreate', &__cuCtxCreate_v4, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxDestroy_v2' in found_functions}} - global __cuCtxDestroy_v2 - cuGetProcAddress('cuCtxDestroy', &__cuCtxDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxPushCurrent_v2' in found_functions}} - global __cuCtxPushCurrent_v2 - cuGetProcAddress('cuCtxPushCurrent', &__cuCtxPushCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxPopCurrent_v2' in found_functions}} - global __cuCtxPopCurrent_v2 - cuGetProcAddress('cuCtxPopCurrent', &__cuCtxPopCurrent_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetCurrent' in found_functions}} - global __cuCtxSetCurrent - cuGetProcAddress('cuCtxSetCurrent', &__cuCtxSetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetCurrent' in found_functions}} - global __cuCtxGetCurrent - cuGetProcAddress('cuCtxGetCurrent', &__cuCtxGetCurrent, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetDevice' in found_functions}} - global __cuCtxGetDevice - cuGetProcAddress('cuCtxGetDevice', &__cuCtxGetDevice, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetFlags' in found_functions}} - global __cuCtxGetFlags - cuGetProcAddress('cuCtxGetFlags', &__cuCtxGetFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetFlags' in found_functions}} - global __cuCtxSetFlags - cuGetProcAddress('cuCtxSetFlags', &__cuCtxSetFlags, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetId' in found_functions}} - global __cuCtxGetId - cuGetProcAddress('cuCtxGetId', &__cuCtxGetId, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSynchronize' in found_functions}} - global __cuCtxSynchronize - cuGetProcAddress('cuCtxSynchronize', &__cuCtxSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetLimit' in found_functions}} - global __cuCtxSetLimit - cuGetProcAddress('cuCtxSetLimit', &__cuCtxSetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetLimit' in found_functions}} - global __cuCtxGetLimit - cuGetProcAddress('cuCtxGetLimit', &__cuCtxGetLimit, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetCacheConfig' in found_functions}} - global __cuCtxGetCacheConfig - cuGetProcAddress('cuCtxGetCacheConfig', &__cuCtxGetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetCacheConfig' in found_functions}} - global __cuCtxSetCacheConfig - cuGetProcAddress('cuCtxSetCacheConfig', &__cuCtxSetCacheConfig, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetApiVersion' in found_functions}} - global __cuCtxGetApiVersion - cuGetProcAddress('cuCtxGetApiVersion', &__cuCtxGetApiVersion, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - global __cuCtxGetStreamPriorityRange - cuGetProcAddress('cuCtxGetStreamPriorityRange', &__cuCtxGetStreamPriorityRange, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - global __cuCtxResetPersistingL2Cache - cuGetProcAddress('cuCtxResetPersistingL2Cache', &__cuCtxResetPersistingL2Cache, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetExecAffinity' in found_functions}} - global __cuCtxGetExecAffinity - cuGetProcAddress('cuCtxGetExecAffinity', &__cuCtxGetExecAffinity, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxRecordEvent' in found_functions}} - global __cuCtxRecordEvent - cuGetProcAddress('cuCtxRecordEvent', &__cuCtxRecordEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxWaitEvent' in found_functions}} - global __cuCtxWaitEvent - cuGetProcAddress('cuCtxWaitEvent', &__cuCtxWaitEvent, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxAttach' in found_functions}} - global __cuCtxAttach - cuGetProcAddress('cuCtxAttach', &__cuCtxAttach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxDetach' in found_functions}} - global __cuCtxDetach - cuGetProcAddress('cuCtxDetach', &__cuCtxDetach, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - global __cuCtxGetSharedMemConfig - cuGetProcAddress('cuCtxGetSharedMemConfig', &__cuCtxGetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - global __cuCtxSetSharedMemConfig - cuGetProcAddress('cuCtxSetSharedMemConfig', &__cuCtxSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoad' in found_functions}} - global __cuModuleLoad - cuGetProcAddress('cuModuleLoad', &__cuModuleLoad, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadData' in found_functions}} - global __cuModuleLoadData - cuGetProcAddress('cuModuleLoadData', &__cuModuleLoadData, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadDataEx' in found_functions}} - global __cuModuleLoadDataEx - cuGetProcAddress('cuModuleLoadDataEx', &__cuModuleLoadDataEx, 2010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleLoadFatBinary' in found_functions}} - global __cuModuleLoadFatBinary - cuGetProcAddress('cuModuleLoadFatBinary', &__cuModuleLoadFatBinary, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleUnload' in found_functions}} - global __cuModuleUnload - cuGetProcAddress('cuModuleUnload', &__cuModuleUnload, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetLoadingMode' in found_functions}} - global __cuModuleGetLoadingMode - cuGetProcAddress('cuModuleGetLoadingMode', &__cuModuleGetLoadingMode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetFunction' in found_functions}} - global __cuModuleGetFunction - cuGetProcAddress('cuModuleGetFunction', &__cuModuleGetFunction, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetFunctionCount' in found_functions}} - global __cuModuleGetFunctionCount - cuGetProcAddress('cuModuleGetFunctionCount', &__cuModuleGetFunctionCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleEnumerateFunctions' in found_functions}} - global __cuModuleEnumerateFunctions - cuGetProcAddress('cuModuleEnumerateFunctions', &__cuModuleEnumerateFunctions, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetGlobal_v2' in found_functions}} - global __cuModuleGetGlobal_v2 - cuGetProcAddress('cuModuleGetGlobal', &__cuModuleGetGlobal_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkCreate_v2' in found_functions}} - global __cuLinkCreate_v2 - cuGetProcAddress('cuLinkCreate', &__cuLinkCreate_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkAddData_v2' in found_functions}} - global __cuLinkAddData_v2 - cuGetProcAddress('cuLinkAddData', &__cuLinkAddData_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkAddFile_v2' in found_functions}} - global __cuLinkAddFile_v2 - cuGetProcAddress('cuLinkAddFile', &__cuLinkAddFile_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkComplete' in found_functions}} - global __cuLinkComplete - cuGetProcAddress('cuLinkComplete', &__cuLinkComplete, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLinkDestroy' in found_functions}} - global __cuLinkDestroy - cuGetProcAddress('cuLinkDestroy', &__cuLinkDestroy, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetTexRef' in found_functions}} - global __cuModuleGetTexRef - cuGetProcAddress('cuModuleGetTexRef', &__cuModuleGetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuModuleGetSurfRef' in found_functions}} - global __cuModuleGetSurfRef - cuGetProcAddress('cuModuleGetSurfRef', &__cuModuleGetSurfRef, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryLoadData' in found_functions}} - global __cuLibraryLoadData - cuGetProcAddress('cuLibraryLoadData', &__cuLibraryLoadData, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryLoadFromFile' in found_functions}} - global __cuLibraryLoadFromFile - cuGetProcAddress('cuLibraryLoadFromFile', &__cuLibraryLoadFromFile, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryUnload' in found_functions}} - global __cuLibraryUnload - cuGetProcAddress('cuLibraryUnload', &__cuLibraryUnload, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetKernel' in found_functions}} - global __cuLibraryGetKernel - cuGetProcAddress('cuLibraryGetKernel', &__cuLibraryGetKernel, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetKernelCount' in found_functions}} - global __cuLibraryGetKernelCount - cuGetProcAddress('cuLibraryGetKernelCount', &__cuLibraryGetKernelCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryEnumerateKernels' in found_functions}} - global __cuLibraryEnumerateKernels - cuGetProcAddress('cuLibraryEnumerateKernels', &__cuLibraryEnumerateKernels, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetModule' in found_functions}} - global __cuLibraryGetModule - cuGetProcAddress('cuLibraryGetModule', &__cuLibraryGetModule, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetFunction' in found_functions}} - global __cuKernelGetFunction - cuGetProcAddress('cuKernelGetFunction', &__cuKernelGetFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetLibrary' in found_functions}} - global __cuKernelGetLibrary - cuGetProcAddress('cuKernelGetLibrary', &__cuKernelGetLibrary, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetGlobal' in found_functions}} - global __cuLibraryGetGlobal - cuGetProcAddress('cuLibraryGetGlobal', &__cuLibraryGetGlobal, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetManaged' in found_functions}} - global __cuLibraryGetManaged - cuGetProcAddress('cuLibraryGetManaged', &__cuLibraryGetManaged, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - global __cuLibraryGetUnifiedFunction - cuGetProcAddress('cuLibraryGetUnifiedFunction', &__cuLibraryGetUnifiedFunction, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetAttribute' in found_functions}} - global __cuKernelGetAttribute - cuGetProcAddress('cuKernelGetAttribute', &__cuKernelGetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelSetAttribute' in found_functions}} - global __cuKernelSetAttribute - cuGetProcAddress('cuKernelSetAttribute', &__cuKernelSetAttribute, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelSetCacheConfig' in found_functions}} - global __cuKernelSetCacheConfig - cuGetProcAddress('cuKernelSetCacheConfig', &__cuKernelSetCacheConfig, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetName' in found_functions}} - global __cuKernelGetName - cuGetProcAddress('cuKernelGetName', &__cuKernelGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuKernelGetParamInfo' in found_functions}} - global __cuKernelGetParamInfo - cuGetProcAddress('cuKernelGetParamInfo', &__cuKernelGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetInfo_v2' in found_functions}} - global __cuMemGetInfo_v2 - cuGetProcAddress('cuMemGetInfo', &__cuMemGetInfo_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAlloc_v2' in found_functions}} - global __cuMemAlloc_v2 - cuGetProcAddress('cuMemAlloc', &__cuMemAlloc_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocPitch_v2' in found_functions}} - global __cuMemAllocPitch_v2 - cuGetProcAddress('cuMemAllocPitch', &__cuMemAllocPitch_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemFree_v2' in found_functions}} - global __cuMemFree_v2 - cuGetProcAddress('cuMemFree', &__cuMemFree_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAddressRange_v2' in found_functions}} - global __cuMemGetAddressRange_v2 - cuGetProcAddress('cuMemGetAddressRange', &__cuMemGetAddressRange_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocHost_v2' in found_functions}} - global __cuMemAllocHost_v2 - cuGetProcAddress('cuMemAllocHost', &__cuMemAllocHost_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemFreeHost' in found_functions}} - global __cuMemFreeHost - cuGetProcAddress('cuMemFreeHost', &__cuMemFreeHost, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostAlloc' in found_functions}} - global __cuMemHostAlloc - cuGetProcAddress('cuMemHostAlloc', &__cuMemHostAlloc, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - global __cuMemHostGetDevicePointer_v2 - cuGetProcAddress('cuMemHostGetDevicePointer', &__cuMemHostGetDevicePointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostGetFlags' in found_functions}} - global __cuMemHostGetFlags - cuGetProcAddress('cuMemHostGetFlags', &__cuMemHostGetFlags, 2030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAllocManaged' in found_functions}} - global __cuMemAllocManaged - cuGetProcAddress('cuMemAllocManaged', &__cuMemAllocManaged, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - global __cuDeviceRegisterAsyncNotification - cuGetProcAddress('cuDeviceRegisterAsyncNotification', &__cuDeviceRegisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - global __cuDeviceUnregisterAsyncNotification - cuGetProcAddress('cuDeviceUnregisterAsyncNotification', &__cuDeviceUnregisterAsyncNotification, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - global __cuDeviceGetByPCIBusId - cuGetProcAddress('cuDeviceGetByPCIBusId', &__cuDeviceGetByPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetPCIBusId' in found_functions}} - global __cuDeviceGetPCIBusId - cuGetProcAddress('cuDeviceGetPCIBusId', &__cuDeviceGetPCIBusId, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcGetEventHandle' in found_functions}} - global __cuIpcGetEventHandle - cuGetProcAddress('cuIpcGetEventHandle', &__cuIpcGetEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcOpenEventHandle' in found_functions}} - global __cuIpcOpenEventHandle - cuGetProcAddress('cuIpcOpenEventHandle', &__cuIpcOpenEventHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcGetMemHandle' in found_functions}} - global __cuIpcGetMemHandle - cuGetProcAddress('cuIpcGetMemHandle', &__cuIpcGetMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - global __cuIpcOpenMemHandle_v2 - cuGetProcAddress('cuIpcOpenMemHandle', &__cuIpcOpenMemHandle_v2, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuIpcCloseMemHandle' in found_functions}} - global __cuIpcCloseMemHandle - cuGetProcAddress('cuIpcCloseMemHandle', &__cuIpcCloseMemHandle, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostRegister_v2' in found_functions}} - global __cuMemHostRegister_v2 - cuGetProcAddress('cuMemHostRegister', &__cuMemHostRegister_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemHostUnregister' in found_functions}} - global __cuMemHostUnregister - cuGetProcAddress('cuMemHostUnregister', &__cuMemHostUnregister, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayCreate_v2' in found_functions}} - global __cuArrayCreate_v2 - cuGetProcAddress('cuArrayCreate', &__cuArrayCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - global __cuArrayGetDescriptor_v2 - cuGetProcAddress('cuArrayGetDescriptor', &__cuArrayGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetSparseProperties' in found_functions}} - global __cuArrayGetSparseProperties - cuGetProcAddress('cuArrayGetSparseProperties', &__cuArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - global __cuMipmappedArrayGetSparseProperties - cuGetProcAddress('cuMipmappedArrayGetSparseProperties', &__cuMipmappedArrayGetSparseProperties, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - global __cuArrayGetMemoryRequirements - cuGetProcAddress('cuArrayGetMemoryRequirements', &__cuArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - global __cuMipmappedArrayGetMemoryRequirements - cuGetProcAddress('cuMipmappedArrayGetMemoryRequirements', &__cuMipmappedArrayGetMemoryRequirements, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayGetPlane' in found_functions}} - global __cuArrayGetPlane - cuGetProcAddress('cuArrayGetPlane', &__cuArrayGetPlane, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArrayDestroy' in found_functions}} - global __cuArrayDestroy - cuGetProcAddress('cuArrayDestroy', &__cuArrayDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArray3DCreate_v2' in found_functions}} - global __cuArray3DCreate_v2 - cuGetProcAddress('cuArray3DCreate', &__cuArray3DCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - global __cuArray3DGetDescriptor_v2 - cuGetProcAddress('cuArray3DGetDescriptor', &__cuArray3DGetDescriptor_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayCreate' in found_functions}} - global __cuMipmappedArrayCreate - cuGetProcAddress('cuMipmappedArrayCreate', &__cuMipmappedArrayCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - global __cuMipmappedArrayGetLevel - cuGetProcAddress('cuMipmappedArrayGetLevel', &__cuMipmappedArrayGetLevel, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMipmappedArrayDestroy' in found_functions}} - global __cuMipmappedArrayDestroy - cuGetProcAddress('cuMipmappedArrayDestroy', &__cuMipmappedArrayDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - global __cuMemGetHandleForAddressRange - cuGetProcAddress('cuMemGetHandleForAddressRange', &__cuMemGetHandleForAddressRange, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAddressReserve' in found_functions}} - global __cuMemAddressReserve - cuGetProcAddress('cuMemAddressReserve', &__cuMemAddressReserve, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAddressFree' in found_functions}} - global __cuMemAddressFree - cuGetProcAddress('cuMemAddressFree', &__cuMemAddressFree, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemCreate' in found_functions}} - global __cuMemCreate - cuGetProcAddress('cuMemCreate', &__cuMemCreate, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRelease' in found_functions}} - global __cuMemRelease - cuGetProcAddress('cuMemRelease', &__cuMemRelease, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemMap' in found_functions}} - global __cuMemMap - cuGetProcAddress('cuMemMap', &__cuMemMap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemUnmap' in found_functions}} - global __cuMemUnmap - cuGetProcAddress('cuMemUnmap', &__cuMemUnmap, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemSetAccess' in found_functions}} - global __cuMemSetAccess - cuGetProcAddress('cuMemSetAccess', &__cuMemSetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAccess' in found_functions}} - global __cuMemGetAccess - cuGetProcAddress('cuMemGetAccess', &__cuMemGetAccess, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemExportToShareableHandle' in found_functions}} - global __cuMemExportToShareableHandle - cuGetProcAddress('cuMemExportToShareableHandle', &__cuMemExportToShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemImportFromShareableHandle' in found_functions}} - global __cuMemImportFromShareableHandle - cuGetProcAddress('cuMemImportFromShareableHandle', &__cuMemImportFromShareableHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAllocationGranularity' in found_functions}} - global __cuMemGetAllocationGranularity - cuGetProcAddress('cuMemGetAllocationGranularity', &__cuMemGetAllocationGranularity, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - global __cuMemGetAllocationPropertiesFromHandle - cuGetProcAddress('cuMemGetAllocationPropertiesFromHandle', &__cuMemGetAllocationPropertiesFromHandle, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRetainAllocationHandle' in found_functions}} - global __cuMemRetainAllocationHandle - cuGetProcAddress('cuMemRetainAllocationHandle', &__cuMemRetainAllocationHandle, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolTrimTo' in found_functions}} - global __cuMemPoolTrimTo - cuGetProcAddress('cuMemPoolTrimTo', &__cuMemPoolTrimTo, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolSetAttribute' in found_functions}} - global __cuMemPoolSetAttribute - cuGetProcAddress('cuMemPoolSetAttribute', &__cuMemPoolSetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolGetAttribute' in found_functions}} - global __cuMemPoolGetAttribute - cuGetProcAddress('cuMemPoolGetAttribute', &__cuMemPoolGetAttribute, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolSetAccess' in found_functions}} - global __cuMemPoolSetAccess - cuGetProcAddress('cuMemPoolSetAccess', &__cuMemPoolSetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolGetAccess' in found_functions}} - global __cuMemPoolGetAccess - cuGetProcAddress('cuMemPoolGetAccess', &__cuMemPoolGetAccess, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolCreate' in found_functions}} - global __cuMemPoolCreate - cuGetProcAddress('cuMemPoolCreate', &__cuMemPoolCreate, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolDestroy' in found_functions}} - global __cuMemPoolDestroy - cuGetProcAddress('cuMemPoolDestroy', &__cuMemPoolDestroy, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - global __cuMemPoolExportToShareableHandle - cuGetProcAddress('cuMemPoolExportToShareableHandle', &__cuMemPoolExportToShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - global __cuMemPoolImportFromShareableHandle - cuGetProcAddress('cuMemPoolImportFromShareableHandle', &__cuMemPoolImportFromShareableHandle, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolExportPointer' in found_functions}} - global __cuMemPoolExportPointer - cuGetProcAddress('cuMemPoolExportPointer', &__cuMemPoolExportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemPoolImportPointer' in found_functions}} - global __cuMemPoolImportPointer - cuGetProcAddress('cuMemPoolImportPointer', &__cuMemPoolImportPointer, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastCreate' in found_functions}} - global __cuMulticastCreate - cuGetProcAddress('cuMulticastCreate', &__cuMulticastCreate, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastAddDevice' in found_functions}} - global __cuMulticastAddDevice - cuGetProcAddress('cuMulticastAddDevice', &__cuMulticastAddDevice, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastBindMem' in found_functions}} - global __cuMulticastBindMem - cuGetProcAddress('cuMulticastBindMem', &__cuMulticastBindMem, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - global __cuMulticastBindAddr - cuGetProcAddress('cuMulticastBindAddr', &__cuMulticastBindAddr, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastUnbind' in found_functions}} - global __cuMulticastUnbind - cuGetProcAddress('cuMulticastUnbind', &__cuMulticastUnbind, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMulticastGetGranularity' in found_functions}} - global __cuMulticastGetGranularity - cuGetProcAddress('cuMulticastGetGranularity', &__cuMulticastGetGranularity, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerGetAttribute' in found_functions}} - global __cuPointerGetAttribute - cuGetProcAddress('cuPointerGetAttribute', &__cuPointerGetAttribute, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAdvise' in found_functions}} - global __cuMemAdvise - cuGetProcAddress('cuMemAdvise', &__cuMemAdvise, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} - global __cuMemAdvise_v2 - cuGetProcAddress('cuMemAdvise', &__cuMemAdvise_v2, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRangeGetAttribute' in found_functions}} - global __cuMemRangeGetAttribute - cuGetProcAddress('cuMemRangeGetAttribute', &__cuMemRangeGetAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuMemRangeGetAttributes' in found_functions}} - global __cuMemRangeGetAttributes - cuGetProcAddress('cuMemRangeGetAttributes', &__cuMemRangeGetAttributes, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerSetAttribute' in found_functions}} - global __cuPointerSetAttribute - cuGetProcAddress('cuPointerSetAttribute', &__cuPointerSetAttribute, 6000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuPointerGetAttributes' in found_functions}} - global __cuPointerGetAttributes - cuGetProcAddress('cuPointerGetAttributes', &__cuPointerGetAttributes, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamCreate' in found_functions}} - global __cuStreamCreate - cuGetProcAddress('cuStreamCreate', &__cuStreamCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamCreateWithPriority' in found_functions}} - global __cuStreamCreateWithPriority - cuGetProcAddress('cuStreamCreateWithPriority', &__cuStreamCreateWithPriority, 5050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - global __cuThreadExchangeStreamCaptureMode - cuGetProcAddress('cuThreadExchangeStreamCaptureMode', &__cuThreadExchangeStreamCaptureMode, 10010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamDestroy_v2' in found_functions}} - global __cuStreamDestroy_v2 - cuGetProcAddress('cuStreamDestroy', &__cuStreamDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventCreate' in found_functions}} - global __cuEventCreate - cuGetProcAddress('cuEventCreate', &__cuEventCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventQuery' in found_functions}} - global __cuEventQuery - cuGetProcAddress('cuEventQuery', &__cuEventQuery, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventSynchronize' in found_functions}} - global __cuEventSynchronize - cuGetProcAddress('cuEventSynchronize', &__cuEventSynchronize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventDestroy_v2' in found_functions}} - global __cuEventDestroy_v2 - cuGetProcAddress('cuEventDestroy', &__cuEventDestroy_v2, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventElapsedTime' in found_functions}} - global __cuEventElapsedTime - cuGetProcAddress('cuEventElapsedTime', &__cuEventElapsedTime, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} - global __cuEventElapsedTime_v2 - cuGetProcAddress('cuEventElapsedTime', &__cuEventElapsedTime_v2, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuImportExternalMemory' in found_functions}} - global __cuImportExternalMemory - cuGetProcAddress('cuImportExternalMemory', &__cuImportExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - global __cuExternalMemoryGetMappedBuffer - cuGetProcAddress('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - global __cuExternalMemoryGetMappedMipmappedArray - cuGetProcAddress('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDestroyExternalMemory' in found_functions}} - global __cuDestroyExternalMemory - cuGetProcAddress('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuImportExternalSemaphore' in found_functions}} - global __cuImportExternalSemaphore - cuGetProcAddress('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDestroyExternalSemaphore' in found_functions}} - global __cuDestroyExternalSemaphore - cuGetProcAddress('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncGetAttribute' in found_functions}} - global __cuFuncGetAttribute - cuGetProcAddress('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetAttribute' in found_functions}} - global __cuFuncSetAttribute - cuGetProcAddress('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetCacheConfig' in found_functions}} - global __cuFuncSetCacheConfig - cuGetProcAddress('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncGetModule' in found_functions}} - global __cuFuncGetModule - cuGetProcAddress('cuFuncGetModule', &__cuFuncGetModule, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncGetName' in found_functions}} - global __cuFuncGetName - cuGetProcAddress('cuFuncGetName', &__cuFuncGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncGetParamInfo' in found_functions}} - global __cuFuncGetParamInfo - cuGetProcAddress('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncIsLoaded' in found_functions}} - global __cuFuncIsLoaded - cuGetProcAddress('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncLoad' in found_functions}} - global __cuFuncLoad - cuGetProcAddress('cuFuncLoad', &__cuFuncLoad, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - global __cuLaunchCooperativeKernelMultiDevice - cuGetProcAddress('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetBlockShape' in found_functions}} - global __cuFuncSetBlockShape - cuGetProcAddress('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetSharedSize' in found_functions}} - global __cuFuncSetSharedSize - cuGetProcAddress('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSetSize' in found_functions}} - global __cuParamSetSize - cuGetProcAddress('cuParamSetSize', &__cuParamSetSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSeti' in found_functions}} - global __cuParamSeti - cuGetProcAddress('cuParamSeti', &__cuParamSeti, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSetf' in found_functions}} - global __cuParamSetf - cuGetProcAddress('cuParamSetf', &__cuParamSetf, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSetv' in found_functions}} - global __cuParamSetv - cuGetProcAddress('cuParamSetv', &__cuParamSetv, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLaunch' in found_functions}} - global __cuLaunch - cuGetProcAddress('cuLaunch', &__cuLaunch, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLaunchGrid' in found_functions}} - global __cuLaunchGrid - cuGetProcAddress('cuLaunchGrid', &__cuLaunchGrid, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLaunchGridAsync' in found_functions}} - global __cuLaunchGridAsync - cuGetProcAddress('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuParamSetTexRef' in found_functions}} - global __cuParamSetTexRef - cuGetProcAddress('cuParamSetTexRef', &__cuParamSetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuFuncSetSharedMemConfig' in found_functions}} - global __cuFuncSetSharedMemConfig - cuGetProcAddress('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphCreate' in found_functions}} - global __cuGraphCreate - cuGetProcAddress('cuGraphCreate', &__cuGraphCreate, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddKernelNode_v2' in found_functions}} - global __cuGraphAddKernelNode_v2 - cuGetProcAddress('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - global __cuGraphKernelNodeGetParams_v2 - cuGetProcAddress('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - global __cuGraphKernelNodeSetParams_v2 - cuGetProcAddress('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddMemcpyNode' in found_functions}} - global __cuGraphAddMemcpyNode - cuGetProcAddress('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - global __cuGraphMemcpyNodeGetParams - cuGetProcAddress('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - global __cuGraphMemcpyNodeSetParams - cuGetProcAddress('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddMemsetNode' in found_functions}} - global __cuGraphAddMemsetNode - cuGetProcAddress('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - global __cuGraphMemsetNodeGetParams - cuGetProcAddress('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - global __cuGraphMemsetNodeSetParams - cuGetProcAddress('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddHostNode' in found_functions}} - global __cuGraphAddHostNode - cuGetProcAddress('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphHostNodeGetParams' in found_functions}} - global __cuGraphHostNodeGetParams - cuGetProcAddress('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphHostNodeSetParams' in found_functions}} - global __cuGraphHostNodeSetParams - cuGetProcAddress('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddChildGraphNode' in found_functions}} - global __cuGraphAddChildGraphNode - cuGetProcAddress('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - global __cuGraphChildGraphNodeGetGraph - cuGetProcAddress('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddEmptyNode' in found_functions}} - global __cuGraphAddEmptyNode - cuGetProcAddress('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddEventRecordNode' in found_functions}} - global __cuGraphAddEventRecordNode - cuGetProcAddress('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - global __cuGraphEventRecordNodeGetEvent - cuGetProcAddress('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - global __cuGraphEventRecordNodeSetEvent - cuGetProcAddress('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddEventWaitNode' in found_functions}} - global __cuGraphAddEventWaitNode - cuGetProcAddress('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - global __cuGraphEventWaitNodeGetEvent - cuGetProcAddress('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - global __cuGraphEventWaitNodeSetEvent - cuGetProcAddress('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - global __cuGraphAddExternalSemaphoresSignalNode - cuGetProcAddress('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeGetParams - cuGetProcAddress('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeSetParams - cuGetProcAddress('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - global __cuGraphAddExternalSemaphoresWaitNode - cuGetProcAddress('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeGetParams - cuGetProcAddress('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeSetParams - cuGetProcAddress('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - global __cuGraphAddBatchMemOpNode - cuGetProcAddress('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - global __cuGraphBatchMemOpNodeGetParams - cuGetProcAddress('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphBatchMemOpNodeSetParams - cuGetProcAddress('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphExecBatchMemOpNodeSetParams - cuGetProcAddress('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddMemAllocNode' in found_functions}} - global __cuGraphAddMemAllocNode - cuGetProcAddress('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - global __cuGraphMemAllocNodeGetParams - cuGetProcAddress('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddMemFreeNode' in found_functions}} - global __cuGraphAddMemFreeNode - cuGetProcAddress('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - global __cuGraphMemFreeNodeGetParams - cuGetProcAddress('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGraphMemTrim' in found_functions}} - global __cuDeviceGraphMemTrim - cuGetProcAddress('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - global __cuDeviceGetGraphMemAttribute - cuGetProcAddress('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - global __cuDeviceSetGraphMemAttribute - cuGetProcAddress('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphClone' in found_functions}} - global __cuGraphClone - cuGetProcAddress('cuGraphClone', &__cuGraphClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeFindInClone' in found_functions}} - global __cuGraphNodeFindInClone - cuGetProcAddress('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetType' in found_functions}} - global __cuGraphNodeGetType - cuGetProcAddress('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphGetNodes' in found_functions}} - global __cuGraphGetNodes - cuGetProcAddress('cuGraphGetNodes', &__cuGraphGetNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphGetRootNodes' in found_functions}} - global __cuGraphGetRootNodes - cuGetProcAddress('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphGetEdges' in found_functions}} - global __cuGraphGetEdges - cuGetProcAddress('cuGraphGetEdges', &__cuGraphGetEdges, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} - global __cuGraphGetEdges_v2 - cuGetProcAddress('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetDependencies' in found_functions}} - global __cuGraphNodeGetDependencies - cuGetProcAddress('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - global __cuGraphNodeGetDependencies_v2 - cuGetProcAddress('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetDependentNodes' in found_functions}} - global __cuGraphNodeGetDependentNodes - cuGetProcAddress('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - global __cuGraphNodeGetDependentNodes_v2 - cuGetProcAddress('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddDependencies' in found_functions}} - global __cuGraphAddDependencies - cuGetProcAddress('cuGraphAddDependencies', &__cuGraphAddDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} - global __cuGraphAddDependencies_v2 - cuGetProcAddress('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphRemoveDependencies' in found_functions}} - global __cuGraphRemoveDependencies - cuGetProcAddress('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - global __cuGraphRemoveDependencies_v2 - cuGetProcAddress('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphDestroyNode' in found_functions}} - global __cuGraphDestroyNode - cuGetProcAddress('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphInstantiateWithFlags' in found_functions}} - global __cuGraphInstantiateWithFlags - cuGetProcAddress('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecGetFlags' in found_functions}} - global __cuGraphExecGetFlags - cuGetProcAddress('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - global __cuGraphExecKernelNodeSetParams_v2 - cuGetProcAddress('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - global __cuGraphExecMemcpyNodeSetParams - cuGetProcAddress('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - global __cuGraphExecMemsetNodeSetParams - cuGetProcAddress('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - global __cuGraphExecHostNodeSetParams - cuGetProcAddress('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - global __cuGraphExecChildGraphNodeSetParams - cuGetProcAddress('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - global __cuGraphExecEventRecordNodeSetEvent - cuGetProcAddress('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - global __cuGraphExecEventWaitNodeSetEvent - cuGetProcAddress('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - cuGetProcAddress('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - cuGetProcAddress('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeSetEnabled' in found_functions}} - global __cuGraphNodeSetEnabled - cuGetProcAddress('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeGetEnabled' in found_functions}} - global __cuGraphNodeGetEnabled - cuGetProcAddress('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecDestroy' in found_functions}} - global __cuGraphExecDestroy - cuGetProcAddress('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphDestroy' in found_functions}} - global __cuGraphDestroy - cuGetProcAddress('cuGraphDestroy', &__cuGraphDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecUpdate_v2' in found_functions}} - global __cuGraphExecUpdate_v2 - cuGetProcAddress('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - global __cuGraphKernelNodeCopyAttributes - cuGetProcAddress('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - global __cuGraphKernelNodeGetAttribute - cuGetProcAddress('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - global __cuGraphKernelNodeSetAttribute - cuGetProcAddress('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphDebugDotPrint' in found_functions}} - global __cuGraphDebugDotPrint - cuGetProcAddress('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuUserObjectCreate' in found_functions}} - global __cuUserObjectCreate - cuGetProcAddress('cuUserObjectCreate', &__cuUserObjectCreate, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuUserObjectRetain' in found_functions}} - global __cuUserObjectRetain - cuGetProcAddress('cuUserObjectRetain', &__cuUserObjectRetain, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuUserObjectRelease' in found_functions}} - global __cuUserObjectRelease - cuGetProcAddress('cuUserObjectRelease', &__cuUserObjectRelease, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphRetainUserObject' in found_functions}} - global __cuGraphRetainUserObject - cuGetProcAddress('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphReleaseUserObject' in found_functions}} - global __cuGraphReleaseUserObject - cuGetProcAddress('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddNode' in found_functions}} - global __cuGraphAddNode - cuGetProcAddress('cuGraphAddNode', &__cuGraphAddNode, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} - global __cuGraphAddNode_v2 - cuGetProcAddress('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphNodeSetParams' in found_functions}} - global __cuGraphNodeSetParams - cuGetProcAddress('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphExecNodeSetParams' in found_functions}} - global __cuGraphExecNodeSetParams - cuGetProcAddress('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphConditionalHandleCreate' in found_functions}} - global __cuGraphConditionalHandleCreate - cuGetProcAddress('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - cuGetProcAddress('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - cuGetProcAddress('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - global __cuOccupancyMaxPotentialBlockSize - cuGetProcAddress('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - global __cuOccupancyMaxPotentialBlockSizeWithFlags - cuGetProcAddress('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - global __cuOccupancyAvailableDynamicSMemPerBlock - cuGetProcAddress('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - global __cuOccupancyMaxPotentialClusterSize - cuGetProcAddress('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - global __cuOccupancyMaxActiveClusters - cuGetProcAddress('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetArray' in found_functions}} - global __cuTexRefSetArray - cuGetProcAddress('cuTexRefSetArray', &__cuTexRefSetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMipmappedArray' in found_functions}} - global __cuTexRefSetMipmappedArray - cuGetProcAddress('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetAddress_v2' in found_functions}} - global __cuTexRefSetAddress_v2 - cuGetProcAddress('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - global __cuTexRefSetAddress2D_v3 - cuGetProcAddress('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetFormat' in found_functions}} - global __cuTexRefSetFormat - cuGetProcAddress('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetAddressMode' in found_functions}} - global __cuTexRefSetAddressMode - cuGetProcAddress('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetFilterMode' in found_functions}} - global __cuTexRefSetFilterMode - cuGetProcAddress('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - global __cuTexRefSetMipmapFilterMode - cuGetProcAddress('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - global __cuTexRefSetMipmapLevelBias - cuGetProcAddress('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - global __cuTexRefSetMipmapLevelClamp - cuGetProcAddress('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - global __cuTexRefSetMaxAnisotropy - cuGetProcAddress('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetBorderColor' in found_functions}} - global __cuTexRefSetBorderColor - cuGetProcAddress('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefSetFlags' in found_functions}} - global __cuTexRefSetFlags - cuGetProcAddress('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetAddress_v2' in found_functions}} - global __cuTexRefGetAddress_v2 - cuGetProcAddress('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetArray' in found_functions}} - global __cuTexRefGetArray - cuGetProcAddress('cuTexRefGetArray', &__cuTexRefGetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMipmappedArray' in found_functions}} - global __cuTexRefGetMipmappedArray - cuGetProcAddress('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetAddressMode' in found_functions}} - global __cuTexRefGetAddressMode - cuGetProcAddress('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetFilterMode' in found_functions}} - global __cuTexRefGetFilterMode - cuGetProcAddress('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetFormat' in found_functions}} - global __cuTexRefGetFormat - cuGetProcAddress('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - global __cuTexRefGetMipmapFilterMode - cuGetProcAddress('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - global __cuTexRefGetMipmapLevelBias - cuGetProcAddress('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - global __cuTexRefGetMipmapLevelClamp - cuGetProcAddress('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - global __cuTexRefGetMaxAnisotropy - cuGetProcAddress('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetBorderColor' in found_functions}} - global __cuTexRefGetBorderColor - cuGetProcAddress('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefGetFlags' in found_functions}} - global __cuTexRefGetFlags - cuGetProcAddress('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefCreate' in found_functions}} - global __cuTexRefCreate - cuGetProcAddress('cuTexRefCreate', &__cuTexRefCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexRefDestroy' in found_functions}} - global __cuTexRefDestroy - cuGetProcAddress('cuTexRefDestroy', &__cuTexRefDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfRefSetArray' in found_functions}} - global __cuSurfRefSetArray - cuGetProcAddress('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfRefGetArray' in found_functions}} - global __cuSurfRefGetArray - cuGetProcAddress('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectCreate' in found_functions}} - global __cuTexObjectCreate - cuGetProcAddress('cuTexObjectCreate', &__cuTexObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectDestroy' in found_functions}} - global __cuTexObjectDestroy - cuGetProcAddress('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectGetResourceDesc' in found_functions}} - global __cuTexObjectGetResourceDesc - cuGetProcAddress('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectGetTextureDesc' in found_functions}} - global __cuTexObjectGetTextureDesc - cuGetProcAddress('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - global __cuTexObjectGetResourceViewDesc - cuGetProcAddress('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfObjectCreate' in found_functions}} - global __cuSurfObjectCreate - cuGetProcAddress('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfObjectDestroy' in found_functions}} - global __cuSurfObjectDestroy - cuGetProcAddress('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - global __cuSurfObjectGetResourceDesc - cuGetProcAddress('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTensorMapEncodeTiled' in found_functions}} - global __cuTensorMapEncodeTiled - cuGetProcAddress('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTensorMapEncodeIm2col' in found_functions}} - global __cuTensorMapEncodeIm2col - cuGetProcAddress('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - global __cuTensorMapEncodeIm2colWide - cuGetProcAddress('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuTensorMapReplaceAddress' in found_functions}} - global __cuTensorMapReplaceAddress - cuGetProcAddress('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceCanAccessPeer' in found_functions}} - global __cuDeviceCanAccessPeer - cuGetProcAddress('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxEnablePeerAccess' in found_functions}} - global __cuCtxEnablePeerAccess - cuGetProcAddress('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxDisablePeerAccess' in found_functions}} - global __cuCtxDisablePeerAccess - cuGetProcAddress('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetP2PAttribute' in found_functions}} - global __cuDeviceGetP2PAttribute - cuGetProcAddress('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsUnregisterResource' in found_functions}} - global __cuGraphicsUnregisterResource - cuGetProcAddress('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - global __cuGraphicsSubResourceGetMappedArray - cuGetProcAddress('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - global __cuGraphicsResourceGetMappedMipmappedArray - cuGetProcAddress('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - global __cuGraphicsResourceGetMappedPointer_v2 - cuGetProcAddress('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - global __cuGraphicsResourceSetMapFlags_v2 - cuGetProcAddress('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGetProcAddress_v2' in found_functions}} - global __cuGetProcAddress_v2 - cuGetProcAddress('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpGetAttribute' in found_functions}} - global __cuCoredumpGetAttribute - cuGetProcAddress('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - global __cuCoredumpGetAttributeGlobal - cuGetProcAddress('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpSetAttribute' in found_functions}} - global __cuCoredumpSetAttribute - cuGetProcAddress('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - global __cuCoredumpSetAttributeGlobal - cuGetProcAddress('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGetExportTable' in found_functions}} - global __cuGetExportTable - cuGetProcAddress('cuGetExportTable', &__cuGetExportTable, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxCreate' in found_functions}} - global __cuGreenCtxCreate - cuGetProcAddress('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxDestroy' in found_functions}} - global __cuGreenCtxDestroy - cuGetProcAddress('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxFromGreenCtx' in found_functions}} - global __cuCtxFromGreenCtx - cuGetProcAddress('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDeviceGetDevResource' in found_functions}} - global __cuDeviceGetDevResource - cuGetProcAddress('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCtxGetDevResource' in found_functions}} - global __cuCtxGetDevResource - cuGetProcAddress('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxGetDevResource' in found_functions}} - global __cuGreenCtxGetDevResource - cuGetProcAddress('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevSmResourceSplitByCount' in found_functions}} - global __cuDevSmResourceSplitByCount - cuGetProcAddress('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuDevResourceGenerateDesc' in found_functions}} - global __cuDevResourceGenerateDesc - cuGetProcAddress('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxRecordEvent' in found_functions}} - global __cuGreenCtxRecordEvent - cuGetProcAddress('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxWaitEvent' in found_functions}} - global __cuGreenCtxWaitEvent - cuGetProcAddress('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuStreamGetGreenCtx' in found_functions}} - global __cuStreamGetGreenCtx - cuGetProcAddress('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuGreenCtxStreamCreate' in found_functions}} - global __cuGreenCtxStreamCreate - cuGetProcAddress('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsRegisterCallback' in found_functions}} - global __cuLogsRegisterCallback - cuGetProcAddress('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsUnregisterCallback' in found_functions}} - global __cuLogsUnregisterCallback - cuGetProcAddress('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsCurrent' in found_functions}} - global __cuLogsCurrent - cuGetProcAddress('cuLogsCurrent', &__cuLogsCurrent, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsDumpToFile' in found_functions}} - global __cuLogsDumpToFile - cuGetProcAddress('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuLogsDumpToMemory' in found_functions}} - global __cuLogsDumpToMemory - cuGetProcAddress('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - global __cuCheckpointProcessGetRestoreThreadId - cuGetProcAddress('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessGetState' in found_functions}} - global __cuCheckpointProcessGetState - cuGetProcAddress('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessLock' in found_functions}} - global __cuCheckpointProcessLock - cuGetProcAddress('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - global __cuCheckpointProcessCheckpoint - cuGetProcAddress('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessRestore' in found_functions}} - global __cuCheckpointProcessRestore - cuGetProcAddress('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} - global __cuCheckpointProcessUnlock - cuGetProcAddress('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuProfilerStart' in found_functions}} - global __cuProfilerStart - cuGetProcAddress('cuProfilerStart', &__cuProfilerStart, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if 'cuProfilerStop' in found_functions}} - global __cuProfilerStop - cuGetProcAddress('cuProfilerStop', &__cuProfilerStop, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsEGLRegisterImage - cuGetProcAddress('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnect - cuGetProcAddress('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnectWithFlags - cuGetProcAddress('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerDisconnect - cuGetProcAddress('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerAcquireFrame - cuGetProcAddress('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamConsumerReleaseFrame - cuGetProcAddress('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamProducerConnect - cuGetProcAddress('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamProducerDisconnect - cuGetProcAddress('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamProducerPresentFrame - cuGetProcAddress('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEGLStreamProducerReturnFrame - cuGetProcAddress('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsResourceGetMappedEglFrame - cuGetProcAddress('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuEventCreateFromEGLSync - cuGetProcAddress('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterBuffer - cuGetProcAddress('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterImage - cuGetProcAddress('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGLGetDevices_v2 - cuGetProcAddress('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuVDPAUGetDevice - cuGetProcAddress('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuVDPAUCtxCreate_v2 - cuGetProcAddress('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterVideoSurface - cuGetProcAddress('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterOutputSurface - cuGetProcAddress('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) - {{endif}} - return 0 - - {{if 'Windows' == platform.system()}} - # Load using win32GetAddr - with gil: - if usePTDS: - # Get all PTDS version of functions - pass - {{if 'cuMemcpy' in found_functions}} - try: - global __cuMemcpy - __cuMemcpy = win32api.GetProcAddress(handle, 'cuMemcpy_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - try: - global __cuMemcpyPeer - __cuMemcpyPeer = win32api.GetProcAddress(handle, 'cuMemcpyPeer_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - try: - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoD_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - try: - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoH_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - try: - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoD_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - try: - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoA_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - try: - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoD_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - try: - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoA_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - try: - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoH_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - try: - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoA_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - try: - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2D_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - try: - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - try: - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3D_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - try: - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = win32api.GetProcAddress(handle, 'cuMemcpy3DPeer_ptds') - except: - pass - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - try: - global __cuMemcpyAsync - __cuMemcpyAsync = win32api.GetProcAddress(handle, 'cuMemcpyAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - try: - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpyPeerAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - try: - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - try: - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - try: - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DPeerAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - try: - global __cuMemcpyBatchAsync - __cuMemcpyBatchAsync = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - try: - global __cuMemcpy3DBatchAsync - __cuMemcpy3DBatchAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - try: - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD8_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - try: - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD16_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - try: - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD32_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - try: - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D8_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - try: - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D16_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - try: - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D32_v2_ptds') - except: - pass - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - try: - global __cuMemsetD8Async - __cuMemsetD8Async = win32api.GetProcAddress(handle, 'cuMemsetD8Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - try: - global __cuMemsetD16Async - __cuMemsetD16Async = win32api.GetProcAddress(handle, 'cuMemsetD16Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - try: - global __cuMemsetD32Async - __cuMemsetD32Async = win32api.GetProcAddress(handle, 'cuMemsetD32Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - try: - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = win32api.GetProcAddress(handle, 'cuMemsetD2D8Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - try: - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = win32api.GetProcAddress(handle, 'cuMemsetD2D16Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - try: - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = win32api.GetProcAddress(handle, 'cuMemsetD2D32Async_ptsz') - except: - pass - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - try: - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = win32api.GetProcAddress(handle, 'cuMemBatchDecompressAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - try: - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = win32api.GetProcAddress(handle, 'cuMemMapArrayAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - try: - global __cuMemFreeAsync - __cuMemFreeAsync = win32api.GetProcAddress(handle, 'cuMemFreeAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - try: - global __cuMemAllocAsync - __cuMemAllocAsync = win32api.GetProcAddress(handle, 'cuMemAllocAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - try: - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = win32api.GetProcAddress(handle, 'cuMemAllocFromPoolAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - try: - global __cuMemPrefetchAsync - __cuMemPrefetchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - try: - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - try: - global __cuStreamGetPriority - __cuStreamGetPriority = win32api.GetProcAddress(handle, 'cuStreamGetPriority_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - try: - global __cuStreamGetDevice - __cuStreamGetDevice = win32api.GetProcAddress(handle, 'cuStreamGetDevice_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - try: - global __cuStreamGetFlags - __cuStreamGetFlags = win32api.GetProcAddress(handle, 'cuStreamGetFlags_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - try: - global __cuStreamGetId - __cuStreamGetId = win32api.GetProcAddress(handle, 'cuStreamGetId_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - try: - global __cuStreamGetCtx - __cuStreamGetCtx = win32api.GetProcAddress(handle, 'cuStreamGetCtx_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - try: - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCtx_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - try: - global __cuStreamWaitEvent - __cuStreamWaitEvent = win32api.GetProcAddress(handle, 'cuStreamWaitEvent_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - try: - global __cuStreamAddCallback - __cuStreamAddCallback = win32api.GetProcAddress(handle, 'cuStreamAddCallback_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - try: - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = win32api.GetProcAddress(handle, 'cuStreamBeginCapture_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - try: - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = win32api.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - try: - global __cuStreamEndCapture - __cuStreamEndCapture = win32api.GetProcAddress(handle, 'cuStreamEndCapture_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - try: - global __cuStreamIsCapturing - __cuStreamIsCapturing = win32api.GetProcAddress(handle, 'cuStreamIsCapturing_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v2 - __cuStreamGetCaptureInfo_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies - __cuStreamUpdateCaptureDependencies = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - try: - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = win32api.GetProcAddress(handle, 'cuStreamAttachMemAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - try: - global __cuStreamQuery - __cuStreamQuery = win32api.GetProcAddress(handle, 'cuStreamQuery_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - try: - global __cuStreamSynchronize - __cuStreamSynchronize = win32api.GetProcAddress(handle, 'cuStreamSynchronize_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - try: - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = win32api.GetProcAddress(handle, 'cuStreamCopyAttributes_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - try: - global __cuStreamGetAttribute - __cuStreamGetAttribute = win32api.GetProcAddress(handle, 'cuStreamGetAttribute_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - try: - global __cuStreamSetAttribute - __cuStreamSetAttribute = win32api.GetProcAddress(handle, 'cuStreamSetAttribute_ptsz') - except: - pass - {{endif}} - {{if 'cuEventRecord' in found_functions}} - try: - global __cuEventRecord - __cuEventRecord = win32api.GetProcAddress(handle, 'cuEventRecord_ptsz') - except: - pass - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - try: - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = win32api.GetProcAddress(handle, 'cuEventRecordWithFlags_ptsz') - except: - pass - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - try: - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - try: - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - try: - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue32_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - try: - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue64_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - try: - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue32_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - try: - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue64_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - try: - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = win32api.GetProcAddress(handle, 'cuStreamBatchMemOp_v2_ptsz') - except: - pass - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - try: - global __cuLaunchKernel - __cuLaunchKernel = win32api.GetProcAddress(handle, 'cuLaunchKernel_ptsz') - except: - pass - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - try: - global __cuLaunchKernelEx - __cuLaunchKernelEx = win32api.GetProcAddress(handle, 'cuLaunchKernelEx_ptsz') - except: - pass - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - try: - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernel_ptsz') - except: - pass - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - try: - global __cuLaunchHostFunc - __cuLaunchHostFunc = win32api.GetProcAddress(handle, 'cuLaunchHostFunc_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - try: - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithParams_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - try: - global __cuGraphUpload - __cuGraphUpload = win32api.GetProcAddress(handle, 'cuGraphUpload_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - try: - global __cuGraphLaunch - __cuGraphLaunch = win32api.GetProcAddress(handle, 'cuGraphLaunch_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - try: - global __cuGraphicsMapResources - __cuGraphicsMapResources = win32api.GetProcAddress(handle, 'cuGraphicsMapResources_ptsz') - except: - pass - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - try: - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = win32api.GetProcAddress(handle, 'cuGraphicsUnmapResources_ptsz') - except: - pass - {{endif}} - else: - # Else get the regular version - pass - {{if 'cuMemcpy' in found_functions}} - try: - global __cuMemcpy - __cuMemcpy = win32api.GetProcAddress(handle, 'cuMemcpy') - except: - pass - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - try: - global __cuMemcpyPeer - __cuMemcpyPeer = win32api.GetProcAddress(handle, 'cuMemcpyPeer') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - try: - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoD_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - try: - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoH_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - try: - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoD_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - try: - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoA_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - try: - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoD_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - try: - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoA_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - try: - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoH_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - try: - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoA_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - try: - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2D_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - try: - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - try: - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3D_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - try: - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = win32api.GetProcAddress(handle, 'cuMemcpy3DPeer') - except: - pass - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - try: - global __cuMemcpyAsync - __cuMemcpyAsync = win32api.GetProcAddress(handle, 'cuMemcpyAsync') - except: - pass - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - try: - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpyPeerAsync') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - try: - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - try: - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - try: - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - try: - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy2DAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - try: - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = win32api.GetProcAddress(handle, 'cuMemcpy3DAsync_v2') - except: - pass - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - try: - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DPeerAsync') - except: - pass - {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - try: - global __cuMemcpyBatchAsync - __cuMemcpyBatchAsync = win32api.GetProcAddress(handle, 'cuMemcpyBatchAsync') - except: - pass - {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - try: - global __cuMemcpy3DBatchAsync - __cuMemcpy3DBatchAsync = win32api.GetProcAddress(handle, 'cuMemcpy3DBatchAsync') - except: - pass - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - try: - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD8_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - try: - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD16_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - try: - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD32_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - try: - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D8_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - try: - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D16_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - try: - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = win32api.GetProcAddress(handle, 'cuMemsetD2D32_v2') - except: - pass - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - try: - global __cuMemsetD8Async - __cuMemsetD8Async = win32api.GetProcAddress(handle, 'cuMemsetD8Async') - except: - pass - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - try: - global __cuMemsetD16Async - __cuMemsetD16Async = win32api.GetProcAddress(handle, 'cuMemsetD16Async') - except: - pass - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - try: - global __cuMemsetD32Async - __cuMemsetD32Async = win32api.GetProcAddress(handle, 'cuMemsetD32Async') - except: - pass - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - try: - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = win32api.GetProcAddress(handle, 'cuMemsetD2D8Async') - except: - pass - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - try: - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = win32api.GetProcAddress(handle, 'cuMemsetD2D16Async') - except: - pass - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - try: - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = win32api.GetProcAddress(handle, 'cuMemsetD2D32Async') - except: - pass - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - try: - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = win32api.GetProcAddress(handle, 'cuMemBatchDecompressAsync') - except: - pass - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - try: - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = win32api.GetProcAddress(handle, 'cuMemMapArrayAsync') - except: - pass - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - try: - global __cuMemFreeAsync - __cuMemFreeAsync = win32api.GetProcAddress(handle, 'cuMemFreeAsync') - except: - pass - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - try: - global __cuMemAllocAsync - __cuMemAllocAsync = win32api.GetProcAddress(handle, 'cuMemAllocAsync') - except: - pass - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - try: - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = win32api.GetProcAddress(handle, 'cuMemAllocFromPoolAsync') - except: - pass - {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - try: - global __cuMemPrefetchAsync - __cuMemPrefetchAsync = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync') - except: - pass - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - try: - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = win32api.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') - except: - pass - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - try: - global __cuStreamGetPriority - __cuStreamGetPriority = win32api.GetProcAddress(handle, 'cuStreamGetPriority') - except: - pass - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - try: - global __cuStreamGetDevice - __cuStreamGetDevice = win32api.GetProcAddress(handle, 'cuStreamGetDevice') - except: - pass - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - try: - global __cuStreamGetFlags - __cuStreamGetFlags = win32api.GetProcAddress(handle, 'cuStreamGetFlags') - except: - pass - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - try: - global __cuStreamGetId - __cuStreamGetId = win32api.GetProcAddress(handle, 'cuStreamGetId') - except: - pass - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - try: - global __cuStreamGetCtx - __cuStreamGetCtx = win32api.GetProcAddress(handle, 'cuStreamGetCtx') - except: - pass - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - try: - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCtx_v2') - except: - pass - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - try: - global __cuStreamWaitEvent - __cuStreamWaitEvent = win32api.GetProcAddress(handle, 'cuStreamWaitEvent') - except: - pass - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - try: - global __cuStreamAddCallback - __cuStreamAddCallback = win32api.GetProcAddress(handle, 'cuStreamAddCallback') - except: - pass - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - try: - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = win32api.GetProcAddress(handle, 'cuStreamBeginCapture_v2') - except: - pass - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - try: - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = win32api.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph') - except: - pass - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - try: - global __cuStreamEndCapture - __cuStreamEndCapture = win32api.GetProcAddress(handle, 'cuStreamEndCapture') - except: - pass - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - try: - global __cuStreamIsCapturing - __cuStreamIsCapturing = win32api.GetProcAddress(handle, 'cuStreamIsCapturing') - except: - pass - {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v2 - __cuStreamGetCaptureInfo_v2 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v2') - except: - pass - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - try: - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = win32api.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3') - except: - pass - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies - __cuStreamUpdateCaptureDependencies = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies') - except: - pass - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - try: - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = win32api.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2') - except: - pass - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - try: - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = win32api.GetProcAddress(handle, 'cuStreamAttachMemAsync') - except: - pass - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - try: - global __cuStreamQuery - __cuStreamQuery = win32api.GetProcAddress(handle, 'cuStreamQuery') - except: - pass - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - try: - global __cuStreamSynchronize - __cuStreamSynchronize = win32api.GetProcAddress(handle, 'cuStreamSynchronize') - except: - pass - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - try: - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = win32api.GetProcAddress(handle, 'cuStreamCopyAttributes') - except: - pass - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - try: - global __cuStreamGetAttribute - __cuStreamGetAttribute = win32api.GetProcAddress(handle, 'cuStreamGetAttribute') - except: - pass - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - try: - global __cuStreamSetAttribute - __cuStreamSetAttribute = win32api.GetProcAddress(handle, 'cuStreamSetAttribute') - except: - pass - {{endif}} - {{if 'cuEventRecord' in found_functions}} - try: - global __cuEventRecord - __cuEventRecord = win32api.GetProcAddress(handle, 'cuEventRecord') - except: - pass - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - try: - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = win32api.GetProcAddress(handle, 'cuEventRecordWithFlags') - except: - pass - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - try: - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync') - except: - pass - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - try: - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = win32api.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync') - except: - pass - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - try: - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue32_v2') - except: - pass - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - try: - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWaitValue64_v2') - except: - pass - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - try: - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue32_v2') - except: - pass - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - try: - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = win32api.GetProcAddress(handle, 'cuStreamWriteValue64_v2') - except: - pass - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - try: - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = win32api.GetProcAddress(handle, 'cuStreamBatchMemOp_v2') - except: - pass - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - try: - global __cuLaunchKernel - __cuLaunchKernel = win32api.GetProcAddress(handle, 'cuLaunchKernel') - except: - pass - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - try: - global __cuLaunchKernelEx - __cuLaunchKernelEx = win32api.GetProcAddress(handle, 'cuLaunchKernelEx') - except: - pass - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - try: - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernel') - except: - pass - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - try: - global __cuLaunchHostFunc - __cuLaunchHostFunc = win32api.GetProcAddress(handle, 'cuLaunchHostFunc') - except: - pass - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - try: - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithParams') - except: - pass - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - try: - global __cuGraphUpload - __cuGraphUpload = win32api.GetProcAddress(handle, 'cuGraphUpload') - except: - pass - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - try: - global __cuGraphLaunch - __cuGraphLaunch = win32api.GetProcAddress(handle, 'cuGraphLaunch') - except: - pass - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - try: - global __cuGraphicsMapResources - __cuGraphicsMapResources = win32api.GetProcAddress(handle, 'cuGraphicsMapResources') - except: - pass - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - try: - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = win32api.GetProcAddress(handle, 'cuGraphicsUnmapResources') - except: - pass - {{endif}} - # Get remaining functions - {{if 'cuGetErrorString' in found_functions}} - try: - global __cuGetErrorString - __cuGetErrorString = win32api.GetProcAddress(handle, 'cuGetErrorString') - except: - pass - {{endif}} - {{if 'cuGetErrorName' in found_functions}} - try: - global __cuGetErrorName - __cuGetErrorName = win32api.GetProcAddress(handle, 'cuGetErrorName') - except: - pass - {{endif}} - {{if 'cuInit' in found_functions}} - try: - global __cuInit - __cuInit = win32api.GetProcAddress(handle, 'cuInit') - except: - pass - {{endif}} - {{if 'cuDriverGetVersion' in found_functions}} - try: - global __cuDriverGetVersion - __cuDriverGetVersion = win32api.GetProcAddress(handle, 'cuDriverGetVersion') - except: - pass - {{endif}} - {{if 'cuDeviceGet' in found_functions}} - try: - global __cuDeviceGet - __cuDeviceGet = win32api.GetProcAddress(handle, 'cuDeviceGet') - except: - pass - {{endif}} - {{if 'cuDeviceGetCount' in found_functions}} - try: - global __cuDeviceGetCount - __cuDeviceGetCount = win32api.GetProcAddress(handle, 'cuDeviceGetCount') - except: - pass - {{endif}} - {{if 'cuDeviceGetName' in found_functions}} - try: - global __cuDeviceGetName - __cuDeviceGetName = win32api.GetProcAddress(handle, 'cuDeviceGetName') - except: - pass - {{endif}} - {{if 'cuDeviceGetUuid' in found_functions}} - try: - global __cuDeviceGetUuid - __cuDeviceGetUuid = win32api.GetProcAddress(handle, 'cuDeviceGetUuid') - except: - pass - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} - try: - global __cuDeviceGetUuid_v2 - __cuDeviceGetUuid_v2 = win32api.GetProcAddress(handle, 'cuDeviceGetUuid_v2') - except: - pass - {{endif}} - {{if 'cuDeviceGetLuid' in found_functions}} - try: - global __cuDeviceGetLuid - __cuDeviceGetLuid = win32api.GetProcAddress(handle, 'cuDeviceGetLuid') - except: - pass - {{endif}} - {{if 'cuDeviceTotalMem_v2' in found_functions}} - try: - global __cuDeviceTotalMem_v2 - __cuDeviceTotalMem_v2 = win32api.GetProcAddress(handle, 'cuDeviceTotalMem_v2') - except: - pass - {{endif}} - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - try: - global __cuDeviceGetTexture1DLinearMaxWidth - __cuDeviceGetTexture1DLinearMaxWidth = win32api.GetProcAddress(handle, 'cuDeviceGetTexture1DLinearMaxWidth') - except: - pass - {{endif}} - {{if 'cuDeviceGetAttribute' in found_functions}} - try: - global __cuDeviceGetAttribute - __cuDeviceGetAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetAttribute') - except: - pass - {{endif}} - {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - try: - global __cuDeviceGetNvSciSyncAttributes - __cuDeviceGetNvSciSyncAttributes = win32api.GetProcAddress(handle, 'cuDeviceGetNvSciSyncAttributes') - except: - pass - {{endif}} - {{if 'cuDeviceSetMemPool' in found_functions}} - try: - global __cuDeviceSetMemPool - __cuDeviceSetMemPool = win32api.GetProcAddress(handle, 'cuDeviceSetMemPool') - except: - pass - {{endif}} - {{if 'cuDeviceGetMemPool' in found_functions}} - try: - global __cuDeviceGetMemPool - __cuDeviceGetMemPool = win32api.GetProcAddress(handle, 'cuDeviceGetMemPool') - except: - pass - {{endif}} - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - try: - global __cuDeviceGetDefaultMemPool - __cuDeviceGetDefaultMemPool = win32api.GetProcAddress(handle, 'cuDeviceGetDefaultMemPool') - except: - pass - {{endif}} - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - try: - global __cuDeviceGetExecAffinitySupport - __cuDeviceGetExecAffinitySupport = win32api.GetProcAddress(handle, 'cuDeviceGetExecAffinitySupport') - except: - pass - {{endif}} - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - try: - global __cuFlushGPUDirectRDMAWrites - __cuFlushGPUDirectRDMAWrites = win32api.GetProcAddress(handle, 'cuFlushGPUDirectRDMAWrites') - except: - pass - {{endif}} - {{if 'cuDeviceGetProperties' in found_functions}} - try: - global __cuDeviceGetProperties - __cuDeviceGetProperties = win32api.GetProcAddress(handle, 'cuDeviceGetProperties') - except: - pass - {{endif}} - {{if 'cuDeviceComputeCapability' in found_functions}} - try: - global __cuDeviceComputeCapability - __cuDeviceComputeCapability = win32api.GetProcAddress(handle, 'cuDeviceComputeCapability') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - try: - global __cuDevicePrimaryCtxRetain - __cuDevicePrimaryCtxRetain = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxRetain') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxRelease_v2 - __cuDevicePrimaryCtxRelease_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxRelease_v2') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxSetFlags_v2 - __cuDevicePrimaryCtxSetFlags_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxSetFlags_v2') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - try: - global __cuDevicePrimaryCtxGetState - __cuDevicePrimaryCtxGetState = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxGetState') - except: - pass - {{endif}} - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - try: - global __cuDevicePrimaryCtxReset_v2 - __cuDevicePrimaryCtxReset_v2 = win32api.GetProcAddress(handle, 'cuDevicePrimaryCtxReset_v2') - except: - pass - {{endif}} - {{if 'cuCtxCreate_v2' in found_functions}} - try: - global __cuCtxCreate_v2 - __cuCtxCreate_v2 = win32api.GetProcAddress(handle, 'cuCtxCreate_v2') - except: - pass - {{endif}} - {{if 'cuCtxCreate_v3' in found_functions}} - try: - global __cuCtxCreate_v3 - __cuCtxCreate_v3 = win32api.GetProcAddress(handle, 'cuCtxCreate_v3') - except: - pass - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} - try: - global __cuCtxCreate_v4 - __cuCtxCreate_v4 = win32api.GetProcAddress(handle, 'cuCtxCreate_v4') - except: - pass - {{endif}} - {{if 'cuCtxDestroy_v2' in found_functions}} - try: - global __cuCtxDestroy_v2 - __cuCtxDestroy_v2 = win32api.GetProcAddress(handle, 'cuCtxDestroy_v2') - except: - pass - {{endif}} - {{if 'cuCtxPushCurrent_v2' in found_functions}} - try: - global __cuCtxPushCurrent_v2 - __cuCtxPushCurrent_v2 = win32api.GetProcAddress(handle, 'cuCtxPushCurrent_v2') - except: - pass - {{endif}} - {{if 'cuCtxPopCurrent_v2' in found_functions}} - try: - global __cuCtxPopCurrent_v2 - __cuCtxPopCurrent_v2 = win32api.GetProcAddress(handle, 'cuCtxPopCurrent_v2') - except: - pass - {{endif}} - {{if 'cuCtxSetCurrent' in found_functions}} - try: - global __cuCtxSetCurrent - __cuCtxSetCurrent = win32api.GetProcAddress(handle, 'cuCtxSetCurrent') - except: - pass - {{endif}} - {{if 'cuCtxGetCurrent' in found_functions}} - try: - global __cuCtxGetCurrent - __cuCtxGetCurrent = win32api.GetProcAddress(handle, 'cuCtxGetCurrent') - except: - pass - {{endif}} - {{if 'cuCtxGetDevice' in found_functions}} - try: - global __cuCtxGetDevice - __cuCtxGetDevice = win32api.GetProcAddress(handle, 'cuCtxGetDevice') - except: - pass - {{endif}} - {{if 'cuCtxGetFlags' in found_functions}} - try: - global __cuCtxGetFlags - __cuCtxGetFlags = win32api.GetProcAddress(handle, 'cuCtxGetFlags') - except: - pass - {{endif}} - {{if 'cuCtxSetFlags' in found_functions}} - try: - global __cuCtxSetFlags - __cuCtxSetFlags = win32api.GetProcAddress(handle, 'cuCtxSetFlags') - except: - pass - {{endif}} - {{if 'cuCtxGetId' in found_functions}} - try: - global __cuCtxGetId - __cuCtxGetId = win32api.GetProcAddress(handle, 'cuCtxGetId') - except: - pass - {{endif}} - {{if 'cuCtxSynchronize' in found_functions}} - try: - global __cuCtxSynchronize - __cuCtxSynchronize = win32api.GetProcAddress(handle, 'cuCtxSynchronize') - except: - pass - {{endif}} - {{if 'cuCtxSetLimit' in found_functions}} - try: - global __cuCtxSetLimit - __cuCtxSetLimit = win32api.GetProcAddress(handle, 'cuCtxSetLimit') - except: - pass - {{endif}} - {{if 'cuCtxGetLimit' in found_functions}} - try: - global __cuCtxGetLimit - __cuCtxGetLimit = win32api.GetProcAddress(handle, 'cuCtxGetLimit') - except: - pass - {{endif}} - {{if 'cuCtxGetCacheConfig' in found_functions}} - try: - global __cuCtxGetCacheConfig - __cuCtxGetCacheConfig = win32api.GetProcAddress(handle, 'cuCtxGetCacheConfig') - except: - pass - {{endif}} - {{if 'cuCtxSetCacheConfig' in found_functions}} - try: - global __cuCtxSetCacheConfig - __cuCtxSetCacheConfig = win32api.GetProcAddress(handle, 'cuCtxSetCacheConfig') - except: - pass - {{endif}} - {{if 'cuCtxGetApiVersion' in found_functions}} - try: - global __cuCtxGetApiVersion - __cuCtxGetApiVersion = win32api.GetProcAddress(handle, 'cuCtxGetApiVersion') - except: - pass - {{endif}} - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - try: - global __cuCtxGetStreamPriorityRange - __cuCtxGetStreamPriorityRange = win32api.GetProcAddress(handle, 'cuCtxGetStreamPriorityRange') - except: - pass - {{endif}} - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - try: - global __cuCtxResetPersistingL2Cache - __cuCtxResetPersistingL2Cache = win32api.GetProcAddress(handle, 'cuCtxResetPersistingL2Cache') - except: - pass - {{endif}} - {{if 'cuCtxGetExecAffinity' in found_functions}} - try: - global __cuCtxGetExecAffinity - __cuCtxGetExecAffinity = win32api.GetProcAddress(handle, 'cuCtxGetExecAffinity') - except: - pass - {{endif}} - {{if 'cuCtxRecordEvent' in found_functions}} - try: - global __cuCtxRecordEvent - __cuCtxRecordEvent = win32api.GetProcAddress(handle, 'cuCtxRecordEvent') - except: - pass - {{endif}} - {{if 'cuCtxWaitEvent' in found_functions}} - try: - global __cuCtxWaitEvent - __cuCtxWaitEvent = win32api.GetProcAddress(handle, 'cuCtxWaitEvent') - except: - pass - {{endif}} - {{if 'cuCtxAttach' in found_functions}} - try: - global __cuCtxAttach - __cuCtxAttach = win32api.GetProcAddress(handle, 'cuCtxAttach') - except: - pass - {{endif}} - {{if 'cuCtxDetach' in found_functions}} - try: - global __cuCtxDetach - __cuCtxDetach = win32api.GetProcAddress(handle, 'cuCtxDetach') - except: - pass - {{endif}} - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - try: - global __cuCtxGetSharedMemConfig - __cuCtxGetSharedMemConfig = win32api.GetProcAddress(handle, 'cuCtxGetSharedMemConfig') - except: - pass - {{endif}} - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - try: - global __cuCtxSetSharedMemConfig - __cuCtxSetSharedMemConfig = win32api.GetProcAddress(handle, 'cuCtxSetSharedMemConfig') - except: - pass - {{endif}} - {{if 'cuModuleLoad' in found_functions}} - try: - global __cuModuleLoad - __cuModuleLoad = win32api.GetProcAddress(handle, 'cuModuleLoad') - except: - pass - {{endif}} - {{if 'cuModuleLoadData' in found_functions}} - try: - global __cuModuleLoadData - __cuModuleLoadData = win32api.GetProcAddress(handle, 'cuModuleLoadData') - except: - pass - {{endif}} - {{if 'cuModuleLoadDataEx' in found_functions}} - try: - global __cuModuleLoadDataEx - __cuModuleLoadDataEx = win32api.GetProcAddress(handle, 'cuModuleLoadDataEx') - except: - pass - {{endif}} - {{if 'cuModuleLoadFatBinary' in found_functions}} - try: - global __cuModuleLoadFatBinary - __cuModuleLoadFatBinary = win32api.GetProcAddress(handle, 'cuModuleLoadFatBinary') - except: - pass - {{endif}} - {{if 'cuModuleUnload' in found_functions}} - try: - global __cuModuleUnload - __cuModuleUnload = win32api.GetProcAddress(handle, 'cuModuleUnload') - except: - pass - {{endif}} - {{if 'cuModuleGetLoadingMode' in found_functions}} - try: - global __cuModuleGetLoadingMode - __cuModuleGetLoadingMode = win32api.GetProcAddress(handle, 'cuModuleGetLoadingMode') - except: - pass - {{endif}} - {{if 'cuModuleGetFunction' in found_functions}} - try: - global __cuModuleGetFunction - __cuModuleGetFunction = win32api.GetProcAddress(handle, 'cuModuleGetFunction') - except: - pass - {{endif}} - {{if 'cuModuleGetFunctionCount' in found_functions}} - try: - global __cuModuleGetFunctionCount - __cuModuleGetFunctionCount = win32api.GetProcAddress(handle, 'cuModuleGetFunctionCount') - except: - pass - {{endif}} - {{if 'cuModuleEnumerateFunctions' in found_functions}} - try: - global __cuModuleEnumerateFunctions - __cuModuleEnumerateFunctions = win32api.GetProcAddress(handle, 'cuModuleEnumerateFunctions') - except: - pass - {{endif}} - {{if 'cuModuleGetGlobal_v2' in found_functions}} - try: - global __cuModuleGetGlobal_v2 - __cuModuleGetGlobal_v2 = win32api.GetProcAddress(handle, 'cuModuleGetGlobal_v2') - except: - pass - {{endif}} - {{if 'cuLinkCreate_v2' in found_functions}} - try: - global __cuLinkCreate_v2 - __cuLinkCreate_v2 = win32api.GetProcAddress(handle, 'cuLinkCreate_v2') - except: - pass - {{endif}} - {{if 'cuLinkAddData_v2' in found_functions}} - try: - global __cuLinkAddData_v2 - __cuLinkAddData_v2 = win32api.GetProcAddress(handle, 'cuLinkAddData_v2') - except: - pass - {{endif}} - {{if 'cuLinkAddFile_v2' in found_functions}} - try: - global __cuLinkAddFile_v2 - __cuLinkAddFile_v2 = win32api.GetProcAddress(handle, 'cuLinkAddFile_v2') - except: - pass - {{endif}} - {{if 'cuLinkComplete' in found_functions}} - try: - global __cuLinkComplete - __cuLinkComplete = win32api.GetProcAddress(handle, 'cuLinkComplete') - except: - pass - {{endif}} - {{if 'cuLinkDestroy' in found_functions}} - try: - global __cuLinkDestroy - __cuLinkDestroy = win32api.GetProcAddress(handle, 'cuLinkDestroy') - except: - pass - {{endif}} - {{if 'cuModuleGetTexRef' in found_functions}} - try: - global __cuModuleGetTexRef - __cuModuleGetTexRef = win32api.GetProcAddress(handle, 'cuModuleGetTexRef') - except: - pass - {{endif}} - {{if 'cuModuleGetSurfRef' in found_functions}} - try: - global __cuModuleGetSurfRef - __cuModuleGetSurfRef = win32api.GetProcAddress(handle, 'cuModuleGetSurfRef') - except: - pass - {{endif}} - {{if 'cuLibraryLoadData' in found_functions}} - try: - global __cuLibraryLoadData - __cuLibraryLoadData = win32api.GetProcAddress(handle, 'cuLibraryLoadData') - except: - pass - {{endif}} - {{if 'cuLibraryLoadFromFile' in found_functions}} - try: - global __cuLibraryLoadFromFile - __cuLibraryLoadFromFile = win32api.GetProcAddress(handle, 'cuLibraryLoadFromFile') - except: - pass - {{endif}} - {{if 'cuLibraryUnload' in found_functions}} - try: - global __cuLibraryUnload - __cuLibraryUnload = win32api.GetProcAddress(handle, 'cuLibraryUnload') - except: - pass - {{endif}} - {{if 'cuLibraryGetKernel' in found_functions}} - try: - global __cuLibraryGetKernel - __cuLibraryGetKernel = win32api.GetProcAddress(handle, 'cuLibraryGetKernel') - except: - pass - {{endif}} - {{if 'cuLibraryGetKernelCount' in found_functions}} - try: - global __cuLibraryGetKernelCount - __cuLibraryGetKernelCount = win32api.GetProcAddress(handle, 'cuLibraryGetKernelCount') - except: - pass - {{endif}} - {{if 'cuLibraryEnumerateKernels' in found_functions}} - try: - global __cuLibraryEnumerateKernels - __cuLibraryEnumerateKernels = win32api.GetProcAddress(handle, 'cuLibraryEnumerateKernels') - except: - pass - {{endif}} - {{if 'cuLibraryGetModule' in found_functions}} - try: - global __cuLibraryGetModule - __cuLibraryGetModule = win32api.GetProcAddress(handle, 'cuLibraryGetModule') - except: - pass - {{endif}} - {{if 'cuKernelGetFunction' in found_functions}} - try: - global __cuKernelGetFunction - __cuKernelGetFunction = win32api.GetProcAddress(handle, 'cuKernelGetFunction') - except: - pass - {{endif}} - {{if 'cuKernelGetLibrary' in found_functions}} - try: - global __cuKernelGetLibrary - __cuKernelGetLibrary = win32api.GetProcAddress(handle, 'cuKernelGetLibrary') - except: - pass - {{endif}} - {{if 'cuLibraryGetGlobal' in found_functions}} - try: - global __cuLibraryGetGlobal - __cuLibraryGetGlobal = win32api.GetProcAddress(handle, 'cuLibraryGetGlobal') - except: - pass - {{endif}} - {{if 'cuLibraryGetManaged' in found_functions}} - try: - global __cuLibraryGetManaged - __cuLibraryGetManaged = win32api.GetProcAddress(handle, 'cuLibraryGetManaged') - except: - pass - {{endif}} - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - try: - global __cuLibraryGetUnifiedFunction - __cuLibraryGetUnifiedFunction = win32api.GetProcAddress(handle, 'cuLibraryGetUnifiedFunction') - except: - pass - {{endif}} - {{if 'cuKernelGetAttribute' in found_functions}} - try: - global __cuKernelGetAttribute - __cuKernelGetAttribute = win32api.GetProcAddress(handle, 'cuKernelGetAttribute') - except: - pass - {{endif}} - {{if 'cuKernelSetAttribute' in found_functions}} - try: - global __cuKernelSetAttribute - __cuKernelSetAttribute = win32api.GetProcAddress(handle, 'cuKernelSetAttribute') - except: - pass - {{endif}} - {{if 'cuKernelSetCacheConfig' in found_functions}} - try: - global __cuKernelSetCacheConfig - __cuKernelSetCacheConfig = win32api.GetProcAddress(handle, 'cuKernelSetCacheConfig') - except: - pass - {{endif}} - {{if 'cuKernelGetName' in found_functions}} - try: - global __cuKernelGetName - __cuKernelGetName = win32api.GetProcAddress(handle, 'cuKernelGetName') - except: - pass - {{endif}} - {{if 'cuKernelGetParamInfo' in found_functions}} - try: - global __cuKernelGetParamInfo - __cuKernelGetParamInfo = win32api.GetProcAddress(handle, 'cuKernelGetParamInfo') - except: - pass - {{endif}} - {{if 'cuMemGetInfo_v2' in found_functions}} - try: - global __cuMemGetInfo_v2 - __cuMemGetInfo_v2 = win32api.GetProcAddress(handle, 'cuMemGetInfo_v2') - except: - pass - {{endif}} - {{if 'cuMemAlloc_v2' in found_functions}} - try: - global __cuMemAlloc_v2 - __cuMemAlloc_v2 = win32api.GetProcAddress(handle, 'cuMemAlloc_v2') - except: - pass - {{endif}} - {{if 'cuMemAllocPitch_v2' in found_functions}} - try: - global __cuMemAllocPitch_v2 - __cuMemAllocPitch_v2 = win32api.GetProcAddress(handle, 'cuMemAllocPitch_v2') - except: - pass - {{endif}} - {{if 'cuMemFree_v2' in found_functions}} - try: - global __cuMemFree_v2 - __cuMemFree_v2 = win32api.GetProcAddress(handle, 'cuMemFree_v2') - except: - pass - {{endif}} - {{if 'cuMemGetAddressRange_v2' in found_functions}} - try: - global __cuMemGetAddressRange_v2 - __cuMemGetAddressRange_v2 = win32api.GetProcAddress(handle, 'cuMemGetAddressRange_v2') - except: - pass - {{endif}} - {{if 'cuMemAllocHost_v2' in found_functions}} - try: - global __cuMemAllocHost_v2 - __cuMemAllocHost_v2 = win32api.GetProcAddress(handle, 'cuMemAllocHost_v2') - except: - pass - {{endif}} - {{if 'cuMemFreeHost' in found_functions}} - try: - global __cuMemFreeHost - __cuMemFreeHost = win32api.GetProcAddress(handle, 'cuMemFreeHost') - except: - pass - {{endif}} - {{if 'cuMemHostAlloc' in found_functions}} - try: - global __cuMemHostAlloc - __cuMemHostAlloc = win32api.GetProcAddress(handle, 'cuMemHostAlloc') - except: - pass - {{endif}} - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - try: - global __cuMemHostGetDevicePointer_v2 - __cuMemHostGetDevicePointer_v2 = win32api.GetProcAddress(handle, 'cuMemHostGetDevicePointer_v2') - except: - pass - {{endif}} - {{if 'cuMemHostGetFlags' in found_functions}} - try: - global __cuMemHostGetFlags - __cuMemHostGetFlags = win32api.GetProcAddress(handle, 'cuMemHostGetFlags') - except: - pass - {{endif}} - {{if 'cuMemAllocManaged' in found_functions}} - try: - global __cuMemAllocManaged - __cuMemAllocManaged = win32api.GetProcAddress(handle, 'cuMemAllocManaged') - except: - pass - {{endif}} - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - try: - global __cuDeviceRegisterAsyncNotification - __cuDeviceRegisterAsyncNotification = win32api.GetProcAddress(handle, 'cuDeviceRegisterAsyncNotification') - except: - pass - {{endif}} - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - try: - global __cuDeviceUnregisterAsyncNotification - __cuDeviceUnregisterAsyncNotification = win32api.GetProcAddress(handle, 'cuDeviceUnregisterAsyncNotification') - except: - pass - {{endif}} - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - try: - global __cuDeviceGetByPCIBusId - __cuDeviceGetByPCIBusId = win32api.GetProcAddress(handle, 'cuDeviceGetByPCIBusId') - except: - pass - {{endif}} - {{if 'cuDeviceGetPCIBusId' in found_functions}} - try: - global __cuDeviceGetPCIBusId - __cuDeviceGetPCIBusId = win32api.GetProcAddress(handle, 'cuDeviceGetPCIBusId') - except: - pass - {{endif}} - {{if 'cuIpcGetEventHandle' in found_functions}} - try: - global __cuIpcGetEventHandle - __cuIpcGetEventHandle = win32api.GetProcAddress(handle, 'cuIpcGetEventHandle') - except: - pass - {{endif}} - {{if 'cuIpcOpenEventHandle' in found_functions}} - try: - global __cuIpcOpenEventHandle - __cuIpcOpenEventHandle = win32api.GetProcAddress(handle, 'cuIpcOpenEventHandle') - except: - pass - {{endif}} - {{if 'cuIpcGetMemHandle' in found_functions}} - try: - global __cuIpcGetMemHandle - __cuIpcGetMemHandle = win32api.GetProcAddress(handle, 'cuIpcGetMemHandle') - except: - pass - {{endif}} - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - try: - global __cuIpcOpenMemHandle_v2 - __cuIpcOpenMemHandle_v2 = win32api.GetProcAddress(handle, 'cuIpcOpenMemHandle_v2') - except: - pass - {{endif}} - {{if 'cuIpcCloseMemHandle' in found_functions}} - try: - global __cuIpcCloseMemHandle - __cuIpcCloseMemHandle = win32api.GetProcAddress(handle, 'cuIpcCloseMemHandle') - except: - pass - {{endif}} - {{if 'cuMemHostRegister_v2' in found_functions}} - try: - global __cuMemHostRegister_v2 - __cuMemHostRegister_v2 = win32api.GetProcAddress(handle, 'cuMemHostRegister_v2') - except: - pass - {{endif}} - {{if 'cuMemHostUnregister' in found_functions}} - try: - global __cuMemHostUnregister - __cuMemHostUnregister = win32api.GetProcAddress(handle, 'cuMemHostUnregister') - except: - pass - {{endif}} - {{if 'cuArrayCreate_v2' in found_functions}} - try: - global __cuArrayCreate_v2 - __cuArrayCreate_v2 = win32api.GetProcAddress(handle, 'cuArrayCreate_v2') - except: - pass - {{endif}} - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - try: - global __cuArrayGetDescriptor_v2 - __cuArrayGetDescriptor_v2 = win32api.GetProcAddress(handle, 'cuArrayGetDescriptor_v2') - except: - pass - {{endif}} - {{if 'cuArrayGetSparseProperties' in found_functions}} - try: - global __cuArrayGetSparseProperties - __cuArrayGetSparseProperties = win32api.GetProcAddress(handle, 'cuArrayGetSparseProperties') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - try: - global __cuMipmappedArrayGetSparseProperties - __cuMipmappedArrayGetSparseProperties = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetSparseProperties') - except: - pass - {{endif}} - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - try: - global __cuArrayGetMemoryRequirements - __cuArrayGetMemoryRequirements = win32api.GetProcAddress(handle, 'cuArrayGetMemoryRequirements') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - try: - global __cuMipmappedArrayGetMemoryRequirements - __cuMipmappedArrayGetMemoryRequirements = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetMemoryRequirements') - except: - pass - {{endif}} - {{if 'cuArrayGetPlane' in found_functions}} - try: - global __cuArrayGetPlane - __cuArrayGetPlane = win32api.GetProcAddress(handle, 'cuArrayGetPlane') - except: - pass - {{endif}} - {{if 'cuArrayDestroy' in found_functions}} - try: - global __cuArrayDestroy - __cuArrayDestroy = win32api.GetProcAddress(handle, 'cuArrayDestroy') - except: - pass - {{endif}} - {{if 'cuArray3DCreate_v2' in found_functions}} - try: - global __cuArray3DCreate_v2 - __cuArray3DCreate_v2 = win32api.GetProcAddress(handle, 'cuArray3DCreate_v2') - except: - pass - {{endif}} - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - try: - global __cuArray3DGetDescriptor_v2 - __cuArray3DGetDescriptor_v2 = win32api.GetProcAddress(handle, 'cuArray3DGetDescriptor_v2') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayCreate' in found_functions}} - try: - global __cuMipmappedArrayCreate - __cuMipmappedArrayCreate = win32api.GetProcAddress(handle, 'cuMipmappedArrayCreate') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - try: - global __cuMipmappedArrayGetLevel - __cuMipmappedArrayGetLevel = win32api.GetProcAddress(handle, 'cuMipmappedArrayGetLevel') - except: - pass - {{endif}} - {{if 'cuMipmappedArrayDestroy' in found_functions}} - try: - global __cuMipmappedArrayDestroy - __cuMipmappedArrayDestroy = win32api.GetProcAddress(handle, 'cuMipmappedArrayDestroy') - except: - pass - {{endif}} - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - try: - global __cuMemGetHandleForAddressRange - __cuMemGetHandleForAddressRange = win32api.GetProcAddress(handle, 'cuMemGetHandleForAddressRange') - except: - pass - {{endif}} - {{if 'cuMemAddressReserve' in found_functions}} - try: - global __cuMemAddressReserve - __cuMemAddressReserve = win32api.GetProcAddress(handle, 'cuMemAddressReserve') - except: - pass - {{endif}} - {{if 'cuMemAddressFree' in found_functions}} - try: - global __cuMemAddressFree - __cuMemAddressFree = win32api.GetProcAddress(handle, 'cuMemAddressFree') - except: - pass - {{endif}} - {{if 'cuMemCreate' in found_functions}} - try: - global __cuMemCreate - __cuMemCreate = win32api.GetProcAddress(handle, 'cuMemCreate') - except: - pass - {{endif}} - {{if 'cuMemRelease' in found_functions}} - try: - global __cuMemRelease - __cuMemRelease = win32api.GetProcAddress(handle, 'cuMemRelease') - except: - pass - {{endif}} - {{if 'cuMemMap' in found_functions}} - try: - global __cuMemMap - __cuMemMap = win32api.GetProcAddress(handle, 'cuMemMap') - except: - pass - {{endif}} - {{if 'cuMemUnmap' in found_functions}} - try: - global __cuMemUnmap - __cuMemUnmap = win32api.GetProcAddress(handle, 'cuMemUnmap') - except: - pass - {{endif}} - {{if 'cuMemSetAccess' in found_functions}} - try: - global __cuMemSetAccess - __cuMemSetAccess = win32api.GetProcAddress(handle, 'cuMemSetAccess') - except: - pass - {{endif}} - {{if 'cuMemGetAccess' in found_functions}} - try: - global __cuMemGetAccess - __cuMemGetAccess = win32api.GetProcAddress(handle, 'cuMemGetAccess') - except: - pass - {{endif}} - {{if 'cuMemExportToShareableHandle' in found_functions}} - try: - global __cuMemExportToShareableHandle - __cuMemExportToShareableHandle = win32api.GetProcAddress(handle, 'cuMemExportToShareableHandle') - except: - pass - {{endif}} - {{if 'cuMemImportFromShareableHandle' in found_functions}} - try: - global __cuMemImportFromShareableHandle - __cuMemImportFromShareableHandle = win32api.GetProcAddress(handle, 'cuMemImportFromShareableHandle') - except: - pass - {{endif}} - {{if 'cuMemGetAllocationGranularity' in found_functions}} - try: - global __cuMemGetAllocationGranularity - __cuMemGetAllocationGranularity = win32api.GetProcAddress(handle, 'cuMemGetAllocationGranularity') - except: - pass - {{endif}} - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - try: - global __cuMemGetAllocationPropertiesFromHandle - __cuMemGetAllocationPropertiesFromHandle = win32api.GetProcAddress(handle, 'cuMemGetAllocationPropertiesFromHandle') - except: - pass - {{endif}} - {{if 'cuMemRetainAllocationHandle' in found_functions}} - try: - global __cuMemRetainAllocationHandle - __cuMemRetainAllocationHandle = win32api.GetProcAddress(handle, 'cuMemRetainAllocationHandle') - except: - pass - {{endif}} - {{if 'cuMemPoolTrimTo' in found_functions}} - try: - global __cuMemPoolTrimTo - __cuMemPoolTrimTo = win32api.GetProcAddress(handle, 'cuMemPoolTrimTo') - except: - pass - {{endif}} - {{if 'cuMemPoolSetAttribute' in found_functions}} - try: - global __cuMemPoolSetAttribute - __cuMemPoolSetAttribute = win32api.GetProcAddress(handle, 'cuMemPoolSetAttribute') - except: - pass - {{endif}} - {{if 'cuMemPoolGetAttribute' in found_functions}} - try: - global __cuMemPoolGetAttribute - __cuMemPoolGetAttribute = win32api.GetProcAddress(handle, 'cuMemPoolGetAttribute') - except: - pass - {{endif}} - {{if 'cuMemPoolSetAccess' in found_functions}} - try: - global __cuMemPoolSetAccess - __cuMemPoolSetAccess = win32api.GetProcAddress(handle, 'cuMemPoolSetAccess') - except: - pass - {{endif}} - {{if 'cuMemPoolGetAccess' in found_functions}} - try: - global __cuMemPoolGetAccess - __cuMemPoolGetAccess = win32api.GetProcAddress(handle, 'cuMemPoolGetAccess') - except: - pass - {{endif}} - {{if 'cuMemPoolCreate' in found_functions}} - try: - global __cuMemPoolCreate - __cuMemPoolCreate = win32api.GetProcAddress(handle, 'cuMemPoolCreate') - except: - pass - {{endif}} - {{if 'cuMemPoolDestroy' in found_functions}} - try: - global __cuMemPoolDestroy - __cuMemPoolDestroy = win32api.GetProcAddress(handle, 'cuMemPoolDestroy') - except: - pass - {{endif}} - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - try: - global __cuMemPoolExportToShareableHandle - __cuMemPoolExportToShareableHandle = win32api.GetProcAddress(handle, 'cuMemPoolExportToShareableHandle') - except: - pass - {{endif}} - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - try: - global __cuMemPoolImportFromShareableHandle - __cuMemPoolImportFromShareableHandle = win32api.GetProcAddress(handle, 'cuMemPoolImportFromShareableHandle') - except: - pass - {{endif}} - {{if 'cuMemPoolExportPointer' in found_functions}} - try: - global __cuMemPoolExportPointer - __cuMemPoolExportPointer = win32api.GetProcAddress(handle, 'cuMemPoolExportPointer') - except: - pass - {{endif}} - {{if 'cuMemPoolImportPointer' in found_functions}} - try: - global __cuMemPoolImportPointer - __cuMemPoolImportPointer = win32api.GetProcAddress(handle, 'cuMemPoolImportPointer') - except: - pass - {{endif}} - {{if 'cuMulticastCreate' in found_functions}} - try: - global __cuMulticastCreate - __cuMulticastCreate = win32api.GetProcAddress(handle, 'cuMulticastCreate') - except: - pass - {{endif}} - {{if 'cuMulticastAddDevice' in found_functions}} - try: - global __cuMulticastAddDevice - __cuMulticastAddDevice = win32api.GetProcAddress(handle, 'cuMulticastAddDevice') - except: - pass - {{endif}} - {{if 'cuMulticastBindMem' in found_functions}} - try: - global __cuMulticastBindMem - __cuMulticastBindMem = win32api.GetProcAddress(handle, 'cuMulticastBindMem') - except: - pass - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - try: - global __cuMulticastBindAddr - __cuMulticastBindAddr = win32api.GetProcAddress(handle, 'cuMulticastBindAddr') - except: - pass - {{endif}} - {{if 'cuMulticastUnbind' in found_functions}} - try: - global __cuMulticastUnbind - __cuMulticastUnbind = win32api.GetProcAddress(handle, 'cuMulticastUnbind') - except: - pass - {{endif}} - {{if 'cuMulticastGetGranularity' in found_functions}} - try: - global __cuMulticastGetGranularity - __cuMulticastGetGranularity = win32api.GetProcAddress(handle, 'cuMulticastGetGranularity') - except: - pass - {{endif}} - {{if 'cuPointerGetAttribute' in found_functions}} - try: - global __cuPointerGetAttribute - __cuPointerGetAttribute = win32api.GetProcAddress(handle, 'cuPointerGetAttribute') - except: - pass - {{endif}} - {{if 'cuMemAdvise' in found_functions}} - try: - global __cuMemAdvise - __cuMemAdvise = win32api.GetProcAddress(handle, 'cuMemAdvise') - except: - pass - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} - try: - global __cuMemAdvise_v2 - __cuMemAdvise_v2 = win32api.GetProcAddress(handle, 'cuMemAdvise_v2') - except: - pass - {{endif}} - {{if 'cuMemRangeGetAttribute' in found_functions}} - try: - global __cuMemRangeGetAttribute - __cuMemRangeGetAttribute = win32api.GetProcAddress(handle, 'cuMemRangeGetAttribute') - except: - pass - {{endif}} - {{if 'cuMemRangeGetAttributes' in found_functions}} - try: - global __cuMemRangeGetAttributes - __cuMemRangeGetAttributes = win32api.GetProcAddress(handle, 'cuMemRangeGetAttributes') - except: - pass - {{endif}} - {{if 'cuPointerSetAttribute' in found_functions}} - try: - global __cuPointerSetAttribute - __cuPointerSetAttribute = win32api.GetProcAddress(handle, 'cuPointerSetAttribute') - except: - pass - {{endif}} - {{if 'cuPointerGetAttributes' in found_functions}} - try: - global __cuPointerGetAttributes - __cuPointerGetAttributes = win32api.GetProcAddress(handle, 'cuPointerGetAttributes') - except: - pass - {{endif}} - {{if 'cuStreamCreate' in found_functions}} - try: - global __cuStreamCreate - __cuStreamCreate = win32api.GetProcAddress(handle, 'cuStreamCreate') - except: - pass - {{endif}} - {{if 'cuStreamCreateWithPriority' in found_functions}} - try: - global __cuStreamCreateWithPriority - __cuStreamCreateWithPriority = win32api.GetProcAddress(handle, 'cuStreamCreateWithPriority') - except: - pass - {{endif}} - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - try: - global __cuThreadExchangeStreamCaptureMode - __cuThreadExchangeStreamCaptureMode = win32api.GetProcAddress(handle, 'cuThreadExchangeStreamCaptureMode') - except: - pass - {{endif}} - {{if 'cuStreamDestroy_v2' in found_functions}} - try: - global __cuStreamDestroy_v2 - __cuStreamDestroy_v2 = win32api.GetProcAddress(handle, 'cuStreamDestroy_v2') - except: - pass - {{endif}} - {{if 'cuEventCreate' in found_functions}} - try: - global __cuEventCreate - __cuEventCreate = win32api.GetProcAddress(handle, 'cuEventCreate') - except: - pass - {{endif}} - {{if 'cuEventQuery' in found_functions}} - try: - global __cuEventQuery - __cuEventQuery = win32api.GetProcAddress(handle, 'cuEventQuery') - except: - pass - {{endif}} - {{if 'cuEventSynchronize' in found_functions}} - try: - global __cuEventSynchronize - __cuEventSynchronize = win32api.GetProcAddress(handle, 'cuEventSynchronize') - except: - pass - {{endif}} - {{if 'cuEventDestroy_v2' in found_functions}} - try: - global __cuEventDestroy_v2 - __cuEventDestroy_v2 = win32api.GetProcAddress(handle, 'cuEventDestroy_v2') - except: - pass - {{endif}} - {{if 'cuEventElapsedTime' in found_functions}} - try: - global __cuEventElapsedTime - __cuEventElapsedTime = win32api.GetProcAddress(handle, 'cuEventElapsedTime') - except: - pass - {{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} - try: - global __cuEventElapsedTime_v2 - __cuEventElapsedTime_v2 = win32api.GetProcAddress(handle, 'cuEventElapsedTime_v2') - except: - pass - {{endif}} - {{if 'cuImportExternalMemory' in found_functions}} - try: - global __cuImportExternalMemory - __cuImportExternalMemory = win32api.GetProcAddress(handle, 'cuImportExternalMemory') - except: - pass - {{endif}} - {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - try: - global __cuExternalMemoryGetMappedBuffer - __cuExternalMemoryGetMappedBuffer = win32api.GetProcAddress(handle, 'cuExternalMemoryGetMappedBuffer') - except: - pass - {{endif}} - {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - try: - global __cuExternalMemoryGetMappedMipmappedArray - __cuExternalMemoryGetMappedMipmappedArray = win32api.GetProcAddress(handle, 'cuExternalMemoryGetMappedMipmappedArray') - except: - pass - {{endif}} - {{if 'cuDestroyExternalMemory' in found_functions}} - try: - global __cuDestroyExternalMemory - __cuDestroyExternalMemory = win32api.GetProcAddress(handle, 'cuDestroyExternalMemory') - except: - pass - {{endif}} - {{if 'cuImportExternalSemaphore' in found_functions}} - try: - global __cuImportExternalSemaphore - __cuImportExternalSemaphore = win32api.GetProcAddress(handle, 'cuImportExternalSemaphore') - except: - pass - {{endif}} - {{if 'cuDestroyExternalSemaphore' in found_functions}} - try: - global __cuDestroyExternalSemaphore - __cuDestroyExternalSemaphore = win32api.GetProcAddress(handle, 'cuDestroyExternalSemaphore') - except: - pass - {{endif}} - {{if 'cuFuncGetAttribute' in found_functions}} - try: - global __cuFuncGetAttribute - __cuFuncGetAttribute = win32api.GetProcAddress(handle, 'cuFuncGetAttribute') - except: - pass - {{endif}} - {{if 'cuFuncSetAttribute' in found_functions}} - try: - global __cuFuncSetAttribute - __cuFuncSetAttribute = win32api.GetProcAddress(handle, 'cuFuncSetAttribute') - except: - pass - {{endif}} - {{if 'cuFuncSetCacheConfig' in found_functions}} - try: - global __cuFuncSetCacheConfig - __cuFuncSetCacheConfig = win32api.GetProcAddress(handle, 'cuFuncSetCacheConfig') - except: - pass - {{endif}} - {{if 'cuFuncGetModule' in found_functions}} - try: - global __cuFuncGetModule - __cuFuncGetModule = win32api.GetProcAddress(handle, 'cuFuncGetModule') - except: - pass - {{endif}} - {{if 'cuFuncGetName' in found_functions}} - try: - global __cuFuncGetName - __cuFuncGetName = win32api.GetProcAddress(handle, 'cuFuncGetName') - except: - pass - {{endif}} - {{if 'cuFuncGetParamInfo' in found_functions}} - try: - global __cuFuncGetParamInfo - __cuFuncGetParamInfo = win32api.GetProcAddress(handle, 'cuFuncGetParamInfo') - except: - pass - {{endif}} - {{if 'cuFuncIsLoaded' in found_functions}} - try: - global __cuFuncIsLoaded - __cuFuncIsLoaded = win32api.GetProcAddress(handle, 'cuFuncIsLoaded') - except: - pass - {{endif}} - {{if 'cuFuncLoad' in found_functions}} - try: - global __cuFuncLoad - __cuFuncLoad = win32api.GetProcAddress(handle, 'cuFuncLoad') - except: - pass - {{endif}} - {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - try: - global __cuLaunchCooperativeKernelMultiDevice - __cuLaunchCooperativeKernelMultiDevice = win32api.GetProcAddress(handle, 'cuLaunchCooperativeKernelMultiDevice') - except: - pass - {{endif}} - {{if 'cuFuncSetBlockShape' in found_functions}} - try: - global __cuFuncSetBlockShape - __cuFuncSetBlockShape = win32api.GetProcAddress(handle, 'cuFuncSetBlockShape') - except: - pass - {{endif}} - {{if 'cuFuncSetSharedSize' in found_functions}} - try: - global __cuFuncSetSharedSize - __cuFuncSetSharedSize = win32api.GetProcAddress(handle, 'cuFuncSetSharedSize') - except: - pass - {{endif}} - {{if 'cuParamSetSize' in found_functions}} - try: - global __cuParamSetSize - __cuParamSetSize = win32api.GetProcAddress(handle, 'cuParamSetSize') - except: - pass - {{endif}} - {{if 'cuParamSeti' in found_functions}} - try: - global __cuParamSeti - __cuParamSeti = win32api.GetProcAddress(handle, 'cuParamSeti') - except: - pass - {{endif}} - {{if 'cuParamSetf' in found_functions}} - try: - global __cuParamSetf - __cuParamSetf = win32api.GetProcAddress(handle, 'cuParamSetf') - except: - pass - {{endif}} - {{if 'cuParamSetv' in found_functions}} - try: - global __cuParamSetv - __cuParamSetv = win32api.GetProcAddress(handle, 'cuParamSetv') - except: - pass - {{endif}} - {{if 'cuLaunch' in found_functions}} - try: - global __cuLaunch - __cuLaunch = win32api.GetProcAddress(handle, 'cuLaunch') - except: - pass - {{endif}} - {{if 'cuLaunchGrid' in found_functions}} - try: - global __cuLaunchGrid - __cuLaunchGrid = win32api.GetProcAddress(handle, 'cuLaunchGrid') - except: - pass - {{endif}} - {{if 'cuLaunchGridAsync' in found_functions}} - try: - global __cuLaunchGridAsync - __cuLaunchGridAsync = win32api.GetProcAddress(handle, 'cuLaunchGridAsync') - except: - pass - {{endif}} - {{if 'cuParamSetTexRef' in found_functions}} - try: - global __cuParamSetTexRef - __cuParamSetTexRef = win32api.GetProcAddress(handle, 'cuParamSetTexRef') - except: - pass - {{endif}} - {{if 'cuFuncSetSharedMemConfig' in found_functions}} - try: - global __cuFuncSetSharedMemConfig - __cuFuncSetSharedMemConfig = win32api.GetProcAddress(handle, 'cuFuncSetSharedMemConfig') - except: - pass - {{endif}} - {{if 'cuGraphCreate' in found_functions}} - try: - global __cuGraphCreate - __cuGraphCreate = win32api.GetProcAddress(handle, 'cuGraphCreate') - except: - pass - {{endif}} - {{if 'cuGraphAddKernelNode_v2' in found_functions}} - try: - global __cuGraphAddKernelNode_v2 - __cuGraphAddKernelNode_v2 = win32api.GetProcAddress(handle, 'cuGraphAddKernelNode_v2') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - try: - global __cuGraphKernelNodeGetParams_v2 - __cuGraphKernelNodeGetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphKernelNodeGetParams_v2') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - try: - global __cuGraphKernelNodeSetParams_v2 - __cuGraphKernelNodeSetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphKernelNodeSetParams_v2') - except: - pass - {{endif}} - {{if 'cuGraphAddMemcpyNode' in found_functions}} - try: - global __cuGraphAddMemcpyNode - __cuGraphAddMemcpyNode = win32api.GetProcAddress(handle, 'cuGraphAddMemcpyNode') - except: - pass - {{endif}} - {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - try: - global __cuGraphMemcpyNodeGetParams - __cuGraphMemcpyNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemcpyNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - try: - global __cuGraphMemcpyNodeSetParams - __cuGraphMemcpyNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphMemcpyNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddMemsetNode' in found_functions}} - try: - global __cuGraphAddMemsetNode - __cuGraphAddMemsetNode = win32api.GetProcAddress(handle, 'cuGraphAddMemsetNode') - except: - pass - {{endif}} - {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - try: - global __cuGraphMemsetNodeGetParams - __cuGraphMemsetNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemsetNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - try: - global __cuGraphMemsetNodeSetParams - __cuGraphMemsetNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphMemsetNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddHostNode' in found_functions}} - try: - global __cuGraphAddHostNode - __cuGraphAddHostNode = win32api.GetProcAddress(handle, 'cuGraphAddHostNode') - except: - pass - {{endif}} - {{if 'cuGraphHostNodeGetParams' in found_functions}} - try: - global __cuGraphHostNodeGetParams - __cuGraphHostNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphHostNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphHostNodeSetParams' in found_functions}} - try: - global __cuGraphHostNodeSetParams - __cuGraphHostNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphHostNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddChildGraphNode' in found_functions}} - try: - global __cuGraphAddChildGraphNode - __cuGraphAddChildGraphNode = win32api.GetProcAddress(handle, 'cuGraphAddChildGraphNode') - except: - pass - {{endif}} - {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - try: - global __cuGraphChildGraphNodeGetGraph - __cuGraphChildGraphNodeGetGraph = win32api.GetProcAddress(handle, 'cuGraphChildGraphNodeGetGraph') - except: - pass - {{endif}} - {{if 'cuGraphAddEmptyNode' in found_functions}} - try: - global __cuGraphAddEmptyNode - __cuGraphAddEmptyNode = win32api.GetProcAddress(handle, 'cuGraphAddEmptyNode') - except: - pass - {{endif}} - {{if 'cuGraphAddEventRecordNode' in found_functions}} - try: - global __cuGraphAddEventRecordNode - __cuGraphAddEventRecordNode = win32api.GetProcAddress(handle, 'cuGraphAddEventRecordNode') - except: - pass - {{endif}} - {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - try: - global __cuGraphEventRecordNodeGetEvent - __cuGraphEventRecordNodeGetEvent = win32api.GetProcAddress(handle, 'cuGraphEventRecordNodeGetEvent') - except: - pass - {{endif}} - {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - try: - global __cuGraphEventRecordNodeSetEvent - __cuGraphEventRecordNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphEventRecordNodeSetEvent') - except: - pass - {{endif}} - {{if 'cuGraphAddEventWaitNode' in found_functions}} - try: - global __cuGraphAddEventWaitNode - __cuGraphAddEventWaitNode = win32api.GetProcAddress(handle, 'cuGraphAddEventWaitNode') - except: - pass - {{endif}} - {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - try: - global __cuGraphEventWaitNodeGetEvent - __cuGraphEventWaitNodeGetEvent = win32api.GetProcAddress(handle, 'cuGraphEventWaitNodeGetEvent') - except: - pass - {{endif}} - {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - try: - global __cuGraphEventWaitNodeSetEvent - __cuGraphEventWaitNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphEventWaitNodeSetEvent') - except: - pass - {{endif}} - {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - try: - global __cuGraphAddExternalSemaphoresSignalNode - __cuGraphAddExternalSemaphoresSignalNode = win32api.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresSignalNode') - except: - pass - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresSignalNodeGetParams - __cuGraphExternalSemaphoresSignalNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresSignalNodeSetParams - __cuGraphExternalSemaphoresSignalNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - try: - global __cuGraphAddExternalSemaphoresWaitNode - __cuGraphAddExternalSemaphoresWaitNode = win32api.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresWaitNode') - except: - pass - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresWaitNodeGetParams - __cuGraphExternalSemaphoresWaitNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - try: - global __cuGraphExternalSemaphoresWaitNodeSetParams - __cuGraphExternalSemaphoresWaitNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - try: - global __cuGraphAddBatchMemOpNode - __cuGraphAddBatchMemOpNode = win32api.GetProcAddress(handle, 'cuGraphAddBatchMemOpNode') - except: - pass - {{endif}} - {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - try: - global __cuGraphBatchMemOpNodeGetParams - __cuGraphBatchMemOpNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphBatchMemOpNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - try: - global __cuGraphBatchMemOpNodeSetParams - __cuGraphBatchMemOpNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphBatchMemOpNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - try: - global __cuGraphExecBatchMemOpNodeSetParams - __cuGraphExecBatchMemOpNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecBatchMemOpNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddMemAllocNode' in found_functions}} - try: - global __cuGraphAddMemAllocNode - __cuGraphAddMemAllocNode = win32api.GetProcAddress(handle, 'cuGraphAddMemAllocNode') - except: - pass - {{endif}} - {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - try: - global __cuGraphMemAllocNodeGetParams - __cuGraphMemAllocNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemAllocNodeGetParams') - except: - pass - {{endif}} - {{if 'cuGraphAddMemFreeNode' in found_functions}} - try: - global __cuGraphAddMemFreeNode - __cuGraphAddMemFreeNode = win32api.GetProcAddress(handle, 'cuGraphAddMemFreeNode') - except: - pass - {{endif}} - {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - try: - global __cuGraphMemFreeNodeGetParams - __cuGraphMemFreeNodeGetParams = win32api.GetProcAddress(handle, 'cuGraphMemFreeNodeGetParams') - except: - pass - {{endif}} - {{if 'cuDeviceGraphMemTrim' in found_functions}} - try: - global __cuDeviceGraphMemTrim - __cuDeviceGraphMemTrim = win32api.GetProcAddress(handle, 'cuDeviceGraphMemTrim') - except: - pass - {{endif}} - {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - try: - global __cuDeviceGetGraphMemAttribute - __cuDeviceGetGraphMemAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetGraphMemAttribute') - except: - pass - {{endif}} - {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - try: - global __cuDeviceSetGraphMemAttribute - __cuDeviceSetGraphMemAttribute = win32api.GetProcAddress(handle, 'cuDeviceSetGraphMemAttribute') - except: - pass - {{endif}} - {{if 'cuGraphClone' in found_functions}} - try: - global __cuGraphClone - __cuGraphClone = win32api.GetProcAddress(handle, 'cuGraphClone') - except: - pass - {{endif}} - {{if 'cuGraphNodeFindInClone' in found_functions}} - try: - global __cuGraphNodeFindInClone - __cuGraphNodeFindInClone = win32api.GetProcAddress(handle, 'cuGraphNodeFindInClone') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetType' in found_functions}} - try: - global __cuGraphNodeGetType - __cuGraphNodeGetType = win32api.GetProcAddress(handle, 'cuGraphNodeGetType') - except: - pass - {{endif}} - {{if 'cuGraphGetNodes' in found_functions}} - try: - global __cuGraphGetNodes - __cuGraphGetNodes = win32api.GetProcAddress(handle, 'cuGraphGetNodes') - except: - pass - {{endif}} - {{if 'cuGraphGetRootNodes' in found_functions}} - try: - global __cuGraphGetRootNodes - __cuGraphGetRootNodes = win32api.GetProcAddress(handle, 'cuGraphGetRootNodes') - except: - pass - {{endif}} - {{if 'cuGraphGetEdges' in found_functions}} - try: - global __cuGraphGetEdges - __cuGraphGetEdges = win32api.GetProcAddress(handle, 'cuGraphGetEdges') - except: - pass - {{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} - try: - global __cuGraphGetEdges_v2 - __cuGraphGetEdges_v2 = win32api.GetProcAddress(handle, 'cuGraphGetEdges_v2') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetDependencies' in found_functions}} - try: - global __cuGraphNodeGetDependencies - __cuGraphNodeGetDependencies = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependencies') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - try: - global __cuGraphNodeGetDependencies_v2 - __cuGraphNodeGetDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependencies_v2') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetDependentNodes' in found_functions}} - try: - global __cuGraphNodeGetDependentNodes - __cuGraphNodeGetDependentNodes = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - try: - global __cuGraphNodeGetDependentNodes_v2 - __cuGraphNodeGetDependentNodes_v2 = win32api.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes_v2') - except: - pass - {{endif}} - {{if 'cuGraphAddDependencies' in found_functions}} - try: - global __cuGraphAddDependencies - __cuGraphAddDependencies = win32api.GetProcAddress(handle, 'cuGraphAddDependencies') - except: - pass - {{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} - try: - global __cuGraphAddDependencies_v2 - __cuGraphAddDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphAddDependencies_v2') - except: - pass - {{endif}} - {{if 'cuGraphRemoveDependencies' in found_functions}} - try: - global __cuGraphRemoveDependencies - __cuGraphRemoveDependencies = win32api.GetProcAddress(handle, 'cuGraphRemoveDependencies') - except: - pass - {{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - try: - global __cuGraphRemoveDependencies_v2 - __cuGraphRemoveDependencies_v2 = win32api.GetProcAddress(handle, 'cuGraphRemoveDependencies_v2') - except: - pass - {{endif}} - {{if 'cuGraphDestroyNode' in found_functions}} - try: - global __cuGraphDestroyNode - __cuGraphDestroyNode = win32api.GetProcAddress(handle, 'cuGraphDestroyNode') - except: - pass - {{endif}} - {{if 'cuGraphInstantiateWithFlags' in found_functions}} - try: - global __cuGraphInstantiateWithFlags - __cuGraphInstantiateWithFlags = win32api.GetProcAddress(handle, 'cuGraphInstantiateWithFlags') - except: - pass - {{endif}} - {{if 'cuGraphExecGetFlags' in found_functions}} - try: - global __cuGraphExecGetFlags - __cuGraphExecGetFlags = win32api.GetProcAddress(handle, 'cuGraphExecGetFlags') - except: - pass - {{endif}} - {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - try: - global __cuGraphExecKernelNodeSetParams_v2 - __cuGraphExecKernelNodeSetParams_v2 = win32api.GetProcAddress(handle, 'cuGraphExecKernelNodeSetParams_v2') - except: - pass - {{endif}} - {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - try: - global __cuGraphExecMemcpyNodeSetParams - __cuGraphExecMemcpyNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecMemcpyNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - try: - global __cuGraphExecMemsetNodeSetParams - __cuGraphExecMemsetNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecMemsetNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - try: - global __cuGraphExecHostNodeSetParams - __cuGraphExecHostNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecHostNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - try: - global __cuGraphExecChildGraphNodeSetParams - __cuGraphExecChildGraphNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecChildGraphNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - try: - global __cuGraphExecEventRecordNodeSetEvent - __cuGraphExecEventRecordNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphExecEventRecordNodeSetEvent') - except: - pass - {{endif}} - {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - try: - global __cuGraphExecEventWaitNodeSetEvent - __cuGraphExecEventWaitNodeSetEvent = win32api.GetProcAddress(handle, 'cuGraphExecEventWaitNodeSetEvent') - except: - pass - {{endif}} - {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - try: - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - __cuGraphExecExternalSemaphoresSignalNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - try: - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - __cuGraphExecExternalSemaphoresWaitNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphNodeSetEnabled' in found_functions}} - try: - global __cuGraphNodeSetEnabled - __cuGraphNodeSetEnabled = win32api.GetProcAddress(handle, 'cuGraphNodeSetEnabled') - except: - pass - {{endif}} - {{if 'cuGraphNodeGetEnabled' in found_functions}} - try: - global __cuGraphNodeGetEnabled - __cuGraphNodeGetEnabled = win32api.GetProcAddress(handle, 'cuGraphNodeGetEnabled') - except: - pass - {{endif}} - {{if 'cuGraphExecDestroy' in found_functions}} - try: - global __cuGraphExecDestroy - __cuGraphExecDestroy = win32api.GetProcAddress(handle, 'cuGraphExecDestroy') - except: - pass - {{endif}} - {{if 'cuGraphDestroy' in found_functions}} - try: - global __cuGraphDestroy - __cuGraphDestroy = win32api.GetProcAddress(handle, 'cuGraphDestroy') - except: - pass - {{endif}} - {{if 'cuGraphExecUpdate_v2' in found_functions}} - try: - global __cuGraphExecUpdate_v2 - __cuGraphExecUpdate_v2 = win32api.GetProcAddress(handle, 'cuGraphExecUpdate_v2') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - try: - global __cuGraphKernelNodeCopyAttributes - __cuGraphKernelNodeCopyAttributes = win32api.GetProcAddress(handle, 'cuGraphKernelNodeCopyAttributes') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - try: - global __cuGraphKernelNodeGetAttribute - __cuGraphKernelNodeGetAttribute = win32api.GetProcAddress(handle, 'cuGraphKernelNodeGetAttribute') - except: - pass - {{endif}} - {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - try: - global __cuGraphKernelNodeSetAttribute - __cuGraphKernelNodeSetAttribute = win32api.GetProcAddress(handle, 'cuGraphKernelNodeSetAttribute') - except: - pass - {{endif}} - {{if 'cuGraphDebugDotPrint' in found_functions}} - try: - global __cuGraphDebugDotPrint - __cuGraphDebugDotPrint = win32api.GetProcAddress(handle, 'cuGraphDebugDotPrint') - except: - pass - {{endif}} - {{if 'cuUserObjectCreate' in found_functions}} - try: - global __cuUserObjectCreate - __cuUserObjectCreate = win32api.GetProcAddress(handle, 'cuUserObjectCreate') - except: - pass - {{endif}} - {{if 'cuUserObjectRetain' in found_functions}} - try: - global __cuUserObjectRetain - __cuUserObjectRetain = win32api.GetProcAddress(handle, 'cuUserObjectRetain') - except: - pass - {{endif}} - {{if 'cuUserObjectRelease' in found_functions}} - try: - global __cuUserObjectRelease - __cuUserObjectRelease = win32api.GetProcAddress(handle, 'cuUserObjectRelease') - except: - pass - {{endif}} - {{if 'cuGraphRetainUserObject' in found_functions}} - try: - global __cuGraphRetainUserObject - __cuGraphRetainUserObject = win32api.GetProcAddress(handle, 'cuGraphRetainUserObject') - except: - pass - {{endif}} - {{if 'cuGraphReleaseUserObject' in found_functions}} - try: - global __cuGraphReleaseUserObject - __cuGraphReleaseUserObject = win32api.GetProcAddress(handle, 'cuGraphReleaseUserObject') - except: - pass - {{endif}} - {{if 'cuGraphAddNode' in found_functions}} - try: - global __cuGraphAddNode - __cuGraphAddNode = win32api.GetProcAddress(handle, 'cuGraphAddNode') - except: - pass - {{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} - try: - global __cuGraphAddNode_v2 - __cuGraphAddNode_v2 = win32api.GetProcAddress(handle, 'cuGraphAddNode_v2') - except: - pass - {{endif}} - {{if 'cuGraphNodeSetParams' in found_functions}} - try: - global __cuGraphNodeSetParams - __cuGraphNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphExecNodeSetParams' in found_functions}} - try: - global __cuGraphExecNodeSetParams - __cuGraphExecNodeSetParams = win32api.GetProcAddress(handle, 'cuGraphExecNodeSetParams') - except: - pass - {{endif}} - {{if 'cuGraphConditionalHandleCreate' in found_functions}} - try: - global __cuGraphConditionalHandleCreate - __cuGraphConditionalHandleCreate = win32api.GetProcAddress(handle, 'cuGraphConditionalHandleCreate') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - try: - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - __cuOccupancyMaxActiveBlocksPerMultiprocessor = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - try: - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - try: - global __cuOccupancyMaxPotentialBlockSize - __cuOccupancyMaxPotentialBlockSize = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSize') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - try: - global __cuOccupancyMaxPotentialBlockSizeWithFlags - __cuOccupancyMaxPotentialBlockSizeWithFlags = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') - except: - pass - {{endif}} - {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - try: - global __cuOccupancyAvailableDynamicSMemPerBlock - __cuOccupancyAvailableDynamicSMemPerBlock = win32api.GetProcAddress(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - try: - global __cuOccupancyMaxPotentialClusterSize - __cuOccupancyMaxPotentialClusterSize = win32api.GetProcAddress(handle, 'cuOccupancyMaxPotentialClusterSize') - except: - pass - {{endif}} - {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - try: - global __cuOccupancyMaxActiveClusters - __cuOccupancyMaxActiveClusters = win32api.GetProcAddress(handle, 'cuOccupancyMaxActiveClusters') - except: - pass - {{endif}} - {{if 'cuTexRefSetArray' in found_functions}} - try: - global __cuTexRefSetArray - __cuTexRefSetArray = win32api.GetProcAddress(handle, 'cuTexRefSetArray') - except: - pass - {{endif}} - {{if 'cuTexRefSetMipmappedArray' in found_functions}} - try: - global __cuTexRefSetMipmappedArray - __cuTexRefSetMipmappedArray = win32api.GetProcAddress(handle, 'cuTexRefSetMipmappedArray') - except: - pass - {{endif}} - {{if 'cuTexRefSetAddress_v2' in found_functions}} - try: - global __cuTexRefSetAddress_v2 - __cuTexRefSetAddress_v2 = win32api.GetProcAddress(handle, 'cuTexRefSetAddress_v2') - except: - pass - {{endif}} - {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - try: - global __cuTexRefSetAddress2D_v3 - __cuTexRefSetAddress2D_v3 = win32api.GetProcAddress(handle, 'cuTexRefSetAddress2D_v3') - except: - pass - {{endif}} - {{if 'cuTexRefSetFormat' in found_functions}} - try: - global __cuTexRefSetFormat - __cuTexRefSetFormat = win32api.GetProcAddress(handle, 'cuTexRefSetFormat') - except: - pass - {{endif}} - {{if 'cuTexRefSetAddressMode' in found_functions}} - try: - global __cuTexRefSetAddressMode - __cuTexRefSetAddressMode = win32api.GetProcAddress(handle, 'cuTexRefSetAddressMode') - except: - pass - {{endif}} - {{if 'cuTexRefSetFilterMode' in found_functions}} - try: - global __cuTexRefSetFilterMode - __cuTexRefSetFilterMode = win32api.GetProcAddress(handle, 'cuTexRefSetFilterMode') - except: - pass - {{endif}} - {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - try: - global __cuTexRefSetMipmapFilterMode - __cuTexRefSetMipmapFilterMode = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapFilterMode') - except: - pass - {{endif}} - {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - try: - global __cuTexRefSetMipmapLevelBias - __cuTexRefSetMipmapLevelBias = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapLevelBias') - except: - pass - {{endif}} - {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - try: - global __cuTexRefSetMipmapLevelClamp - __cuTexRefSetMipmapLevelClamp = win32api.GetProcAddress(handle, 'cuTexRefSetMipmapLevelClamp') - except: - pass - {{endif}} - {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - try: - global __cuTexRefSetMaxAnisotropy - __cuTexRefSetMaxAnisotropy = win32api.GetProcAddress(handle, 'cuTexRefSetMaxAnisotropy') - except: - pass - {{endif}} - {{if 'cuTexRefSetBorderColor' in found_functions}} - try: - global __cuTexRefSetBorderColor - __cuTexRefSetBorderColor = win32api.GetProcAddress(handle, 'cuTexRefSetBorderColor') - except: - pass - {{endif}} - {{if 'cuTexRefSetFlags' in found_functions}} - try: - global __cuTexRefSetFlags - __cuTexRefSetFlags = win32api.GetProcAddress(handle, 'cuTexRefSetFlags') - except: - pass - {{endif}} - {{if 'cuTexRefGetAddress_v2' in found_functions}} - try: - global __cuTexRefGetAddress_v2 - __cuTexRefGetAddress_v2 = win32api.GetProcAddress(handle, 'cuTexRefGetAddress_v2') - except: - pass - {{endif}} - {{if 'cuTexRefGetArray' in found_functions}} - try: - global __cuTexRefGetArray - __cuTexRefGetArray = win32api.GetProcAddress(handle, 'cuTexRefGetArray') - except: - pass - {{endif}} - {{if 'cuTexRefGetMipmappedArray' in found_functions}} - try: - global __cuTexRefGetMipmappedArray - __cuTexRefGetMipmappedArray = win32api.GetProcAddress(handle, 'cuTexRefGetMipmappedArray') - except: - pass - {{endif}} - {{if 'cuTexRefGetAddressMode' in found_functions}} - try: - global __cuTexRefGetAddressMode - __cuTexRefGetAddressMode = win32api.GetProcAddress(handle, 'cuTexRefGetAddressMode') - except: - pass - {{endif}} - {{if 'cuTexRefGetFilterMode' in found_functions}} - try: - global __cuTexRefGetFilterMode - __cuTexRefGetFilterMode = win32api.GetProcAddress(handle, 'cuTexRefGetFilterMode') - except: - pass - {{endif}} - {{if 'cuTexRefGetFormat' in found_functions}} - try: - global __cuTexRefGetFormat - __cuTexRefGetFormat = win32api.GetProcAddress(handle, 'cuTexRefGetFormat') - except: - pass - {{endif}} - {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - try: - global __cuTexRefGetMipmapFilterMode - __cuTexRefGetMipmapFilterMode = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapFilterMode') - except: - pass - {{endif}} - {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - try: - global __cuTexRefGetMipmapLevelBias - __cuTexRefGetMipmapLevelBias = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapLevelBias') - except: - pass - {{endif}} - {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - try: - global __cuTexRefGetMipmapLevelClamp - __cuTexRefGetMipmapLevelClamp = win32api.GetProcAddress(handle, 'cuTexRefGetMipmapLevelClamp') - except: - pass - {{endif}} - {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - try: - global __cuTexRefGetMaxAnisotropy - __cuTexRefGetMaxAnisotropy = win32api.GetProcAddress(handle, 'cuTexRefGetMaxAnisotropy') - except: - pass - {{endif}} - {{if 'cuTexRefGetBorderColor' in found_functions}} - try: - global __cuTexRefGetBorderColor - __cuTexRefGetBorderColor = win32api.GetProcAddress(handle, 'cuTexRefGetBorderColor') - except: - pass - {{endif}} - {{if 'cuTexRefGetFlags' in found_functions}} - try: - global __cuTexRefGetFlags - __cuTexRefGetFlags = win32api.GetProcAddress(handle, 'cuTexRefGetFlags') - except: - pass - {{endif}} - {{if 'cuTexRefCreate' in found_functions}} - try: - global __cuTexRefCreate - __cuTexRefCreate = win32api.GetProcAddress(handle, 'cuTexRefCreate') - except: - pass - {{endif}} - {{if 'cuTexRefDestroy' in found_functions}} - try: - global __cuTexRefDestroy - __cuTexRefDestroy = win32api.GetProcAddress(handle, 'cuTexRefDestroy') - except: - pass - {{endif}} - {{if 'cuSurfRefSetArray' in found_functions}} - try: - global __cuSurfRefSetArray - __cuSurfRefSetArray = win32api.GetProcAddress(handle, 'cuSurfRefSetArray') - except: - pass - {{endif}} - {{if 'cuSurfRefGetArray' in found_functions}} - try: - global __cuSurfRefGetArray - __cuSurfRefGetArray = win32api.GetProcAddress(handle, 'cuSurfRefGetArray') - except: - pass - {{endif}} - {{if 'cuTexObjectCreate' in found_functions}} - try: - global __cuTexObjectCreate - __cuTexObjectCreate = win32api.GetProcAddress(handle, 'cuTexObjectCreate') - except: - pass - {{endif}} - {{if 'cuTexObjectDestroy' in found_functions}} - try: - global __cuTexObjectDestroy - __cuTexObjectDestroy = win32api.GetProcAddress(handle, 'cuTexObjectDestroy') - except: - pass - {{endif}} - {{if 'cuTexObjectGetResourceDesc' in found_functions}} - try: - global __cuTexObjectGetResourceDesc - __cuTexObjectGetResourceDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetResourceDesc') - except: - pass - {{endif}} - {{if 'cuTexObjectGetTextureDesc' in found_functions}} - try: - global __cuTexObjectGetTextureDesc - __cuTexObjectGetTextureDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetTextureDesc') - except: - pass - {{endif}} - {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - try: - global __cuTexObjectGetResourceViewDesc - __cuTexObjectGetResourceViewDesc = win32api.GetProcAddress(handle, 'cuTexObjectGetResourceViewDesc') - except: - pass - {{endif}} - {{if 'cuSurfObjectCreate' in found_functions}} - try: - global __cuSurfObjectCreate - __cuSurfObjectCreate = win32api.GetProcAddress(handle, 'cuSurfObjectCreate') - except: - pass - {{endif}} - {{if 'cuSurfObjectDestroy' in found_functions}} - try: - global __cuSurfObjectDestroy - __cuSurfObjectDestroy = win32api.GetProcAddress(handle, 'cuSurfObjectDestroy') - except: - pass - {{endif}} - {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - try: - global __cuSurfObjectGetResourceDesc - __cuSurfObjectGetResourceDesc = win32api.GetProcAddress(handle, 'cuSurfObjectGetResourceDesc') - except: - pass - {{endif}} - {{if 'cuTensorMapEncodeTiled' in found_functions}} - try: - global __cuTensorMapEncodeTiled - __cuTensorMapEncodeTiled = win32api.GetProcAddress(handle, 'cuTensorMapEncodeTiled') - except: - pass - {{endif}} - {{if 'cuTensorMapEncodeIm2col' in found_functions}} - try: - global __cuTensorMapEncodeIm2col - __cuTensorMapEncodeIm2col = win32api.GetProcAddress(handle, 'cuTensorMapEncodeIm2col') - except: - pass - {{endif}} - {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - try: - global __cuTensorMapEncodeIm2colWide - __cuTensorMapEncodeIm2colWide = win32api.GetProcAddress(handle, 'cuTensorMapEncodeIm2colWide') - except: - pass - {{endif}} - {{if 'cuTensorMapReplaceAddress' in found_functions}} - try: - global __cuTensorMapReplaceAddress - __cuTensorMapReplaceAddress = win32api.GetProcAddress(handle, 'cuTensorMapReplaceAddress') - except: - pass - {{endif}} - {{if 'cuDeviceCanAccessPeer' in found_functions}} - try: - global __cuDeviceCanAccessPeer - __cuDeviceCanAccessPeer = win32api.GetProcAddress(handle, 'cuDeviceCanAccessPeer') - except: - pass - {{endif}} - {{if 'cuCtxEnablePeerAccess' in found_functions}} - try: - global __cuCtxEnablePeerAccess - __cuCtxEnablePeerAccess = win32api.GetProcAddress(handle, 'cuCtxEnablePeerAccess') - except: - pass - {{endif}} - {{if 'cuCtxDisablePeerAccess' in found_functions}} - try: - global __cuCtxDisablePeerAccess - __cuCtxDisablePeerAccess = win32api.GetProcAddress(handle, 'cuCtxDisablePeerAccess') - except: - pass - {{endif}} - {{if 'cuDeviceGetP2PAttribute' in found_functions}} - try: - global __cuDeviceGetP2PAttribute - __cuDeviceGetP2PAttribute = win32api.GetProcAddress(handle, 'cuDeviceGetP2PAttribute') - except: - pass - {{endif}} - {{if 'cuGraphicsUnregisterResource' in found_functions}} - try: - global __cuGraphicsUnregisterResource - __cuGraphicsUnregisterResource = win32api.GetProcAddress(handle, 'cuGraphicsUnregisterResource') - except: - pass - {{endif}} - {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - try: - global __cuGraphicsSubResourceGetMappedArray - __cuGraphicsSubResourceGetMappedArray = win32api.GetProcAddress(handle, 'cuGraphicsSubResourceGetMappedArray') - except: - pass - {{endif}} - {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - try: - global __cuGraphicsResourceGetMappedMipmappedArray - __cuGraphicsResourceGetMappedMipmappedArray = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedMipmappedArray') - except: - pass - {{endif}} - {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - try: - global __cuGraphicsResourceGetMappedPointer_v2 - __cuGraphicsResourceGetMappedPointer_v2 = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedPointer_v2') - except: - pass - {{endif}} - {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - try: - global __cuGraphicsResourceSetMapFlags_v2 - __cuGraphicsResourceSetMapFlags_v2 = win32api.GetProcAddress(handle, 'cuGraphicsResourceSetMapFlags_v2') - except: - pass - {{endif}} - {{if 'cuGetProcAddress_v2' in found_functions}} - try: - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = win32api.GetProcAddress(handle, 'cuGetProcAddress_v2') - except: - pass - {{endif}} - {{if 'cuCoredumpGetAttribute' in found_functions}} - try: - global __cuCoredumpGetAttribute - __cuCoredumpGetAttribute = win32api.GetProcAddress(handle, 'cuCoredumpGetAttribute') - except: - pass - {{endif}} - {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - try: - global __cuCoredumpGetAttributeGlobal - __cuCoredumpGetAttributeGlobal = win32api.GetProcAddress(handle, 'cuCoredumpGetAttributeGlobal') - except: - pass - {{endif}} - {{if 'cuCoredumpSetAttribute' in found_functions}} - try: - global __cuCoredumpSetAttribute - __cuCoredumpSetAttribute = win32api.GetProcAddress(handle, 'cuCoredumpSetAttribute') - except: - pass - {{endif}} - {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - try: - global __cuCoredumpSetAttributeGlobal - __cuCoredumpSetAttributeGlobal = win32api.GetProcAddress(handle, 'cuCoredumpSetAttributeGlobal') - except: - pass - {{endif}} - {{if 'cuGetExportTable' in found_functions}} - try: - global __cuGetExportTable - __cuGetExportTable = win32api.GetProcAddress(handle, 'cuGetExportTable') - except: - pass - {{endif}} - {{if 'cuGreenCtxCreate' in found_functions}} - try: - global __cuGreenCtxCreate - __cuGreenCtxCreate = win32api.GetProcAddress(handle, 'cuGreenCtxCreate') - except: - pass - {{endif}} - {{if 'cuGreenCtxDestroy' in found_functions}} - try: - global __cuGreenCtxDestroy - __cuGreenCtxDestroy = win32api.GetProcAddress(handle, 'cuGreenCtxDestroy') - except: - pass - {{endif}} - {{if 'cuCtxFromGreenCtx' in found_functions}} - try: - global __cuCtxFromGreenCtx - __cuCtxFromGreenCtx = win32api.GetProcAddress(handle, 'cuCtxFromGreenCtx') - except: - pass - {{endif}} - {{if 'cuDeviceGetDevResource' in found_functions}} - try: - global __cuDeviceGetDevResource - __cuDeviceGetDevResource = win32api.GetProcAddress(handle, 'cuDeviceGetDevResource') - except: - pass - {{endif}} - {{if 'cuCtxGetDevResource' in found_functions}} - try: - global __cuCtxGetDevResource - __cuCtxGetDevResource = win32api.GetProcAddress(handle, 'cuCtxGetDevResource') - except: - pass - {{endif}} - {{if 'cuGreenCtxGetDevResource' in found_functions}} - try: - global __cuGreenCtxGetDevResource - __cuGreenCtxGetDevResource = win32api.GetProcAddress(handle, 'cuGreenCtxGetDevResource') - except: - pass - {{endif}} - {{if 'cuDevSmResourceSplitByCount' in found_functions}} - try: - global __cuDevSmResourceSplitByCount - __cuDevSmResourceSplitByCount = win32api.GetProcAddress(handle, 'cuDevSmResourceSplitByCount') - except: - pass - {{endif}} - {{if 'cuDevResourceGenerateDesc' in found_functions}} - try: - global __cuDevResourceGenerateDesc - __cuDevResourceGenerateDesc = win32api.GetProcAddress(handle, 'cuDevResourceGenerateDesc') - except: - pass - {{endif}} - {{if 'cuGreenCtxRecordEvent' in found_functions}} - try: - global __cuGreenCtxRecordEvent - __cuGreenCtxRecordEvent = win32api.GetProcAddress(handle, 'cuGreenCtxRecordEvent') - except: - pass - {{endif}} - {{if 'cuGreenCtxWaitEvent' in found_functions}} - try: - global __cuGreenCtxWaitEvent - __cuGreenCtxWaitEvent = win32api.GetProcAddress(handle, 'cuGreenCtxWaitEvent') - except: - pass - {{endif}} - {{if 'cuStreamGetGreenCtx' in found_functions}} - try: - global __cuStreamGetGreenCtx - __cuStreamGetGreenCtx = win32api.GetProcAddress(handle, 'cuStreamGetGreenCtx') - except: - pass - {{endif}} - {{if 'cuGreenCtxStreamCreate' in found_functions}} - try: - global __cuGreenCtxStreamCreate - __cuGreenCtxStreamCreate = win32api.GetProcAddress(handle, 'cuGreenCtxStreamCreate') - except: - pass - {{endif}} - {{if 'cuLogsRegisterCallback' in found_functions}} - try: - global __cuLogsRegisterCallback - __cuLogsRegisterCallback = win32api.GetProcAddress(handle, 'cuLogsRegisterCallback') - except: - pass - {{endif}} - {{if 'cuLogsUnregisterCallback' in found_functions}} - try: - global __cuLogsUnregisterCallback - __cuLogsUnregisterCallback = win32api.GetProcAddress(handle, 'cuLogsUnregisterCallback') - except: - pass - {{endif}} - {{if 'cuLogsCurrent' in found_functions}} - try: - global __cuLogsCurrent - __cuLogsCurrent = win32api.GetProcAddress(handle, 'cuLogsCurrent') - except: - pass - {{endif}} - {{if 'cuLogsDumpToFile' in found_functions}} - try: - global __cuLogsDumpToFile - __cuLogsDumpToFile = win32api.GetProcAddress(handle, 'cuLogsDumpToFile') - except: - pass - {{endif}} - {{if 'cuLogsDumpToMemory' in found_functions}} - try: - global __cuLogsDumpToMemory - __cuLogsDumpToMemory = win32api.GetProcAddress(handle, 'cuLogsDumpToMemory') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - try: - global __cuCheckpointProcessGetRestoreThreadId - __cuCheckpointProcessGetRestoreThreadId = win32api.GetProcAddress(handle, 'cuCheckpointProcessGetRestoreThreadId') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessGetState' in found_functions}} - try: - global __cuCheckpointProcessGetState - __cuCheckpointProcessGetState = win32api.GetProcAddress(handle, 'cuCheckpointProcessGetState') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessLock' in found_functions}} - try: - global __cuCheckpointProcessLock - __cuCheckpointProcessLock = win32api.GetProcAddress(handle, 'cuCheckpointProcessLock') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - try: - global __cuCheckpointProcessCheckpoint - __cuCheckpointProcessCheckpoint = win32api.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessRestore' in found_functions}} - try: - global __cuCheckpointProcessRestore - __cuCheckpointProcessRestore = win32api.GetProcAddress(handle, 'cuCheckpointProcessRestore') - except: - pass - {{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} - try: - global __cuCheckpointProcessUnlock - __cuCheckpointProcessUnlock = win32api.GetProcAddress(handle, 'cuCheckpointProcessUnlock') - except: - pass - {{endif}} - {{if 'cuProfilerStart' in found_functions}} - try: - global __cuProfilerStart - __cuProfilerStart = win32api.GetProcAddress(handle, 'cuProfilerStart') - except: - pass - {{endif}} - {{if 'cuProfilerStop' in found_functions}} - try: - global __cuProfilerStop - __cuProfilerStop = win32api.GetProcAddress(handle, 'cuProfilerStop') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsEGLRegisterImage - __cuGraphicsEGLRegisterImage = win32api.GetProcAddress(handle, 'cuGraphicsEGLRegisterImage') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerConnect - __cuEGLStreamConsumerConnect = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerConnect') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerConnectWithFlags - __cuEGLStreamConsumerConnectWithFlags = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerConnectWithFlags') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerDisconnect - __cuEGLStreamConsumerDisconnect = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerDisconnect') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerAcquireFrame - __cuEGLStreamConsumerAcquireFrame = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerAcquireFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamConsumerReleaseFrame - __cuEGLStreamConsumerReleaseFrame = win32api.GetProcAddress(handle, 'cuEGLStreamConsumerReleaseFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamProducerConnect - __cuEGLStreamProducerConnect = win32api.GetProcAddress(handle, 'cuEGLStreamProducerConnect') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamProducerDisconnect - __cuEGLStreamProducerDisconnect = win32api.GetProcAddress(handle, 'cuEGLStreamProducerDisconnect') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamProducerPresentFrame - __cuEGLStreamProducerPresentFrame = win32api.GetProcAddress(handle, 'cuEGLStreamProducerPresentFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEGLStreamProducerReturnFrame - __cuEGLStreamProducerReturnFrame = win32api.GetProcAddress(handle, 'cuEGLStreamProducerReturnFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsResourceGetMappedEglFrame - __cuGraphicsResourceGetMappedEglFrame = win32api.GetProcAddress(handle, 'cuGraphicsResourceGetMappedEglFrame') - except: - pass - {{endif}} - {{if True}} - try: - global __cuEventCreateFromEGLSync - __cuEventCreateFromEGLSync = win32api.GetProcAddress(handle, 'cuEventCreateFromEGLSync') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsGLRegisterBuffer - __cuGraphicsGLRegisterBuffer = win32api.GetProcAddress(handle, 'cuGraphicsGLRegisterBuffer') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsGLRegisterImage - __cuGraphicsGLRegisterImage = win32api.GetProcAddress(handle, 'cuGraphicsGLRegisterImage') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGLGetDevices_v2 - __cuGLGetDevices_v2 = win32api.GetProcAddress(handle, 'cuGLGetDevices_v2') - except: - pass - {{endif}} - {{if True}} - try: - global __cuVDPAUGetDevice - __cuVDPAUGetDevice = win32api.GetProcAddress(handle, 'cuVDPAUGetDevice') - except: - pass - {{endif}} - {{if True}} - try: - global __cuVDPAUCtxCreate_v2 - __cuVDPAUCtxCreate_v2 = win32api.GetProcAddress(handle, 'cuVDPAUCtxCreate_v2') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsVDPAURegisterVideoSurface - __cuGraphicsVDPAURegisterVideoSurface = win32api.GetProcAddress(handle, 'cuGraphicsVDPAURegisterVideoSurface') - except: - pass - {{endif}} - {{if True}} - try: - global __cuGraphicsVDPAURegisterOutputSurface - __cuGraphicsVDPAURegisterOutputSurface = win32api.GetProcAddress(handle, 'cuGraphicsVDPAURegisterOutputSurface') - except: - pass - {{endif}} - {{else}} - # Load using dlsym - if usePTDS: - # Get all PTDS version of functions - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy_ptds') - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer_ptds') - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2_ptds') - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2_ptds') - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2_ptds') - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2_ptds') - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2_ptds') - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2_ptds') - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer_ptds') - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync_ptsz') - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync_ptsz') - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2_ptsz') - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync_ptsz') - {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - __cuMemcpyBatchAsync = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_ptsz') - {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - __cuMemcpy3DBatchAsync = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_ptsz') - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2_ptds') - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2_ptds') - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2_ptds') - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2_ptds') - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async_ptsz') - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async_ptsz') - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async_ptsz') - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async_ptsz') - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync_ptsz') - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync_ptsz') - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync_ptsz') - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync_ptsz') - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync_ptsz') - {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - __cuMemPrefetchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_ptsz') - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2_ptsz') - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority_ptsz') - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice_ptsz') - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags_ptsz') - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId_ptsz') - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx_ptsz') - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2_ptsz') - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent_ptsz') - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback_ptsz') - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2_ptsz') - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph_ptsz') - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture_ptsz') - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing_ptsz') - {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - __cuStreamGetCaptureInfo_v2 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v2_ptsz') - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3_ptsz') - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - __cuStreamUpdateCaptureDependencies = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_ptsz') - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync_ptsz') - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery_ptsz') - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize_ptsz') - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes_ptsz') - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute_ptsz') - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute_ptsz') - {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord_ptsz') - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags_ptsz') - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync_ptsz') - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync_ptsz') - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2_ptsz') - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2_ptsz') - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2_ptsz') - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2_ptsz') - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2_ptsz') - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel_ptsz') - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx_ptsz') - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel_ptsz') - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc_ptsz') - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams_ptsz') - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload_ptsz') - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch_ptsz') - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources_ptsz') - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources_ptsz') - {{endif}} - else: - # Else get the regular version - pass - {{if 'cuMemcpy' in found_functions}} - global __cuMemcpy - __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy') - {{endif}} - {{if 'cuMemcpyPeer' in found_functions}} - global __cuMemcpyPeer - __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer') - {{endif}} - {{if 'cuMemcpyHtoD_v2' in found_functions}} - global __cuMemcpyHtoD_v2 - __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2') - {{endif}} - {{if 'cuMemcpyDtoH_v2' in found_functions}} - global __cuMemcpyDtoH_v2 - __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2') - {{endif}} - {{if 'cuMemcpyDtoD_v2' in found_functions}} - global __cuMemcpyDtoD_v2 - __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2') - {{endif}} - {{if 'cuMemcpyDtoA_v2' in found_functions}} - global __cuMemcpyDtoA_v2 - __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2') - {{endif}} - {{if 'cuMemcpyAtoD_v2' in found_functions}} - global __cuMemcpyAtoD_v2 - __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2') - {{endif}} - {{if 'cuMemcpyHtoA_v2' in found_functions}} - global __cuMemcpyHtoA_v2 - __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2') - {{endif}} - {{if 'cuMemcpyAtoH_v2' in found_functions}} - global __cuMemcpyAtoH_v2 - __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2') - {{endif}} - {{if 'cuMemcpyAtoA_v2' in found_functions}} - global __cuMemcpyAtoA_v2 - __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2') - {{endif}} - {{if 'cuMemcpy2D_v2' in found_functions}} - global __cuMemcpy2D_v2 - __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2') - {{endif}} - {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} - global __cuMemcpy2DUnaligned_v2 - __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2') - {{endif}} - {{if 'cuMemcpy3D_v2' in found_functions}} - global __cuMemcpy3D_v2 - __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2') - {{endif}} - {{if 'cuMemcpy3DPeer' in found_functions}} - global __cuMemcpy3DPeer - __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer') - {{endif}} - {{if 'cuMemcpyAsync' in found_functions}} - global __cuMemcpyAsync - __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync') - {{endif}} - {{if 'cuMemcpyPeerAsync' in found_functions}} - global __cuMemcpyPeerAsync - __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync') - {{endif}} - {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} - global __cuMemcpyHtoDAsync_v2 - __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2') - {{endif}} - {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} - global __cuMemcpyDtoHAsync_v2 - __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2') - {{endif}} - {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} - global __cuMemcpyDtoDAsync_v2 - __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2') - {{endif}} - {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} - global __cuMemcpyHtoAAsync_v2 - __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2') - {{endif}} - {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} - global __cuMemcpyAtoHAsync_v2 - __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2') - {{endif}} - {{if 'cuMemcpy2DAsync_v2' in found_functions}} - global __cuMemcpy2DAsync_v2 - __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2') - {{endif}} - {{if 'cuMemcpy3DAsync_v2' in found_functions}} - global __cuMemcpy3DAsync_v2 - __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2') - {{endif}} - {{if 'cuMemcpy3DPeerAsync' in found_functions}} - global __cuMemcpy3DPeerAsync - __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync') - {{endif}} - {{if 'cuMemcpyBatchAsync' in found_functions}} - global __cuMemcpyBatchAsync - __cuMemcpyBatchAsync = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync') - {{endif}} - {{if 'cuMemcpy3DBatchAsync' in found_functions}} - global __cuMemcpy3DBatchAsync - __cuMemcpy3DBatchAsync = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync') - {{endif}} - {{if 'cuMemsetD8_v2' in found_functions}} - global __cuMemsetD8_v2 - __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2') - {{endif}} - {{if 'cuMemsetD16_v2' in found_functions}} - global __cuMemsetD16_v2 - __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2') - {{endif}} - {{if 'cuMemsetD32_v2' in found_functions}} - global __cuMemsetD32_v2 - __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2') - {{endif}} - {{if 'cuMemsetD2D8_v2' in found_functions}} - global __cuMemsetD2D8_v2 - __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2') - {{endif}} - {{if 'cuMemsetD2D16_v2' in found_functions}} - global __cuMemsetD2D16_v2 - __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2') - {{endif}} - {{if 'cuMemsetD2D32_v2' in found_functions}} - global __cuMemsetD2D32_v2 - __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2') - {{endif}} - {{if 'cuMemsetD8Async' in found_functions}} - global __cuMemsetD8Async - __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async') - {{endif}} - {{if 'cuMemsetD16Async' in found_functions}} - global __cuMemsetD16Async - __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async') - {{endif}} - {{if 'cuMemsetD32Async' in found_functions}} - global __cuMemsetD32Async - __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async') - {{endif}} - {{if 'cuMemsetD2D8Async' in found_functions}} - global __cuMemsetD2D8Async - __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async') - {{endif}} - {{if 'cuMemsetD2D16Async' in found_functions}} - global __cuMemsetD2D16Async - __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async') - {{endif}} - {{if 'cuMemsetD2D32Async' in found_functions}} - global __cuMemsetD2D32Async - __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async') - {{endif}} - {{if 'cuMemBatchDecompressAsync' in found_functions}} - global __cuMemBatchDecompressAsync - __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync') - {{endif}} - {{if 'cuMemMapArrayAsync' in found_functions}} - global __cuMemMapArrayAsync - __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync') - {{endif}} - {{if 'cuMemFreeAsync' in found_functions}} - global __cuMemFreeAsync - __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync') - {{endif}} - {{if 'cuMemAllocAsync' in found_functions}} - global __cuMemAllocAsync - __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync') - {{endif}} - {{if 'cuMemAllocFromPoolAsync' in found_functions}} - global __cuMemAllocFromPoolAsync - __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync') - {{endif}} - {{if 'cuMemPrefetchAsync' in found_functions}} - global __cuMemPrefetchAsync - __cuMemPrefetchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchAsync') - {{endif}} - {{if 'cuMemPrefetchAsync_v2' in found_functions}} - global __cuMemPrefetchAsync_v2 - __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2') - {{endif}} - {{if 'cuStreamGetPriority' in found_functions}} - global __cuStreamGetPriority - __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority') - {{endif}} - {{if 'cuStreamGetDevice' in found_functions}} - global __cuStreamGetDevice - __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice') - {{endif}} - {{if 'cuStreamGetFlags' in found_functions}} - global __cuStreamGetFlags - __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags') - {{endif}} - {{if 'cuStreamGetId' in found_functions}} - global __cuStreamGetId - __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId') - {{endif}} - {{if 'cuStreamGetCtx' in found_functions}} - global __cuStreamGetCtx - __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx') - {{endif}} - {{if 'cuStreamGetCtx_v2' in found_functions}} - global __cuStreamGetCtx_v2 - __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2') - {{endif}} - {{if 'cuStreamWaitEvent' in found_functions}} - global __cuStreamWaitEvent - __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent') - {{endif}} - {{if 'cuStreamAddCallback' in found_functions}} - global __cuStreamAddCallback - __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback') - {{endif}} - {{if 'cuStreamBeginCapture_v2' in found_functions}} - global __cuStreamBeginCapture_v2 - __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2') - {{endif}} - {{if 'cuStreamBeginCaptureToGraph' in found_functions}} - global __cuStreamBeginCaptureToGraph - __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph') - {{endif}} - {{if 'cuStreamEndCapture' in found_functions}} - global __cuStreamEndCapture - __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture') - {{endif}} - {{if 'cuStreamIsCapturing' in found_functions}} - global __cuStreamIsCapturing - __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing') - {{endif}} - {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} - global __cuStreamGetCaptureInfo_v2 - __cuStreamGetCaptureInfo_v2 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v2') - {{endif}} - {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} - global __cuStreamGetCaptureInfo_v3 - __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3') - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} - global __cuStreamUpdateCaptureDependencies - __cuStreamUpdateCaptureDependencies = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies') - {{endif}} - {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} - global __cuStreamUpdateCaptureDependencies_v2 - __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2') - {{endif}} - {{if 'cuStreamAttachMemAsync' in found_functions}} - global __cuStreamAttachMemAsync - __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync') - {{endif}} - {{if 'cuStreamQuery' in found_functions}} - global __cuStreamQuery - __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery') - {{endif}} - {{if 'cuStreamSynchronize' in found_functions}} - global __cuStreamSynchronize - __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize') - {{endif}} - {{if 'cuStreamCopyAttributes' in found_functions}} - global __cuStreamCopyAttributes - __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes') - {{endif}} - {{if 'cuStreamGetAttribute' in found_functions}} - global __cuStreamGetAttribute - __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute') - {{endif}} - {{if 'cuStreamSetAttribute' in found_functions}} - global __cuStreamSetAttribute - __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute') - {{endif}} - {{if 'cuEventRecord' in found_functions}} - global __cuEventRecord - __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord') - {{endif}} - {{if 'cuEventRecordWithFlags' in found_functions}} - global __cuEventRecordWithFlags - __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags') - {{endif}} - {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} - global __cuSignalExternalSemaphoresAsync - __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync') - {{endif}} - {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} - global __cuWaitExternalSemaphoresAsync - __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync') - {{endif}} - {{if 'cuStreamWaitValue32_v2' in found_functions}} - global __cuStreamWaitValue32_v2 - __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2') - {{endif}} - {{if 'cuStreamWaitValue64_v2' in found_functions}} - global __cuStreamWaitValue64_v2 - __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2') - {{endif}} - {{if 'cuStreamWriteValue32_v2' in found_functions}} - global __cuStreamWriteValue32_v2 - __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2') - {{endif}} - {{if 'cuStreamWriteValue64_v2' in found_functions}} - global __cuStreamWriteValue64_v2 - __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2') - {{endif}} - {{if 'cuStreamBatchMemOp_v2' in found_functions}} - global __cuStreamBatchMemOp_v2 - __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2') - {{endif}} - {{if 'cuLaunchKernel' in found_functions}} - global __cuLaunchKernel - __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel') - {{endif}} - {{if 'cuLaunchKernelEx' in found_functions}} - global __cuLaunchKernelEx - __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx') - {{endif}} - {{if 'cuLaunchCooperativeKernel' in found_functions}} - global __cuLaunchCooperativeKernel - __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel') - {{endif}} - {{if 'cuLaunchHostFunc' in found_functions}} - global __cuLaunchHostFunc - __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc') - {{endif}} - {{if 'cuGraphInstantiateWithParams' in found_functions}} - global __cuGraphInstantiateWithParams - __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams') - {{endif}} - {{if 'cuGraphUpload' in found_functions}} - global __cuGraphUpload - __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload') - {{endif}} - {{if 'cuGraphLaunch' in found_functions}} - global __cuGraphLaunch - __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch') - {{endif}} - {{if 'cuGraphicsMapResources' in found_functions}} - global __cuGraphicsMapResources - __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources') - {{endif}} - {{if 'cuGraphicsUnmapResources' in found_functions}} - global __cuGraphicsUnmapResources - __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources') - {{endif}} - # Get remaining functions - {{if 'cuGetErrorString' in found_functions}} - global __cuGetErrorString - __cuGetErrorString = dlfcn.dlsym(handle, 'cuGetErrorString') - {{endif}} - {{if 'cuGetErrorName' in found_functions}} - global __cuGetErrorName - __cuGetErrorName = dlfcn.dlsym(handle, 'cuGetErrorName') - {{endif}} - {{if 'cuInit' in found_functions}} - global __cuInit - __cuInit = dlfcn.dlsym(handle, 'cuInit') - {{endif}} - {{if 'cuDriverGetVersion' in found_functions}} - global __cuDriverGetVersion - __cuDriverGetVersion = dlfcn.dlsym(handle, 'cuDriverGetVersion') - {{endif}} - {{if 'cuDeviceGet' in found_functions}} - global __cuDeviceGet - __cuDeviceGet = dlfcn.dlsym(handle, 'cuDeviceGet') - {{endif}} - {{if 'cuDeviceGetCount' in found_functions}} - global __cuDeviceGetCount - __cuDeviceGetCount = dlfcn.dlsym(handle, 'cuDeviceGetCount') - {{endif}} - {{if 'cuDeviceGetName' in found_functions}} - global __cuDeviceGetName - __cuDeviceGetName = dlfcn.dlsym(handle, 'cuDeviceGetName') - {{endif}} - {{if 'cuDeviceGetUuid' in found_functions}} - global __cuDeviceGetUuid - __cuDeviceGetUuid = dlfcn.dlsym(handle, 'cuDeviceGetUuid') - {{endif}} - {{if 'cuDeviceGetUuid_v2' in found_functions}} - global __cuDeviceGetUuid_v2 - __cuDeviceGetUuid_v2 = dlfcn.dlsym(handle, 'cuDeviceGetUuid_v2') - {{endif}} - {{if 'cuDeviceGetLuid' in found_functions}} - global __cuDeviceGetLuid - __cuDeviceGetLuid = dlfcn.dlsym(handle, 'cuDeviceGetLuid') - {{endif}} - {{if 'cuDeviceTotalMem_v2' in found_functions}} - global __cuDeviceTotalMem_v2 - __cuDeviceTotalMem_v2 = dlfcn.dlsym(handle, 'cuDeviceTotalMem_v2') - {{endif}} - {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} - global __cuDeviceGetTexture1DLinearMaxWidth - __cuDeviceGetTexture1DLinearMaxWidth = dlfcn.dlsym(handle, 'cuDeviceGetTexture1DLinearMaxWidth') - {{endif}} - {{if 'cuDeviceGetAttribute' in found_functions}} - global __cuDeviceGetAttribute - __cuDeviceGetAttribute = dlfcn.dlsym(handle, 'cuDeviceGetAttribute') - {{endif}} - {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} - global __cuDeviceGetNvSciSyncAttributes - __cuDeviceGetNvSciSyncAttributes = dlfcn.dlsym(handle, 'cuDeviceGetNvSciSyncAttributes') - {{endif}} - {{if 'cuDeviceSetMemPool' in found_functions}} - global __cuDeviceSetMemPool - __cuDeviceSetMemPool = dlfcn.dlsym(handle, 'cuDeviceSetMemPool') - {{endif}} - {{if 'cuDeviceGetMemPool' in found_functions}} - global __cuDeviceGetMemPool - __cuDeviceGetMemPool = dlfcn.dlsym(handle, 'cuDeviceGetMemPool') - {{endif}} - {{if 'cuDeviceGetDefaultMemPool' in found_functions}} - global __cuDeviceGetDefaultMemPool - __cuDeviceGetDefaultMemPool = dlfcn.dlsym(handle, 'cuDeviceGetDefaultMemPool') - {{endif}} - {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} - global __cuDeviceGetExecAffinitySupport - __cuDeviceGetExecAffinitySupport = dlfcn.dlsym(handle, 'cuDeviceGetExecAffinitySupport') - {{endif}} - {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} - global __cuFlushGPUDirectRDMAWrites - __cuFlushGPUDirectRDMAWrites = dlfcn.dlsym(handle, 'cuFlushGPUDirectRDMAWrites') - {{endif}} - {{if 'cuDeviceGetProperties' in found_functions}} - global __cuDeviceGetProperties - __cuDeviceGetProperties = dlfcn.dlsym(handle, 'cuDeviceGetProperties') - {{endif}} - {{if 'cuDeviceComputeCapability' in found_functions}} - global __cuDeviceComputeCapability - __cuDeviceComputeCapability = dlfcn.dlsym(handle, 'cuDeviceComputeCapability') - {{endif}} - {{if 'cuDevicePrimaryCtxRetain' in found_functions}} - global __cuDevicePrimaryCtxRetain - __cuDevicePrimaryCtxRetain = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRetain') - {{endif}} - {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} - global __cuDevicePrimaryCtxRelease_v2 - __cuDevicePrimaryCtxRelease_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRelease_v2') - {{endif}} - {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} - global __cuDevicePrimaryCtxSetFlags_v2 - __cuDevicePrimaryCtxSetFlags_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxSetFlags_v2') - {{endif}} - {{if 'cuDevicePrimaryCtxGetState' in found_functions}} - global __cuDevicePrimaryCtxGetState - __cuDevicePrimaryCtxGetState = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxGetState') - {{endif}} - {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} - global __cuDevicePrimaryCtxReset_v2 - __cuDevicePrimaryCtxReset_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxReset_v2') - {{endif}} - {{if 'cuCtxCreate_v2' in found_functions}} - global __cuCtxCreate_v2 - __cuCtxCreate_v2 = dlfcn.dlsym(handle, 'cuCtxCreate_v2') - {{endif}} - {{if 'cuCtxCreate_v3' in found_functions}} - global __cuCtxCreate_v3 - __cuCtxCreate_v3 = dlfcn.dlsym(handle, 'cuCtxCreate_v3') - {{endif}} - {{if 'cuCtxCreate_v4' in found_functions}} - global __cuCtxCreate_v4 - __cuCtxCreate_v4 = dlfcn.dlsym(handle, 'cuCtxCreate_v4') - {{endif}} - {{if 'cuCtxDestroy_v2' in found_functions}} - global __cuCtxDestroy_v2 - __cuCtxDestroy_v2 = dlfcn.dlsym(handle, 'cuCtxDestroy_v2') - {{endif}} - {{if 'cuCtxPushCurrent_v2' in found_functions}} - global __cuCtxPushCurrent_v2 - __cuCtxPushCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPushCurrent_v2') - {{endif}} - {{if 'cuCtxPopCurrent_v2' in found_functions}} - global __cuCtxPopCurrent_v2 - __cuCtxPopCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPopCurrent_v2') - {{endif}} - {{if 'cuCtxSetCurrent' in found_functions}} - global __cuCtxSetCurrent - __cuCtxSetCurrent = dlfcn.dlsym(handle, 'cuCtxSetCurrent') - {{endif}} - {{if 'cuCtxGetCurrent' in found_functions}} - global __cuCtxGetCurrent - __cuCtxGetCurrent = dlfcn.dlsym(handle, 'cuCtxGetCurrent') - {{endif}} - {{if 'cuCtxGetDevice' in found_functions}} - global __cuCtxGetDevice - __cuCtxGetDevice = dlfcn.dlsym(handle, 'cuCtxGetDevice') - {{endif}} - {{if 'cuCtxGetFlags' in found_functions}} - global __cuCtxGetFlags - __cuCtxGetFlags = dlfcn.dlsym(handle, 'cuCtxGetFlags') - {{endif}} - {{if 'cuCtxSetFlags' in found_functions}} - global __cuCtxSetFlags - __cuCtxSetFlags = dlfcn.dlsym(handle, 'cuCtxSetFlags') - {{endif}} - {{if 'cuCtxGetId' in found_functions}} - global __cuCtxGetId - __cuCtxGetId = dlfcn.dlsym(handle, 'cuCtxGetId') - {{endif}} - {{if 'cuCtxSynchronize' in found_functions}} - global __cuCtxSynchronize - __cuCtxSynchronize = dlfcn.dlsym(handle, 'cuCtxSynchronize') - {{endif}} - {{if 'cuCtxSetLimit' in found_functions}} - global __cuCtxSetLimit - __cuCtxSetLimit = dlfcn.dlsym(handle, 'cuCtxSetLimit') - {{endif}} - {{if 'cuCtxGetLimit' in found_functions}} - global __cuCtxGetLimit - __cuCtxGetLimit = dlfcn.dlsym(handle, 'cuCtxGetLimit') - {{endif}} - {{if 'cuCtxGetCacheConfig' in found_functions}} - global __cuCtxGetCacheConfig - __cuCtxGetCacheConfig = dlfcn.dlsym(handle, 'cuCtxGetCacheConfig') - {{endif}} - {{if 'cuCtxSetCacheConfig' in found_functions}} - global __cuCtxSetCacheConfig - __cuCtxSetCacheConfig = dlfcn.dlsym(handle, 'cuCtxSetCacheConfig') - {{endif}} - {{if 'cuCtxGetApiVersion' in found_functions}} - global __cuCtxGetApiVersion - __cuCtxGetApiVersion = dlfcn.dlsym(handle, 'cuCtxGetApiVersion') - {{endif}} - {{if 'cuCtxGetStreamPriorityRange' in found_functions}} - global __cuCtxGetStreamPriorityRange - __cuCtxGetStreamPriorityRange = dlfcn.dlsym(handle, 'cuCtxGetStreamPriorityRange') - {{endif}} - {{if 'cuCtxResetPersistingL2Cache' in found_functions}} - global __cuCtxResetPersistingL2Cache - __cuCtxResetPersistingL2Cache = dlfcn.dlsym(handle, 'cuCtxResetPersistingL2Cache') - {{endif}} - {{if 'cuCtxGetExecAffinity' in found_functions}} - global __cuCtxGetExecAffinity - __cuCtxGetExecAffinity = dlfcn.dlsym(handle, 'cuCtxGetExecAffinity') - {{endif}} - {{if 'cuCtxRecordEvent' in found_functions}} - global __cuCtxRecordEvent - __cuCtxRecordEvent = dlfcn.dlsym(handle, 'cuCtxRecordEvent') - {{endif}} - {{if 'cuCtxWaitEvent' in found_functions}} - global __cuCtxWaitEvent - __cuCtxWaitEvent = dlfcn.dlsym(handle, 'cuCtxWaitEvent') - {{endif}} - {{if 'cuCtxAttach' in found_functions}} - global __cuCtxAttach - __cuCtxAttach = dlfcn.dlsym(handle, 'cuCtxAttach') - {{endif}} - {{if 'cuCtxDetach' in found_functions}} - global __cuCtxDetach - __cuCtxDetach = dlfcn.dlsym(handle, 'cuCtxDetach') - {{endif}} - {{if 'cuCtxGetSharedMemConfig' in found_functions}} - global __cuCtxGetSharedMemConfig - __cuCtxGetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxGetSharedMemConfig') - {{endif}} - {{if 'cuCtxSetSharedMemConfig' in found_functions}} - global __cuCtxSetSharedMemConfig - __cuCtxSetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxSetSharedMemConfig') - {{endif}} - {{if 'cuModuleLoad' in found_functions}} - global __cuModuleLoad - __cuModuleLoad = dlfcn.dlsym(handle, 'cuModuleLoad') - {{endif}} - {{if 'cuModuleLoadData' in found_functions}} - global __cuModuleLoadData - __cuModuleLoadData = dlfcn.dlsym(handle, 'cuModuleLoadData') - {{endif}} - {{if 'cuModuleLoadDataEx' in found_functions}} - global __cuModuleLoadDataEx - __cuModuleLoadDataEx = dlfcn.dlsym(handle, 'cuModuleLoadDataEx') - {{endif}} - {{if 'cuModuleLoadFatBinary' in found_functions}} - global __cuModuleLoadFatBinary - __cuModuleLoadFatBinary = dlfcn.dlsym(handle, 'cuModuleLoadFatBinary') - {{endif}} - {{if 'cuModuleUnload' in found_functions}} - global __cuModuleUnload - __cuModuleUnload = dlfcn.dlsym(handle, 'cuModuleUnload') - {{endif}} - {{if 'cuModuleGetLoadingMode' in found_functions}} - global __cuModuleGetLoadingMode - __cuModuleGetLoadingMode = dlfcn.dlsym(handle, 'cuModuleGetLoadingMode') - {{endif}} - {{if 'cuModuleGetFunction' in found_functions}} - global __cuModuleGetFunction - __cuModuleGetFunction = dlfcn.dlsym(handle, 'cuModuleGetFunction') - {{endif}} - {{if 'cuModuleGetFunctionCount' in found_functions}} - global __cuModuleGetFunctionCount - __cuModuleGetFunctionCount = dlfcn.dlsym(handle, 'cuModuleGetFunctionCount') - {{endif}} - {{if 'cuModuleEnumerateFunctions' in found_functions}} - global __cuModuleEnumerateFunctions - __cuModuleEnumerateFunctions = dlfcn.dlsym(handle, 'cuModuleEnumerateFunctions') - {{endif}} - {{if 'cuModuleGetGlobal_v2' in found_functions}} - global __cuModuleGetGlobal_v2 - __cuModuleGetGlobal_v2 = dlfcn.dlsym(handle, 'cuModuleGetGlobal_v2') - {{endif}} - {{if 'cuLinkCreate_v2' in found_functions}} - global __cuLinkCreate_v2 - __cuLinkCreate_v2 = dlfcn.dlsym(handle, 'cuLinkCreate_v2') - {{endif}} - {{if 'cuLinkAddData_v2' in found_functions}} - global __cuLinkAddData_v2 - __cuLinkAddData_v2 = dlfcn.dlsym(handle, 'cuLinkAddData_v2') - {{endif}} - {{if 'cuLinkAddFile_v2' in found_functions}} - global __cuLinkAddFile_v2 - __cuLinkAddFile_v2 = dlfcn.dlsym(handle, 'cuLinkAddFile_v2') - {{endif}} - {{if 'cuLinkComplete' in found_functions}} - global __cuLinkComplete - __cuLinkComplete = dlfcn.dlsym(handle, 'cuLinkComplete') - {{endif}} - {{if 'cuLinkDestroy' in found_functions}} - global __cuLinkDestroy - __cuLinkDestroy = dlfcn.dlsym(handle, 'cuLinkDestroy') - {{endif}} - {{if 'cuModuleGetTexRef' in found_functions}} - global __cuModuleGetTexRef - __cuModuleGetTexRef = dlfcn.dlsym(handle, 'cuModuleGetTexRef') - {{endif}} - {{if 'cuModuleGetSurfRef' in found_functions}} - global __cuModuleGetSurfRef - __cuModuleGetSurfRef = dlfcn.dlsym(handle, 'cuModuleGetSurfRef') - {{endif}} - {{if 'cuLibraryLoadData' in found_functions}} - global __cuLibraryLoadData - __cuLibraryLoadData = dlfcn.dlsym(handle, 'cuLibraryLoadData') - {{endif}} - {{if 'cuLibraryLoadFromFile' in found_functions}} - global __cuLibraryLoadFromFile - __cuLibraryLoadFromFile = dlfcn.dlsym(handle, 'cuLibraryLoadFromFile') - {{endif}} - {{if 'cuLibraryUnload' in found_functions}} - global __cuLibraryUnload - __cuLibraryUnload = dlfcn.dlsym(handle, 'cuLibraryUnload') - {{endif}} - {{if 'cuLibraryGetKernel' in found_functions}} - global __cuLibraryGetKernel - __cuLibraryGetKernel = dlfcn.dlsym(handle, 'cuLibraryGetKernel') - {{endif}} - {{if 'cuLibraryGetKernelCount' in found_functions}} - global __cuLibraryGetKernelCount - __cuLibraryGetKernelCount = dlfcn.dlsym(handle, 'cuLibraryGetKernelCount') - {{endif}} - {{if 'cuLibraryEnumerateKernels' in found_functions}} - global __cuLibraryEnumerateKernels - __cuLibraryEnumerateKernels = dlfcn.dlsym(handle, 'cuLibraryEnumerateKernels') - {{endif}} - {{if 'cuLibraryGetModule' in found_functions}} - global __cuLibraryGetModule - __cuLibraryGetModule = dlfcn.dlsym(handle, 'cuLibraryGetModule') - {{endif}} - {{if 'cuKernelGetFunction' in found_functions}} - global __cuKernelGetFunction - __cuKernelGetFunction = dlfcn.dlsym(handle, 'cuKernelGetFunction') - {{endif}} - {{if 'cuKernelGetLibrary' in found_functions}} - global __cuKernelGetLibrary - __cuKernelGetLibrary = dlfcn.dlsym(handle, 'cuKernelGetLibrary') - {{endif}} - {{if 'cuLibraryGetGlobal' in found_functions}} - global __cuLibraryGetGlobal - __cuLibraryGetGlobal = dlfcn.dlsym(handle, 'cuLibraryGetGlobal') - {{endif}} - {{if 'cuLibraryGetManaged' in found_functions}} - global __cuLibraryGetManaged - __cuLibraryGetManaged = dlfcn.dlsym(handle, 'cuLibraryGetManaged') - {{endif}} - {{if 'cuLibraryGetUnifiedFunction' in found_functions}} - global __cuLibraryGetUnifiedFunction - __cuLibraryGetUnifiedFunction = dlfcn.dlsym(handle, 'cuLibraryGetUnifiedFunction') - {{endif}} - {{if 'cuKernelGetAttribute' in found_functions}} - global __cuKernelGetAttribute - __cuKernelGetAttribute = dlfcn.dlsym(handle, 'cuKernelGetAttribute') - {{endif}} - {{if 'cuKernelSetAttribute' in found_functions}} - global __cuKernelSetAttribute - __cuKernelSetAttribute = dlfcn.dlsym(handle, 'cuKernelSetAttribute') - {{endif}} - {{if 'cuKernelSetCacheConfig' in found_functions}} - global __cuKernelSetCacheConfig - __cuKernelSetCacheConfig = dlfcn.dlsym(handle, 'cuKernelSetCacheConfig') - {{endif}} - {{if 'cuKernelGetName' in found_functions}} - global __cuKernelGetName - __cuKernelGetName = dlfcn.dlsym(handle, 'cuKernelGetName') - {{endif}} - {{if 'cuKernelGetParamInfo' in found_functions}} - global __cuKernelGetParamInfo - __cuKernelGetParamInfo = dlfcn.dlsym(handle, 'cuKernelGetParamInfo') - {{endif}} - {{if 'cuMemGetInfo_v2' in found_functions}} - global __cuMemGetInfo_v2 - __cuMemGetInfo_v2 = dlfcn.dlsym(handle, 'cuMemGetInfo_v2') - {{endif}} - {{if 'cuMemAlloc_v2' in found_functions}} - global __cuMemAlloc_v2 - __cuMemAlloc_v2 = dlfcn.dlsym(handle, 'cuMemAlloc_v2') - {{endif}} - {{if 'cuMemAllocPitch_v2' in found_functions}} - global __cuMemAllocPitch_v2 - __cuMemAllocPitch_v2 = dlfcn.dlsym(handle, 'cuMemAllocPitch_v2') - {{endif}} - {{if 'cuMemFree_v2' in found_functions}} - global __cuMemFree_v2 - __cuMemFree_v2 = dlfcn.dlsym(handle, 'cuMemFree_v2') - {{endif}} - {{if 'cuMemGetAddressRange_v2' in found_functions}} - global __cuMemGetAddressRange_v2 - __cuMemGetAddressRange_v2 = dlfcn.dlsym(handle, 'cuMemGetAddressRange_v2') - {{endif}} - {{if 'cuMemAllocHost_v2' in found_functions}} - global __cuMemAllocHost_v2 - __cuMemAllocHost_v2 = dlfcn.dlsym(handle, 'cuMemAllocHost_v2') - {{endif}} - {{if 'cuMemFreeHost' in found_functions}} - global __cuMemFreeHost - __cuMemFreeHost = dlfcn.dlsym(handle, 'cuMemFreeHost') - {{endif}} - {{if 'cuMemHostAlloc' in found_functions}} - global __cuMemHostAlloc - __cuMemHostAlloc = dlfcn.dlsym(handle, 'cuMemHostAlloc') - {{endif}} - {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} - global __cuMemHostGetDevicePointer_v2 - __cuMemHostGetDevicePointer_v2 = dlfcn.dlsym(handle, 'cuMemHostGetDevicePointer_v2') - {{endif}} - {{if 'cuMemHostGetFlags' in found_functions}} - global __cuMemHostGetFlags - __cuMemHostGetFlags = dlfcn.dlsym(handle, 'cuMemHostGetFlags') - {{endif}} - {{if 'cuMemAllocManaged' in found_functions}} - global __cuMemAllocManaged - __cuMemAllocManaged = dlfcn.dlsym(handle, 'cuMemAllocManaged') - {{endif}} - {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} - global __cuDeviceRegisterAsyncNotification - __cuDeviceRegisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceRegisterAsyncNotification') - {{endif}} - {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} - global __cuDeviceUnregisterAsyncNotification - __cuDeviceUnregisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceUnregisterAsyncNotification') - {{endif}} - {{if 'cuDeviceGetByPCIBusId' in found_functions}} - global __cuDeviceGetByPCIBusId - __cuDeviceGetByPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetByPCIBusId') - {{endif}} - {{if 'cuDeviceGetPCIBusId' in found_functions}} - global __cuDeviceGetPCIBusId - __cuDeviceGetPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetPCIBusId') - {{endif}} - {{if 'cuIpcGetEventHandle' in found_functions}} - global __cuIpcGetEventHandle - __cuIpcGetEventHandle = dlfcn.dlsym(handle, 'cuIpcGetEventHandle') - {{endif}} - {{if 'cuIpcOpenEventHandle' in found_functions}} - global __cuIpcOpenEventHandle - __cuIpcOpenEventHandle = dlfcn.dlsym(handle, 'cuIpcOpenEventHandle') - {{endif}} - {{if 'cuIpcGetMemHandle' in found_functions}} - global __cuIpcGetMemHandle - __cuIpcGetMemHandle = dlfcn.dlsym(handle, 'cuIpcGetMemHandle') - {{endif}} - {{if 'cuIpcOpenMemHandle_v2' in found_functions}} - global __cuIpcOpenMemHandle_v2 - __cuIpcOpenMemHandle_v2 = dlfcn.dlsym(handle, 'cuIpcOpenMemHandle_v2') - {{endif}} - {{if 'cuIpcCloseMemHandle' in found_functions}} - global __cuIpcCloseMemHandle - __cuIpcCloseMemHandle = dlfcn.dlsym(handle, 'cuIpcCloseMemHandle') - {{endif}} - {{if 'cuMemHostRegister_v2' in found_functions}} - global __cuMemHostRegister_v2 - __cuMemHostRegister_v2 = dlfcn.dlsym(handle, 'cuMemHostRegister_v2') - {{endif}} - {{if 'cuMemHostUnregister' in found_functions}} - global __cuMemHostUnregister - __cuMemHostUnregister = dlfcn.dlsym(handle, 'cuMemHostUnregister') - {{endif}} - {{if 'cuArrayCreate_v2' in found_functions}} - global __cuArrayCreate_v2 - __cuArrayCreate_v2 = dlfcn.dlsym(handle, 'cuArrayCreate_v2') - {{endif}} - {{if 'cuArrayGetDescriptor_v2' in found_functions}} - global __cuArrayGetDescriptor_v2 - __cuArrayGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArrayGetDescriptor_v2') - {{endif}} - {{if 'cuArrayGetSparseProperties' in found_functions}} - global __cuArrayGetSparseProperties - __cuArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuArrayGetSparseProperties') - {{endif}} - {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} - global __cuMipmappedArrayGetSparseProperties - __cuMipmappedArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuMipmappedArrayGetSparseProperties') - {{endif}} - {{if 'cuArrayGetMemoryRequirements' in found_functions}} - global __cuArrayGetMemoryRequirements - __cuArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuArrayGetMemoryRequirements') - {{endif}} - {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} - global __cuMipmappedArrayGetMemoryRequirements - __cuMipmappedArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuMipmappedArrayGetMemoryRequirements') - {{endif}} - {{if 'cuArrayGetPlane' in found_functions}} - global __cuArrayGetPlane - __cuArrayGetPlane = dlfcn.dlsym(handle, 'cuArrayGetPlane') - {{endif}} - {{if 'cuArrayDestroy' in found_functions}} - global __cuArrayDestroy - __cuArrayDestroy = dlfcn.dlsym(handle, 'cuArrayDestroy') - {{endif}} - {{if 'cuArray3DCreate_v2' in found_functions}} - global __cuArray3DCreate_v2 - __cuArray3DCreate_v2 = dlfcn.dlsym(handle, 'cuArray3DCreate_v2') - {{endif}} - {{if 'cuArray3DGetDescriptor_v2' in found_functions}} - global __cuArray3DGetDescriptor_v2 - __cuArray3DGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArray3DGetDescriptor_v2') - {{endif}} - {{if 'cuMipmappedArrayCreate' in found_functions}} - global __cuMipmappedArrayCreate - __cuMipmappedArrayCreate = dlfcn.dlsym(handle, 'cuMipmappedArrayCreate') - {{endif}} - {{if 'cuMipmappedArrayGetLevel' in found_functions}} - global __cuMipmappedArrayGetLevel - __cuMipmappedArrayGetLevel = dlfcn.dlsym(handle, 'cuMipmappedArrayGetLevel') - {{endif}} - {{if 'cuMipmappedArrayDestroy' in found_functions}} - global __cuMipmappedArrayDestroy - __cuMipmappedArrayDestroy = dlfcn.dlsym(handle, 'cuMipmappedArrayDestroy') - {{endif}} - {{if 'cuMemGetHandleForAddressRange' in found_functions}} - global __cuMemGetHandleForAddressRange - __cuMemGetHandleForAddressRange = dlfcn.dlsym(handle, 'cuMemGetHandleForAddressRange') - {{endif}} - {{if 'cuMemAddressReserve' in found_functions}} - global __cuMemAddressReserve - __cuMemAddressReserve = dlfcn.dlsym(handle, 'cuMemAddressReserve') - {{endif}} - {{if 'cuMemAddressFree' in found_functions}} - global __cuMemAddressFree - __cuMemAddressFree = dlfcn.dlsym(handle, 'cuMemAddressFree') - {{endif}} - {{if 'cuMemCreate' in found_functions}} - global __cuMemCreate - __cuMemCreate = dlfcn.dlsym(handle, 'cuMemCreate') - {{endif}} - {{if 'cuMemRelease' in found_functions}} - global __cuMemRelease - __cuMemRelease = dlfcn.dlsym(handle, 'cuMemRelease') - {{endif}} - {{if 'cuMemMap' in found_functions}} - global __cuMemMap - __cuMemMap = dlfcn.dlsym(handle, 'cuMemMap') - {{endif}} - {{if 'cuMemUnmap' in found_functions}} - global __cuMemUnmap - __cuMemUnmap = dlfcn.dlsym(handle, 'cuMemUnmap') - {{endif}} - {{if 'cuMemSetAccess' in found_functions}} - global __cuMemSetAccess - __cuMemSetAccess = dlfcn.dlsym(handle, 'cuMemSetAccess') - {{endif}} - {{if 'cuMemGetAccess' in found_functions}} - global __cuMemGetAccess - __cuMemGetAccess = dlfcn.dlsym(handle, 'cuMemGetAccess') - {{endif}} - {{if 'cuMemExportToShareableHandle' in found_functions}} - global __cuMemExportToShareableHandle - __cuMemExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemExportToShareableHandle') - {{endif}} - {{if 'cuMemImportFromShareableHandle' in found_functions}} - global __cuMemImportFromShareableHandle - __cuMemImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemImportFromShareableHandle') - {{endif}} - {{if 'cuMemGetAllocationGranularity' in found_functions}} - global __cuMemGetAllocationGranularity - __cuMemGetAllocationGranularity = dlfcn.dlsym(handle, 'cuMemGetAllocationGranularity') - {{endif}} - {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} - global __cuMemGetAllocationPropertiesFromHandle - __cuMemGetAllocationPropertiesFromHandle = dlfcn.dlsym(handle, 'cuMemGetAllocationPropertiesFromHandle') - {{endif}} - {{if 'cuMemRetainAllocationHandle' in found_functions}} - global __cuMemRetainAllocationHandle - __cuMemRetainAllocationHandle = dlfcn.dlsym(handle, 'cuMemRetainAllocationHandle') - {{endif}} - {{if 'cuMemPoolTrimTo' in found_functions}} - global __cuMemPoolTrimTo - __cuMemPoolTrimTo = dlfcn.dlsym(handle, 'cuMemPoolTrimTo') - {{endif}} - {{if 'cuMemPoolSetAttribute' in found_functions}} - global __cuMemPoolSetAttribute - __cuMemPoolSetAttribute = dlfcn.dlsym(handle, 'cuMemPoolSetAttribute') - {{endif}} - {{if 'cuMemPoolGetAttribute' in found_functions}} - global __cuMemPoolGetAttribute - __cuMemPoolGetAttribute = dlfcn.dlsym(handle, 'cuMemPoolGetAttribute') - {{endif}} - {{if 'cuMemPoolSetAccess' in found_functions}} - global __cuMemPoolSetAccess - __cuMemPoolSetAccess = dlfcn.dlsym(handle, 'cuMemPoolSetAccess') - {{endif}} - {{if 'cuMemPoolGetAccess' in found_functions}} - global __cuMemPoolGetAccess - __cuMemPoolGetAccess = dlfcn.dlsym(handle, 'cuMemPoolGetAccess') - {{endif}} - {{if 'cuMemPoolCreate' in found_functions}} - global __cuMemPoolCreate - __cuMemPoolCreate = dlfcn.dlsym(handle, 'cuMemPoolCreate') - {{endif}} - {{if 'cuMemPoolDestroy' in found_functions}} - global __cuMemPoolDestroy - __cuMemPoolDestroy = dlfcn.dlsym(handle, 'cuMemPoolDestroy') - {{endif}} - {{if 'cuMemPoolExportToShareableHandle' in found_functions}} - global __cuMemPoolExportToShareableHandle - __cuMemPoolExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolExportToShareableHandle') - {{endif}} - {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} - global __cuMemPoolImportFromShareableHandle - __cuMemPoolImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolImportFromShareableHandle') - {{endif}} - {{if 'cuMemPoolExportPointer' in found_functions}} - global __cuMemPoolExportPointer - __cuMemPoolExportPointer = dlfcn.dlsym(handle, 'cuMemPoolExportPointer') - {{endif}} - {{if 'cuMemPoolImportPointer' in found_functions}} - global __cuMemPoolImportPointer - __cuMemPoolImportPointer = dlfcn.dlsym(handle, 'cuMemPoolImportPointer') - {{endif}} - {{if 'cuMulticastCreate' in found_functions}} - global __cuMulticastCreate - __cuMulticastCreate = dlfcn.dlsym(handle, 'cuMulticastCreate') - {{endif}} - {{if 'cuMulticastAddDevice' in found_functions}} - global __cuMulticastAddDevice - __cuMulticastAddDevice = dlfcn.dlsym(handle, 'cuMulticastAddDevice') - {{endif}} - {{if 'cuMulticastBindMem' in found_functions}} - global __cuMulticastBindMem - __cuMulticastBindMem = dlfcn.dlsym(handle, 'cuMulticastBindMem') - {{endif}} - {{if 'cuMulticastBindAddr' in found_functions}} - global __cuMulticastBindAddr - __cuMulticastBindAddr = dlfcn.dlsym(handle, 'cuMulticastBindAddr') - {{endif}} - {{if 'cuMulticastUnbind' in found_functions}} - global __cuMulticastUnbind - __cuMulticastUnbind = dlfcn.dlsym(handle, 'cuMulticastUnbind') - {{endif}} - {{if 'cuMulticastGetGranularity' in found_functions}} - global __cuMulticastGetGranularity - __cuMulticastGetGranularity = dlfcn.dlsym(handle, 'cuMulticastGetGranularity') - {{endif}} - {{if 'cuPointerGetAttribute' in found_functions}} - global __cuPointerGetAttribute - __cuPointerGetAttribute = dlfcn.dlsym(handle, 'cuPointerGetAttribute') - {{endif}} - {{if 'cuMemAdvise' in found_functions}} - global __cuMemAdvise - __cuMemAdvise = dlfcn.dlsym(handle, 'cuMemAdvise') - {{endif}} - {{if 'cuMemAdvise_v2' in found_functions}} - global __cuMemAdvise_v2 - __cuMemAdvise_v2 = dlfcn.dlsym(handle, 'cuMemAdvise_v2') - {{endif}} - {{if 'cuMemRangeGetAttribute' in found_functions}} - global __cuMemRangeGetAttribute - __cuMemRangeGetAttribute = dlfcn.dlsym(handle, 'cuMemRangeGetAttribute') - {{endif}} - {{if 'cuMemRangeGetAttributes' in found_functions}} - global __cuMemRangeGetAttributes - __cuMemRangeGetAttributes = dlfcn.dlsym(handle, 'cuMemRangeGetAttributes') - {{endif}} - {{if 'cuPointerSetAttribute' in found_functions}} - global __cuPointerSetAttribute - __cuPointerSetAttribute = dlfcn.dlsym(handle, 'cuPointerSetAttribute') - {{endif}} - {{if 'cuPointerGetAttributes' in found_functions}} - global __cuPointerGetAttributes - __cuPointerGetAttributes = dlfcn.dlsym(handle, 'cuPointerGetAttributes') - {{endif}} - {{if 'cuStreamCreate' in found_functions}} - global __cuStreamCreate - __cuStreamCreate = dlfcn.dlsym(handle, 'cuStreamCreate') - {{endif}} - {{if 'cuStreamCreateWithPriority' in found_functions}} - global __cuStreamCreateWithPriority - __cuStreamCreateWithPriority = dlfcn.dlsym(handle, 'cuStreamCreateWithPriority') - {{endif}} - {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} - global __cuThreadExchangeStreamCaptureMode - __cuThreadExchangeStreamCaptureMode = dlfcn.dlsym(handle, 'cuThreadExchangeStreamCaptureMode') - {{endif}} - {{if 'cuStreamDestroy_v2' in found_functions}} - global __cuStreamDestroy_v2 - __cuStreamDestroy_v2 = dlfcn.dlsym(handle, 'cuStreamDestroy_v2') - {{endif}} - {{if 'cuEventCreate' in found_functions}} - global __cuEventCreate - __cuEventCreate = dlfcn.dlsym(handle, 'cuEventCreate') - {{endif}} - {{if 'cuEventQuery' in found_functions}} - global __cuEventQuery - __cuEventQuery = dlfcn.dlsym(handle, 'cuEventQuery') - {{endif}} - {{if 'cuEventSynchronize' in found_functions}} - global __cuEventSynchronize - __cuEventSynchronize = dlfcn.dlsym(handle, 'cuEventSynchronize') - {{endif}} - {{if 'cuEventDestroy_v2' in found_functions}} - global __cuEventDestroy_v2 - __cuEventDestroy_v2 = dlfcn.dlsym(handle, 'cuEventDestroy_v2') - {{endif}} - {{if 'cuEventElapsedTime' in found_functions}} - global __cuEventElapsedTime - __cuEventElapsedTime = dlfcn.dlsym(handle, 'cuEventElapsedTime') - {{endif}} - {{if 'cuEventElapsedTime_v2' in found_functions}} - global __cuEventElapsedTime_v2 - __cuEventElapsedTime_v2 = dlfcn.dlsym(handle, 'cuEventElapsedTime_v2') - {{endif}} - {{if 'cuImportExternalMemory' in found_functions}} - global __cuImportExternalMemory - __cuImportExternalMemory = dlfcn.dlsym(handle, 'cuImportExternalMemory') - {{endif}} - {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} - global __cuExternalMemoryGetMappedBuffer - __cuExternalMemoryGetMappedBuffer = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedBuffer') - {{endif}} - {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} - global __cuExternalMemoryGetMappedMipmappedArray - __cuExternalMemoryGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedMipmappedArray') - {{endif}} - {{if 'cuDestroyExternalMemory' in found_functions}} - global __cuDestroyExternalMemory - __cuDestroyExternalMemory = dlfcn.dlsym(handle, 'cuDestroyExternalMemory') - {{endif}} - {{if 'cuImportExternalSemaphore' in found_functions}} - global __cuImportExternalSemaphore - __cuImportExternalSemaphore = dlfcn.dlsym(handle, 'cuImportExternalSemaphore') - {{endif}} - {{if 'cuDestroyExternalSemaphore' in found_functions}} - global __cuDestroyExternalSemaphore - __cuDestroyExternalSemaphore = dlfcn.dlsym(handle, 'cuDestroyExternalSemaphore') - {{endif}} - {{if 'cuFuncGetAttribute' in found_functions}} - global __cuFuncGetAttribute - __cuFuncGetAttribute = dlfcn.dlsym(handle, 'cuFuncGetAttribute') - {{endif}} - {{if 'cuFuncSetAttribute' in found_functions}} - global __cuFuncSetAttribute - __cuFuncSetAttribute = dlfcn.dlsym(handle, 'cuFuncSetAttribute') - {{endif}} - {{if 'cuFuncSetCacheConfig' in found_functions}} - global __cuFuncSetCacheConfig - __cuFuncSetCacheConfig = dlfcn.dlsym(handle, 'cuFuncSetCacheConfig') - {{endif}} - {{if 'cuFuncGetModule' in found_functions}} - global __cuFuncGetModule - __cuFuncGetModule = dlfcn.dlsym(handle, 'cuFuncGetModule') - {{endif}} - {{if 'cuFuncGetName' in found_functions}} - global __cuFuncGetName - __cuFuncGetName = dlfcn.dlsym(handle, 'cuFuncGetName') - {{endif}} - {{if 'cuFuncGetParamInfo' in found_functions}} - global __cuFuncGetParamInfo - __cuFuncGetParamInfo = dlfcn.dlsym(handle, 'cuFuncGetParamInfo') - {{endif}} - {{if 'cuFuncIsLoaded' in found_functions}} - global __cuFuncIsLoaded - __cuFuncIsLoaded = dlfcn.dlsym(handle, 'cuFuncIsLoaded') - {{endif}} - {{if 'cuFuncLoad' in found_functions}} - global __cuFuncLoad - __cuFuncLoad = dlfcn.dlsym(handle, 'cuFuncLoad') - {{endif}} - {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} - global __cuLaunchCooperativeKernelMultiDevice - __cuLaunchCooperativeKernelMultiDevice = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernelMultiDevice') - {{endif}} - {{if 'cuFuncSetBlockShape' in found_functions}} - global __cuFuncSetBlockShape - __cuFuncSetBlockShape = dlfcn.dlsym(handle, 'cuFuncSetBlockShape') - {{endif}} - {{if 'cuFuncSetSharedSize' in found_functions}} - global __cuFuncSetSharedSize - __cuFuncSetSharedSize = dlfcn.dlsym(handle, 'cuFuncSetSharedSize') - {{endif}} - {{if 'cuParamSetSize' in found_functions}} - global __cuParamSetSize - __cuParamSetSize = dlfcn.dlsym(handle, 'cuParamSetSize') - {{endif}} - {{if 'cuParamSeti' in found_functions}} - global __cuParamSeti - __cuParamSeti = dlfcn.dlsym(handle, 'cuParamSeti') - {{endif}} - {{if 'cuParamSetf' in found_functions}} - global __cuParamSetf - __cuParamSetf = dlfcn.dlsym(handle, 'cuParamSetf') - {{endif}} - {{if 'cuParamSetv' in found_functions}} - global __cuParamSetv - __cuParamSetv = dlfcn.dlsym(handle, 'cuParamSetv') - {{endif}} - {{if 'cuLaunch' in found_functions}} - global __cuLaunch - __cuLaunch = dlfcn.dlsym(handle, 'cuLaunch') - {{endif}} - {{if 'cuLaunchGrid' in found_functions}} - global __cuLaunchGrid - __cuLaunchGrid = dlfcn.dlsym(handle, 'cuLaunchGrid') - {{endif}} - {{if 'cuLaunchGridAsync' in found_functions}} - global __cuLaunchGridAsync - __cuLaunchGridAsync = dlfcn.dlsym(handle, 'cuLaunchGridAsync') - {{endif}} - {{if 'cuParamSetTexRef' in found_functions}} - global __cuParamSetTexRef - __cuParamSetTexRef = dlfcn.dlsym(handle, 'cuParamSetTexRef') - {{endif}} - {{if 'cuFuncSetSharedMemConfig' in found_functions}} - global __cuFuncSetSharedMemConfig - __cuFuncSetSharedMemConfig = dlfcn.dlsym(handle, 'cuFuncSetSharedMemConfig') - {{endif}} - {{if 'cuGraphCreate' in found_functions}} - global __cuGraphCreate - __cuGraphCreate = dlfcn.dlsym(handle, 'cuGraphCreate') - {{endif}} - {{if 'cuGraphAddKernelNode_v2' in found_functions}} - global __cuGraphAddKernelNode_v2 - __cuGraphAddKernelNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddKernelNode_v2') - {{endif}} - {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} - global __cuGraphKernelNodeGetParams_v2 - __cuGraphKernelNodeGetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetParams_v2') - {{endif}} - {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} - global __cuGraphKernelNodeSetParams_v2 - __cuGraphKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetParams_v2') - {{endif}} - {{if 'cuGraphAddMemcpyNode' in found_functions}} - global __cuGraphAddMemcpyNode - __cuGraphAddMemcpyNode = dlfcn.dlsym(handle, 'cuGraphAddMemcpyNode') - {{endif}} - {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} - global __cuGraphMemcpyNodeGetParams - __cuGraphMemcpyNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeGetParams') - {{endif}} - {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} - global __cuGraphMemcpyNodeSetParams - __cuGraphMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeSetParams') - {{endif}} - {{if 'cuGraphAddMemsetNode' in found_functions}} - global __cuGraphAddMemsetNode - __cuGraphAddMemsetNode = dlfcn.dlsym(handle, 'cuGraphAddMemsetNode') - {{endif}} - {{if 'cuGraphMemsetNodeGetParams' in found_functions}} - global __cuGraphMemsetNodeGetParams - __cuGraphMemsetNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeGetParams') - {{endif}} - {{if 'cuGraphMemsetNodeSetParams' in found_functions}} - global __cuGraphMemsetNodeSetParams - __cuGraphMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeSetParams') - {{endif}} - {{if 'cuGraphAddHostNode' in found_functions}} - global __cuGraphAddHostNode - __cuGraphAddHostNode = dlfcn.dlsym(handle, 'cuGraphAddHostNode') - {{endif}} - {{if 'cuGraphHostNodeGetParams' in found_functions}} - global __cuGraphHostNodeGetParams - __cuGraphHostNodeGetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeGetParams') - {{endif}} - {{if 'cuGraphHostNodeSetParams' in found_functions}} - global __cuGraphHostNodeSetParams - __cuGraphHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeSetParams') - {{endif}} - {{if 'cuGraphAddChildGraphNode' in found_functions}} - global __cuGraphAddChildGraphNode - __cuGraphAddChildGraphNode = dlfcn.dlsym(handle, 'cuGraphAddChildGraphNode') - {{endif}} - {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} - global __cuGraphChildGraphNodeGetGraph - __cuGraphChildGraphNodeGetGraph = dlfcn.dlsym(handle, 'cuGraphChildGraphNodeGetGraph') - {{endif}} - {{if 'cuGraphAddEmptyNode' in found_functions}} - global __cuGraphAddEmptyNode - __cuGraphAddEmptyNode = dlfcn.dlsym(handle, 'cuGraphAddEmptyNode') - {{endif}} - {{if 'cuGraphAddEventRecordNode' in found_functions}} - global __cuGraphAddEventRecordNode - __cuGraphAddEventRecordNode = dlfcn.dlsym(handle, 'cuGraphAddEventRecordNode') - {{endif}} - {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} - global __cuGraphEventRecordNodeGetEvent - __cuGraphEventRecordNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeGetEvent') - {{endif}} - {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} - global __cuGraphEventRecordNodeSetEvent - __cuGraphEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeSetEvent') - {{endif}} - {{if 'cuGraphAddEventWaitNode' in found_functions}} - global __cuGraphAddEventWaitNode - __cuGraphAddEventWaitNode = dlfcn.dlsym(handle, 'cuGraphAddEventWaitNode') - {{endif}} - {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} - global __cuGraphEventWaitNodeGetEvent - __cuGraphEventWaitNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeGetEvent') - {{endif}} - {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} - global __cuGraphEventWaitNodeSetEvent - __cuGraphEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeSetEvent') - {{endif}} - {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} - global __cuGraphAddExternalSemaphoresSignalNode - __cuGraphAddExternalSemaphoresSignalNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresSignalNode') - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeGetParams - __cuGraphExternalSemaphoresSignalNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') - {{endif}} - {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresSignalNodeSetParams - __cuGraphExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') - {{endif}} - {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} - global __cuGraphAddExternalSemaphoresWaitNode - __cuGraphAddExternalSemaphoresWaitNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresWaitNode') - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeGetParams - __cuGraphExternalSemaphoresWaitNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') - {{endif}} - {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExternalSemaphoresWaitNodeSetParams - __cuGraphExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') - {{endif}} - {{if 'cuGraphAddBatchMemOpNode' in found_functions}} - global __cuGraphAddBatchMemOpNode - __cuGraphAddBatchMemOpNode = dlfcn.dlsym(handle, 'cuGraphAddBatchMemOpNode') - {{endif}} - {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} - global __cuGraphBatchMemOpNodeGetParams - __cuGraphBatchMemOpNodeGetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeGetParams') - {{endif}} - {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphBatchMemOpNodeSetParams - __cuGraphBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeSetParams') - {{endif}} - {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} - global __cuGraphExecBatchMemOpNodeSetParams - __cuGraphExecBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecBatchMemOpNodeSetParams') - {{endif}} - {{if 'cuGraphAddMemAllocNode' in found_functions}} - global __cuGraphAddMemAllocNode - __cuGraphAddMemAllocNode = dlfcn.dlsym(handle, 'cuGraphAddMemAllocNode') - {{endif}} - {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} - global __cuGraphMemAllocNodeGetParams - __cuGraphMemAllocNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemAllocNodeGetParams') - {{endif}} - {{if 'cuGraphAddMemFreeNode' in found_functions}} - global __cuGraphAddMemFreeNode - __cuGraphAddMemFreeNode = dlfcn.dlsym(handle, 'cuGraphAddMemFreeNode') - {{endif}} - {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} - global __cuGraphMemFreeNodeGetParams - __cuGraphMemFreeNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemFreeNodeGetParams') - {{endif}} - {{if 'cuDeviceGraphMemTrim' in found_functions}} - global __cuDeviceGraphMemTrim - __cuDeviceGraphMemTrim = dlfcn.dlsym(handle, 'cuDeviceGraphMemTrim') - {{endif}} - {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} - global __cuDeviceGetGraphMemAttribute - __cuDeviceGetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceGetGraphMemAttribute') - {{endif}} - {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} - global __cuDeviceSetGraphMemAttribute - __cuDeviceSetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceSetGraphMemAttribute') - {{endif}} - {{if 'cuGraphClone' in found_functions}} - global __cuGraphClone - __cuGraphClone = dlfcn.dlsym(handle, 'cuGraphClone') - {{endif}} - {{if 'cuGraphNodeFindInClone' in found_functions}} - global __cuGraphNodeFindInClone - __cuGraphNodeFindInClone = dlfcn.dlsym(handle, 'cuGraphNodeFindInClone') - {{endif}} - {{if 'cuGraphNodeGetType' in found_functions}} - global __cuGraphNodeGetType - __cuGraphNodeGetType = dlfcn.dlsym(handle, 'cuGraphNodeGetType') - {{endif}} - {{if 'cuGraphGetNodes' in found_functions}} - global __cuGraphGetNodes - __cuGraphGetNodes = dlfcn.dlsym(handle, 'cuGraphGetNodes') - {{endif}} - {{if 'cuGraphGetRootNodes' in found_functions}} - global __cuGraphGetRootNodes - __cuGraphGetRootNodes = dlfcn.dlsym(handle, 'cuGraphGetRootNodes') - {{endif}} - {{if 'cuGraphGetEdges' in found_functions}} - global __cuGraphGetEdges - __cuGraphGetEdges = dlfcn.dlsym(handle, 'cuGraphGetEdges') - {{endif}} - {{if 'cuGraphGetEdges_v2' in found_functions}} - global __cuGraphGetEdges_v2 - __cuGraphGetEdges_v2 = dlfcn.dlsym(handle, 'cuGraphGetEdges_v2') - {{endif}} - {{if 'cuGraphNodeGetDependencies' in found_functions}} - global __cuGraphNodeGetDependencies - __cuGraphNodeGetDependencies = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies') - {{endif}} - {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} - global __cuGraphNodeGetDependencies_v2 - __cuGraphNodeGetDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies_v2') - {{endif}} - {{if 'cuGraphNodeGetDependentNodes' in found_functions}} - global __cuGraphNodeGetDependentNodes - __cuGraphNodeGetDependentNodes = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes') - {{endif}} - {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} - global __cuGraphNodeGetDependentNodes_v2 - __cuGraphNodeGetDependentNodes_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes_v2') - {{endif}} - {{if 'cuGraphAddDependencies' in found_functions}} - global __cuGraphAddDependencies - __cuGraphAddDependencies = dlfcn.dlsym(handle, 'cuGraphAddDependencies') - {{endif}} - {{if 'cuGraphAddDependencies_v2' in found_functions}} - global __cuGraphAddDependencies_v2 - __cuGraphAddDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphAddDependencies_v2') - {{endif}} - {{if 'cuGraphRemoveDependencies' in found_functions}} - global __cuGraphRemoveDependencies - __cuGraphRemoveDependencies = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies') - {{endif}} - {{if 'cuGraphRemoveDependencies_v2' in found_functions}} - global __cuGraphRemoveDependencies_v2 - __cuGraphRemoveDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies_v2') - {{endif}} - {{if 'cuGraphDestroyNode' in found_functions}} - global __cuGraphDestroyNode - __cuGraphDestroyNode = dlfcn.dlsym(handle, 'cuGraphDestroyNode') - {{endif}} - {{if 'cuGraphInstantiateWithFlags' in found_functions}} - global __cuGraphInstantiateWithFlags - __cuGraphInstantiateWithFlags = dlfcn.dlsym(handle, 'cuGraphInstantiateWithFlags') - {{endif}} - {{if 'cuGraphExecGetFlags' in found_functions}} - global __cuGraphExecGetFlags - __cuGraphExecGetFlags = dlfcn.dlsym(handle, 'cuGraphExecGetFlags') - {{endif}} - {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} - global __cuGraphExecKernelNodeSetParams_v2 - __cuGraphExecKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphExecKernelNodeSetParams_v2') - {{endif}} - {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} - global __cuGraphExecMemcpyNodeSetParams - __cuGraphExecMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemcpyNodeSetParams') - {{endif}} - {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} - global __cuGraphExecMemsetNodeSetParams - __cuGraphExecMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemsetNodeSetParams') - {{endif}} - {{if 'cuGraphExecHostNodeSetParams' in found_functions}} - global __cuGraphExecHostNodeSetParams - __cuGraphExecHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecHostNodeSetParams') - {{endif}} - {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} - global __cuGraphExecChildGraphNodeSetParams - __cuGraphExecChildGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecChildGraphNodeSetParams') - {{endif}} - {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} - global __cuGraphExecEventRecordNodeSetEvent - __cuGraphExecEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventRecordNodeSetEvent') - {{endif}} - {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} - global __cuGraphExecEventWaitNodeSetEvent - __cuGraphExecEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventWaitNodeSetEvent') - {{endif}} - {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresSignalNodeSetParams - __cuGraphExecExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') - {{endif}} - {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} - global __cuGraphExecExternalSemaphoresWaitNodeSetParams - __cuGraphExecExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') - {{endif}} - {{if 'cuGraphNodeSetEnabled' in found_functions}} - global __cuGraphNodeSetEnabled - __cuGraphNodeSetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeSetEnabled') - {{endif}} - {{if 'cuGraphNodeGetEnabled' in found_functions}} - global __cuGraphNodeGetEnabled - __cuGraphNodeGetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeGetEnabled') - {{endif}} - {{if 'cuGraphExecDestroy' in found_functions}} - global __cuGraphExecDestroy - __cuGraphExecDestroy = dlfcn.dlsym(handle, 'cuGraphExecDestroy') - {{endif}} - {{if 'cuGraphDestroy' in found_functions}} - global __cuGraphDestroy - __cuGraphDestroy = dlfcn.dlsym(handle, 'cuGraphDestroy') - {{endif}} - {{if 'cuGraphExecUpdate_v2' in found_functions}} - global __cuGraphExecUpdate_v2 - __cuGraphExecUpdate_v2 = dlfcn.dlsym(handle, 'cuGraphExecUpdate_v2') - {{endif}} - {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} - global __cuGraphKernelNodeCopyAttributes - __cuGraphKernelNodeCopyAttributes = dlfcn.dlsym(handle, 'cuGraphKernelNodeCopyAttributes') - {{endif}} - {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} - global __cuGraphKernelNodeGetAttribute - __cuGraphKernelNodeGetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetAttribute') - {{endif}} - {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} - global __cuGraphKernelNodeSetAttribute - __cuGraphKernelNodeSetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetAttribute') - {{endif}} - {{if 'cuGraphDebugDotPrint' in found_functions}} - global __cuGraphDebugDotPrint - __cuGraphDebugDotPrint = dlfcn.dlsym(handle, 'cuGraphDebugDotPrint') - {{endif}} - {{if 'cuUserObjectCreate' in found_functions}} - global __cuUserObjectCreate - __cuUserObjectCreate = dlfcn.dlsym(handle, 'cuUserObjectCreate') - {{endif}} - {{if 'cuUserObjectRetain' in found_functions}} - global __cuUserObjectRetain - __cuUserObjectRetain = dlfcn.dlsym(handle, 'cuUserObjectRetain') - {{endif}} - {{if 'cuUserObjectRelease' in found_functions}} - global __cuUserObjectRelease - __cuUserObjectRelease = dlfcn.dlsym(handle, 'cuUserObjectRelease') - {{endif}} - {{if 'cuGraphRetainUserObject' in found_functions}} - global __cuGraphRetainUserObject - __cuGraphRetainUserObject = dlfcn.dlsym(handle, 'cuGraphRetainUserObject') - {{endif}} - {{if 'cuGraphReleaseUserObject' in found_functions}} - global __cuGraphReleaseUserObject - __cuGraphReleaseUserObject = dlfcn.dlsym(handle, 'cuGraphReleaseUserObject') - {{endif}} - {{if 'cuGraphAddNode' in found_functions}} - global __cuGraphAddNode - __cuGraphAddNode = dlfcn.dlsym(handle, 'cuGraphAddNode') - {{endif}} - {{if 'cuGraphAddNode_v2' in found_functions}} - global __cuGraphAddNode_v2 - __cuGraphAddNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddNode_v2') - {{endif}} - {{if 'cuGraphNodeSetParams' in found_functions}} - global __cuGraphNodeSetParams - __cuGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphNodeSetParams') - {{endif}} - {{if 'cuGraphExecNodeSetParams' in found_functions}} - global __cuGraphExecNodeSetParams - __cuGraphExecNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecNodeSetParams') - {{endif}} - {{if 'cuGraphConditionalHandleCreate' in found_functions}} - global __cuGraphConditionalHandleCreate - __cuGraphConditionalHandleCreate = dlfcn.dlsym(handle, 'cuGraphConditionalHandleCreate') - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessor - __cuOccupancyMaxActiveBlocksPerMultiprocessor = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') - {{endif}} - {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} - global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags - __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} - global __cuOccupancyMaxPotentialBlockSize - __cuOccupancyMaxPotentialBlockSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSize') - {{endif}} - {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} - global __cuOccupancyMaxPotentialBlockSizeWithFlags - __cuOccupancyMaxPotentialBlockSizeWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') - {{endif}} - {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} - global __cuOccupancyAvailableDynamicSMemPerBlock - __cuOccupancyAvailableDynamicSMemPerBlock = dlfcn.dlsym(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') - {{endif}} - {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} - global __cuOccupancyMaxPotentialClusterSize - __cuOccupancyMaxPotentialClusterSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialClusterSize') - {{endif}} - {{if 'cuOccupancyMaxActiveClusters' in found_functions}} - global __cuOccupancyMaxActiveClusters - __cuOccupancyMaxActiveClusters = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveClusters') - {{endif}} - {{if 'cuTexRefSetArray' in found_functions}} - global __cuTexRefSetArray - __cuTexRefSetArray = dlfcn.dlsym(handle, 'cuTexRefSetArray') - {{endif}} - {{if 'cuTexRefSetMipmappedArray' in found_functions}} - global __cuTexRefSetMipmappedArray - __cuTexRefSetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefSetMipmappedArray') - {{endif}} - {{if 'cuTexRefSetAddress_v2' in found_functions}} - global __cuTexRefSetAddress_v2 - __cuTexRefSetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefSetAddress_v2') - {{endif}} - {{if 'cuTexRefSetAddress2D_v3' in found_functions}} - global __cuTexRefSetAddress2D_v3 - __cuTexRefSetAddress2D_v3 = dlfcn.dlsym(handle, 'cuTexRefSetAddress2D_v3') - {{endif}} - {{if 'cuTexRefSetFormat' in found_functions}} - global __cuTexRefSetFormat - __cuTexRefSetFormat = dlfcn.dlsym(handle, 'cuTexRefSetFormat') - {{endif}} - {{if 'cuTexRefSetAddressMode' in found_functions}} - global __cuTexRefSetAddressMode - __cuTexRefSetAddressMode = dlfcn.dlsym(handle, 'cuTexRefSetAddressMode') - {{endif}} - {{if 'cuTexRefSetFilterMode' in found_functions}} - global __cuTexRefSetFilterMode - __cuTexRefSetFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetFilterMode') - {{endif}} - {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} - global __cuTexRefSetMipmapFilterMode - __cuTexRefSetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetMipmapFilterMode') - {{endif}} - {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} - global __cuTexRefSetMipmapLevelBias - __cuTexRefSetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelBias') - {{endif}} - {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} - global __cuTexRefSetMipmapLevelClamp - __cuTexRefSetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelClamp') - {{endif}} - {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} - global __cuTexRefSetMaxAnisotropy - __cuTexRefSetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefSetMaxAnisotropy') - {{endif}} - {{if 'cuTexRefSetBorderColor' in found_functions}} - global __cuTexRefSetBorderColor - __cuTexRefSetBorderColor = dlfcn.dlsym(handle, 'cuTexRefSetBorderColor') - {{endif}} - {{if 'cuTexRefSetFlags' in found_functions}} - global __cuTexRefSetFlags - __cuTexRefSetFlags = dlfcn.dlsym(handle, 'cuTexRefSetFlags') - {{endif}} - {{if 'cuTexRefGetAddress_v2' in found_functions}} - global __cuTexRefGetAddress_v2 - __cuTexRefGetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefGetAddress_v2') - {{endif}} - {{if 'cuTexRefGetArray' in found_functions}} - global __cuTexRefGetArray - __cuTexRefGetArray = dlfcn.dlsym(handle, 'cuTexRefGetArray') - {{endif}} - {{if 'cuTexRefGetMipmappedArray' in found_functions}} - global __cuTexRefGetMipmappedArray - __cuTexRefGetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefGetMipmappedArray') - {{endif}} - {{if 'cuTexRefGetAddressMode' in found_functions}} - global __cuTexRefGetAddressMode - __cuTexRefGetAddressMode = dlfcn.dlsym(handle, 'cuTexRefGetAddressMode') - {{endif}} - {{if 'cuTexRefGetFilterMode' in found_functions}} - global __cuTexRefGetFilterMode - __cuTexRefGetFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetFilterMode') - {{endif}} - {{if 'cuTexRefGetFormat' in found_functions}} - global __cuTexRefGetFormat - __cuTexRefGetFormat = dlfcn.dlsym(handle, 'cuTexRefGetFormat') - {{endif}} - {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} - global __cuTexRefGetMipmapFilterMode - __cuTexRefGetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetMipmapFilterMode') - {{endif}} - {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} - global __cuTexRefGetMipmapLevelBias - __cuTexRefGetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelBias') - {{endif}} - {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} - global __cuTexRefGetMipmapLevelClamp - __cuTexRefGetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelClamp') - {{endif}} - {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} - global __cuTexRefGetMaxAnisotropy - __cuTexRefGetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefGetMaxAnisotropy') - {{endif}} - {{if 'cuTexRefGetBorderColor' in found_functions}} - global __cuTexRefGetBorderColor - __cuTexRefGetBorderColor = dlfcn.dlsym(handle, 'cuTexRefGetBorderColor') - {{endif}} - {{if 'cuTexRefGetFlags' in found_functions}} - global __cuTexRefGetFlags - __cuTexRefGetFlags = dlfcn.dlsym(handle, 'cuTexRefGetFlags') - {{endif}} - {{if 'cuTexRefCreate' in found_functions}} - global __cuTexRefCreate - __cuTexRefCreate = dlfcn.dlsym(handle, 'cuTexRefCreate') - {{endif}} - {{if 'cuTexRefDestroy' in found_functions}} - global __cuTexRefDestroy - __cuTexRefDestroy = dlfcn.dlsym(handle, 'cuTexRefDestroy') - {{endif}} - {{if 'cuSurfRefSetArray' in found_functions}} - global __cuSurfRefSetArray - __cuSurfRefSetArray = dlfcn.dlsym(handle, 'cuSurfRefSetArray') - {{endif}} - {{if 'cuSurfRefGetArray' in found_functions}} - global __cuSurfRefGetArray - __cuSurfRefGetArray = dlfcn.dlsym(handle, 'cuSurfRefGetArray') - {{endif}} - {{if 'cuTexObjectCreate' in found_functions}} - global __cuTexObjectCreate - __cuTexObjectCreate = dlfcn.dlsym(handle, 'cuTexObjectCreate') - {{endif}} - {{if 'cuTexObjectDestroy' in found_functions}} - global __cuTexObjectDestroy - __cuTexObjectDestroy = dlfcn.dlsym(handle, 'cuTexObjectDestroy') - {{endif}} - {{if 'cuTexObjectGetResourceDesc' in found_functions}} - global __cuTexObjectGetResourceDesc - __cuTexObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceDesc') - {{endif}} - {{if 'cuTexObjectGetTextureDesc' in found_functions}} - global __cuTexObjectGetTextureDesc - __cuTexObjectGetTextureDesc = dlfcn.dlsym(handle, 'cuTexObjectGetTextureDesc') - {{endif}} - {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} - global __cuTexObjectGetResourceViewDesc - __cuTexObjectGetResourceViewDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceViewDesc') - {{endif}} - {{if 'cuSurfObjectCreate' in found_functions}} - global __cuSurfObjectCreate - __cuSurfObjectCreate = dlfcn.dlsym(handle, 'cuSurfObjectCreate') - {{endif}} - {{if 'cuSurfObjectDestroy' in found_functions}} - global __cuSurfObjectDestroy - __cuSurfObjectDestroy = dlfcn.dlsym(handle, 'cuSurfObjectDestroy') - {{endif}} - {{if 'cuSurfObjectGetResourceDesc' in found_functions}} - global __cuSurfObjectGetResourceDesc - __cuSurfObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuSurfObjectGetResourceDesc') - {{endif}} - {{if 'cuTensorMapEncodeTiled' in found_functions}} - global __cuTensorMapEncodeTiled - __cuTensorMapEncodeTiled = dlfcn.dlsym(handle, 'cuTensorMapEncodeTiled') - {{endif}} - {{if 'cuTensorMapEncodeIm2col' in found_functions}} - global __cuTensorMapEncodeIm2col - __cuTensorMapEncodeIm2col = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2col') - {{endif}} - {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} - global __cuTensorMapEncodeIm2colWide - __cuTensorMapEncodeIm2colWide = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2colWide') - {{endif}} - {{if 'cuTensorMapReplaceAddress' in found_functions}} - global __cuTensorMapReplaceAddress - __cuTensorMapReplaceAddress = dlfcn.dlsym(handle, 'cuTensorMapReplaceAddress') - {{endif}} - {{if 'cuDeviceCanAccessPeer' in found_functions}} - global __cuDeviceCanAccessPeer - __cuDeviceCanAccessPeer = dlfcn.dlsym(handle, 'cuDeviceCanAccessPeer') - {{endif}} - {{if 'cuCtxEnablePeerAccess' in found_functions}} - global __cuCtxEnablePeerAccess - __cuCtxEnablePeerAccess = dlfcn.dlsym(handle, 'cuCtxEnablePeerAccess') - {{endif}} - {{if 'cuCtxDisablePeerAccess' in found_functions}} - global __cuCtxDisablePeerAccess - __cuCtxDisablePeerAccess = dlfcn.dlsym(handle, 'cuCtxDisablePeerAccess') - {{endif}} - {{if 'cuDeviceGetP2PAttribute' in found_functions}} - global __cuDeviceGetP2PAttribute - __cuDeviceGetP2PAttribute = dlfcn.dlsym(handle, 'cuDeviceGetP2PAttribute') - {{endif}} - {{if 'cuGraphicsUnregisterResource' in found_functions}} - global __cuGraphicsUnregisterResource - __cuGraphicsUnregisterResource = dlfcn.dlsym(handle, 'cuGraphicsUnregisterResource') - {{endif}} - {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} - global __cuGraphicsSubResourceGetMappedArray - __cuGraphicsSubResourceGetMappedArray = dlfcn.dlsym(handle, 'cuGraphicsSubResourceGetMappedArray') - {{endif}} - {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} - global __cuGraphicsResourceGetMappedMipmappedArray - __cuGraphicsResourceGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedMipmappedArray') - {{endif}} - {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} - global __cuGraphicsResourceGetMappedPointer_v2 - __cuGraphicsResourceGetMappedPointer_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedPointer_v2') - {{endif}} - {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} - global __cuGraphicsResourceSetMapFlags_v2 - __cuGraphicsResourceSetMapFlags_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceSetMapFlags_v2') - {{endif}} - {{if 'cuGetProcAddress_v2' in found_functions}} - global __cuGetProcAddress_v2 - __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') - {{endif}} - {{if 'cuCoredumpGetAttribute' in found_functions}} - global __cuCoredumpGetAttribute - __cuCoredumpGetAttribute = dlfcn.dlsym(handle, 'cuCoredumpGetAttribute') - {{endif}} - {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} - global __cuCoredumpGetAttributeGlobal - __cuCoredumpGetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpGetAttributeGlobal') - {{endif}} - {{if 'cuCoredumpSetAttribute' in found_functions}} - global __cuCoredumpSetAttribute - __cuCoredumpSetAttribute = dlfcn.dlsym(handle, 'cuCoredumpSetAttribute') - {{endif}} - {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} - global __cuCoredumpSetAttributeGlobal - __cuCoredumpSetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpSetAttributeGlobal') - {{endif}} - {{if 'cuGetExportTable' in found_functions}} - global __cuGetExportTable - __cuGetExportTable = dlfcn.dlsym(handle, 'cuGetExportTable') - {{endif}} - {{if 'cuGreenCtxCreate' in found_functions}} - global __cuGreenCtxCreate - __cuGreenCtxCreate = dlfcn.dlsym(handle, 'cuGreenCtxCreate') - {{endif}} - {{if 'cuGreenCtxDestroy' in found_functions}} - global __cuGreenCtxDestroy - __cuGreenCtxDestroy = dlfcn.dlsym(handle, 'cuGreenCtxDestroy') - {{endif}} - {{if 'cuCtxFromGreenCtx' in found_functions}} - global __cuCtxFromGreenCtx - __cuCtxFromGreenCtx = dlfcn.dlsym(handle, 'cuCtxFromGreenCtx') - {{endif}} - {{if 'cuDeviceGetDevResource' in found_functions}} - global __cuDeviceGetDevResource - __cuDeviceGetDevResource = dlfcn.dlsym(handle, 'cuDeviceGetDevResource') - {{endif}} - {{if 'cuCtxGetDevResource' in found_functions}} - global __cuCtxGetDevResource - __cuCtxGetDevResource = dlfcn.dlsym(handle, 'cuCtxGetDevResource') - {{endif}} - {{if 'cuGreenCtxGetDevResource' in found_functions}} - global __cuGreenCtxGetDevResource - __cuGreenCtxGetDevResource = dlfcn.dlsym(handle, 'cuGreenCtxGetDevResource') - {{endif}} - {{if 'cuDevSmResourceSplitByCount' in found_functions}} - global __cuDevSmResourceSplitByCount - __cuDevSmResourceSplitByCount = dlfcn.dlsym(handle, 'cuDevSmResourceSplitByCount') - {{endif}} - {{if 'cuDevResourceGenerateDesc' in found_functions}} - global __cuDevResourceGenerateDesc - __cuDevResourceGenerateDesc = dlfcn.dlsym(handle, 'cuDevResourceGenerateDesc') - {{endif}} - {{if 'cuGreenCtxRecordEvent' in found_functions}} - global __cuGreenCtxRecordEvent - __cuGreenCtxRecordEvent = dlfcn.dlsym(handle, 'cuGreenCtxRecordEvent') - {{endif}} - {{if 'cuGreenCtxWaitEvent' in found_functions}} - global __cuGreenCtxWaitEvent - __cuGreenCtxWaitEvent = dlfcn.dlsym(handle, 'cuGreenCtxWaitEvent') - {{endif}} - {{if 'cuStreamGetGreenCtx' in found_functions}} - global __cuStreamGetGreenCtx - __cuStreamGetGreenCtx = dlfcn.dlsym(handle, 'cuStreamGetGreenCtx') - {{endif}} - {{if 'cuGreenCtxStreamCreate' in found_functions}} - global __cuGreenCtxStreamCreate - __cuGreenCtxStreamCreate = dlfcn.dlsym(handle, 'cuGreenCtxStreamCreate') - {{endif}} - {{if 'cuLogsRegisterCallback' in found_functions}} - global __cuLogsRegisterCallback - __cuLogsRegisterCallback = dlfcn.dlsym(handle, 'cuLogsRegisterCallback') - {{endif}} - {{if 'cuLogsUnregisterCallback' in found_functions}} - global __cuLogsUnregisterCallback - __cuLogsUnregisterCallback = dlfcn.dlsym(handle, 'cuLogsUnregisterCallback') - {{endif}} - {{if 'cuLogsCurrent' in found_functions}} - global __cuLogsCurrent - __cuLogsCurrent = dlfcn.dlsym(handle, 'cuLogsCurrent') - {{endif}} - {{if 'cuLogsDumpToFile' in found_functions}} - global __cuLogsDumpToFile - __cuLogsDumpToFile = dlfcn.dlsym(handle, 'cuLogsDumpToFile') - {{endif}} - {{if 'cuLogsDumpToMemory' in found_functions}} - global __cuLogsDumpToMemory - __cuLogsDumpToMemory = dlfcn.dlsym(handle, 'cuLogsDumpToMemory') - {{endif}} - {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} - global __cuCheckpointProcessGetRestoreThreadId - __cuCheckpointProcessGetRestoreThreadId = dlfcn.dlsym(handle, 'cuCheckpointProcessGetRestoreThreadId') - {{endif}} - {{if 'cuCheckpointProcessGetState' in found_functions}} - global __cuCheckpointProcessGetState - __cuCheckpointProcessGetState = dlfcn.dlsym(handle, 'cuCheckpointProcessGetState') - {{endif}} - {{if 'cuCheckpointProcessLock' in found_functions}} - global __cuCheckpointProcessLock - __cuCheckpointProcessLock = dlfcn.dlsym(handle, 'cuCheckpointProcessLock') - {{endif}} - {{if 'cuCheckpointProcessCheckpoint' in found_functions}} - global __cuCheckpointProcessCheckpoint - __cuCheckpointProcessCheckpoint = dlfcn.dlsym(handle, 'cuCheckpointProcessCheckpoint') - {{endif}} - {{if 'cuCheckpointProcessRestore' in found_functions}} - global __cuCheckpointProcessRestore - __cuCheckpointProcessRestore = dlfcn.dlsym(handle, 'cuCheckpointProcessRestore') - {{endif}} - {{if 'cuCheckpointProcessUnlock' in found_functions}} - global __cuCheckpointProcessUnlock - __cuCheckpointProcessUnlock = dlfcn.dlsym(handle, 'cuCheckpointProcessUnlock') - {{endif}} - {{if 'cuProfilerStart' in found_functions}} - global __cuProfilerStart - __cuProfilerStart = dlfcn.dlsym(handle, 'cuProfilerStart') - {{endif}} - {{if 'cuProfilerStop' in found_functions}} - global __cuProfilerStop - __cuProfilerStop = dlfcn.dlsym(handle, 'cuProfilerStop') - {{endif}} - {{if True}} - global __cuGraphicsEGLRegisterImage - __cuGraphicsEGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsEGLRegisterImage') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnect - __cuEGLStreamConsumerConnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnect') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerConnectWithFlags - __cuEGLStreamConsumerConnectWithFlags = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnectWithFlags') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerDisconnect - __cuEGLStreamConsumerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerDisconnect') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerAcquireFrame - __cuEGLStreamConsumerAcquireFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerAcquireFrame') - {{endif}} - {{if True}} - global __cuEGLStreamConsumerReleaseFrame - __cuEGLStreamConsumerReleaseFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerReleaseFrame') - {{endif}} - {{if True}} - global __cuEGLStreamProducerConnect - __cuEGLStreamProducerConnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerConnect') - {{endif}} - {{if True}} - global __cuEGLStreamProducerDisconnect - __cuEGLStreamProducerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerDisconnect') - {{endif}} - {{if True}} - global __cuEGLStreamProducerPresentFrame - __cuEGLStreamProducerPresentFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerPresentFrame') - {{endif}} - {{if True}} - global __cuEGLStreamProducerReturnFrame - __cuEGLStreamProducerReturnFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerReturnFrame') - {{endif}} - {{if True}} - global __cuGraphicsResourceGetMappedEglFrame - __cuGraphicsResourceGetMappedEglFrame = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedEglFrame') - {{endif}} - {{if True}} - global __cuEventCreateFromEGLSync - __cuEventCreateFromEGLSync = dlfcn.dlsym(handle, 'cuEventCreateFromEGLSync') - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterBuffer - __cuGraphicsGLRegisterBuffer = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterBuffer') - {{endif}} - {{if True}} - global __cuGraphicsGLRegisterImage - __cuGraphicsGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterImage') - {{endif}} - {{if True}} - global __cuGLGetDevices_v2 - __cuGLGetDevices_v2 = dlfcn.dlsym(handle, 'cuGLGetDevices_v2') - {{endif}} - {{if True}} - global __cuVDPAUGetDevice - __cuVDPAUGetDevice = dlfcn.dlsym(handle, 'cuVDPAUGetDevice') - {{endif}} - {{if True}} - global __cuVDPAUCtxCreate_v2 - __cuVDPAUCtxCreate_v2 = dlfcn.dlsym(handle, 'cuVDPAUCtxCreate_v2') - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterVideoSurface - __cuGraphicsVDPAURegisterVideoSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterVideoSurface') - {{endif}} - {{if True}} - global __cuGraphicsVDPAURegisterOutputSurface - __cuGraphicsVDPAURegisterOutputSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterOutputSurface') - {{endif}} - {{endif}} + {{if 'cuImportExternalMemory' in found_functions}} + global __cuImportExternalMemory + _F_cuGetProcAddress_v2('cuImportExternalMemory', &__cuImportExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} + global __cuExternalMemoryGetMappedBuffer + _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedBuffer', &__cuExternalMemoryGetMappedBuffer, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} + global __cuExternalMemoryGetMappedMipmappedArray + _F_cuGetProcAddress_v2('cuExternalMemoryGetMappedMipmappedArray', &__cuExternalMemoryGetMappedMipmappedArray, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDestroyExternalMemory' in found_functions}} + global __cuDestroyExternalMemory + _F_cuGetProcAddress_v2('cuDestroyExternalMemory', &__cuDestroyExternalMemory, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuImportExternalSemaphore' in found_functions}} + global __cuImportExternalSemaphore + _F_cuGetProcAddress_v2('cuImportExternalSemaphore', &__cuImportExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDestroyExternalSemaphore' in found_functions}} + global __cuDestroyExternalSemaphore + _F_cuGetProcAddress_v2('cuDestroyExternalSemaphore', &__cuDestroyExternalSemaphore, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncGetAttribute' in found_functions}} + global __cuFuncGetAttribute + _F_cuGetProcAddress_v2('cuFuncGetAttribute', &__cuFuncGetAttribute, 2020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetAttribute' in found_functions}} + global __cuFuncSetAttribute + _F_cuGetProcAddress_v2('cuFuncSetAttribute', &__cuFuncSetAttribute, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetCacheConfig' in found_functions}} + global __cuFuncSetCacheConfig + _F_cuGetProcAddress_v2('cuFuncSetCacheConfig', &__cuFuncSetCacheConfig, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncGetModule' in found_functions}} + global __cuFuncGetModule + _F_cuGetProcAddress_v2('cuFuncGetModule', &__cuFuncGetModule, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncGetName' in found_functions}} + global __cuFuncGetName + _F_cuGetProcAddress_v2('cuFuncGetName', &__cuFuncGetName, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncGetParamInfo' in found_functions}} + global __cuFuncGetParamInfo + _F_cuGetProcAddress_v2('cuFuncGetParamInfo', &__cuFuncGetParamInfo, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncIsLoaded' in found_functions}} + global __cuFuncIsLoaded + _F_cuGetProcAddress_v2('cuFuncIsLoaded', &__cuFuncIsLoaded, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncLoad' in found_functions}} + global __cuFuncLoad + _F_cuGetProcAddress_v2('cuFuncLoad', &__cuFuncLoad, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} + global __cuLaunchCooperativeKernelMultiDevice + _F_cuGetProcAddress_v2('cuLaunchCooperativeKernelMultiDevice', &__cuLaunchCooperativeKernelMultiDevice, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetBlockShape' in found_functions}} + global __cuFuncSetBlockShape + _F_cuGetProcAddress_v2('cuFuncSetBlockShape', &__cuFuncSetBlockShape, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetSharedSize' in found_functions}} + global __cuFuncSetSharedSize + _F_cuGetProcAddress_v2('cuFuncSetSharedSize', &__cuFuncSetSharedSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSetSize' in found_functions}} + global __cuParamSetSize + _F_cuGetProcAddress_v2('cuParamSetSize', &__cuParamSetSize, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSeti' in found_functions}} + global __cuParamSeti + _F_cuGetProcAddress_v2('cuParamSeti', &__cuParamSeti, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSetf' in found_functions}} + global __cuParamSetf + _F_cuGetProcAddress_v2('cuParamSetf', &__cuParamSetf, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSetv' in found_functions}} + global __cuParamSetv + _F_cuGetProcAddress_v2('cuParamSetv', &__cuParamSetv, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunch' in found_functions}} + global __cuLaunch + _F_cuGetProcAddress_v2('cuLaunch', &__cuLaunch, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchGrid' in found_functions}} + global __cuLaunchGrid + _F_cuGetProcAddress_v2('cuLaunchGrid', &__cuLaunchGrid, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLaunchGridAsync' in found_functions}} + global __cuLaunchGridAsync + _F_cuGetProcAddress_v2('cuLaunchGridAsync', &__cuLaunchGridAsync, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuParamSetTexRef' in found_functions}} + global __cuParamSetTexRef + _F_cuGetProcAddress_v2('cuParamSetTexRef', &__cuParamSetTexRef, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuFuncSetSharedMemConfig' in found_functions}} + global __cuFuncSetSharedMemConfig + _F_cuGetProcAddress_v2('cuFuncSetSharedMemConfig', &__cuFuncSetSharedMemConfig, 4020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphCreate' in found_functions}} + global __cuGraphCreate + _F_cuGetProcAddress_v2('cuGraphCreate', &__cuGraphCreate, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddKernelNode_v2' in found_functions}} + global __cuGraphAddKernelNode_v2 + _F_cuGetProcAddress_v2('cuGraphAddKernelNode', &__cuGraphAddKernelNode_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} + global __cuGraphKernelNodeGetParams_v2 + _F_cuGetProcAddress_v2('cuGraphKernelNodeGetParams', &__cuGraphKernelNodeGetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} + global __cuGraphKernelNodeSetParams_v2 + _F_cuGetProcAddress_v2('cuGraphKernelNodeSetParams', &__cuGraphKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddMemcpyNode' in found_functions}} + global __cuGraphAddMemcpyNode + _F_cuGetProcAddress_v2('cuGraphAddMemcpyNode', &__cuGraphAddMemcpyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} + global __cuGraphMemcpyNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemcpyNodeGetParams', &__cuGraphMemcpyNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} + global __cuGraphMemcpyNodeSetParams + _F_cuGetProcAddress_v2('cuGraphMemcpyNodeSetParams', &__cuGraphMemcpyNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddMemsetNode' in found_functions}} + global __cuGraphAddMemsetNode + _F_cuGetProcAddress_v2('cuGraphAddMemsetNode', &__cuGraphAddMemsetNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemsetNodeGetParams' in found_functions}} + global __cuGraphMemsetNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemsetNodeGetParams', &__cuGraphMemsetNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemsetNodeSetParams' in found_functions}} + global __cuGraphMemsetNodeSetParams + _F_cuGetProcAddress_v2('cuGraphMemsetNodeSetParams', &__cuGraphMemsetNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddHostNode' in found_functions}} + global __cuGraphAddHostNode + _F_cuGetProcAddress_v2('cuGraphAddHostNode', &__cuGraphAddHostNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphHostNodeGetParams' in found_functions}} + global __cuGraphHostNodeGetParams + _F_cuGetProcAddress_v2('cuGraphHostNodeGetParams', &__cuGraphHostNodeGetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphHostNodeSetParams' in found_functions}} + global __cuGraphHostNodeSetParams + _F_cuGetProcAddress_v2('cuGraphHostNodeSetParams', &__cuGraphHostNodeSetParams, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddChildGraphNode' in found_functions}} + global __cuGraphAddChildGraphNode + _F_cuGetProcAddress_v2('cuGraphAddChildGraphNode', &__cuGraphAddChildGraphNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} + global __cuGraphChildGraphNodeGetGraph + _F_cuGetProcAddress_v2('cuGraphChildGraphNodeGetGraph', &__cuGraphChildGraphNodeGetGraph, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddEmptyNode' in found_functions}} + global __cuGraphAddEmptyNode + _F_cuGetProcAddress_v2('cuGraphAddEmptyNode', &__cuGraphAddEmptyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddEventRecordNode' in found_functions}} + global __cuGraphAddEventRecordNode + _F_cuGetProcAddress_v2('cuGraphAddEventRecordNode', &__cuGraphAddEventRecordNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} + global __cuGraphEventRecordNodeGetEvent + _F_cuGetProcAddress_v2('cuGraphEventRecordNodeGetEvent', &__cuGraphEventRecordNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} + global __cuGraphEventRecordNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphEventRecordNodeSetEvent', &__cuGraphEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddEventWaitNode' in found_functions}} + global __cuGraphAddEventWaitNode + _F_cuGetProcAddress_v2('cuGraphAddEventWaitNode', &__cuGraphAddEventWaitNode, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} + global __cuGraphEventWaitNodeGetEvent + _F_cuGetProcAddress_v2('cuGraphEventWaitNodeGetEvent', &__cuGraphEventWaitNodeGetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} + global __cuGraphEventWaitNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphEventWaitNodeSetEvent', &__cuGraphEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} + global __cuGraphAddExternalSemaphoresSignalNode + _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresSignalNode', &__cuGraphAddExternalSemaphoresSignalNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeGetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeGetParams', &__cuGraphExternalSemaphoresSignalNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresSignalNodeSetParams', &__cuGraphExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} + global __cuGraphAddExternalSemaphoresWaitNode + _F_cuGetProcAddress_v2('cuGraphAddExternalSemaphoresWaitNode', &__cuGraphAddExternalSemaphoresWaitNode, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeGetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeGetParams', &__cuGraphExternalSemaphoresWaitNodeGetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExternalSemaphoresWaitNodeSetParams', &__cuGraphExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddBatchMemOpNode' in found_functions}} + global __cuGraphAddBatchMemOpNode + _F_cuGetProcAddress_v2('cuGraphAddBatchMemOpNode', &__cuGraphAddBatchMemOpNode, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} + global __cuGraphBatchMemOpNodeGetParams + _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeGetParams', &__cuGraphBatchMemOpNodeGetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphBatchMemOpNodeSetParams + _F_cuGetProcAddress_v2('cuGraphBatchMemOpNodeSetParams', &__cuGraphBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphExecBatchMemOpNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecBatchMemOpNodeSetParams', &__cuGraphExecBatchMemOpNodeSetParams, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddMemAllocNode' in found_functions}} + global __cuGraphAddMemAllocNode + _F_cuGetProcAddress_v2('cuGraphAddMemAllocNode', &__cuGraphAddMemAllocNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} + global __cuGraphMemAllocNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemAllocNodeGetParams', &__cuGraphMemAllocNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddMemFreeNode' in found_functions}} + global __cuGraphAddMemFreeNode + _F_cuGetProcAddress_v2('cuGraphAddMemFreeNode', &__cuGraphAddMemFreeNode, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} + global __cuGraphMemFreeNodeGetParams + _F_cuGetProcAddress_v2('cuGraphMemFreeNodeGetParams', &__cuGraphMemFreeNodeGetParams, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGraphMemTrim' in found_functions}} + global __cuDeviceGraphMemTrim + _F_cuGetProcAddress_v2('cuDeviceGraphMemTrim', &__cuDeviceGraphMemTrim, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} + global __cuDeviceGetGraphMemAttribute + _F_cuGetProcAddress_v2('cuDeviceGetGraphMemAttribute', &__cuDeviceGetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} + global __cuDeviceSetGraphMemAttribute + _F_cuGetProcAddress_v2('cuDeviceSetGraphMemAttribute', &__cuDeviceSetGraphMemAttribute, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphClone' in found_functions}} + global __cuGraphClone + _F_cuGetProcAddress_v2('cuGraphClone', &__cuGraphClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeFindInClone' in found_functions}} + global __cuGraphNodeFindInClone + _F_cuGetProcAddress_v2('cuGraphNodeFindInClone', &__cuGraphNodeFindInClone, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetType' in found_functions}} + global __cuGraphNodeGetType + _F_cuGetProcAddress_v2('cuGraphNodeGetType', &__cuGraphNodeGetType, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphGetNodes' in found_functions}} + global __cuGraphGetNodes + _F_cuGetProcAddress_v2('cuGraphGetNodes', &__cuGraphGetNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphGetRootNodes' in found_functions}} + global __cuGraphGetRootNodes + _F_cuGetProcAddress_v2('cuGraphGetRootNodes', &__cuGraphGetRootNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphGetEdges' in found_functions}} + global __cuGraphGetEdges + _F_cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphGetEdges_v2' in found_functions}} + global __cuGraphGetEdges_v2 + _F_cuGetProcAddress_v2('cuGraphGetEdges', &__cuGraphGetEdges_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetDependencies' in found_functions}} + global __cuGraphNodeGetDependencies + _F_cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} + global __cuGraphNodeGetDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphNodeGetDependencies', &__cuGraphNodeGetDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetDependentNodes' in found_functions}} + global __cuGraphNodeGetDependentNodes + _F_cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} + global __cuGraphNodeGetDependentNodes_v2 + _F_cuGetProcAddress_v2('cuGraphNodeGetDependentNodes', &__cuGraphNodeGetDependentNodes_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddDependencies' in found_functions}} + global __cuGraphAddDependencies + _F_cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddDependencies_v2' in found_functions}} + global __cuGraphAddDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphAddDependencies', &__cuGraphAddDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphRemoveDependencies' in found_functions}} + global __cuGraphRemoveDependencies + _F_cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphRemoveDependencies_v2' in found_functions}} + global __cuGraphRemoveDependencies_v2 + _F_cuGetProcAddress_v2('cuGraphRemoveDependencies', &__cuGraphRemoveDependencies_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphDestroyNode' in found_functions}} + global __cuGraphDestroyNode + _F_cuGetProcAddress_v2('cuGraphDestroyNode', &__cuGraphDestroyNode, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphInstantiateWithFlags' in found_functions}} + global __cuGraphInstantiateWithFlags + _F_cuGetProcAddress_v2('cuGraphInstantiateWithFlags', &__cuGraphInstantiateWithFlags, 11040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecGetFlags' in found_functions}} + global __cuGraphExecGetFlags + _F_cuGetProcAddress_v2('cuGraphExecGetFlags', &__cuGraphExecGetFlags, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} + global __cuGraphExecKernelNodeSetParams_v2 + _F_cuGetProcAddress_v2('cuGraphExecKernelNodeSetParams', &__cuGraphExecKernelNodeSetParams_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} + global __cuGraphExecMemcpyNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecMemcpyNodeSetParams', &__cuGraphExecMemcpyNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} + global __cuGraphExecMemsetNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecMemsetNodeSetParams', &__cuGraphExecMemsetNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecHostNodeSetParams' in found_functions}} + global __cuGraphExecHostNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecHostNodeSetParams', &__cuGraphExecHostNodeSetParams, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} + global __cuGraphExecChildGraphNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecChildGraphNodeSetParams', &__cuGraphExecChildGraphNodeSetParams, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} + global __cuGraphExecEventRecordNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphExecEventRecordNodeSetEvent', &__cuGraphExecEventRecordNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} + global __cuGraphExecEventWaitNodeSetEvent + _F_cuGetProcAddress_v2('cuGraphExecEventWaitNodeSetEvent', &__cuGraphExecEventWaitNodeSetEvent, 11010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresSignalNodeSetParams', &__cuGraphExecExternalSemaphoresSignalNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecExternalSemaphoresWaitNodeSetParams', &__cuGraphExecExternalSemaphoresWaitNodeSetParams, 11020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeSetEnabled' in found_functions}} + global __cuGraphNodeSetEnabled + _F_cuGetProcAddress_v2('cuGraphNodeSetEnabled', &__cuGraphNodeSetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeGetEnabled' in found_functions}} + global __cuGraphNodeGetEnabled + _F_cuGetProcAddress_v2('cuGraphNodeGetEnabled', &__cuGraphNodeGetEnabled, 11060, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecDestroy' in found_functions}} + global __cuGraphExecDestroy + _F_cuGetProcAddress_v2('cuGraphExecDestroy', &__cuGraphExecDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphDestroy' in found_functions}} + global __cuGraphDestroy + _F_cuGetProcAddress_v2('cuGraphDestroy', &__cuGraphDestroy, 10000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecUpdate_v2' in found_functions}} + global __cuGraphExecUpdate_v2 + _F_cuGetProcAddress_v2('cuGraphExecUpdate', &__cuGraphExecUpdate_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} + global __cuGraphKernelNodeCopyAttributes + _F_cuGetProcAddress_v2('cuGraphKernelNodeCopyAttributes', &__cuGraphKernelNodeCopyAttributes, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} + global __cuGraphKernelNodeGetAttribute + _F_cuGetProcAddress_v2('cuGraphKernelNodeGetAttribute', &__cuGraphKernelNodeGetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} + global __cuGraphKernelNodeSetAttribute + _F_cuGetProcAddress_v2('cuGraphKernelNodeSetAttribute', &__cuGraphKernelNodeSetAttribute, 11000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphDebugDotPrint' in found_functions}} + global __cuGraphDebugDotPrint + _F_cuGetProcAddress_v2('cuGraphDebugDotPrint', &__cuGraphDebugDotPrint, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuUserObjectCreate' in found_functions}} + global __cuUserObjectCreate + _F_cuGetProcAddress_v2('cuUserObjectCreate', &__cuUserObjectCreate, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuUserObjectRetain' in found_functions}} + global __cuUserObjectRetain + _F_cuGetProcAddress_v2('cuUserObjectRetain', &__cuUserObjectRetain, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuUserObjectRelease' in found_functions}} + global __cuUserObjectRelease + _F_cuGetProcAddress_v2('cuUserObjectRelease', &__cuUserObjectRelease, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphRetainUserObject' in found_functions}} + global __cuGraphRetainUserObject + _F_cuGetProcAddress_v2('cuGraphRetainUserObject', &__cuGraphRetainUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphReleaseUserObject' in found_functions}} + global __cuGraphReleaseUserObject + _F_cuGetProcAddress_v2('cuGraphReleaseUserObject', &__cuGraphReleaseUserObject, 11030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddNode' in found_functions}} + global __cuGraphAddNode + _F_cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphAddNode_v2' in found_functions}} + global __cuGraphAddNode_v2 + _F_cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v2, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphNodeSetParams' in found_functions}} + global __cuGraphNodeSetParams + _F_cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphExecNodeSetParams' in found_functions}} + global __cuGraphExecNodeSetParams + _F_cuGetProcAddress_v2('cuGraphExecNodeSetParams', &__cuGraphExecNodeSetParams, 12020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphConditionalHandleCreate' in found_functions}} + global __cuGraphConditionalHandleCreate + _F_cuGetProcAddress_v2('cuGraphConditionalHandleCreate', &__cuGraphConditionalHandleCreate, 12030, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessor', &__cuOccupancyMaxActiveBlocksPerMultiprocessor, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags', &__cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} + global __cuOccupancyMaxPotentialBlockSize + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSize', &__cuOccupancyMaxPotentialBlockSize, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} + global __cuOccupancyMaxPotentialBlockSizeWithFlags + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialBlockSizeWithFlags', &__cuOccupancyMaxPotentialBlockSizeWithFlags, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + global __cuOccupancyAvailableDynamicSMemPerBlock + _F_cuGetProcAddress_v2('cuOccupancyAvailableDynamicSMemPerBlock', &__cuOccupancyAvailableDynamicSMemPerBlock, 10020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} + global __cuOccupancyMaxPotentialClusterSize + _F_cuGetProcAddress_v2('cuOccupancyMaxPotentialClusterSize', &__cuOccupancyMaxPotentialClusterSize, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuOccupancyMaxActiveClusters' in found_functions}} + global __cuOccupancyMaxActiveClusters + _F_cuGetProcAddress_v2('cuOccupancyMaxActiveClusters', &__cuOccupancyMaxActiveClusters, 11070, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetArray' in found_functions}} + global __cuTexRefSetArray + _F_cuGetProcAddress_v2('cuTexRefSetArray', &__cuTexRefSetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMipmappedArray' in found_functions}} + global __cuTexRefSetMipmappedArray + _F_cuGetProcAddress_v2('cuTexRefSetMipmappedArray', &__cuTexRefSetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetAddress_v2' in found_functions}} + global __cuTexRefSetAddress_v2 + _F_cuGetProcAddress_v2('cuTexRefSetAddress', &__cuTexRefSetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetAddress2D_v3' in found_functions}} + global __cuTexRefSetAddress2D_v3 + _F_cuGetProcAddress_v2('cuTexRefSetAddress2D', &__cuTexRefSetAddress2D_v3, 4010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetFormat' in found_functions}} + global __cuTexRefSetFormat + _F_cuGetProcAddress_v2('cuTexRefSetFormat', &__cuTexRefSetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetAddressMode' in found_functions}} + global __cuTexRefSetAddressMode + _F_cuGetProcAddress_v2('cuTexRefSetAddressMode', &__cuTexRefSetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetFilterMode' in found_functions}} + global __cuTexRefSetFilterMode + _F_cuGetProcAddress_v2('cuTexRefSetFilterMode', &__cuTexRefSetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} + global __cuTexRefSetMipmapFilterMode + _F_cuGetProcAddress_v2('cuTexRefSetMipmapFilterMode', &__cuTexRefSetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} + global __cuTexRefSetMipmapLevelBias + _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelBias', &__cuTexRefSetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} + global __cuTexRefSetMipmapLevelClamp + _F_cuGetProcAddress_v2('cuTexRefSetMipmapLevelClamp', &__cuTexRefSetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} + global __cuTexRefSetMaxAnisotropy + _F_cuGetProcAddress_v2('cuTexRefSetMaxAnisotropy', &__cuTexRefSetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetBorderColor' in found_functions}} + global __cuTexRefSetBorderColor + _F_cuGetProcAddress_v2('cuTexRefSetBorderColor', &__cuTexRefSetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefSetFlags' in found_functions}} + global __cuTexRefSetFlags + _F_cuGetProcAddress_v2('cuTexRefSetFlags', &__cuTexRefSetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetAddress_v2' in found_functions}} + global __cuTexRefGetAddress_v2 + _F_cuGetProcAddress_v2('cuTexRefGetAddress', &__cuTexRefGetAddress_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetArray' in found_functions}} + global __cuTexRefGetArray + _F_cuGetProcAddress_v2('cuTexRefGetArray', &__cuTexRefGetArray, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMipmappedArray' in found_functions}} + global __cuTexRefGetMipmappedArray + _F_cuGetProcAddress_v2('cuTexRefGetMipmappedArray', &__cuTexRefGetMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetAddressMode' in found_functions}} + global __cuTexRefGetAddressMode + _F_cuGetProcAddress_v2('cuTexRefGetAddressMode', &__cuTexRefGetAddressMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetFilterMode' in found_functions}} + global __cuTexRefGetFilterMode + _F_cuGetProcAddress_v2('cuTexRefGetFilterMode', &__cuTexRefGetFilterMode, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetFormat' in found_functions}} + global __cuTexRefGetFormat + _F_cuGetProcAddress_v2('cuTexRefGetFormat', &__cuTexRefGetFormat, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} + global __cuTexRefGetMipmapFilterMode + _F_cuGetProcAddress_v2('cuTexRefGetMipmapFilterMode', &__cuTexRefGetMipmapFilterMode, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} + global __cuTexRefGetMipmapLevelBias + _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelBias', &__cuTexRefGetMipmapLevelBias, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} + global __cuTexRefGetMipmapLevelClamp + _F_cuGetProcAddress_v2('cuTexRefGetMipmapLevelClamp', &__cuTexRefGetMipmapLevelClamp, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} + global __cuTexRefGetMaxAnisotropy + _F_cuGetProcAddress_v2('cuTexRefGetMaxAnisotropy', &__cuTexRefGetMaxAnisotropy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetBorderColor' in found_functions}} + global __cuTexRefGetBorderColor + _F_cuGetProcAddress_v2('cuTexRefGetBorderColor', &__cuTexRefGetBorderColor, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefGetFlags' in found_functions}} + global __cuTexRefGetFlags + _F_cuGetProcAddress_v2('cuTexRefGetFlags', &__cuTexRefGetFlags, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefCreate' in found_functions}} + global __cuTexRefCreate + _F_cuGetProcAddress_v2('cuTexRefCreate', &__cuTexRefCreate, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexRefDestroy' in found_functions}} + global __cuTexRefDestroy + _F_cuGetProcAddress_v2('cuTexRefDestroy', &__cuTexRefDestroy, 2000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfRefSetArray' in found_functions}} + global __cuSurfRefSetArray + _F_cuGetProcAddress_v2('cuSurfRefSetArray', &__cuSurfRefSetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfRefGetArray' in found_functions}} + global __cuSurfRefGetArray + _F_cuGetProcAddress_v2('cuSurfRefGetArray', &__cuSurfRefGetArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectCreate' in found_functions}} + global __cuTexObjectCreate + _F_cuGetProcAddress_v2('cuTexObjectCreate', &__cuTexObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectDestroy' in found_functions}} + global __cuTexObjectDestroy + _F_cuGetProcAddress_v2('cuTexObjectDestroy', &__cuTexObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectGetResourceDesc' in found_functions}} + global __cuTexObjectGetResourceDesc + _F_cuGetProcAddress_v2('cuTexObjectGetResourceDesc', &__cuTexObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectGetTextureDesc' in found_functions}} + global __cuTexObjectGetTextureDesc + _F_cuGetProcAddress_v2('cuTexObjectGetTextureDesc', &__cuTexObjectGetTextureDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} + global __cuTexObjectGetResourceViewDesc + _F_cuGetProcAddress_v2('cuTexObjectGetResourceViewDesc', &__cuTexObjectGetResourceViewDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfObjectCreate' in found_functions}} + global __cuSurfObjectCreate + _F_cuGetProcAddress_v2('cuSurfObjectCreate', &__cuSurfObjectCreate, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfObjectDestroy' in found_functions}} + global __cuSurfObjectDestroy + _F_cuGetProcAddress_v2('cuSurfObjectDestroy', &__cuSurfObjectDestroy, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuSurfObjectGetResourceDesc' in found_functions}} + global __cuSurfObjectGetResourceDesc + _F_cuGetProcAddress_v2('cuSurfObjectGetResourceDesc', &__cuSurfObjectGetResourceDesc, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTensorMapEncodeTiled' in found_functions}} + global __cuTensorMapEncodeTiled + _F_cuGetProcAddress_v2('cuTensorMapEncodeTiled', &__cuTensorMapEncodeTiled, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTensorMapEncodeIm2col' in found_functions}} + global __cuTensorMapEncodeIm2col + _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2col', &__cuTensorMapEncodeIm2col, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} + global __cuTensorMapEncodeIm2colWide + _F_cuGetProcAddress_v2('cuTensorMapEncodeIm2colWide', &__cuTensorMapEncodeIm2colWide, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuTensorMapReplaceAddress' in found_functions}} + global __cuTensorMapReplaceAddress + _F_cuGetProcAddress_v2('cuTensorMapReplaceAddress', &__cuTensorMapReplaceAddress, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceCanAccessPeer' in found_functions}} + global __cuDeviceCanAccessPeer + _F_cuGetProcAddress_v2('cuDeviceCanAccessPeer', &__cuDeviceCanAccessPeer, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCtxEnablePeerAccess' in found_functions}} + global __cuCtxEnablePeerAccess + _F_cuGetProcAddress_v2('cuCtxEnablePeerAccess', &__cuCtxEnablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCtxDisablePeerAccess' in found_functions}} + global __cuCtxDisablePeerAccess + _F_cuGetProcAddress_v2('cuCtxDisablePeerAccess', &__cuCtxDisablePeerAccess, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGetP2PAttribute' in found_functions}} + global __cuDeviceGetP2PAttribute + _F_cuGetProcAddress_v2('cuDeviceGetP2PAttribute', &__cuDeviceGetP2PAttribute, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} + global __cuGraphicsUnregisterResource + _F_cuGetProcAddress_v2('cuGraphicsUnregisterResource', &__cuGraphicsUnregisterResource, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} + global __cuGraphicsSubResourceGetMappedArray + _F_cuGetProcAddress_v2('cuGraphicsSubResourceGetMappedArray', &__cuGraphicsSubResourceGetMappedArray, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} + global __cuGraphicsResourceGetMappedMipmappedArray + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedMipmappedArray', &__cuGraphicsResourceGetMappedMipmappedArray, 5000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} + global __cuGraphicsResourceGetMappedPointer_v2 + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedPointer', &__cuGraphicsResourceGetMappedPointer_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} + global __cuGraphicsResourceSetMapFlags_v2 + _F_cuGetProcAddress_v2('cuGraphicsResourceSetMapFlags', &__cuGraphicsResourceSetMapFlags_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGetProcAddress_v2' in found_functions}} + global __cuGetProcAddress_v2 + _F_cuGetProcAddress_v2('cuGetProcAddress', &__cuGetProcAddress_v2, 12000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCoredumpGetAttribute' in found_functions}} + global __cuCoredumpGetAttribute + _F_cuGetProcAddress_v2('cuCoredumpGetAttribute', &__cuCoredumpGetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} + global __cuCoredumpGetAttributeGlobal + _F_cuGetProcAddress_v2('cuCoredumpGetAttributeGlobal', &__cuCoredumpGetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCoredumpSetAttribute' in found_functions}} + global __cuCoredumpSetAttribute + _F_cuGetProcAddress_v2('cuCoredumpSetAttribute', &__cuCoredumpSetAttribute, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} + global __cuCoredumpSetAttributeGlobal + _F_cuGetProcAddress_v2('cuCoredumpSetAttributeGlobal', &__cuCoredumpSetAttributeGlobal, 12010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGetExportTable' in found_functions}} + global __cuGetExportTable + _F_cuGetProcAddress_v2('cuGetExportTable', &__cuGetExportTable, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxCreate' in found_functions}} + global __cuGreenCtxCreate + _F_cuGetProcAddress_v2('cuGreenCtxCreate', &__cuGreenCtxCreate, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxDestroy' in found_functions}} + global __cuGreenCtxDestroy + _F_cuGetProcAddress_v2('cuGreenCtxDestroy', &__cuGreenCtxDestroy, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCtxFromGreenCtx' in found_functions}} + global __cuCtxFromGreenCtx + _F_cuGetProcAddress_v2('cuCtxFromGreenCtx', &__cuCtxFromGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDeviceGetDevResource' in found_functions}} + global __cuDeviceGetDevResource + _F_cuGetProcAddress_v2('cuDeviceGetDevResource', &__cuDeviceGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCtxGetDevResource' in found_functions}} + global __cuCtxGetDevResource + _F_cuGetProcAddress_v2('cuCtxGetDevResource', &__cuCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxGetDevResource' in found_functions}} + global __cuGreenCtxGetDevResource + _F_cuGetProcAddress_v2('cuGreenCtxGetDevResource', &__cuGreenCtxGetDevResource, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDevSmResourceSplitByCount' in found_functions}} + global __cuDevSmResourceSplitByCount + _F_cuGetProcAddress_v2('cuDevSmResourceSplitByCount', &__cuDevSmResourceSplitByCount, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuDevResourceGenerateDesc' in found_functions}} + global __cuDevResourceGenerateDesc + _F_cuGetProcAddress_v2('cuDevResourceGenerateDesc', &__cuDevResourceGenerateDesc, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxRecordEvent' in found_functions}} + global __cuGreenCtxRecordEvent + _F_cuGetProcAddress_v2('cuGreenCtxRecordEvent', &__cuGreenCtxRecordEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxWaitEvent' in found_functions}} + global __cuGreenCtxWaitEvent + _F_cuGetProcAddress_v2('cuGreenCtxWaitEvent', &__cuGreenCtxWaitEvent, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuStreamGetGreenCtx' in found_functions}} + global __cuStreamGetGreenCtx + _F_cuGetProcAddress_v2('cuStreamGetGreenCtx', &__cuStreamGetGreenCtx, 12040, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuGreenCtxStreamCreate' in found_functions}} + global __cuGreenCtxStreamCreate + _F_cuGetProcAddress_v2('cuGreenCtxStreamCreate', &__cuGreenCtxStreamCreate, 12050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} + global __cuLogsRegisterCallback + _F_cuGetProcAddress_v2('cuLogsRegisterCallback', &__cuLogsRegisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsUnregisterCallback' in found_functions}} + global __cuLogsUnregisterCallback + _F_cuGetProcAddress_v2('cuLogsUnregisterCallback', &__cuLogsUnregisterCallback, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsCurrent' in found_functions}} + global __cuLogsCurrent + _F_cuGetProcAddress_v2('cuLogsCurrent', &__cuLogsCurrent, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsDumpToFile' in found_functions}} + global __cuLogsDumpToFile + _F_cuGetProcAddress_v2('cuLogsDumpToFile', &__cuLogsDumpToFile, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuLogsDumpToMemory' in found_functions}} + global __cuLogsDumpToMemory + _F_cuGetProcAddress_v2('cuLogsDumpToMemory', &__cuLogsDumpToMemory, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} + global __cuCheckpointProcessGetRestoreThreadId + _F_cuGetProcAddress_v2('cuCheckpointProcessGetRestoreThreadId', &__cuCheckpointProcessGetRestoreThreadId, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessGetState' in found_functions}} + global __cuCheckpointProcessGetState + _F_cuGetProcAddress_v2('cuCheckpointProcessGetState', &__cuCheckpointProcessGetState, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessLock' in found_functions}} + global __cuCheckpointProcessLock + _F_cuGetProcAddress_v2('cuCheckpointProcessLock', &__cuCheckpointProcessLock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessCheckpoint' in found_functions}} + global __cuCheckpointProcessCheckpoint + _F_cuGetProcAddress_v2('cuCheckpointProcessCheckpoint', &__cuCheckpointProcessCheckpoint, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessRestore' in found_functions}} + global __cuCheckpointProcessRestore + _F_cuGetProcAddress_v2('cuCheckpointProcessRestore', &__cuCheckpointProcessRestore, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} + global __cuCheckpointProcessUnlock + _F_cuGetProcAddress_v2('cuCheckpointProcessUnlock', &__cuCheckpointProcessUnlock, 12080, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuProfilerStart' in found_functions}} + global __cuProfilerStart + _F_cuGetProcAddress_v2('cuProfilerStart', &__cuProfilerStart, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if 'cuProfilerStop' in found_functions}} + global __cuProfilerStop + _F_cuGetProcAddress_v2('cuProfilerStop', &__cuProfilerStop, 4000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsEGLRegisterImage + _F_cuGetProcAddress_v2('cuGraphicsEGLRegisterImage', &__cuGraphicsEGLRegisterImage, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnect + _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnect', &__cuEGLStreamConsumerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnectWithFlags + _F_cuGetProcAddress_v2('cuEGLStreamConsumerConnectWithFlags', &__cuEGLStreamConsumerConnectWithFlags, 8000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerDisconnect + _F_cuGetProcAddress_v2('cuEGLStreamConsumerDisconnect', &__cuEGLStreamConsumerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerAcquireFrame + _F_cuGetProcAddress_v2('cuEGLStreamConsumerAcquireFrame', &__cuEGLStreamConsumerAcquireFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamConsumerReleaseFrame + _F_cuGetProcAddress_v2('cuEGLStreamConsumerReleaseFrame', &__cuEGLStreamConsumerReleaseFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamProducerConnect + _F_cuGetProcAddress_v2('cuEGLStreamProducerConnect', &__cuEGLStreamProducerConnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamProducerDisconnect + _F_cuGetProcAddress_v2('cuEGLStreamProducerDisconnect', &__cuEGLStreamProducerDisconnect, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamProducerPresentFrame + _F_cuGetProcAddress_v2('cuEGLStreamProducerPresentFrame', &__cuEGLStreamProducerPresentFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEGLStreamProducerReturnFrame + _F_cuGetProcAddress_v2('cuEGLStreamProducerReturnFrame', &__cuEGLStreamProducerReturnFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsResourceGetMappedEglFrame + _F_cuGetProcAddress_v2('cuGraphicsResourceGetMappedEglFrame', &__cuGraphicsResourceGetMappedEglFrame, 7000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuEventCreateFromEGLSync + _F_cuGetProcAddress_v2('cuEventCreateFromEGLSync', &__cuEventCreateFromEGLSync, 9000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterBuffer + _F_cuGetProcAddress_v2('cuGraphicsGLRegisterBuffer', &__cuGraphicsGLRegisterBuffer, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterImage + _F_cuGetProcAddress_v2('cuGraphicsGLRegisterImage', &__cuGraphicsGLRegisterImage, 3000, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGLGetDevices_v2 + _F_cuGetProcAddress_v2('cuGLGetDevices', &__cuGLGetDevices_v2, 6050, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuVDPAUGetDevice + _F_cuGetProcAddress_v2('cuVDPAUGetDevice', &__cuVDPAUGetDevice, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuVDPAUCtxCreate_v2 + _F_cuGetProcAddress_v2('cuVDPAUCtxCreate', &__cuVDPAUCtxCreate_v2, 3020, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterVideoSurface + _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterVideoSurface', &__cuGraphicsVDPAURegisterVideoSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterOutputSurface + _F_cuGetProcAddress_v2('cuGraphicsVDPAURegisterOutputSurface', &__cuGraphicsVDPAURegisterOutputSurface, 3010, CU_GET_PROC_ADDRESS_DEFAULT, NULL) + {{endif}} + __cuPythonInit = True + return 0 + + {{if 'Windows' == platform.system()}} + # Load using win32GetAddr + if usePTDS: + # Get all PTDS version of functions + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + __cuMemcpy = windll.GetProcAddress(handle, 'cuMemcpy_ptds') + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + __cuMemcpyPeer = windll.GetProcAddress(handle, 'cuMemcpyPeer_ptds') + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoH_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoH_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = windll.GetProcAddress(handle, 'cuMemcpy2D_v2_ptds') + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2_ptds') + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = windll.GetProcAddress(handle, 'cuMemcpy3D_v2_ptds') + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = windll.GetProcAddress(handle, 'cuMemcpy3DPeer_ptds') + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + __cuMemcpyAsync = windll.GetProcAddress(handle, 'cuMemcpyAsync_ptsz') + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = windll.GetProcAddress(handle, 'cuMemcpyPeerAsync_ptsz') + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = windll.GetProcAddress(handle, 'cuMemcpy3DPeerAsync_ptsz') + {{endif}} + {{if 'cuMemcpyBatchAsync' in found_functions}} + global __cuMemcpyBatchAsync + __cuMemcpyBatchAsync = windll.GetProcAddress(handle, 'cuMemcpyBatchAsync_ptsz') + {{endif}} + {{if 'cuMemcpy3DBatchAsync' in found_functions}} + global __cuMemcpy3DBatchAsync + __cuMemcpy3DBatchAsync = windll.GetProcAddress(handle, 'cuMemcpy3DBatchAsync_ptsz') + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = windll.GetProcAddress(handle, 'cuMemsetD8_v2_ptds') + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = windll.GetProcAddress(handle, 'cuMemsetD16_v2_ptds') + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = windll.GetProcAddress(handle, 'cuMemsetD32_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D8_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D16_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D32_v2_ptds') + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + __cuMemsetD8Async = windll.GetProcAddress(handle, 'cuMemsetD8Async_ptsz') + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + __cuMemsetD16Async = windll.GetProcAddress(handle, 'cuMemsetD16Async_ptsz') + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + __cuMemsetD32Async = windll.GetProcAddress(handle, 'cuMemsetD32Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = windll.GetProcAddress(handle, 'cuMemsetD2D8Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = windll.GetProcAddress(handle, 'cuMemsetD2D16Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = windll.GetProcAddress(handle, 'cuMemsetD2D32Async_ptsz') + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = windll.GetProcAddress(handle, 'cuMemBatchDecompressAsync_ptsz') + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = windll.GetProcAddress(handle, 'cuMemMapArrayAsync_ptsz') + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + __cuMemFreeAsync = windll.GetProcAddress(handle, 'cuMemFreeAsync_ptsz') + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + __cuMemAllocAsync = windll.GetProcAddress(handle, 'cuMemAllocAsync_ptsz') + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = windll.GetProcAddress(handle, 'cuMemAllocFromPoolAsync_ptsz') + {{endif}} + {{if 'cuMemPrefetchAsync' in found_functions}} + global __cuMemPrefetchAsync + __cuMemPrefetchAsync = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_ptsz') + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_v2_ptsz') + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + __cuStreamGetPriority = windll.GetProcAddress(handle, 'cuStreamGetPriority_ptsz') + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + __cuStreamGetDevice = windll.GetProcAddress(handle, 'cuStreamGetDevice_ptsz') + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + __cuStreamGetFlags = windll.GetProcAddress(handle, 'cuStreamGetFlags_ptsz') + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + __cuStreamGetId = windll.GetProcAddress(handle, 'cuStreamGetId_ptsz') + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + __cuStreamGetCtx = windll.GetProcAddress(handle, 'cuStreamGetCtx_ptsz') + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = windll.GetProcAddress(handle, 'cuStreamGetCtx_v2_ptsz') + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + __cuStreamWaitEvent = windll.GetProcAddress(handle, 'cuStreamWaitEvent_ptsz') + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + __cuStreamAddCallback = windll.GetProcAddress(handle, 'cuStreamAddCallback_ptsz') + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = windll.GetProcAddress(handle, 'cuStreamBeginCapture_v2_ptsz') + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph_ptsz') + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + __cuStreamEndCapture = windll.GetProcAddress(handle, 'cuStreamEndCapture_ptsz') + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + __cuStreamIsCapturing = windll.GetProcAddress(handle, 'cuStreamIsCapturing_ptsz') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} + global __cuStreamGetCaptureInfo_v2 + __cuStreamGetCaptureInfo_v2 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v2_ptsz') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3_ptsz') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} + global __cuStreamUpdateCaptureDependencies + __cuStreamUpdateCaptureDependencies = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_ptsz') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = windll.GetProcAddress(handle, 'cuStreamAttachMemAsync_ptsz') + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + __cuStreamQuery = windll.GetProcAddress(handle, 'cuStreamQuery_ptsz') + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + __cuStreamSynchronize = windll.GetProcAddress(handle, 'cuStreamSynchronize_ptsz') + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = windll.GetProcAddress(handle, 'cuStreamCopyAttributes_ptsz') + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + __cuStreamGetAttribute = windll.GetProcAddress(handle, 'cuStreamGetAttribute_ptsz') + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + __cuStreamSetAttribute = windll.GetProcAddress(handle, 'cuStreamSetAttribute_ptsz') + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + __cuEventRecord = windll.GetProcAddress(handle, 'cuEventRecord_ptsz') + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = windll.GetProcAddress(handle, 'cuEventRecordWithFlags_ptsz') + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync_ptsz') + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync_ptsz') + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue32_v2_ptsz') + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue64_v2_ptsz') + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue32_v2_ptsz') + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue64_v2_ptsz') + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = windll.GetProcAddress(handle, 'cuStreamBatchMemOp_v2_ptsz') + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + __cuLaunchKernel = windll.GetProcAddress(handle, 'cuLaunchKernel_ptsz') + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + __cuLaunchKernelEx = windll.GetProcAddress(handle, 'cuLaunchKernelEx_ptsz') + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernel_ptsz') + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + __cuLaunchHostFunc = windll.GetProcAddress(handle, 'cuLaunchHostFunc_ptsz') + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = windll.GetProcAddress(handle, 'cuGraphInstantiateWithParams_ptsz') + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + __cuGraphUpload = windll.GetProcAddress(handle, 'cuGraphUpload_ptsz') + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + __cuGraphLaunch = windll.GetProcAddress(handle, 'cuGraphLaunch_ptsz') + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + __cuGraphicsMapResources = windll.GetProcAddress(handle, 'cuGraphicsMapResources_ptsz') + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = windll.GetProcAddress(handle, 'cuGraphicsUnmapResources_ptsz') + {{endif}} + else: + # Else get the regular version + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + __cuMemcpy = windll.GetProcAddress(handle, 'cuMemcpy') + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + __cuMemcpyPeer = windll.GetProcAddress(handle, 'cuMemcpyPeer') + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoD_v2') + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoH_v2') + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoD_v2') + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoA_v2') + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoD_v2') + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoA_v2') + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoH_v2') + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoA_v2') + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = windll.GetProcAddress(handle, 'cuMemcpy2D_v2') + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DUnaligned_v2') + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = windll.GetProcAddress(handle, 'cuMemcpy3D_v2') + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = windll.GetProcAddress(handle, 'cuMemcpy3DPeer') + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + __cuMemcpyAsync = windll.GetProcAddress(handle, 'cuMemcpyAsync') + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = windll.GetProcAddress(handle, 'cuMemcpyPeerAsync') + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoDAsync_v2') + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoHAsync_v2') + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyDtoDAsync_v2') + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyHtoAAsync_v2') + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpyAtoHAsync_v2') + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy2DAsync_v2') + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = windll.GetProcAddress(handle, 'cuMemcpy3DAsync_v2') + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = windll.GetProcAddress(handle, 'cuMemcpy3DPeerAsync') + {{endif}} + {{if 'cuMemcpyBatchAsync' in found_functions}} + global __cuMemcpyBatchAsync + __cuMemcpyBatchAsync = windll.GetProcAddress(handle, 'cuMemcpyBatchAsync') + {{endif}} + {{if 'cuMemcpy3DBatchAsync' in found_functions}} + global __cuMemcpy3DBatchAsync + __cuMemcpy3DBatchAsync = windll.GetProcAddress(handle, 'cuMemcpy3DBatchAsync') + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = windll.GetProcAddress(handle, 'cuMemsetD8_v2') + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = windll.GetProcAddress(handle, 'cuMemsetD16_v2') + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = windll.GetProcAddress(handle, 'cuMemsetD32_v2') + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D8_v2') + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D16_v2') + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = windll.GetProcAddress(handle, 'cuMemsetD2D32_v2') + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + __cuMemsetD8Async = windll.GetProcAddress(handle, 'cuMemsetD8Async') + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + __cuMemsetD16Async = windll.GetProcAddress(handle, 'cuMemsetD16Async') + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + __cuMemsetD32Async = windll.GetProcAddress(handle, 'cuMemsetD32Async') + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = windll.GetProcAddress(handle, 'cuMemsetD2D8Async') + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = windll.GetProcAddress(handle, 'cuMemsetD2D16Async') + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = windll.GetProcAddress(handle, 'cuMemsetD2D32Async') + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = windll.GetProcAddress(handle, 'cuMemBatchDecompressAsync') + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = windll.GetProcAddress(handle, 'cuMemMapArrayAsync') + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + __cuMemFreeAsync = windll.GetProcAddress(handle, 'cuMemFreeAsync') + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + __cuMemAllocAsync = windll.GetProcAddress(handle, 'cuMemAllocAsync') + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = windll.GetProcAddress(handle, 'cuMemAllocFromPoolAsync') + {{endif}} + {{if 'cuMemPrefetchAsync' in found_functions}} + global __cuMemPrefetchAsync + __cuMemPrefetchAsync = windll.GetProcAddress(handle, 'cuMemPrefetchAsync') + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = windll.GetProcAddress(handle, 'cuMemPrefetchAsync_v2') + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + __cuStreamGetPriority = windll.GetProcAddress(handle, 'cuStreamGetPriority') + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + __cuStreamGetDevice = windll.GetProcAddress(handle, 'cuStreamGetDevice') + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + __cuStreamGetFlags = windll.GetProcAddress(handle, 'cuStreamGetFlags') + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + __cuStreamGetId = windll.GetProcAddress(handle, 'cuStreamGetId') + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + __cuStreamGetCtx = windll.GetProcAddress(handle, 'cuStreamGetCtx') + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = windll.GetProcAddress(handle, 'cuStreamGetCtx_v2') + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + __cuStreamWaitEvent = windll.GetProcAddress(handle, 'cuStreamWaitEvent') + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + __cuStreamAddCallback = windll.GetProcAddress(handle, 'cuStreamAddCallback') + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = windll.GetProcAddress(handle, 'cuStreamBeginCapture_v2') + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = windll.GetProcAddress(handle, 'cuStreamBeginCaptureToGraph') + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + __cuStreamEndCapture = windll.GetProcAddress(handle, 'cuStreamEndCapture') + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + __cuStreamIsCapturing = windll.GetProcAddress(handle, 'cuStreamIsCapturing') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} + global __cuStreamGetCaptureInfo_v2 + __cuStreamGetCaptureInfo_v2 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v2') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = windll.GetProcAddress(handle, 'cuStreamGetCaptureInfo_v3') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} + global __cuStreamUpdateCaptureDependencies + __cuStreamUpdateCaptureDependencies = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = windll.GetProcAddress(handle, 'cuStreamUpdateCaptureDependencies_v2') + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = windll.GetProcAddress(handle, 'cuStreamAttachMemAsync') + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + __cuStreamQuery = windll.GetProcAddress(handle, 'cuStreamQuery') + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + __cuStreamSynchronize = windll.GetProcAddress(handle, 'cuStreamSynchronize') + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = windll.GetProcAddress(handle, 'cuStreamCopyAttributes') + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + __cuStreamGetAttribute = windll.GetProcAddress(handle, 'cuStreamGetAttribute') + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + __cuStreamSetAttribute = windll.GetProcAddress(handle, 'cuStreamSetAttribute') + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + __cuEventRecord = windll.GetProcAddress(handle, 'cuEventRecord') + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = windll.GetProcAddress(handle, 'cuEventRecordWithFlags') + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuSignalExternalSemaphoresAsync') + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = windll.GetProcAddress(handle, 'cuWaitExternalSemaphoresAsync') + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue32_v2') + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWaitValue64_v2') + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue32_v2') + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = windll.GetProcAddress(handle, 'cuStreamWriteValue64_v2') + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = windll.GetProcAddress(handle, 'cuStreamBatchMemOp_v2') + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + __cuLaunchKernel = windll.GetProcAddress(handle, 'cuLaunchKernel') + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + __cuLaunchKernelEx = windll.GetProcAddress(handle, 'cuLaunchKernelEx') + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernel') + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + __cuLaunchHostFunc = windll.GetProcAddress(handle, 'cuLaunchHostFunc') + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = windll.GetProcAddress(handle, 'cuGraphInstantiateWithParams') + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + __cuGraphUpload = windll.GetProcAddress(handle, 'cuGraphUpload') + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + __cuGraphLaunch = windll.GetProcAddress(handle, 'cuGraphLaunch') + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + __cuGraphicsMapResources = windll.GetProcAddress(handle, 'cuGraphicsMapResources') + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = windll.GetProcAddress(handle, 'cuGraphicsUnmapResources') + {{endif}} + # Get remaining functions + {{if 'cuGetErrorString' in found_functions}} + global __cuGetErrorString + __cuGetErrorString = windll.GetProcAddress(handle, 'cuGetErrorString') + {{endif}} + {{if 'cuGetErrorName' in found_functions}} + global __cuGetErrorName + __cuGetErrorName = windll.GetProcAddress(handle, 'cuGetErrorName') + {{endif}} + {{if 'cuInit' in found_functions}} + global __cuInit + __cuInit = windll.GetProcAddress(handle, 'cuInit') + {{endif}} + {{if 'cuDriverGetVersion' in found_functions}} + global __cuDriverGetVersion + __cuDriverGetVersion = windll.GetProcAddress(handle, 'cuDriverGetVersion') + {{endif}} + {{if 'cuDeviceGet' in found_functions}} + global __cuDeviceGet + __cuDeviceGet = windll.GetProcAddress(handle, 'cuDeviceGet') + {{endif}} + {{if 'cuDeviceGetCount' in found_functions}} + global __cuDeviceGetCount + __cuDeviceGetCount = windll.GetProcAddress(handle, 'cuDeviceGetCount') + {{endif}} + {{if 'cuDeviceGetName' in found_functions}} + global __cuDeviceGetName + __cuDeviceGetName = windll.GetProcAddress(handle, 'cuDeviceGetName') + {{endif}} + {{if 'cuDeviceGetUuid' in found_functions}} + global __cuDeviceGetUuid + __cuDeviceGetUuid = windll.GetProcAddress(handle, 'cuDeviceGetUuid') + {{endif}} + {{if 'cuDeviceGetUuid_v2' in found_functions}} + global __cuDeviceGetUuid_v2 + __cuDeviceGetUuid_v2 = windll.GetProcAddress(handle, 'cuDeviceGetUuid_v2') + {{endif}} + {{if 'cuDeviceGetLuid' in found_functions}} + global __cuDeviceGetLuid + __cuDeviceGetLuid = windll.GetProcAddress(handle, 'cuDeviceGetLuid') + {{endif}} + {{if 'cuDeviceTotalMem_v2' in found_functions}} + global __cuDeviceTotalMem_v2 + __cuDeviceTotalMem_v2 = windll.GetProcAddress(handle, 'cuDeviceTotalMem_v2') + {{endif}} + {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} + global __cuDeviceGetTexture1DLinearMaxWidth + __cuDeviceGetTexture1DLinearMaxWidth = windll.GetProcAddress(handle, 'cuDeviceGetTexture1DLinearMaxWidth') + {{endif}} + {{if 'cuDeviceGetAttribute' in found_functions}} + global __cuDeviceGetAttribute + __cuDeviceGetAttribute = windll.GetProcAddress(handle, 'cuDeviceGetAttribute') + {{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} + global __cuDeviceGetNvSciSyncAttributes + __cuDeviceGetNvSciSyncAttributes = windll.GetProcAddress(handle, 'cuDeviceGetNvSciSyncAttributes') + {{endif}} + {{if 'cuDeviceSetMemPool' in found_functions}} + global __cuDeviceSetMemPool + __cuDeviceSetMemPool = windll.GetProcAddress(handle, 'cuDeviceSetMemPool') + {{endif}} + {{if 'cuDeviceGetMemPool' in found_functions}} + global __cuDeviceGetMemPool + __cuDeviceGetMemPool = windll.GetProcAddress(handle, 'cuDeviceGetMemPool') + {{endif}} + {{if 'cuDeviceGetDefaultMemPool' in found_functions}} + global __cuDeviceGetDefaultMemPool + __cuDeviceGetDefaultMemPool = windll.GetProcAddress(handle, 'cuDeviceGetDefaultMemPool') + {{endif}} + {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} + global __cuDeviceGetExecAffinitySupport + __cuDeviceGetExecAffinitySupport = windll.GetProcAddress(handle, 'cuDeviceGetExecAffinitySupport') + {{endif}} + {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} + global __cuFlushGPUDirectRDMAWrites + __cuFlushGPUDirectRDMAWrites = windll.GetProcAddress(handle, 'cuFlushGPUDirectRDMAWrites') + {{endif}} + {{if 'cuDeviceGetProperties' in found_functions}} + global __cuDeviceGetProperties + __cuDeviceGetProperties = windll.GetProcAddress(handle, 'cuDeviceGetProperties') + {{endif}} + {{if 'cuDeviceComputeCapability' in found_functions}} + global __cuDeviceComputeCapability + __cuDeviceComputeCapability = windll.GetProcAddress(handle, 'cuDeviceComputeCapability') + {{endif}} + {{if 'cuDevicePrimaryCtxRetain' in found_functions}} + global __cuDevicePrimaryCtxRetain + __cuDevicePrimaryCtxRetain = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxRetain') + {{endif}} + {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} + global __cuDevicePrimaryCtxRelease_v2 + __cuDevicePrimaryCtxRelease_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxRelease_v2') + {{endif}} + {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} + global __cuDevicePrimaryCtxSetFlags_v2 + __cuDevicePrimaryCtxSetFlags_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxSetFlags_v2') + {{endif}} + {{if 'cuDevicePrimaryCtxGetState' in found_functions}} + global __cuDevicePrimaryCtxGetState + __cuDevicePrimaryCtxGetState = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxGetState') + {{endif}} + {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} + global __cuDevicePrimaryCtxReset_v2 + __cuDevicePrimaryCtxReset_v2 = windll.GetProcAddress(handle, 'cuDevicePrimaryCtxReset_v2') + {{endif}} + {{if 'cuCtxCreate_v2' in found_functions}} + global __cuCtxCreate_v2 + __cuCtxCreate_v2 = windll.GetProcAddress(handle, 'cuCtxCreate_v2') + {{endif}} + {{if 'cuCtxCreate_v3' in found_functions}} + global __cuCtxCreate_v3 + __cuCtxCreate_v3 = windll.GetProcAddress(handle, 'cuCtxCreate_v3') + {{endif}} + {{if 'cuCtxCreate_v4' in found_functions}} + global __cuCtxCreate_v4 + __cuCtxCreate_v4 = windll.GetProcAddress(handle, 'cuCtxCreate_v4') + {{endif}} + {{if 'cuCtxDestroy_v2' in found_functions}} + global __cuCtxDestroy_v2 + __cuCtxDestroy_v2 = windll.GetProcAddress(handle, 'cuCtxDestroy_v2') + {{endif}} + {{if 'cuCtxPushCurrent_v2' in found_functions}} + global __cuCtxPushCurrent_v2 + __cuCtxPushCurrent_v2 = windll.GetProcAddress(handle, 'cuCtxPushCurrent_v2') + {{endif}} + {{if 'cuCtxPopCurrent_v2' in found_functions}} + global __cuCtxPopCurrent_v2 + __cuCtxPopCurrent_v2 = windll.GetProcAddress(handle, 'cuCtxPopCurrent_v2') + {{endif}} + {{if 'cuCtxSetCurrent' in found_functions}} + global __cuCtxSetCurrent + __cuCtxSetCurrent = windll.GetProcAddress(handle, 'cuCtxSetCurrent') + {{endif}} + {{if 'cuCtxGetCurrent' in found_functions}} + global __cuCtxGetCurrent + __cuCtxGetCurrent = windll.GetProcAddress(handle, 'cuCtxGetCurrent') + {{endif}} + {{if 'cuCtxGetDevice' in found_functions}} + global __cuCtxGetDevice + __cuCtxGetDevice = windll.GetProcAddress(handle, 'cuCtxGetDevice') + {{endif}} + {{if 'cuCtxGetFlags' in found_functions}} + global __cuCtxGetFlags + __cuCtxGetFlags = windll.GetProcAddress(handle, 'cuCtxGetFlags') + {{endif}} + {{if 'cuCtxSetFlags' in found_functions}} + global __cuCtxSetFlags + __cuCtxSetFlags = windll.GetProcAddress(handle, 'cuCtxSetFlags') + {{endif}} + {{if 'cuCtxGetId' in found_functions}} + global __cuCtxGetId + __cuCtxGetId = windll.GetProcAddress(handle, 'cuCtxGetId') + {{endif}} + {{if 'cuCtxSynchronize' in found_functions}} + global __cuCtxSynchronize + __cuCtxSynchronize = windll.GetProcAddress(handle, 'cuCtxSynchronize') + {{endif}} + {{if 'cuCtxSetLimit' in found_functions}} + global __cuCtxSetLimit + __cuCtxSetLimit = windll.GetProcAddress(handle, 'cuCtxSetLimit') + {{endif}} + {{if 'cuCtxGetLimit' in found_functions}} + global __cuCtxGetLimit + __cuCtxGetLimit = windll.GetProcAddress(handle, 'cuCtxGetLimit') + {{endif}} + {{if 'cuCtxGetCacheConfig' in found_functions}} + global __cuCtxGetCacheConfig + __cuCtxGetCacheConfig = windll.GetProcAddress(handle, 'cuCtxGetCacheConfig') + {{endif}} + {{if 'cuCtxSetCacheConfig' in found_functions}} + global __cuCtxSetCacheConfig + __cuCtxSetCacheConfig = windll.GetProcAddress(handle, 'cuCtxSetCacheConfig') + {{endif}} + {{if 'cuCtxGetApiVersion' in found_functions}} + global __cuCtxGetApiVersion + __cuCtxGetApiVersion = windll.GetProcAddress(handle, 'cuCtxGetApiVersion') + {{endif}} + {{if 'cuCtxGetStreamPriorityRange' in found_functions}} + global __cuCtxGetStreamPriorityRange + __cuCtxGetStreamPriorityRange = windll.GetProcAddress(handle, 'cuCtxGetStreamPriorityRange') + {{endif}} + {{if 'cuCtxResetPersistingL2Cache' in found_functions}} + global __cuCtxResetPersistingL2Cache + __cuCtxResetPersistingL2Cache = windll.GetProcAddress(handle, 'cuCtxResetPersistingL2Cache') + {{endif}} + {{if 'cuCtxGetExecAffinity' in found_functions}} + global __cuCtxGetExecAffinity + __cuCtxGetExecAffinity = windll.GetProcAddress(handle, 'cuCtxGetExecAffinity') + {{endif}} + {{if 'cuCtxRecordEvent' in found_functions}} + global __cuCtxRecordEvent + __cuCtxRecordEvent = windll.GetProcAddress(handle, 'cuCtxRecordEvent') + {{endif}} + {{if 'cuCtxWaitEvent' in found_functions}} + global __cuCtxWaitEvent + __cuCtxWaitEvent = windll.GetProcAddress(handle, 'cuCtxWaitEvent') + {{endif}} + {{if 'cuCtxAttach' in found_functions}} + global __cuCtxAttach + __cuCtxAttach = windll.GetProcAddress(handle, 'cuCtxAttach') + {{endif}} + {{if 'cuCtxDetach' in found_functions}} + global __cuCtxDetach + __cuCtxDetach = windll.GetProcAddress(handle, 'cuCtxDetach') + {{endif}} + {{if 'cuCtxGetSharedMemConfig' in found_functions}} + global __cuCtxGetSharedMemConfig + __cuCtxGetSharedMemConfig = windll.GetProcAddress(handle, 'cuCtxGetSharedMemConfig') + {{endif}} + {{if 'cuCtxSetSharedMemConfig' in found_functions}} + global __cuCtxSetSharedMemConfig + __cuCtxSetSharedMemConfig = windll.GetProcAddress(handle, 'cuCtxSetSharedMemConfig') + {{endif}} + {{if 'cuModuleLoad' in found_functions}} + global __cuModuleLoad + __cuModuleLoad = windll.GetProcAddress(handle, 'cuModuleLoad') + {{endif}} + {{if 'cuModuleLoadData' in found_functions}} + global __cuModuleLoadData + __cuModuleLoadData = windll.GetProcAddress(handle, 'cuModuleLoadData') + {{endif}} + {{if 'cuModuleLoadDataEx' in found_functions}} + global __cuModuleLoadDataEx + __cuModuleLoadDataEx = windll.GetProcAddress(handle, 'cuModuleLoadDataEx') + {{endif}} + {{if 'cuModuleLoadFatBinary' in found_functions}} + global __cuModuleLoadFatBinary + __cuModuleLoadFatBinary = windll.GetProcAddress(handle, 'cuModuleLoadFatBinary') + {{endif}} + {{if 'cuModuleUnload' in found_functions}} + global __cuModuleUnload + __cuModuleUnload = windll.GetProcAddress(handle, 'cuModuleUnload') + {{endif}} + {{if 'cuModuleGetLoadingMode' in found_functions}} + global __cuModuleGetLoadingMode + __cuModuleGetLoadingMode = windll.GetProcAddress(handle, 'cuModuleGetLoadingMode') + {{endif}} + {{if 'cuModuleGetFunction' in found_functions}} + global __cuModuleGetFunction + __cuModuleGetFunction = windll.GetProcAddress(handle, 'cuModuleGetFunction') + {{endif}} + {{if 'cuModuleGetFunctionCount' in found_functions}} + global __cuModuleGetFunctionCount + __cuModuleGetFunctionCount = windll.GetProcAddress(handle, 'cuModuleGetFunctionCount') + {{endif}} + {{if 'cuModuleEnumerateFunctions' in found_functions}} + global __cuModuleEnumerateFunctions + __cuModuleEnumerateFunctions = windll.GetProcAddress(handle, 'cuModuleEnumerateFunctions') + {{endif}} + {{if 'cuModuleGetGlobal_v2' in found_functions}} + global __cuModuleGetGlobal_v2 + __cuModuleGetGlobal_v2 = windll.GetProcAddress(handle, 'cuModuleGetGlobal_v2') + {{endif}} + {{if 'cuLinkCreate_v2' in found_functions}} + global __cuLinkCreate_v2 + __cuLinkCreate_v2 = windll.GetProcAddress(handle, 'cuLinkCreate_v2') + {{endif}} + {{if 'cuLinkAddData_v2' in found_functions}} + global __cuLinkAddData_v2 + __cuLinkAddData_v2 = windll.GetProcAddress(handle, 'cuLinkAddData_v2') + {{endif}} + {{if 'cuLinkAddFile_v2' in found_functions}} + global __cuLinkAddFile_v2 + __cuLinkAddFile_v2 = windll.GetProcAddress(handle, 'cuLinkAddFile_v2') + {{endif}} + {{if 'cuLinkComplete' in found_functions}} + global __cuLinkComplete + __cuLinkComplete = windll.GetProcAddress(handle, 'cuLinkComplete') + {{endif}} + {{if 'cuLinkDestroy' in found_functions}} + global __cuLinkDestroy + __cuLinkDestroy = windll.GetProcAddress(handle, 'cuLinkDestroy') + {{endif}} + {{if 'cuModuleGetTexRef' in found_functions}} + global __cuModuleGetTexRef + __cuModuleGetTexRef = windll.GetProcAddress(handle, 'cuModuleGetTexRef') + {{endif}} + {{if 'cuModuleGetSurfRef' in found_functions}} + global __cuModuleGetSurfRef + __cuModuleGetSurfRef = windll.GetProcAddress(handle, 'cuModuleGetSurfRef') + {{endif}} + {{if 'cuLibraryLoadData' in found_functions}} + global __cuLibraryLoadData + __cuLibraryLoadData = windll.GetProcAddress(handle, 'cuLibraryLoadData') + {{endif}} + {{if 'cuLibraryLoadFromFile' in found_functions}} + global __cuLibraryLoadFromFile + __cuLibraryLoadFromFile = windll.GetProcAddress(handle, 'cuLibraryLoadFromFile') + {{endif}} + {{if 'cuLibraryUnload' in found_functions}} + global __cuLibraryUnload + __cuLibraryUnload = windll.GetProcAddress(handle, 'cuLibraryUnload') + {{endif}} + {{if 'cuLibraryGetKernel' in found_functions}} + global __cuLibraryGetKernel + __cuLibraryGetKernel = windll.GetProcAddress(handle, 'cuLibraryGetKernel') + {{endif}} + {{if 'cuLibraryGetKernelCount' in found_functions}} + global __cuLibraryGetKernelCount + __cuLibraryGetKernelCount = windll.GetProcAddress(handle, 'cuLibraryGetKernelCount') + {{endif}} + {{if 'cuLibraryEnumerateKernels' in found_functions}} + global __cuLibraryEnumerateKernels + __cuLibraryEnumerateKernels = windll.GetProcAddress(handle, 'cuLibraryEnumerateKernels') + {{endif}} + {{if 'cuLibraryGetModule' in found_functions}} + global __cuLibraryGetModule + __cuLibraryGetModule = windll.GetProcAddress(handle, 'cuLibraryGetModule') + {{endif}} + {{if 'cuKernelGetFunction' in found_functions}} + global __cuKernelGetFunction + __cuKernelGetFunction = windll.GetProcAddress(handle, 'cuKernelGetFunction') + {{endif}} + {{if 'cuKernelGetLibrary' in found_functions}} + global __cuKernelGetLibrary + __cuKernelGetLibrary = windll.GetProcAddress(handle, 'cuKernelGetLibrary') + {{endif}} + {{if 'cuLibraryGetGlobal' in found_functions}} + global __cuLibraryGetGlobal + __cuLibraryGetGlobal = windll.GetProcAddress(handle, 'cuLibraryGetGlobal') + {{endif}} + {{if 'cuLibraryGetManaged' in found_functions}} + global __cuLibraryGetManaged + __cuLibraryGetManaged = windll.GetProcAddress(handle, 'cuLibraryGetManaged') + {{endif}} + {{if 'cuLibraryGetUnifiedFunction' in found_functions}} + global __cuLibraryGetUnifiedFunction + __cuLibraryGetUnifiedFunction = windll.GetProcAddress(handle, 'cuLibraryGetUnifiedFunction') + {{endif}} + {{if 'cuKernelGetAttribute' in found_functions}} + global __cuKernelGetAttribute + __cuKernelGetAttribute = windll.GetProcAddress(handle, 'cuKernelGetAttribute') + {{endif}} + {{if 'cuKernelSetAttribute' in found_functions}} + global __cuKernelSetAttribute + __cuKernelSetAttribute = windll.GetProcAddress(handle, 'cuKernelSetAttribute') + {{endif}} + {{if 'cuKernelSetCacheConfig' in found_functions}} + global __cuKernelSetCacheConfig + __cuKernelSetCacheConfig = windll.GetProcAddress(handle, 'cuKernelSetCacheConfig') + {{endif}} + {{if 'cuKernelGetName' in found_functions}} + global __cuKernelGetName + __cuKernelGetName = windll.GetProcAddress(handle, 'cuKernelGetName') + {{endif}} + {{if 'cuKernelGetParamInfo' in found_functions}} + global __cuKernelGetParamInfo + __cuKernelGetParamInfo = windll.GetProcAddress(handle, 'cuKernelGetParamInfo') + {{endif}} + {{if 'cuMemGetInfo_v2' in found_functions}} + global __cuMemGetInfo_v2 + __cuMemGetInfo_v2 = windll.GetProcAddress(handle, 'cuMemGetInfo_v2') + {{endif}} + {{if 'cuMemAlloc_v2' in found_functions}} + global __cuMemAlloc_v2 + __cuMemAlloc_v2 = windll.GetProcAddress(handle, 'cuMemAlloc_v2') + {{endif}} + {{if 'cuMemAllocPitch_v2' in found_functions}} + global __cuMemAllocPitch_v2 + __cuMemAllocPitch_v2 = windll.GetProcAddress(handle, 'cuMemAllocPitch_v2') + {{endif}} + {{if 'cuMemFree_v2' in found_functions}} + global __cuMemFree_v2 + __cuMemFree_v2 = windll.GetProcAddress(handle, 'cuMemFree_v2') + {{endif}} + {{if 'cuMemGetAddressRange_v2' in found_functions}} + global __cuMemGetAddressRange_v2 + __cuMemGetAddressRange_v2 = windll.GetProcAddress(handle, 'cuMemGetAddressRange_v2') + {{endif}} + {{if 'cuMemAllocHost_v2' in found_functions}} + global __cuMemAllocHost_v2 + __cuMemAllocHost_v2 = windll.GetProcAddress(handle, 'cuMemAllocHost_v2') + {{endif}} + {{if 'cuMemFreeHost' in found_functions}} + global __cuMemFreeHost + __cuMemFreeHost = windll.GetProcAddress(handle, 'cuMemFreeHost') + {{endif}} + {{if 'cuMemHostAlloc' in found_functions}} + global __cuMemHostAlloc + __cuMemHostAlloc = windll.GetProcAddress(handle, 'cuMemHostAlloc') + {{endif}} + {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} + global __cuMemHostGetDevicePointer_v2 + __cuMemHostGetDevicePointer_v2 = windll.GetProcAddress(handle, 'cuMemHostGetDevicePointer_v2') + {{endif}} + {{if 'cuMemHostGetFlags' in found_functions}} + global __cuMemHostGetFlags + __cuMemHostGetFlags = windll.GetProcAddress(handle, 'cuMemHostGetFlags') + {{endif}} + {{if 'cuMemAllocManaged' in found_functions}} + global __cuMemAllocManaged + __cuMemAllocManaged = windll.GetProcAddress(handle, 'cuMemAllocManaged') + {{endif}} + {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} + global __cuDeviceRegisterAsyncNotification + __cuDeviceRegisterAsyncNotification = windll.GetProcAddress(handle, 'cuDeviceRegisterAsyncNotification') + {{endif}} + {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} + global __cuDeviceUnregisterAsyncNotification + __cuDeviceUnregisterAsyncNotification = windll.GetProcAddress(handle, 'cuDeviceUnregisterAsyncNotification') + {{endif}} + {{if 'cuDeviceGetByPCIBusId' in found_functions}} + global __cuDeviceGetByPCIBusId + __cuDeviceGetByPCIBusId = windll.GetProcAddress(handle, 'cuDeviceGetByPCIBusId') + {{endif}} + {{if 'cuDeviceGetPCIBusId' in found_functions}} + global __cuDeviceGetPCIBusId + __cuDeviceGetPCIBusId = windll.GetProcAddress(handle, 'cuDeviceGetPCIBusId') + {{endif}} + {{if 'cuIpcGetEventHandle' in found_functions}} + global __cuIpcGetEventHandle + __cuIpcGetEventHandle = windll.GetProcAddress(handle, 'cuIpcGetEventHandle') + {{endif}} + {{if 'cuIpcOpenEventHandle' in found_functions}} + global __cuIpcOpenEventHandle + __cuIpcOpenEventHandle = windll.GetProcAddress(handle, 'cuIpcOpenEventHandle') + {{endif}} + {{if 'cuIpcGetMemHandle' in found_functions}} + global __cuIpcGetMemHandle + __cuIpcGetMemHandle = windll.GetProcAddress(handle, 'cuIpcGetMemHandle') + {{endif}} + {{if 'cuIpcOpenMemHandle_v2' in found_functions}} + global __cuIpcOpenMemHandle_v2 + __cuIpcOpenMemHandle_v2 = windll.GetProcAddress(handle, 'cuIpcOpenMemHandle_v2') + {{endif}} + {{if 'cuIpcCloseMemHandle' in found_functions}} + global __cuIpcCloseMemHandle + __cuIpcCloseMemHandle = windll.GetProcAddress(handle, 'cuIpcCloseMemHandle') + {{endif}} + {{if 'cuMemHostRegister_v2' in found_functions}} + global __cuMemHostRegister_v2 + __cuMemHostRegister_v2 = windll.GetProcAddress(handle, 'cuMemHostRegister_v2') + {{endif}} + {{if 'cuMemHostUnregister' in found_functions}} + global __cuMemHostUnregister + __cuMemHostUnregister = windll.GetProcAddress(handle, 'cuMemHostUnregister') + {{endif}} + {{if 'cuArrayCreate_v2' in found_functions}} + global __cuArrayCreate_v2 + __cuArrayCreate_v2 = windll.GetProcAddress(handle, 'cuArrayCreate_v2') + {{endif}} + {{if 'cuArrayGetDescriptor_v2' in found_functions}} + global __cuArrayGetDescriptor_v2 + __cuArrayGetDescriptor_v2 = windll.GetProcAddress(handle, 'cuArrayGetDescriptor_v2') + {{endif}} + {{if 'cuArrayGetSparseProperties' in found_functions}} + global __cuArrayGetSparseProperties + __cuArrayGetSparseProperties = windll.GetProcAddress(handle, 'cuArrayGetSparseProperties') + {{endif}} + {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} + global __cuMipmappedArrayGetSparseProperties + __cuMipmappedArrayGetSparseProperties = windll.GetProcAddress(handle, 'cuMipmappedArrayGetSparseProperties') + {{endif}} + {{if 'cuArrayGetMemoryRequirements' in found_functions}} + global __cuArrayGetMemoryRequirements + __cuArrayGetMemoryRequirements = windll.GetProcAddress(handle, 'cuArrayGetMemoryRequirements') + {{endif}} + {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} + global __cuMipmappedArrayGetMemoryRequirements + __cuMipmappedArrayGetMemoryRequirements = windll.GetProcAddress(handle, 'cuMipmappedArrayGetMemoryRequirements') + {{endif}} + {{if 'cuArrayGetPlane' in found_functions}} + global __cuArrayGetPlane + __cuArrayGetPlane = windll.GetProcAddress(handle, 'cuArrayGetPlane') + {{endif}} + {{if 'cuArrayDestroy' in found_functions}} + global __cuArrayDestroy + __cuArrayDestroy = windll.GetProcAddress(handle, 'cuArrayDestroy') + {{endif}} + {{if 'cuArray3DCreate_v2' in found_functions}} + global __cuArray3DCreate_v2 + __cuArray3DCreate_v2 = windll.GetProcAddress(handle, 'cuArray3DCreate_v2') + {{endif}} + {{if 'cuArray3DGetDescriptor_v2' in found_functions}} + global __cuArray3DGetDescriptor_v2 + __cuArray3DGetDescriptor_v2 = windll.GetProcAddress(handle, 'cuArray3DGetDescriptor_v2') + {{endif}} + {{if 'cuMipmappedArrayCreate' in found_functions}} + global __cuMipmappedArrayCreate + __cuMipmappedArrayCreate = windll.GetProcAddress(handle, 'cuMipmappedArrayCreate') + {{endif}} + {{if 'cuMipmappedArrayGetLevel' in found_functions}} + global __cuMipmappedArrayGetLevel + __cuMipmappedArrayGetLevel = windll.GetProcAddress(handle, 'cuMipmappedArrayGetLevel') + {{endif}} + {{if 'cuMipmappedArrayDestroy' in found_functions}} + global __cuMipmappedArrayDestroy + __cuMipmappedArrayDestroy = windll.GetProcAddress(handle, 'cuMipmappedArrayDestroy') + {{endif}} + {{if 'cuMemGetHandleForAddressRange' in found_functions}} + global __cuMemGetHandleForAddressRange + __cuMemGetHandleForAddressRange = windll.GetProcAddress(handle, 'cuMemGetHandleForAddressRange') + {{endif}} + {{if 'cuMemAddressReserve' in found_functions}} + global __cuMemAddressReserve + __cuMemAddressReserve = windll.GetProcAddress(handle, 'cuMemAddressReserve') + {{endif}} + {{if 'cuMemAddressFree' in found_functions}} + global __cuMemAddressFree + __cuMemAddressFree = windll.GetProcAddress(handle, 'cuMemAddressFree') + {{endif}} + {{if 'cuMemCreate' in found_functions}} + global __cuMemCreate + __cuMemCreate = windll.GetProcAddress(handle, 'cuMemCreate') + {{endif}} + {{if 'cuMemRelease' in found_functions}} + global __cuMemRelease + __cuMemRelease = windll.GetProcAddress(handle, 'cuMemRelease') + {{endif}} + {{if 'cuMemMap' in found_functions}} + global __cuMemMap + __cuMemMap = windll.GetProcAddress(handle, 'cuMemMap') + {{endif}} + {{if 'cuMemUnmap' in found_functions}} + global __cuMemUnmap + __cuMemUnmap = windll.GetProcAddress(handle, 'cuMemUnmap') + {{endif}} + {{if 'cuMemSetAccess' in found_functions}} + global __cuMemSetAccess + __cuMemSetAccess = windll.GetProcAddress(handle, 'cuMemSetAccess') + {{endif}} + {{if 'cuMemGetAccess' in found_functions}} + global __cuMemGetAccess + __cuMemGetAccess = windll.GetProcAddress(handle, 'cuMemGetAccess') + {{endif}} + {{if 'cuMemExportToShareableHandle' in found_functions}} + global __cuMemExportToShareableHandle + __cuMemExportToShareableHandle = windll.GetProcAddress(handle, 'cuMemExportToShareableHandle') + {{endif}} + {{if 'cuMemImportFromShareableHandle' in found_functions}} + global __cuMemImportFromShareableHandle + __cuMemImportFromShareableHandle = windll.GetProcAddress(handle, 'cuMemImportFromShareableHandle') + {{endif}} + {{if 'cuMemGetAllocationGranularity' in found_functions}} + global __cuMemGetAllocationGranularity + __cuMemGetAllocationGranularity = windll.GetProcAddress(handle, 'cuMemGetAllocationGranularity') + {{endif}} + {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} + global __cuMemGetAllocationPropertiesFromHandle + __cuMemGetAllocationPropertiesFromHandle = windll.GetProcAddress(handle, 'cuMemGetAllocationPropertiesFromHandle') + {{endif}} + {{if 'cuMemRetainAllocationHandle' in found_functions}} + global __cuMemRetainAllocationHandle + __cuMemRetainAllocationHandle = windll.GetProcAddress(handle, 'cuMemRetainAllocationHandle') + {{endif}} + {{if 'cuMemPoolTrimTo' in found_functions}} + global __cuMemPoolTrimTo + __cuMemPoolTrimTo = windll.GetProcAddress(handle, 'cuMemPoolTrimTo') + {{endif}} + {{if 'cuMemPoolSetAttribute' in found_functions}} + global __cuMemPoolSetAttribute + __cuMemPoolSetAttribute = windll.GetProcAddress(handle, 'cuMemPoolSetAttribute') + {{endif}} + {{if 'cuMemPoolGetAttribute' in found_functions}} + global __cuMemPoolGetAttribute + __cuMemPoolGetAttribute = windll.GetProcAddress(handle, 'cuMemPoolGetAttribute') + {{endif}} + {{if 'cuMemPoolSetAccess' in found_functions}} + global __cuMemPoolSetAccess + __cuMemPoolSetAccess = windll.GetProcAddress(handle, 'cuMemPoolSetAccess') + {{endif}} + {{if 'cuMemPoolGetAccess' in found_functions}} + global __cuMemPoolGetAccess + __cuMemPoolGetAccess = windll.GetProcAddress(handle, 'cuMemPoolGetAccess') + {{endif}} + {{if 'cuMemPoolCreate' in found_functions}} + global __cuMemPoolCreate + __cuMemPoolCreate = windll.GetProcAddress(handle, 'cuMemPoolCreate') + {{endif}} + {{if 'cuMemPoolDestroy' in found_functions}} + global __cuMemPoolDestroy + __cuMemPoolDestroy = windll.GetProcAddress(handle, 'cuMemPoolDestroy') + {{endif}} + {{if 'cuMemPoolExportToShareableHandle' in found_functions}} + global __cuMemPoolExportToShareableHandle + __cuMemPoolExportToShareableHandle = windll.GetProcAddress(handle, 'cuMemPoolExportToShareableHandle') + {{endif}} + {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} + global __cuMemPoolImportFromShareableHandle + __cuMemPoolImportFromShareableHandle = windll.GetProcAddress(handle, 'cuMemPoolImportFromShareableHandle') + {{endif}} + {{if 'cuMemPoolExportPointer' in found_functions}} + global __cuMemPoolExportPointer + __cuMemPoolExportPointer = windll.GetProcAddress(handle, 'cuMemPoolExportPointer') + {{endif}} + {{if 'cuMemPoolImportPointer' in found_functions}} + global __cuMemPoolImportPointer + __cuMemPoolImportPointer = windll.GetProcAddress(handle, 'cuMemPoolImportPointer') + {{endif}} + {{if 'cuMulticastCreate' in found_functions}} + global __cuMulticastCreate + __cuMulticastCreate = windll.GetProcAddress(handle, 'cuMulticastCreate') + {{endif}} + {{if 'cuMulticastAddDevice' in found_functions}} + global __cuMulticastAddDevice + __cuMulticastAddDevice = windll.GetProcAddress(handle, 'cuMulticastAddDevice') + {{endif}} + {{if 'cuMulticastBindMem' in found_functions}} + global __cuMulticastBindMem + __cuMulticastBindMem = windll.GetProcAddress(handle, 'cuMulticastBindMem') + {{endif}} + {{if 'cuMulticastBindAddr' in found_functions}} + global __cuMulticastBindAddr + __cuMulticastBindAddr = windll.GetProcAddress(handle, 'cuMulticastBindAddr') + {{endif}} + {{if 'cuMulticastUnbind' in found_functions}} + global __cuMulticastUnbind + __cuMulticastUnbind = windll.GetProcAddress(handle, 'cuMulticastUnbind') + {{endif}} + {{if 'cuMulticastGetGranularity' in found_functions}} + global __cuMulticastGetGranularity + __cuMulticastGetGranularity = windll.GetProcAddress(handle, 'cuMulticastGetGranularity') + {{endif}} + {{if 'cuPointerGetAttribute' in found_functions}} + global __cuPointerGetAttribute + __cuPointerGetAttribute = windll.GetProcAddress(handle, 'cuPointerGetAttribute') + {{endif}} + {{if 'cuMemAdvise' in found_functions}} + global __cuMemAdvise + __cuMemAdvise = windll.GetProcAddress(handle, 'cuMemAdvise') + {{endif}} + {{if 'cuMemAdvise_v2' in found_functions}} + global __cuMemAdvise_v2 + __cuMemAdvise_v2 = windll.GetProcAddress(handle, 'cuMemAdvise_v2') + {{endif}} + {{if 'cuMemRangeGetAttribute' in found_functions}} + global __cuMemRangeGetAttribute + __cuMemRangeGetAttribute = windll.GetProcAddress(handle, 'cuMemRangeGetAttribute') + {{endif}} + {{if 'cuMemRangeGetAttributes' in found_functions}} + global __cuMemRangeGetAttributes + __cuMemRangeGetAttributes = windll.GetProcAddress(handle, 'cuMemRangeGetAttributes') + {{endif}} + {{if 'cuPointerSetAttribute' in found_functions}} + global __cuPointerSetAttribute + __cuPointerSetAttribute = windll.GetProcAddress(handle, 'cuPointerSetAttribute') + {{endif}} + {{if 'cuPointerGetAttributes' in found_functions}} + global __cuPointerGetAttributes + __cuPointerGetAttributes = windll.GetProcAddress(handle, 'cuPointerGetAttributes') + {{endif}} + {{if 'cuStreamCreate' in found_functions}} + global __cuStreamCreate + __cuStreamCreate = windll.GetProcAddress(handle, 'cuStreamCreate') + {{endif}} + {{if 'cuStreamCreateWithPriority' in found_functions}} + global __cuStreamCreateWithPriority + __cuStreamCreateWithPriority = windll.GetProcAddress(handle, 'cuStreamCreateWithPriority') + {{endif}} + {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} + global __cuThreadExchangeStreamCaptureMode + __cuThreadExchangeStreamCaptureMode = windll.GetProcAddress(handle, 'cuThreadExchangeStreamCaptureMode') + {{endif}} + {{if 'cuStreamDestroy_v2' in found_functions}} + global __cuStreamDestroy_v2 + __cuStreamDestroy_v2 = windll.GetProcAddress(handle, 'cuStreamDestroy_v2') + {{endif}} + {{if 'cuEventCreate' in found_functions}} + global __cuEventCreate + __cuEventCreate = windll.GetProcAddress(handle, 'cuEventCreate') + {{endif}} + {{if 'cuEventQuery' in found_functions}} + global __cuEventQuery + __cuEventQuery = windll.GetProcAddress(handle, 'cuEventQuery') + {{endif}} + {{if 'cuEventSynchronize' in found_functions}} + global __cuEventSynchronize + __cuEventSynchronize = windll.GetProcAddress(handle, 'cuEventSynchronize') + {{endif}} + {{if 'cuEventDestroy_v2' in found_functions}} + global __cuEventDestroy_v2 + __cuEventDestroy_v2 = windll.GetProcAddress(handle, 'cuEventDestroy_v2') + {{endif}} + {{if 'cuEventElapsedTime' in found_functions}} + global __cuEventElapsedTime + __cuEventElapsedTime = windll.GetProcAddress(handle, 'cuEventElapsedTime') + {{endif}} + {{if 'cuEventElapsedTime_v2' in found_functions}} + global __cuEventElapsedTime_v2 + __cuEventElapsedTime_v2 = windll.GetProcAddress(handle, 'cuEventElapsedTime_v2') + {{endif}} + {{if 'cuImportExternalMemory' in found_functions}} + global __cuImportExternalMemory + __cuImportExternalMemory = windll.GetProcAddress(handle, 'cuImportExternalMemory') + {{endif}} + {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} + global __cuExternalMemoryGetMappedBuffer + __cuExternalMemoryGetMappedBuffer = windll.GetProcAddress(handle, 'cuExternalMemoryGetMappedBuffer') + {{endif}} + {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} + global __cuExternalMemoryGetMappedMipmappedArray + __cuExternalMemoryGetMappedMipmappedArray = windll.GetProcAddress(handle, 'cuExternalMemoryGetMappedMipmappedArray') + {{endif}} + {{if 'cuDestroyExternalMemory' in found_functions}} + global __cuDestroyExternalMemory + __cuDestroyExternalMemory = windll.GetProcAddress(handle, 'cuDestroyExternalMemory') + {{endif}} + {{if 'cuImportExternalSemaphore' in found_functions}} + global __cuImportExternalSemaphore + __cuImportExternalSemaphore = windll.GetProcAddress(handle, 'cuImportExternalSemaphore') + {{endif}} + {{if 'cuDestroyExternalSemaphore' in found_functions}} + global __cuDestroyExternalSemaphore + __cuDestroyExternalSemaphore = windll.GetProcAddress(handle, 'cuDestroyExternalSemaphore') + {{endif}} + {{if 'cuFuncGetAttribute' in found_functions}} + global __cuFuncGetAttribute + __cuFuncGetAttribute = windll.GetProcAddress(handle, 'cuFuncGetAttribute') + {{endif}} + {{if 'cuFuncSetAttribute' in found_functions}} + global __cuFuncSetAttribute + __cuFuncSetAttribute = windll.GetProcAddress(handle, 'cuFuncSetAttribute') + {{endif}} + {{if 'cuFuncSetCacheConfig' in found_functions}} + global __cuFuncSetCacheConfig + __cuFuncSetCacheConfig = windll.GetProcAddress(handle, 'cuFuncSetCacheConfig') + {{endif}} + {{if 'cuFuncGetModule' in found_functions}} + global __cuFuncGetModule + __cuFuncGetModule = windll.GetProcAddress(handle, 'cuFuncGetModule') + {{endif}} + {{if 'cuFuncGetName' in found_functions}} + global __cuFuncGetName + __cuFuncGetName = windll.GetProcAddress(handle, 'cuFuncGetName') + {{endif}} + {{if 'cuFuncGetParamInfo' in found_functions}} + global __cuFuncGetParamInfo + __cuFuncGetParamInfo = windll.GetProcAddress(handle, 'cuFuncGetParamInfo') + {{endif}} + {{if 'cuFuncIsLoaded' in found_functions}} + global __cuFuncIsLoaded + __cuFuncIsLoaded = windll.GetProcAddress(handle, 'cuFuncIsLoaded') + {{endif}} + {{if 'cuFuncLoad' in found_functions}} + global __cuFuncLoad + __cuFuncLoad = windll.GetProcAddress(handle, 'cuFuncLoad') + {{endif}} + {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} + global __cuLaunchCooperativeKernelMultiDevice + __cuLaunchCooperativeKernelMultiDevice = windll.GetProcAddress(handle, 'cuLaunchCooperativeKernelMultiDevice') + {{endif}} + {{if 'cuFuncSetBlockShape' in found_functions}} + global __cuFuncSetBlockShape + __cuFuncSetBlockShape = windll.GetProcAddress(handle, 'cuFuncSetBlockShape') + {{endif}} + {{if 'cuFuncSetSharedSize' in found_functions}} + global __cuFuncSetSharedSize + __cuFuncSetSharedSize = windll.GetProcAddress(handle, 'cuFuncSetSharedSize') + {{endif}} + {{if 'cuParamSetSize' in found_functions}} + global __cuParamSetSize + __cuParamSetSize = windll.GetProcAddress(handle, 'cuParamSetSize') + {{endif}} + {{if 'cuParamSeti' in found_functions}} + global __cuParamSeti + __cuParamSeti = windll.GetProcAddress(handle, 'cuParamSeti') + {{endif}} + {{if 'cuParamSetf' in found_functions}} + global __cuParamSetf + __cuParamSetf = windll.GetProcAddress(handle, 'cuParamSetf') + {{endif}} + {{if 'cuParamSetv' in found_functions}} + global __cuParamSetv + __cuParamSetv = windll.GetProcAddress(handle, 'cuParamSetv') + {{endif}} + {{if 'cuLaunch' in found_functions}} + global __cuLaunch + __cuLaunch = windll.GetProcAddress(handle, 'cuLaunch') + {{endif}} + {{if 'cuLaunchGrid' in found_functions}} + global __cuLaunchGrid + __cuLaunchGrid = windll.GetProcAddress(handle, 'cuLaunchGrid') + {{endif}} + {{if 'cuLaunchGridAsync' in found_functions}} + global __cuLaunchGridAsync + __cuLaunchGridAsync = windll.GetProcAddress(handle, 'cuLaunchGridAsync') + {{endif}} + {{if 'cuParamSetTexRef' in found_functions}} + global __cuParamSetTexRef + __cuParamSetTexRef = windll.GetProcAddress(handle, 'cuParamSetTexRef') + {{endif}} + {{if 'cuFuncSetSharedMemConfig' in found_functions}} + global __cuFuncSetSharedMemConfig + __cuFuncSetSharedMemConfig = windll.GetProcAddress(handle, 'cuFuncSetSharedMemConfig') + {{endif}} + {{if 'cuGraphCreate' in found_functions}} + global __cuGraphCreate + __cuGraphCreate = windll.GetProcAddress(handle, 'cuGraphCreate') + {{endif}} + {{if 'cuGraphAddKernelNode_v2' in found_functions}} + global __cuGraphAddKernelNode_v2 + __cuGraphAddKernelNode_v2 = windll.GetProcAddress(handle, 'cuGraphAddKernelNode_v2') + {{endif}} + {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} + global __cuGraphKernelNodeGetParams_v2 + __cuGraphKernelNodeGetParams_v2 = windll.GetProcAddress(handle, 'cuGraphKernelNodeGetParams_v2') + {{endif}} + {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} + global __cuGraphKernelNodeSetParams_v2 + __cuGraphKernelNodeSetParams_v2 = windll.GetProcAddress(handle, 'cuGraphKernelNodeSetParams_v2') + {{endif}} + {{if 'cuGraphAddMemcpyNode' in found_functions}} + global __cuGraphAddMemcpyNode + __cuGraphAddMemcpyNode = windll.GetProcAddress(handle, 'cuGraphAddMemcpyNode') + {{endif}} + {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} + global __cuGraphMemcpyNodeGetParams + __cuGraphMemcpyNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemcpyNodeGetParams') + {{endif}} + {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} + global __cuGraphMemcpyNodeSetParams + __cuGraphMemcpyNodeSetParams = windll.GetProcAddress(handle, 'cuGraphMemcpyNodeSetParams') + {{endif}} + {{if 'cuGraphAddMemsetNode' in found_functions}} + global __cuGraphAddMemsetNode + __cuGraphAddMemsetNode = windll.GetProcAddress(handle, 'cuGraphAddMemsetNode') + {{endif}} + {{if 'cuGraphMemsetNodeGetParams' in found_functions}} + global __cuGraphMemsetNodeGetParams + __cuGraphMemsetNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemsetNodeGetParams') + {{endif}} + {{if 'cuGraphMemsetNodeSetParams' in found_functions}} + global __cuGraphMemsetNodeSetParams + __cuGraphMemsetNodeSetParams = windll.GetProcAddress(handle, 'cuGraphMemsetNodeSetParams') + {{endif}} + {{if 'cuGraphAddHostNode' in found_functions}} + global __cuGraphAddHostNode + __cuGraphAddHostNode = windll.GetProcAddress(handle, 'cuGraphAddHostNode') + {{endif}} + {{if 'cuGraphHostNodeGetParams' in found_functions}} + global __cuGraphHostNodeGetParams + __cuGraphHostNodeGetParams = windll.GetProcAddress(handle, 'cuGraphHostNodeGetParams') + {{endif}} + {{if 'cuGraphHostNodeSetParams' in found_functions}} + global __cuGraphHostNodeSetParams + __cuGraphHostNodeSetParams = windll.GetProcAddress(handle, 'cuGraphHostNodeSetParams') + {{endif}} + {{if 'cuGraphAddChildGraphNode' in found_functions}} + global __cuGraphAddChildGraphNode + __cuGraphAddChildGraphNode = windll.GetProcAddress(handle, 'cuGraphAddChildGraphNode') + {{endif}} + {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} + global __cuGraphChildGraphNodeGetGraph + __cuGraphChildGraphNodeGetGraph = windll.GetProcAddress(handle, 'cuGraphChildGraphNodeGetGraph') + {{endif}} + {{if 'cuGraphAddEmptyNode' in found_functions}} + global __cuGraphAddEmptyNode + __cuGraphAddEmptyNode = windll.GetProcAddress(handle, 'cuGraphAddEmptyNode') + {{endif}} + {{if 'cuGraphAddEventRecordNode' in found_functions}} + global __cuGraphAddEventRecordNode + __cuGraphAddEventRecordNode = windll.GetProcAddress(handle, 'cuGraphAddEventRecordNode') + {{endif}} + {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} + global __cuGraphEventRecordNodeGetEvent + __cuGraphEventRecordNodeGetEvent = windll.GetProcAddress(handle, 'cuGraphEventRecordNodeGetEvent') + {{endif}} + {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} + global __cuGraphEventRecordNodeSetEvent + __cuGraphEventRecordNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphEventRecordNodeSetEvent') + {{endif}} + {{if 'cuGraphAddEventWaitNode' in found_functions}} + global __cuGraphAddEventWaitNode + __cuGraphAddEventWaitNode = windll.GetProcAddress(handle, 'cuGraphAddEventWaitNode') + {{endif}} + {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} + global __cuGraphEventWaitNodeGetEvent + __cuGraphEventWaitNodeGetEvent = windll.GetProcAddress(handle, 'cuGraphEventWaitNodeGetEvent') + {{endif}} + {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} + global __cuGraphEventWaitNodeSetEvent + __cuGraphEventWaitNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphEventWaitNodeSetEvent') + {{endif}} + {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} + global __cuGraphAddExternalSemaphoresSignalNode + __cuGraphAddExternalSemaphoresSignalNode = windll.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresSignalNode') + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeGetParams + __cuGraphExternalSemaphoresSignalNodeGetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeSetParams + __cuGraphExternalSemaphoresSignalNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') + {{endif}} + {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} + global __cuGraphAddExternalSemaphoresWaitNode + __cuGraphAddExternalSemaphoresWaitNode = windll.GetProcAddress(handle, 'cuGraphAddExternalSemaphoresWaitNode') + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeGetParams + __cuGraphExternalSemaphoresWaitNodeGetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeSetParams + __cuGraphExternalSemaphoresWaitNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') + {{endif}} + {{if 'cuGraphAddBatchMemOpNode' in found_functions}} + global __cuGraphAddBatchMemOpNode + __cuGraphAddBatchMemOpNode = windll.GetProcAddress(handle, 'cuGraphAddBatchMemOpNode') + {{endif}} + {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} + global __cuGraphBatchMemOpNodeGetParams + __cuGraphBatchMemOpNodeGetParams = windll.GetProcAddress(handle, 'cuGraphBatchMemOpNodeGetParams') + {{endif}} + {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphBatchMemOpNodeSetParams + __cuGraphBatchMemOpNodeSetParams = windll.GetProcAddress(handle, 'cuGraphBatchMemOpNodeSetParams') + {{endif}} + {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphExecBatchMemOpNodeSetParams + __cuGraphExecBatchMemOpNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecBatchMemOpNodeSetParams') + {{endif}} + {{if 'cuGraphAddMemAllocNode' in found_functions}} + global __cuGraphAddMemAllocNode + __cuGraphAddMemAllocNode = windll.GetProcAddress(handle, 'cuGraphAddMemAllocNode') + {{endif}} + {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} + global __cuGraphMemAllocNodeGetParams + __cuGraphMemAllocNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemAllocNodeGetParams') + {{endif}} + {{if 'cuGraphAddMemFreeNode' in found_functions}} + global __cuGraphAddMemFreeNode + __cuGraphAddMemFreeNode = windll.GetProcAddress(handle, 'cuGraphAddMemFreeNode') + {{endif}} + {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} + global __cuGraphMemFreeNodeGetParams + __cuGraphMemFreeNodeGetParams = windll.GetProcAddress(handle, 'cuGraphMemFreeNodeGetParams') + {{endif}} + {{if 'cuDeviceGraphMemTrim' in found_functions}} + global __cuDeviceGraphMemTrim + __cuDeviceGraphMemTrim = windll.GetProcAddress(handle, 'cuDeviceGraphMemTrim') + {{endif}} + {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} + global __cuDeviceGetGraphMemAttribute + __cuDeviceGetGraphMemAttribute = windll.GetProcAddress(handle, 'cuDeviceGetGraphMemAttribute') + {{endif}} + {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} + global __cuDeviceSetGraphMemAttribute + __cuDeviceSetGraphMemAttribute = windll.GetProcAddress(handle, 'cuDeviceSetGraphMemAttribute') + {{endif}} + {{if 'cuGraphClone' in found_functions}} + global __cuGraphClone + __cuGraphClone = windll.GetProcAddress(handle, 'cuGraphClone') + {{endif}} + {{if 'cuGraphNodeFindInClone' in found_functions}} + global __cuGraphNodeFindInClone + __cuGraphNodeFindInClone = windll.GetProcAddress(handle, 'cuGraphNodeFindInClone') + {{endif}} + {{if 'cuGraphNodeGetType' in found_functions}} + global __cuGraphNodeGetType + __cuGraphNodeGetType = windll.GetProcAddress(handle, 'cuGraphNodeGetType') + {{endif}} + {{if 'cuGraphGetNodes' in found_functions}} + global __cuGraphGetNodes + __cuGraphGetNodes = windll.GetProcAddress(handle, 'cuGraphGetNodes') + {{endif}} + {{if 'cuGraphGetRootNodes' in found_functions}} + global __cuGraphGetRootNodes + __cuGraphGetRootNodes = windll.GetProcAddress(handle, 'cuGraphGetRootNodes') + {{endif}} + {{if 'cuGraphGetEdges' in found_functions}} + global __cuGraphGetEdges + __cuGraphGetEdges = windll.GetProcAddress(handle, 'cuGraphGetEdges') + {{endif}} + {{if 'cuGraphGetEdges_v2' in found_functions}} + global __cuGraphGetEdges_v2 + __cuGraphGetEdges_v2 = windll.GetProcAddress(handle, 'cuGraphGetEdges_v2') + {{endif}} + {{if 'cuGraphNodeGetDependencies' in found_functions}} + global __cuGraphNodeGetDependencies + __cuGraphNodeGetDependencies = windll.GetProcAddress(handle, 'cuGraphNodeGetDependencies') + {{endif}} + {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} + global __cuGraphNodeGetDependencies_v2 + __cuGraphNodeGetDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphNodeGetDependencies_v2') + {{endif}} + {{if 'cuGraphNodeGetDependentNodes' in found_functions}} + global __cuGraphNodeGetDependentNodes + __cuGraphNodeGetDependentNodes = windll.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes') + {{endif}} + {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} + global __cuGraphNodeGetDependentNodes_v2 + __cuGraphNodeGetDependentNodes_v2 = windll.GetProcAddress(handle, 'cuGraphNodeGetDependentNodes_v2') + {{endif}} + {{if 'cuGraphAddDependencies' in found_functions}} + global __cuGraphAddDependencies + __cuGraphAddDependencies = windll.GetProcAddress(handle, 'cuGraphAddDependencies') + {{endif}} + {{if 'cuGraphAddDependencies_v2' in found_functions}} + global __cuGraphAddDependencies_v2 + __cuGraphAddDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphAddDependencies_v2') + {{endif}} + {{if 'cuGraphRemoveDependencies' in found_functions}} + global __cuGraphRemoveDependencies + __cuGraphRemoveDependencies = windll.GetProcAddress(handle, 'cuGraphRemoveDependencies') + {{endif}} + {{if 'cuGraphRemoveDependencies_v2' in found_functions}} + global __cuGraphRemoveDependencies_v2 + __cuGraphRemoveDependencies_v2 = windll.GetProcAddress(handle, 'cuGraphRemoveDependencies_v2') + {{endif}} + {{if 'cuGraphDestroyNode' in found_functions}} + global __cuGraphDestroyNode + __cuGraphDestroyNode = windll.GetProcAddress(handle, 'cuGraphDestroyNode') + {{endif}} + {{if 'cuGraphInstantiateWithFlags' in found_functions}} + global __cuGraphInstantiateWithFlags + __cuGraphInstantiateWithFlags = windll.GetProcAddress(handle, 'cuGraphInstantiateWithFlags') + {{endif}} + {{if 'cuGraphExecGetFlags' in found_functions}} + global __cuGraphExecGetFlags + __cuGraphExecGetFlags = windll.GetProcAddress(handle, 'cuGraphExecGetFlags') + {{endif}} + {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} + global __cuGraphExecKernelNodeSetParams_v2 + __cuGraphExecKernelNodeSetParams_v2 = windll.GetProcAddress(handle, 'cuGraphExecKernelNodeSetParams_v2') + {{endif}} + {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} + global __cuGraphExecMemcpyNodeSetParams + __cuGraphExecMemcpyNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecMemcpyNodeSetParams') + {{endif}} + {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} + global __cuGraphExecMemsetNodeSetParams + __cuGraphExecMemsetNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecMemsetNodeSetParams') + {{endif}} + {{if 'cuGraphExecHostNodeSetParams' in found_functions}} + global __cuGraphExecHostNodeSetParams + __cuGraphExecHostNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecHostNodeSetParams') + {{endif}} + {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} + global __cuGraphExecChildGraphNodeSetParams + __cuGraphExecChildGraphNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecChildGraphNodeSetParams') + {{endif}} + {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} + global __cuGraphExecEventRecordNodeSetEvent + __cuGraphExecEventRecordNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphExecEventRecordNodeSetEvent') + {{endif}} + {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} + global __cuGraphExecEventWaitNodeSetEvent + __cuGraphExecEventWaitNodeSetEvent = windll.GetProcAddress(handle, 'cuGraphExecEventWaitNodeSetEvent') + {{endif}} + {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + __cuGraphExecExternalSemaphoresSignalNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') + {{endif}} + {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + __cuGraphExecExternalSemaphoresWaitNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') + {{endif}} + {{if 'cuGraphNodeSetEnabled' in found_functions}} + global __cuGraphNodeSetEnabled + __cuGraphNodeSetEnabled = windll.GetProcAddress(handle, 'cuGraphNodeSetEnabled') + {{endif}} + {{if 'cuGraphNodeGetEnabled' in found_functions}} + global __cuGraphNodeGetEnabled + __cuGraphNodeGetEnabled = windll.GetProcAddress(handle, 'cuGraphNodeGetEnabled') + {{endif}} + {{if 'cuGraphExecDestroy' in found_functions}} + global __cuGraphExecDestroy + __cuGraphExecDestroy = windll.GetProcAddress(handle, 'cuGraphExecDestroy') + {{endif}} + {{if 'cuGraphDestroy' in found_functions}} + global __cuGraphDestroy + __cuGraphDestroy = windll.GetProcAddress(handle, 'cuGraphDestroy') + {{endif}} + {{if 'cuGraphExecUpdate_v2' in found_functions}} + global __cuGraphExecUpdate_v2 + __cuGraphExecUpdate_v2 = windll.GetProcAddress(handle, 'cuGraphExecUpdate_v2') + {{endif}} + {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} + global __cuGraphKernelNodeCopyAttributes + __cuGraphKernelNodeCopyAttributes = windll.GetProcAddress(handle, 'cuGraphKernelNodeCopyAttributes') + {{endif}} + {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} + global __cuGraphKernelNodeGetAttribute + __cuGraphKernelNodeGetAttribute = windll.GetProcAddress(handle, 'cuGraphKernelNodeGetAttribute') + {{endif}} + {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} + global __cuGraphKernelNodeSetAttribute + __cuGraphKernelNodeSetAttribute = windll.GetProcAddress(handle, 'cuGraphKernelNodeSetAttribute') + {{endif}} + {{if 'cuGraphDebugDotPrint' in found_functions}} + global __cuGraphDebugDotPrint + __cuGraphDebugDotPrint = windll.GetProcAddress(handle, 'cuGraphDebugDotPrint') + {{endif}} + {{if 'cuUserObjectCreate' in found_functions}} + global __cuUserObjectCreate + __cuUserObjectCreate = windll.GetProcAddress(handle, 'cuUserObjectCreate') + {{endif}} + {{if 'cuUserObjectRetain' in found_functions}} + global __cuUserObjectRetain + __cuUserObjectRetain = windll.GetProcAddress(handle, 'cuUserObjectRetain') + {{endif}} + {{if 'cuUserObjectRelease' in found_functions}} + global __cuUserObjectRelease + __cuUserObjectRelease = windll.GetProcAddress(handle, 'cuUserObjectRelease') + {{endif}} + {{if 'cuGraphRetainUserObject' in found_functions}} + global __cuGraphRetainUserObject + __cuGraphRetainUserObject = windll.GetProcAddress(handle, 'cuGraphRetainUserObject') + {{endif}} + {{if 'cuGraphReleaseUserObject' in found_functions}} + global __cuGraphReleaseUserObject + __cuGraphReleaseUserObject = windll.GetProcAddress(handle, 'cuGraphReleaseUserObject') + {{endif}} + {{if 'cuGraphAddNode' in found_functions}} + global __cuGraphAddNode + __cuGraphAddNode = windll.GetProcAddress(handle, 'cuGraphAddNode') + {{endif}} + {{if 'cuGraphAddNode_v2' in found_functions}} + global __cuGraphAddNode_v2 + __cuGraphAddNode_v2 = windll.GetProcAddress(handle, 'cuGraphAddNode_v2') + {{endif}} + {{if 'cuGraphNodeSetParams' in found_functions}} + global __cuGraphNodeSetParams + __cuGraphNodeSetParams = windll.GetProcAddress(handle, 'cuGraphNodeSetParams') + {{endif}} + {{if 'cuGraphExecNodeSetParams' in found_functions}} + global __cuGraphExecNodeSetParams + __cuGraphExecNodeSetParams = windll.GetProcAddress(handle, 'cuGraphExecNodeSetParams') + {{endif}} + {{if 'cuGraphConditionalHandleCreate' in found_functions}} + global __cuGraphConditionalHandleCreate + __cuGraphConditionalHandleCreate = windll.GetProcAddress(handle, 'cuGraphConditionalHandleCreate') + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + __cuOccupancyMaxActiveBlocksPerMultiprocessor = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} + global __cuOccupancyMaxPotentialBlockSize + __cuOccupancyMaxPotentialBlockSize = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSize') + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} + global __cuOccupancyMaxPotentialBlockSizeWithFlags + __cuOccupancyMaxPotentialBlockSizeWithFlags = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') + {{endif}} + {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + global __cuOccupancyAvailableDynamicSMemPerBlock + __cuOccupancyAvailableDynamicSMemPerBlock = windll.GetProcAddress(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') + {{endif}} + {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} + global __cuOccupancyMaxPotentialClusterSize + __cuOccupancyMaxPotentialClusterSize = windll.GetProcAddress(handle, 'cuOccupancyMaxPotentialClusterSize') + {{endif}} + {{if 'cuOccupancyMaxActiveClusters' in found_functions}} + global __cuOccupancyMaxActiveClusters + __cuOccupancyMaxActiveClusters = windll.GetProcAddress(handle, 'cuOccupancyMaxActiveClusters') + {{endif}} + {{if 'cuTexRefSetArray' in found_functions}} + global __cuTexRefSetArray + __cuTexRefSetArray = windll.GetProcAddress(handle, 'cuTexRefSetArray') + {{endif}} + {{if 'cuTexRefSetMipmappedArray' in found_functions}} + global __cuTexRefSetMipmappedArray + __cuTexRefSetMipmappedArray = windll.GetProcAddress(handle, 'cuTexRefSetMipmappedArray') + {{endif}} + {{if 'cuTexRefSetAddress_v2' in found_functions}} + global __cuTexRefSetAddress_v2 + __cuTexRefSetAddress_v2 = windll.GetProcAddress(handle, 'cuTexRefSetAddress_v2') + {{endif}} + {{if 'cuTexRefSetAddress2D_v3' in found_functions}} + global __cuTexRefSetAddress2D_v3 + __cuTexRefSetAddress2D_v3 = windll.GetProcAddress(handle, 'cuTexRefSetAddress2D_v3') + {{endif}} + {{if 'cuTexRefSetFormat' in found_functions}} + global __cuTexRefSetFormat + __cuTexRefSetFormat = windll.GetProcAddress(handle, 'cuTexRefSetFormat') + {{endif}} + {{if 'cuTexRefSetAddressMode' in found_functions}} + global __cuTexRefSetAddressMode + __cuTexRefSetAddressMode = windll.GetProcAddress(handle, 'cuTexRefSetAddressMode') + {{endif}} + {{if 'cuTexRefSetFilterMode' in found_functions}} + global __cuTexRefSetFilterMode + __cuTexRefSetFilterMode = windll.GetProcAddress(handle, 'cuTexRefSetFilterMode') + {{endif}} + {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} + global __cuTexRefSetMipmapFilterMode + __cuTexRefSetMipmapFilterMode = windll.GetProcAddress(handle, 'cuTexRefSetMipmapFilterMode') + {{endif}} + {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} + global __cuTexRefSetMipmapLevelBias + __cuTexRefSetMipmapLevelBias = windll.GetProcAddress(handle, 'cuTexRefSetMipmapLevelBias') + {{endif}} + {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} + global __cuTexRefSetMipmapLevelClamp + __cuTexRefSetMipmapLevelClamp = windll.GetProcAddress(handle, 'cuTexRefSetMipmapLevelClamp') + {{endif}} + {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} + global __cuTexRefSetMaxAnisotropy + __cuTexRefSetMaxAnisotropy = windll.GetProcAddress(handle, 'cuTexRefSetMaxAnisotropy') + {{endif}} + {{if 'cuTexRefSetBorderColor' in found_functions}} + global __cuTexRefSetBorderColor + __cuTexRefSetBorderColor = windll.GetProcAddress(handle, 'cuTexRefSetBorderColor') + {{endif}} + {{if 'cuTexRefSetFlags' in found_functions}} + global __cuTexRefSetFlags + __cuTexRefSetFlags = windll.GetProcAddress(handle, 'cuTexRefSetFlags') + {{endif}} + {{if 'cuTexRefGetAddress_v2' in found_functions}} + global __cuTexRefGetAddress_v2 + __cuTexRefGetAddress_v2 = windll.GetProcAddress(handle, 'cuTexRefGetAddress_v2') + {{endif}} + {{if 'cuTexRefGetArray' in found_functions}} + global __cuTexRefGetArray + __cuTexRefGetArray = windll.GetProcAddress(handle, 'cuTexRefGetArray') + {{endif}} + {{if 'cuTexRefGetMipmappedArray' in found_functions}} + global __cuTexRefGetMipmappedArray + __cuTexRefGetMipmappedArray = windll.GetProcAddress(handle, 'cuTexRefGetMipmappedArray') + {{endif}} + {{if 'cuTexRefGetAddressMode' in found_functions}} + global __cuTexRefGetAddressMode + __cuTexRefGetAddressMode = windll.GetProcAddress(handle, 'cuTexRefGetAddressMode') + {{endif}} + {{if 'cuTexRefGetFilterMode' in found_functions}} + global __cuTexRefGetFilterMode + __cuTexRefGetFilterMode = windll.GetProcAddress(handle, 'cuTexRefGetFilterMode') + {{endif}} + {{if 'cuTexRefGetFormat' in found_functions}} + global __cuTexRefGetFormat + __cuTexRefGetFormat = windll.GetProcAddress(handle, 'cuTexRefGetFormat') + {{endif}} + {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} + global __cuTexRefGetMipmapFilterMode + __cuTexRefGetMipmapFilterMode = windll.GetProcAddress(handle, 'cuTexRefGetMipmapFilterMode') + {{endif}} + {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} + global __cuTexRefGetMipmapLevelBias + __cuTexRefGetMipmapLevelBias = windll.GetProcAddress(handle, 'cuTexRefGetMipmapLevelBias') + {{endif}} + {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} + global __cuTexRefGetMipmapLevelClamp + __cuTexRefGetMipmapLevelClamp = windll.GetProcAddress(handle, 'cuTexRefGetMipmapLevelClamp') + {{endif}} + {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} + global __cuTexRefGetMaxAnisotropy + __cuTexRefGetMaxAnisotropy = windll.GetProcAddress(handle, 'cuTexRefGetMaxAnisotropy') + {{endif}} + {{if 'cuTexRefGetBorderColor' in found_functions}} + global __cuTexRefGetBorderColor + __cuTexRefGetBorderColor = windll.GetProcAddress(handle, 'cuTexRefGetBorderColor') + {{endif}} + {{if 'cuTexRefGetFlags' in found_functions}} + global __cuTexRefGetFlags + __cuTexRefGetFlags = windll.GetProcAddress(handle, 'cuTexRefGetFlags') + {{endif}} + {{if 'cuTexRefCreate' in found_functions}} + global __cuTexRefCreate + __cuTexRefCreate = windll.GetProcAddress(handle, 'cuTexRefCreate') + {{endif}} + {{if 'cuTexRefDestroy' in found_functions}} + global __cuTexRefDestroy + __cuTexRefDestroy = windll.GetProcAddress(handle, 'cuTexRefDestroy') + {{endif}} + {{if 'cuSurfRefSetArray' in found_functions}} + global __cuSurfRefSetArray + __cuSurfRefSetArray = windll.GetProcAddress(handle, 'cuSurfRefSetArray') + {{endif}} + {{if 'cuSurfRefGetArray' in found_functions}} + global __cuSurfRefGetArray + __cuSurfRefGetArray = windll.GetProcAddress(handle, 'cuSurfRefGetArray') + {{endif}} + {{if 'cuTexObjectCreate' in found_functions}} + global __cuTexObjectCreate + __cuTexObjectCreate = windll.GetProcAddress(handle, 'cuTexObjectCreate') + {{endif}} + {{if 'cuTexObjectDestroy' in found_functions}} + global __cuTexObjectDestroy + __cuTexObjectDestroy = windll.GetProcAddress(handle, 'cuTexObjectDestroy') + {{endif}} + {{if 'cuTexObjectGetResourceDesc' in found_functions}} + global __cuTexObjectGetResourceDesc + __cuTexObjectGetResourceDesc = windll.GetProcAddress(handle, 'cuTexObjectGetResourceDesc') + {{endif}} + {{if 'cuTexObjectGetTextureDesc' in found_functions}} + global __cuTexObjectGetTextureDesc + __cuTexObjectGetTextureDesc = windll.GetProcAddress(handle, 'cuTexObjectGetTextureDesc') + {{endif}} + {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} + global __cuTexObjectGetResourceViewDesc + __cuTexObjectGetResourceViewDesc = windll.GetProcAddress(handle, 'cuTexObjectGetResourceViewDesc') + {{endif}} + {{if 'cuSurfObjectCreate' in found_functions}} + global __cuSurfObjectCreate + __cuSurfObjectCreate = windll.GetProcAddress(handle, 'cuSurfObjectCreate') + {{endif}} + {{if 'cuSurfObjectDestroy' in found_functions}} + global __cuSurfObjectDestroy + __cuSurfObjectDestroy = windll.GetProcAddress(handle, 'cuSurfObjectDestroy') + {{endif}} + {{if 'cuSurfObjectGetResourceDesc' in found_functions}} + global __cuSurfObjectGetResourceDesc + __cuSurfObjectGetResourceDesc = windll.GetProcAddress(handle, 'cuSurfObjectGetResourceDesc') + {{endif}} + {{if 'cuTensorMapEncodeTiled' in found_functions}} + global __cuTensorMapEncodeTiled + __cuTensorMapEncodeTiled = windll.GetProcAddress(handle, 'cuTensorMapEncodeTiled') + {{endif}} + {{if 'cuTensorMapEncodeIm2col' in found_functions}} + global __cuTensorMapEncodeIm2col + __cuTensorMapEncodeIm2col = windll.GetProcAddress(handle, 'cuTensorMapEncodeIm2col') + {{endif}} + {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} + global __cuTensorMapEncodeIm2colWide + __cuTensorMapEncodeIm2colWide = windll.GetProcAddress(handle, 'cuTensorMapEncodeIm2colWide') + {{endif}} + {{if 'cuTensorMapReplaceAddress' in found_functions}} + global __cuTensorMapReplaceAddress + __cuTensorMapReplaceAddress = windll.GetProcAddress(handle, 'cuTensorMapReplaceAddress') + {{endif}} + {{if 'cuDeviceCanAccessPeer' in found_functions}} + global __cuDeviceCanAccessPeer + __cuDeviceCanAccessPeer = windll.GetProcAddress(handle, 'cuDeviceCanAccessPeer') + {{endif}} + {{if 'cuCtxEnablePeerAccess' in found_functions}} + global __cuCtxEnablePeerAccess + __cuCtxEnablePeerAccess = windll.GetProcAddress(handle, 'cuCtxEnablePeerAccess') + {{endif}} + {{if 'cuCtxDisablePeerAccess' in found_functions}} + global __cuCtxDisablePeerAccess + __cuCtxDisablePeerAccess = windll.GetProcAddress(handle, 'cuCtxDisablePeerAccess') + {{endif}} + {{if 'cuDeviceGetP2PAttribute' in found_functions}} + global __cuDeviceGetP2PAttribute + __cuDeviceGetP2PAttribute = windll.GetProcAddress(handle, 'cuDeviceGetP2PAttribute') + {{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} + global __cuGraphicsUnregisterResource + __cuGraphicsUnregisterResource = windll.GetProcAddress(handle, 'cuGraphicsUnregisterResource') + {{endif}} + {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} + global __cuGraphicsSubResourceGetMappedArray + __cuGraphicsSubResourceGetMappedArray = windll.GetProcAddress(handle, 'cuGraphicsSubResourceGetMappedArray') + {{endif}} + {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} + global __cuGraphicsResourceGetMappedMipmappedArray + __cuGraphicsResourceGetMappedMipmappedArray = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedMipmappedArray') + {{endif}} + {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} + global __cuGraphicsResourceGetMappedPointer_v2 + __cuGraphicsResourceGetMappedPointer_v2 = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedPointer_v2') + {{endif}} + {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} + global __cuGraphicsResourceSetMapFlags_v2 + __cuGraphicsResourceSetMapFlags_v2 = windll.GetProcAddress(handle, 'cuGraphicsResourceSetMapFlags_v2') + {{endif}} + {{if 'cuGetProcAddress_v2' in found_functions}} + global __cuGetProcAddress_v2 + __cuGetProcAddress_v2 = windll.GetProcAddress(handle, 'cuGetProcAddress_v2') + {{endif}} + {{if 'cuCoredumpGetAttribute' in found_functions}} + global __cuCoredumpGetAttribute + __cuCoredumpGetAttribute = windll.GetProcAddress(handle, 'cuCoredumpGetAttribute') + {{endif}} + {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} + global __cuCoredumpGetAttributeGlobal + __cuCoredumpGetAttributeGlobal = windll.GetProcAddress(handle, 'cuCoredumpGetAttributeGlobal') + {{endif}} + {{if 'cuCoredumpSetAttribute' in found_functions}} + global __cuCoredumpSetAttribute + __cuCoredumpSetAttribute = windll.GetProcAddress(handle, 'cuCoredumpSetAttribute') + {{endif}} + {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} + global __cuCoredumpSetAttributeGlobal + __cuCoredumpSetAttributeGlobal = windll.GetProcAddress(handle, 'cuCoredumpSetAttributeGlobal') + {{endif}} + {{if 'cuGetExportTable' in found_functions}} + global __cuGetExportTable + __cuGetExportTable = windll.GetProcAddress(handle, 'cuGetExportTable') + {{endif}} + {{if 'cuGreenCtxCreate' in found_functions}} + global __cuGreenCtxCreate + __cuGreenCtxCreate = windll.GetProcAddress(handle, 'cuGreenCtxCreate') + {{endif}} + {{if 'cuGreenCtxDestroy' in found_functions}} + global __cuGreenCtxDestroy + __cuGreenCtxDestroy = windll.GetProcAddress(handle, 'cuGreenCtxDestroy') + {{endif}} + {{if 'cuCtxFromGreenCtx' in found_functions}} + global __cuCtxFromGreenCtx + __cuCtxFromGreenCtx = windll.GetProcAddress(handle, 'cuCtxFromGreenCtx') + {{endif}} + {{if 'cuDeviceGetDevResource' in found_functions}} + global __cuDeviceGetDevResource + __cuDeviceGetDevResource = windll.GetProcAddress(handle, 'cuDeviceGetDevResource') + {{endif}} + {{if 'cuCtxGetDevResource' in found_functions}} + global __cuCtxGetDevResource + __cuCtxGetDevResource = windll.GetProcAddress(handle, 'cuCtxGetDevResource') + {{endif}} + {{if 'cuGreenCtxGetDevResource' in found_functions}} + global __cuGreenCtxGetDevResource + __cuGreenCtxGetDevResource = windll.GetProcAddress(handle, 'cuGreenCtxGetDevResource') + {{endif}} + {{if 'cuDevSmResourceSplitByCount' in found_functions}} + global __cuDevSmResourceSplitByCount + __cuDevSmResourceSplitByCount = windll.GetProcAddress(handle, 'cuDevSmResourceSplitByCount') + {{endif}} + {{if 'cuDevResourceGenerateDesc' in found_functions}} + global __cuDevResourceGenerateDesc + __cuDevResourceGenerateDesc = windll.GetProcAddress(handle, 'cuDevResourceGenerateDesc') + {{endif}} + {{if 'cuGreenCtxRecordEvent' in found_functions}} + global __cuGreenCtxRecordEvent + __cuGreenCtxRecordEvent = windll.GetProcAddress(handle, 'cuGreenCtxRecordEvent') + {{endif}} + {{if 'cuGreenCtxWaitEvent' in found_functions}} + global __cuGreenCtxWaitEvent + __cuGreenCtxWaitEvent = windll.GetProcAddress(handle, 'cuGreenCtxWaitEvent') + {{endif}} + {{if 'cuStreamGetGreenCtx' in found_functions}} + global __cuStreamGetGreenCtx + __cuStreamGetGreenCtx = windll.GetProcAddress(handle, 'cuStreamGetGreenCtx') + {{endif}} + {{if 'cuGreenCtxStreamCreate' in found_functions}} + global __cuGreenCtxStreamCreate + __cuGreenCtxStreamCreate = windll.GetProcAddress(handle, 'cuGreenCtxStreamCreate') + {{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} + global __cuLogsRegisterCallback + __cuLogsRegisterCallback = windll.GetProcAddress(handle, 'cuLogsRegisterCallback') + {{endif}} + {{if 'cuLogsUnregisterCallback' in found_functions}} + global __cuLogsUnregisterCallback + __cuLogsUnregisterCallback = windll.GetProcAddress(handle, 'cuLogsUnregisterCallback') + {{endif}} + {{if 'cuLogsCurrent' in found_functions}} + global __cuLogsCurrent + __cuLogsCurrent = windll.GetProcAddress(handle, 'cuLogsCurrent') + {{endif}} + {{if 'cuLogsDumpToFile' in found_functions}} + global __cuLogsDumpToFile + __cuLogsDumpToFile = windll.GetProcAddress(handle, 'cuLogsDumpToFile') + {{endif}} + {{if 'cuLogsDumpToMemory' in found_functions}} + global __cuLogsDumpToMemory + __cuLogsDumpToMemory = windll.GetProcAddress(handle, 'cuLogsDumpToMemory') + {{endif}} + {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} + global __cuCheckpointProcessGetRestoreThreadId + __cuCheckpointProcessGetRestoreThreadId = windll.GetProcAddress(handle, 'cuCheckpointProcessGetRestoreThreadId') + {{endif}} + {{if 'cuCheckpointProcessGetState' in found_functions}} + global __cuCheckpointProcessGetState + __cuCheckpointProcessGetState = windll.GetProcAddress(handle, 'cuCheckpointProcessGetState') + {{endif}} + {{if 'cuCheckpointProcessLock' in found_functions}} + global __cuCheckpointProcessLock + __cuCheckpointProcessLock = windll.GetProcAddress(handle, 'cuCheckpointProcessLock') + {{endif}} + {{if 'cuCheckpointProcessCheckpoint' in found_functions}} + global __cuCheckpointProcessCheckpoint + __cuCheckpointProcessCheckpoint = windll.GetProcAddress(handle, 'cuCheckpointProcessCheckpoint') + {{endif}} + {{if 'cuCheckpointProcessRestore' in found_functions}} + global __cuCheckpointProcessRestore + __cuCheckpointProcessRestore = windll.GetProcAddress(handle, 'cuCheckpointProcessRestore') + {{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} + global __cuCheckpointProcessUnlock + __cuCheckpointProcessUnlock = windll.GetProcAddress(handle, 'cuCheckpointProcessUnlock') + {{endif}} + {{if 'cuProfilerStart' in found_functions}} + global __cuProfilerStart + __cuProfilerStart = windll.GetProcAddress(handle, 'cuProfilerStart') + {{endif}} + {{if 'cuProfilerStop' in found_functions}} + global __cuProfilerStop + __cuProfilerStop = windll.GetProcAddress(handle, 'cuProfilerStop') + {{endif}} + {{if True}} + global __cuGraphicsEGLRegisterImage + __cuGraphicsEGLRegisterImage = windll.GetProcAddress(handle, 'cuGraphicsEGLRegisterImage') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnect + __cuEGLStreamConsumerConnect = windll.GetProcAddress(handle, 'cuEGLStreamConsumerConnect') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnectWithFlags + __cuEGLStreamConsumerConnectWithFlags = windll.GetProcAddress(handle, 'cuEGLStreamConsumerConnectWithFlags') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerDisconnect + __cuEGLStreamConsumerDisconnect = windll.GetProcAddress(handle, 'cuEGLStreamConsumerDisconnect') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerAcquireFrame + __cuEGLStreamConsumerAcquireFrame = windll.GetProcAddress(handle, 'cuEGLStreamConsumerAcquireFrame') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerReleaseFrame + __cuEGLStreamConsumerReleaseFrame = windll.GetProcAddress(handle, 'cuEGLStreamConsumerReleaseFrame') + {{endif}} + {{if True}} + global __cuEGLStreamProducerConnect + __cuEGLStreamProducerConnect = windll.GetProcAddress(handle, 'cuEGLStreamProducerConnect') + {{endif}} + {{if True}} + global __cuEGLStreamProducerDisconnect + __cuEGLStreamProducerDisconnect = windll.GetProcAddress(handle, 'cuEGLStreamProducerDisconnect') + {{endif}} + {{if True}} + global __cuEGLStreamProducerPresentFrame + __cuEGLStreamProducerPresentFrame = windll.GetProcAddress(handle, 'cuEGLStreamProducerPresentFrame') + {{endif}} + {{if True}} + global __cuEGLStreamProducerReturnFrame + __cuEGLStreamProducerReturnFrame = windll.GetProcAddress(handle, 'cuEGLStreamProducerReturnFrame') + {{endif}} + {{if True}} + global __cuGraphicsResourceGetMappedEglFrame + __cuGraphicsResourceGetMappedEglFrame = windll.GetProcAddress(handle, 'cuGraphicsResourceGetMappedEglFrame') + {{endif}} + {{if True}} + global __cuEventCreateFromEGLSync + __cuEventCreateFromEGLSync = windll.GetProcAddress(handle, 'cuEventCreateFromEGLSync') + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterBuffer + __cuGraphicsGLRegisterBuffer = windll.GetProcAddress(handle, 'cuGraphicsGLRegisterBuffer') + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterImage + __cuGraphicsGLRegisterImage = windll.GetProcAddress(handle, 'cuGraphicsGLRegisterImage') + {{endif}} + {{if True}} + global __cuGLGetDevices_v2 + __cuGLGetDevices_v2 = windll.GetProcAddress(handle, 'cuGLGetDevices_v2') + {{endif}} + {{if True}} + global __cuVDPAUGetDevice + __cuVDPAUGetDevice = windll.GetProcAddress(handle, 'cuVDPAUGetDevice') + {{endif}} + {{if True}} + global __cuVDPAUCtxCreate_v2 + __cuVDPAUCtxCreate_v2 = windll.GetProcAddress(handle, 'cuVDPAUCtxCreate_v2') + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterVideoSurface + __cuGraphicsVDPAURegisterVideoSurface = windll.GetProcAddress(handle, 'cuGraphicsVDPAURegisterVideoSurface') + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterOutputSurface + __cuGraphicsVDPAURegisterOutputSurface = windll.GetProcAddress(handle, 'cuGraphicsVDPAURegisterOutputSurface') + {{endif}} + {{else}} + # Load using dlsym + if usePTDS: + # Get all PTDS version of functions + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy_ptds') + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer_ptds') + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2_ptds') + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2_ptds') + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2_ptds') + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2_ptds') + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2_ptds') + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2_ptds') + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer_ptds') + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync_ptsz') + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync_ptsz') + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2_ptsz') + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync_ptsz') + {{endif}} + {{if 'cuMemcpyBatchAsync' in found_functions}} + global __cuMemcpyBatchAsync + __cuMemcpyBatchAsync = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync_ptsz') + {{endif}} + {{if 'cuMemcpy3DBatchAsync' in found_functions}} + global __cuMemcpy3DBatchAsync + __cuMemcpy3DBatchAsync = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync_ptsz') + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2_ptds') + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2_ptds') + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2_ptds') + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2_ptds') + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async_ptsz') + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async_ptsz') + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async_ptsz') + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async_ptsz') + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync_ptsz') + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync_ptsz') + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync_ptsz') + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync_ptsz') + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync_ptsz') + {{endif}} + {{if 'cuMemPrefetchAsync' in found_functions}} + global __cuMemPrefetchAsync + __cuMemPrefetchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_ptsz') + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2_ptsz') + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority_ptsz') + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice_ptsz') + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags_ptsz') + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId_ptsz') + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx_ptsz') + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2_ptsz') + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent_ptsz') + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback_ptsz') + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2_ptsz') + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph_ptsz') + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture_ptsz') + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing_ptsz') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} + global __cuStreamGetCaptureInfo_v2 + __cuStreamGetCaptureInfo_v2 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v2_ptsz') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3_ptsz') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} + global __cuStreamUpdateCaptureDependencies + __cuStreamUpdateCaptureDependencies = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_ptsz') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2_ptsz') + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync_ptsz') + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery_ptsz') + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize_ptsz') + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes_ptsz') + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute_ptsz') + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute_ptsz') + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord_ptsz') + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags_ptsz') + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync_ptsz') + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync_ptsz') + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2_ptsz') + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2_ptsz') + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2_ptsz') + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2_ptsz') + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2_ptsz') + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel_ptsz') + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx_ptsz') + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel_ptsz') + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc_ptsz') + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams_ptsz') + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload_ptsz') + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch_ptsz') + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources_ptsz') + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources_ptsz') + {{endif}} + else: + # Else get the regular version + pass + {{if 'cuMemcpy' in found_functions}} + global __cuMemcpy + __cuMemcpy = dlfcn.dlsym(handle, 'cuMemcpy') + {{endif}} + {{if 'cuMemcpyPeer' in found_functions}} + global __cuMemcpyPeer + __cuMemcpyPeer = dlfcn.dlsym(handle, 'cuMemcpyPeer') + {{endif}} + {{if 'cuMemcpyHtoD_v2' in found_functions}} + global __cuMemcpyHtoD_v2 + __cuMemcpyHtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoD_v2') + {{endif}} + {{if 'cuMemcpyDtoH_v2' in found_functions}} + global __cuMemcpyDtoH_v2 + __cuMemcpyDtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoH_v2') + {{endif}} + {{if 'cuMemcpyDtoD_v2' in found_functions}} + global __cuMemcpyDtoD_v2 + __cuMemcpyDtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoD_v2') + {{endif}} + {{if 'cuMemcpyDtoA_v2' in found_functions}} + global __cuMemcpyDtoA_v2 + __cuMemcpyDtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoA_v2') + {{endif}} + {{if 'cuMemcpyAtoD_v2' in found_functions}} + global __cuMemcpyAtoD_v2 + __cuMemcpyAtoD_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoD_v2') + {{endif}} + {{if 'cuMemcpyHtoA_v2' in found_functions}} + global __cuMemcpyHtoA_v2 + __cuMemcpyHtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoA_v2') + {{endif}} + {{if 'cuMemcpyAtoH_v2' in found_functions}} + global __cuMemcpyAtoH_v2 + __cuMemcpyAtoH_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoH_v2') + {{endif}} + {{if 'cuMemcpyAtoA_v2' in found_functions}} + global __cuMemcpyAtoA_v2 + __cuMemcpyAtoA_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoA_v2') + {{endif}} + {{if 'cuMemcpy2D_v2' in found_functions}} + global __cuMemcpy2D_v2 + __cuMemcpy2D_v2 = dlfcn.dlsym(handle, 'cuMemcpy2D_v2') + {{endif}} + {{if 'cuMemcpy2DUnaligned_v2' in found_functions}} + global __cuMemcpy2DUnaligned_v2 + __cuMemcpy2DUnaligned_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DUnaligned_v2') + {{endif}} + {{if 'cuMemcpy3D_v2' in found_functions}} + global __cuMemcpy3D_v2 + __cuMemcpy3D_v2 = dlfcn.dlsym(handle, 'cuMemcpy3D_v2') + {{endif}} + {{if 'cuMemcpy3DPeer' in found_functions}} + global __cuMemcpy3DPeer + __cuMemcpy3DPeer = dlfcn.dlsym(handle, 'cuMemcpy3DPeer') + {{endif}} + {{if 'cuMemcpyAsync' in found_functions}} + global __cuMemcpyAsync + __cuMemcpyAsync = dlfcn.dlsym(handle, 'cuMemcpyAsync') + {{endif}} + {{if 'cuMemcpyPeerAsync' in found_functions}} + global __cuMemcpyPeerAsync + __cuMemcpyPeerAsync = dlfcn.dlsym(handle, 'cuMemcpyPeerAsync') + {{endif}} + {{if 'cuMemcpyHtoDAsync_v2' in found_functions}} + global __cuMemcpyHtoDAsync_v2 + __cuMemcpyHtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoDAsync_v2') + {{endif}} + {{if 'cuMemcpyDtoHAsync_v2' in found_functions}} + global __cuMemcpyDtoHAsync_v2 + __cuMemcpyDtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoHAsync_v2') + {{endif}} + {{if 'cuMemcpyDtoDAsync_v2' in found_functions}} + global __cuMemcpyDtoDAsync_v2 + __cuMemcpyDtoDAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyDtoDAsync_v2') + {{endif}} + {{if 'cuMemcpyHtoAAsync_v2' in found_functions}} + global __cuMemcpyHtoAAsync_v2 + __cuMemcpyHtoAAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyHtoAAsync_v2') + {{endif}} + {{if 'cuMemcpyAtoHAsync_v2' in found_functions}} + global __cuMemcpyAtoHAsync_v2 + __cuMemcpyAtoHAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpyAtoHAsync_v2') + {{endif}} + {{if 'cuMemcpy2DAsync_v2' in found_functions}} + global __cuMemcpy2DAsync_v2 + __cuMemcpy2DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy2DAsync_v2') + {{endif}} + {{if 'cuMemcpy3DAsync_v2' in found_functions}} + global __cuMemcpy3DAsync_v2 + __cuMemcpy3DAsync_v2 = dlfcn.dlsym(handle, 'cuMemcpy3DAsync_v2') + {{endif}} + {{if 'cuMemcpy3DPeerAsync' in found_functions}} + global __cuMemcpy3DPeerAsync + __cuMemcpy3DPeerAsync = dlfcn.dlsym(handle, 'cuMemcpy3DPeerAsync') + {{endif}} + {{if 'cuMemcpyBatchAsync' in found_functions}} + global __cuMemcpyBatchAsync + __cuMemcpyBatchAsync = dlfcn.dlsym(handle, 'cuMemcpyBatchAsync') + {{endif}} + {{if 'cuMemcpy3DBatchAsync' in found_functions}} + global __cuMemcpy3DBatchAsync + __cuMemcpy3DBatchAsync = dlfcn.dlsym(handle, 'cuMemcpy3DBatchAsync') + {{endif}} + {{if 'cuMemsetD8_v2' in found_functions}} + global __cuMemsetD8_v2 + __cuMemsetD8_v2 = dlfcn.dlsym(handle, 'cuMemsetD8_v2') + {{endif}} + {{if 'cuMemsetD16_v2' in found_functions}} + global __cuMemsetD16_v2 + __cuMemsetD16_v2 = dlfcn.dlsym(handle, 'cuMemsetD16_v2') + {{endif}} + {{if 'cuMemsetD32_v2' in found_functions}} + global __cuMemsetD32_v2 + __cuMemsetD32_v2 = dlfcn.dlsym(handle, 'cuMemsetD32_v2') + {{endif}} + {{if 'cuMemsetD2D8_v2' in found_functions}} + global __cuMemsetD2D8_v2 + __cuMemsetD2D8_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D8_v2') + {{endif}} + {{if 'cuMemsetD2D16_v2' in found_functions}} + global __cuMemsetD2D16_v2 + __cuMemsetD2D16_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D16_v2') + {{endif}} + {{if 'cuMemsetD2D32_v2' in found_functions}} + global __cuMemsetD2D32_v2 + __cuMemsetD2D32_v2 = dlfcn.dlsym(handle, 'cuMemsetD2D32_v2') + {{endif}} + {{if 'cuMemsetD8Async' in found_functions}} + global __cuMemsetD8Async + __cuMemsetD8Async = dlfcn.dlsym(handle, 'cuMemsetD8Async') + {{endif}} + {{if 'cuMemsetD16Async' in found_functions}} + global __cuMemsetD16Async + __cuMemsetD16Async = dlfcn.dlsym(handle, 'cuMemsetD16Async') + {{endif}} + {{if 'cuMemsetD32Async' in found_functions}} + global __cuMemsetD32Async + __cuMemsetD32Async = dlfcn.dlsym(handle, 'cuMemsetD32Async') + {{endif}} + {{if 'cuMemsetD2D8Async' in found_functions}} + global __cuMemsetD2D8Async + __cuMemsetD2D8Async = dlfcn.dlsym(handle, 'cuMemsetD2D8Async') + {{endif}} + {{if 'cuMemsetD2D16Async' in found_functions}} + global __cuMemsetD2D16Async + __cuMemsetD2D16Async = dlfcn.dlsym(handle, 'cuMemsetD2D16Async') + {{endif}} + {{if 'cuMemsetD2D32Async' in found_functions}} + global __cuMemsetD2D32Async + __cuMemsetD2D32Async = dlfcn.dlsym(handle, 'cuMemsetD2D32Async') + {{endif}} + {{if 'cuMemBatchDecompressAsync' in found_functions}} + global __cuMemBatchDecompressAsync + __cuMemBatchDecompressAsync = dlfcn.dlsym(handle, 'cuMemBatchDecompressAsync') + {{endif}} + {{if 'cuMemMapArrayAsync' in found_functions}} + global __cuMemMapArrayAsync + __cuMemMapArrayAsync = dlfcn.dlsym(handle, 'cuMemMapArrayAsync') + {{endif}} + {{if 'cuMemFreeAsync' in found_functions}} + global __cuMemFreeAsync + __cuMemFreeAsync = dlfcn.dlsym(handle, 'cuMemFreeAsync') + {{endif}} + {{if 'cuMemAllocAsync' in found_functions}} + global __cuMemAllocAsync + __cuMemAllocAsync = dlfcn.dlsym(handle, 'cuMemAllocAsync') + {{endif}} + {{if 'cuMemAllocFromPoolAsync' in found_functions}} + global __cuMemAllocFromPoolAsync + __cuMemAllocFromPoolAsync = dlfcn.dlsym(handle, 'cuMemAllocFromPoolAsync') + {{endif}} + {{if 'cuMemPrefetchAsync' in found_functions}} + global __cuMemPrefetchAsync + __cuMemPrefetchAsync = dlfcn.dlsym(handle, 'cuMemPrefetchAsync') + {{endif}} + {{if 'cuMemPrefetchAsync_v2' in found_functions}} + global __cuMemPrefetchAsync_v2 + __cuMemPrefetchAsync_v2 = dlfcn.dlsym(handle, 'cuMemPrefetchAsync_v2') + {{endif}} + {{if 'cuStreamGetPriority' in found_functions}} + global __cuStreamGetPriority + __cuStreamGetPriority = dlfcn.dlsym(handle, 'cuStreamGetPriority') + {{endif}} + {{if 'cuStreamGetDevice' in found_functions}} + global __cuStreamGetDevice + __cuStreamGetDevice = dlfcn.dlsym(handle, 'cuStreamGetDevice') + {{endif}} + {{if 'cuStreamGetFlags' in found_functions}} + global __cuStreamGetFlags + __cuStreamGetFlags = dlfcn.dlsym(handle, 'cuStreamGetFlags') + {{endif}} + {{if 'cuStreamGetId' in found_functions}} + global __cuStreamGetId + __cuStreamGetId = dlfcn.dlsym(handle, 'cuStreamGetId') + {{endif}} + {{if 'cuStreamGetCtx' in found_functions}} + global __cuStreamGetCtx + __cuStreamGetCtx = dlfcn.dlsym(handle, 'cuStreamGetCtx') + {{endif}} + {{if 'cuStreamGetCtx_v2' in found_functions}} + global __cuStreamGetCtx_v2 + __cuStreamGetCtx_v2 = dlfcn.dlsym(handle, 'cuStreamGetCtx_v2') + {{endif}} + {{if 'cuStreamWaitEvent' in found_functions}} + global __cuStreamWaitEvent + __cuStreamWaitEvent = dlfcn.dlsym(handle, 'cuStreamWaitEvent') + {{endif}} + {{if 'cuStreamAddCallback' in found_functions}} + global __cuStreamAddCallback + __cuStreamAddCallback = dlfcn.dlsym(handle, 'cuStreamAddCallback') + {{endif}} + {{if 'cuStreamBeginCapture_v2' in found_functions}} + global __cuStreamBeginCapture_v2 + __cuStreamBeginCapture_v2 = dlfcn.dlsym(handle, 'cuStreamBeginCapture_v2') + {{endif}} + {{if 'cuStreamBeginCaptureToGraph' in found_functions}} + global __cuStreamBeginCaptureToGraph + __cuStreamBeginCaptureToGraph = dlfcn.dlsym(handle, 'cuStreamBeginCaptureToGraph') + {{endif}} + {{if 'cuStreamEndCapture' in found_functions}} + global __cuStreamEndCapture + __cuStreamEndCapture = dlfcn.dlsym(handle, 'cuStreamEndCapture') + {{endif}} + {{if 'cuStreamIsCapturing' in found_functions}} + global __cuStreamIsCapturing + __cuStreamIsCapturing = dlfcn.dlsym(handle, 'cuStreamIsCapturing') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v2' in found_functions}} + global __cuStreamGetCaptureInfo_v2 + __cuStreamGetCaptureInfo_v2 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v2') + {{endif}} + {{if 'cuStreamGetCaptureInfo_v3' in found_functions}} + global __cuStreamGetCaptureInfo_v3 + __cuStreamGetCaptureInfo_v3 = dlfcn.dlsym(handle, 'cuStreamGetCaptureInfo_v3') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} + global __cuStreamUpdateCaptureDependencies + __cuStreamUpdateCaptureDependencies = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies') + {{endif}} + {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} + global __cuStreamUpdateCaptureDependencies_v2 + __cuStreamUpdateCaptureDependencies_v2 = dlfcn.dlsym(handle, 'cuStreamUpdateCaptureDependencies_v2') + {{endif}} + {{if 'cuStreamAttachMemAsync' in found_functions}} + global __cuStreamAttachMemAsync + __cuStreamAttachMemAsync = dlfcn.dlsym(handle, 'cuStreamAttachMemAsync') + {{endif}} + {{if 'cuStreamQuery' in found_functions}} + global __cuStreamQuery + __cuStreamQuery = dlfcn.dlsym(handle, 'cuStreamQuery') + {{endif}} + {{if 'cuStreamSynchronize' in found_functions}} + global __cuStreamSynchronize + __cuStreamSynchronize = dlfcn.dlsym(handle, 'cuStreamSynchronize') + {{endif}} + {{if 'cuStreamCopyAttributes' in found_functions}} + global __cuStreamCopyAttributes + __cuStreamCopyAttributes = dlfcn.dlsym(handle, 'cuStreamCopyAttributes') + {{endif}} + {{if 'cuStreamGetAttribute' in found_functions}} + global __cuStreamGetAttribute + __cuStreamGetAttribute = dlfcn.dlsym(handle, 'cuStreamGetAttribute') + {{endif}} + {{if 'cuStreamSetAttribute' in found_functions}} + global __cuStreamSetAttribute + __cuStreamSetAttribute = dlfcn.dlsym(handle, 'cuStreamSetAttribute') + {{endif}} + {{if 'cuEventRecord' in found_functions}} + global __cuEventRecord + __cuEventRecord = dlfcn.dlsym(handle, 'cuEventRecord') + {{endif}} + {{if 'cuEventRecordWithFlags' in found_functions}} + global __cuEventRecordWithFlags + __cuEventRecordWithFlags = dlfcn.dlsym(handle, 'cuEventRecordWithFlags') + {{endif}} + {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} + global __cuSignalExternalSemaphoresAsync + __cuSignalExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuSignalExternalSemaphoresAsync') + {{endif}} + {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} + global __cuWaitExternalSemaphoresAsync + __cuWaitExternalSemaphoresAsync = dlfcn.dlsym(handle, 'cuWaitExternalSemaphoresAsync') + {{endif}} + {{if 'cuStreamWaitValue32_v2' in found_functions}} + global __cuStreamWaitValue32_v2 + __cuStreamWaitValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue32_v2') + {{endif}} + {{if 'cuStreamWaitValue64_v2' in found_functions}} + global __cuStreamWaitValue64_v2 + __cuStreamWaitValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWaitValue64_v2') + {{endif}} + {{if 'cuStreamWriteValue32_v2' in found_functions}} + global __cuStreamWriteValue32_v2 + __cuStreamWriteValue32_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue32_v2') + {{endif}} + {{if 'cuStreamWriteValue64_v2' in found_functions}} + global __cuStreamWriteValue64_v2 + __cuStreamWriteValue64_v2 = dlfcn.dlsym(handle, 'cuStreamWriteValue64_v2') + {{endif}} + {{if 'cuStreamBatchMemOp_v2' in found_functions}} + global __cuStreamBatchMemOp_v2 + __cuStreamBatchMemOp_v2 = dlfcn.dlsym(handle, 'cuStreamBatchMemOp_v2') + {{endif}} + {{if 'cuLaunchKernel' in found_functions}} + global __cuLaunchKernel + __cuLaunchKernel = dlfcn.dlsym(handle, 'cuLaunchKernel') + {{endif}} + {{if 'cuLaunchKernelEx' in found_functions}} + global __cuLaunchKernelEx + __cuLaunchKernelEx = dlfcn.dlsym(handle, 'cuLaunchKernelEx') + {{endif}} + {{if 'cuLaunchCooperativeKernel' in found_functions}} + global __cuLaunchCooperativeKernel + __cuLaunchCooperativeKernel = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernel') + {{endif}} + {{if 'cuLaunchHostFunc' in found_functions}} + global __cuLaunchHostFunc + __cuLaunchHostFunc = dlfcn.dlsym(handle, 'cuLaunchHostFunc') + {{endif}} + {{if 'cuGraphInstantiateWithParams' in found_functions}} + global __cuGraphInstantiateWithParams + __cuGraphInstantiateWithParams = dlfcn.dlsym(handle, 'cuGraphInstantiateWithParams') + {{endif}} + {{if 'cuGraphUpload' in found_functions}} + global __cuGraphUpload + __cuGraphUpload = dlfcn.dlsym(handle, 'cuGraphUpload') + {{endif}} + {{if 'cuGraphLaunch' in found_functions}} + global __cuGraphLaunch + __cuGraphLaunch = dlfcn.dlsym(handle, 'cuGraphLaunch') + {{endif}} + {{if 'cuGraphicsMapResources' in found_functions}} + global __cuGraphicsMapResources + __cuGraphicsMapResources = dlfcn.dlsym(handle, 'cuGraphicsMapResources') + {{endif}} + {{if 'cuGraphicsUnmapResources' in found_functions}} + global __cuGraphicsUnmapResources + __cuGraphicsUnmapResources = dlfcn.dlsym(handle, 'cuGraphicsUnmapResources') + {{endif}} + # Get remaining functions + {{if 'cuGetErrorString' in found_functions}} + global __cuGetErrorString + __cuGetErrorString = dlfcn.dlsym(handle, 'cuGetErrorString') + {{endif}} + {{if 'cuGetErrorName' in found_functions}} + global __cuGetErrorName + __cuGetErrorName = dlfcn.dlsym(handle, 'cuGetErrorName') + {{endif}} + {{if 'cuInit' in found_functions}} + global __cuInit + __cuInit = dlfcn.dlsym(handle, 'cuInit') + {{endif}} + {{if 'cuDriverGetVersion' in found_functions}} + global __cuDriverGetVersion + __cuDriverGetVersion = dlfcn.dlsym(handle, 'cuDriverGetVersion') + {{endif}} + {{if 'cuDeviceGet' in found_functions}} + global __cuDeviceGet + __cuDeviceGet = dlfcn.dlsym(handle, 'cuDeviceGet') + {{endif}} + {{if 'cuDeviceGetCount' in found_functions}} + global __cuDeviceGetCount + __cuDeviceGetCount = dlfcn.dlsym(handle, 'cuDeviceGetCount') + {{endif}} + {{if 'cuDeviceGetName' in found_functions}} + global __cuDeviceGetName + __cuDeviceGetName = dlfcn.dlsym(handle, 'cuDeviceGetName') + {{endif}} + {{if 'cuDeviceGetUuid' in found_functions}} + global __cuDeviceGetUuid + __cuDeviceGetUuid = dlfcn.dlsym(handle, 'cuDeviceGetUuid') + {{endif}} + {{if 'cuDeviceGetUuid_v2' in found_functions}} + global __cuDeviceGetUuid_v2 + __cuDeviceGetUuid_v2 = dlfcn.dlsym(handle, 'cuDeviceGetUuid_v2') + {{endif}} + {{if 'cuDeviceGetLuid' in found_functions}} + global __cuDeviceGetLuid + __cuDeviceGetLuid = dlfcn.dlsym(handle, 'cuDeviceGetLuid') + {{endif}} + {{if 'cuDeviceTotalMem_v2' in found_functions}} + global __cuDeviceTotalMem_v2 + __cuDeviceTotalMem_v2 = dlfcn.dlsym(handle, 'cuDeviceTotalMem_v2') + {{endif}} + {{if 'cuDeviceGetTexture1DLinearMaxWidth' in found_functions}} + global __cuDeviceGetTexture1DLinearMaxWidth + __cuDeviceGetTexture1DLinearMaxWidth = dlfcn.dlsym(handle, 'cuDeviceGetTexture1DLinearMaxWidth') + {{endif}} + {{if 'cuDeviceGetAttribute' in found_functions}} + global __cuDeviceGetAttribute + __cuDeviceGetAttribute = dlfcn.dlsym(handle, 'cuDeviceGetAttribute') + {{endif}} + {{if 'cuDeviceGetNvSciSyncAttributes' in found_functions}} + global __cuDeviceGetNvSciSyncAttributes + __cuDeviceGetNvSciSyncAttributes = dlfcn.dlsym(handle, 'cuDeviceGetNvSciSyncAttributes') + {{endif}} + {{if 'cuDeviceSetMemPool' in found_functions}} + global __cuDeviceSetMemPool + __cuDeviceSetMemPool = dlfcn.dlsym(handle, 'cuDeviceSetMemPool') + {{endif}} + {{if 'cuDeviceGetMemPool' in found_functions}} + global __cuDeviceGetMemPool + __cuDeviceGetMemPool = dlfcn.dlsym(handle, 'cuDeviceGetMemPool') + {{endif}} + {{if 'cuDeviceGetDefaultMemPool' in found_functions}} + global __cuDeviceGetDefaultMemPool + __cuDeviceGetDefaultMemPool = dlfcn.dlsym(handle, 'cuDeviceGetDefaultMemPool') + {{endif}} + {{if 'cuDeviceGetExecAffinitySupport' in found_functions}} + global __cuDeviceGetExecAffinitySupport + __cuDeviceGetExecAffinitySupport = dlfcn.dlsym(handle, 'cuDeviceGetExecAffinitySupport') + {{endif}} + {{if 'cuFlushGPUDirectRDMAWrites' in found_functions}} + global __cuFlushGPUDirectRDMAWrites + __cuFlushGPUDirectRDMAWrites = dlfcn.dlsym(handle, 'cuFlushGPUDirectRDMAWrites') + {{endif}} + {{if 'cuDeviceGetProperties' in found_functions}} + global __cuDeviceGetProperties + __cuDeviceGetProperties = dlfcn.dlsym(handle, 'cuDeviceGetProperties') + {{endif}} + {{if 'cuDeviceComputeCapability' in found_functions}} + global __cuDeviceComputeCapability + __cuDeviceComputeCapability = dlfcn.dlsym(handle, 'cuDeviceComputeCapability') + {{endif}} + {{if 'cuDevicePrimaryCtxRetain' in found_functions}} + global __cuDevicePrimaryCtxRetain + __cuDevicePrimaryCtxRetain = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRetain') + {{endif}} + {{if 'cuDevicePrimaryCtxRelease_v2' in found_functions}} + global __cuDevicePrimaryCtxRelease_v2 + __cuDevicePrimaryCtxRelease_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxRelease_v2') + {{endif}} + {{if 'cuDevicePrimaryCtxSetFlags_v2' in found_functions}} + global __cuDevicePrimaryCtxSetFlags_v2 + __cuDevicePrimaryCtxSetFlags_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxSetFlags_v2') + {{endif}} + {{if 'cuDevicePrimaryCtxGetState' in found_functions}} + global __cuDevicePrimaryCtxGetState + __cuDevicePrimaryCtxGetState = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxGetState') + {{endif}} + {{if 'cuDevicePrimaryCtxReset_v2' in found_functions}} + global __cuDevicePrimaryCtxReset_v2 + __cuDevicePrimaryCtxReset_v2 = dlfcn.dlsym(handle, 'cuDevicePrimaryCtxReset_v2') + {{endif}} + {{if 'cuCtxCreate_v2' in found_functions}} + global __cuCtxCreate_v2 + __cuCtxCreate_v2 = dlfcn.dlsym(handle, 'cuCtxCreate_v2') + {{endif}} + {{if 'cuCtxCreate_v3' in found_functions}} + global __cuCtxCreate_v3 + __cuCtxCreate_v3 = dlfcn.dlsym(handle, 'cuCtxCreate_v3') + {{endif}} + {{if 'cuCtxCreate_v4' in found_functions}} + global __cuCtxCreate_v4 + __cuCtxCreate_v4 = dlfcn.dlsym(handle, 'cuCtxCreate_v4') + {{endif}} + {{if 'cuCtxDestroy_v2' in found_functions}} + global __cuCtxDestroy_v2 + __cuCtxDestroy_v2 = dlfcn.dlsym(handle, 'cuCtxDestroy_v2') + {{endif}} + {{if 'cuCtxPushCurrent_v2' in found_functions}} + global __cuCtxPushCurrent_v2 + __cuCtxPushCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPushCurrent_v2') + {{endif}} + {{if 'cuCtxPopCurrent_v2' in found_functions}} + global __cuCtxPopCurrent_v2 + __cuCtxPopCurrent_v2 = dlfcn.dlsym(handle, 'cuCtxPopCurrent_v2') + {{endif}} + {{if 'cuCtxSetCurrent' in found_functions}} + global __cuCtxSetCurrent + __cuCtxSetCurrent = dlfcn.dlsym(handle, 'cuCtxSetCurrent') + {{endif}} + {{if 'cuCtxGetCurrent' in found_functions}} + global __cuCtxGetCurrent + __cuCtxGetCurrent = dlfcn.dlsym(handle, 'cuCtxGetCurrent') + {{endif}} + {{if 'cuCtxGetDevice' in found_functions}} + global __cuCtxGetDevice + __cuCtxGetDevice = dlfcn.dlsym(handle, 'cuCtxGetDevice') + {{endif}} + {{if 'cuCtxGetFlags' in found_functions}} + global __cuCtxGetFlags + __cuCtxGetFlags = dlfcn.dlsym(handle, 'cuCtxGetFlags') + {{endif}} + {{if 'cuCtxSetFlags' in found_functions}} + global __cuCtxSetFlags + __cuCtxSetFlags = dlfcn.dlsym(handle, 'cuCtxSetFlags') + {{endif}} + {{if 'cuCtxGetId' in found_functions}} + global __cuCtxGetId + __cuCtxGetId = dlfcn.dlsym(handle, 'cuCtxGetId') + {{endif}} + {{if 'cuCtxSynchronize' in found_functions}} + global __cuCtxSynchronize + __cuCtxSynchronize = dlfcn.dlsym(handle, 'cuCtxSynchronize') + {{endif}} + {{if 'cuCtxSetLimit' in found_functions}} + global __cuCtxSetLimit + __cuCtxSetLimit = dlfcn.dlsym(handle, 'cuCtxSetLimit') + {{endif}} + {{if 'cuCtxGetLimit' in found_functions}} + global __cuCtxGetLimit + __cuCtxGetLimit = dlfcn.dlsym(handle, 'cuCtxGetLimit') + {{endif}} + {{if 'cuCtxGetCacheConfig' in found_functions}} + global __cuCtxGetCacheConfig + __cuCtxGetCacheConfig = dlfcn.dlsym(handle, 'cuCtxGetCacheConfig') + {{endif}} + {{if 'cuCtxSetCacheConfig' in found_functions}} + global __cuCtxSetCacheConfig + __cuCtxSetCacheConfig = dlfcn.dlsym(handle, 'cuCtxSetCacheConfig') + {{endif}} + {{if 'cuCtxGetApiVersion' in found_functions}} + global __cuCtxGetApiVersion + __cuCtxGetApiVersion = dlfcn.dlsym(handle, 'cuCtxGetApiVersion') + {{endif}} + {{if 'cuCtxGetStreamPriorityRange' in found_functions}} + global __cuCtxGetStreamPriorityRange + __cuCtxGetStreamPriorityRange = dlfcn.dlsym(handle, 'cuCtxGetStreamPriorityRange') + {{endif}} + {{if 'cuCtxResetPersistingL2Cache' in found_functions}} + global __cuCtxResetPersistingL2Cache + __cuCtxResetPersistingL2Cache = dlfcn.dlsym(handle, 'cuCtxResetPersistingL2Cache') + {{endif}} + {{if 'cuCtxGetExecAffinity' in found_functions}} + global __cuCtxGetExecAffinity + __cuCtxGetExecAffinity = dlfcn.dlsym(handle, 'cuCtxGetExecAffinity') + {{endif}} + {{if 'cuCtxRecordEvent' in found_functions}} + global __cuCtxRecordEvent + __cuCtxRecordEvent = dlfcn.dlsym(handle, 'cuCtxRecordEvent') + {{endif}} + {{if 'cuCtxWaitEvent' in found_functions}} + global __cuCtxWaitEvent + __cuCtxWaitEvent = dlfcn.dlsym(handle, 'cuCtxWaitEvent') + {{endif}} + {{if 'cuCtxAttach' in found_functions}} + global __cuCtxAttach + __cuCtxAttach = dlfcn.dlsym(handle, 'cuCtxAttach') + {{endif}} + {{if 'cuCtxDetach' in found_functions}} + global __cuCtxDetach + __cuCtxDetach = dlfcn.dlsym(handle, 'cuCtxDetach') + {{endif}} + {{if 'cuCtxGetSharedMemConfig' in found_functions}} + global __cuCtxGetSharedMemConfig + __cuCtxGetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxGetSharedMemConfig') + {{endif}} + {{if 'cuCtxSetSharedMemConfig' in found_functions}} + global __cuCtxSetSharedMemConfig + __cuCtxSetSharedMemConfig = dlfcn.dlsym(handle, 'cuCtxSetSharedMemConfig') + {{endif}} + {{if 'cuModuleLoad' in found_functions}} + global __cuModuleLoad + __cuModuleLoad = dlfcn.dlsym(handle, 'cuModuleLoad') + {{endif}} + {{if 'cuModuleLoadData' in found_functions}} + global __cuModuleLoadData + __cuModuleLoadData = dlfcn.dlsym(handle, 'cuModuleLoadData') + {{endif}} + {{if 'cuModuleLoadDataEx' in found_functions}} + global __cuModuleLoadDataEx + __cuModuleLoadDataEx = dlfcn.dlsym(handle, 'cuModuleLoadDataEx') + {{endif}} + {{if 'cuModuleLoadFatBinary' in found_functions}} + global __cuModuleLoadFatBinary + __cuModuleLoadFatBinary = dlfcn.dlsym(handle, 'cuModuleLoadFatBinary') + {{endif}} + {{if 'cuModuleUnload' in found_functions}} + global __cuModuleUnload + __cuModuleUnload = dlfcn.dlsym(handle, 'cuModuleUnload') + {{endif}} + {{if 'cuModuleGetLoadingMode' in found_functions}} + global __cuModuleGetLoadingMode + __cuModuleGetLoadingMode = dlfcn.dlsym(handle, 'cuModuleGetLoadingMode') + {{endif}} + {{if 'cuModuleGetFunction' in found_functions}} + global __cuModuleGetFunction + __cuModuleGetFunction = dlfcn.dlsym(handle, 'cuModuleGetFunction') + {{endif}} + {{if 'cuModuleGetFunctionCount' in found_functions}} + global __cuModuleGetFunctionCount + __cuModuleGetFunctionCount = dlfcn.dlsym(handle, 'cuModuleGetFunctionCount') + {{endif}} + {{if 'cuModuleEnumerateFunctions' in found_functions}} + global __cuModuleEnumerateFunctions + __cuModuleEnumerateFunctions = dlfcn.dlsym(handle, 'cuModuleEnumerateFunctions') + {{endif}} + {{if 'cuModuleGetGlobal_v2' in found_functions}} + global __cuModuleGetGlobal_v2 + __cuModuleGetGlobal_v2 = dlfcn.dlsym(handle, 'cuModuleGetGlobal_v2') + {{endif}} + {{if 'cuLinkCreate_v2' in found_functions}} + global __cuLinkCreate_v2 + __cuLinkCreate_v2 = dlfcn.dlsym(handle, 'cuLinkCreate_v2') + {{endif}} + {{if 'cuLinkAddData_v2' in found_functions}} + global __cuLinkAddData_v2 + __cuLinkAddData_v2 = dlfcn.dlsym(handle, 'cuLinkAddData_v2') + {{endif}} + {{if 'cuLinkAddFile_v2' in found_functions}} + global __cuLinkAddFile_v2 + __cuLinkAddFile_v2 = dlfcn.dlsym(handle, 'cuLinkAddFile_v2') + {{endif}} + {{if 'cuLinkComplete' in found_functions}} + global __cuLinkComplete + __cuLinkComplete = dlfcn.dlsym(handle, 'cuLinkComplete') + {{endif}} + {{if 'cuLinkDestroy' in found_functions}} + global __cuLinkDestroy + __cuLinkDestroy = dlfcn.dlsym(handle, 'cuLinkDestroy') + {{endif}} + {{if 'cuModuleGetTexRef' in found_functions}} + global __cuModuleGetTexRef + __cuModuleGetTexRef = dlfcn.dlsym(handle, 'cuModuleGetTexRef') + {{endif}} + {{if 'cuModuleGetSurfRef' in found_functions}} + global __cuModuleGetSurfRef + __cuModuleGetSurfRef = dlfcn.dlsym(handle, 'cuModuleGetSurfRef') + {{endif}} + {{if 'cuLibraryLoadData' in found_functions}} + global __cuLibraryLoadData + __cuLibraryLoadData = dlfcn.dlsym(handle, 'cuLibraryLoadData') + {{endif}} + {{if 'cuLibraryLoadFromFile' in found_functions}} + global __cuLibraryLoadFromFile + __cuLibraryLoadFromFile = dlfcn.dlsym(handle, 'cuLibraryLoadFromFile') + {{endif}} + {{if 'cuLibraryUnload' in found_functions}} + global __cuLibraryUnload + __cuLibraryUnload = dlfcn.dlsym(handle, 'cuLibraryUnload') + {{endif}} + {{if 'cuLibraryGetKernel' in found_functions}} + global __cuLibraryGetKernel + __cuLibraryGetKernel = dlfcn.dlsym(handle, 'cuLibraryGetKernel') + {{endif}} + {{if 'cuLibraryGetKernelCount' in found_functions}} + global __cuLibraryGetKernelCount + __cuLibraryGetKernelCount = dlfcn.dlsym(handle, 'cuLibraryGetKernelCount') + {{endif}} + {{if 'cuLibraryEnumerateKernels' in found_functions}} + global __cuLibraryEnumerateKernels + __cuLibraryEnumerateKernels = dlfcn.dlsym(handle, 'cuLibraryEnumerateKernels') + {{endif}} + {{if 'cuLibraryGetModule' in found_functions}} + global __cuLibraryGetModule + __cuLibraryGetModule = dlfcn.dlsym(handle, 'cuLibraryGetModule') + {{endif}} + {{if 'cuKernelGetFunction' in found_functions}} + global __cuKernelGetFunction + __cuKernelGetFunction = dlfcn.dlsym(handle, 'cuKernelGetFunction') + {{endif}} + {{if 'cuKernelGetLibrary' in found_functions}} + global __cuKernelGetLibrary + __cuKernelGetLibrary = dlfcn.dlsym(handle, 'cuKernelGetLibrary') + {{endif}} + {{if 'cuLibraryGetGlobal' in found_functions}} + global __cuLibraryGetGlobal + __cuLibraryGetGlobal = dlfcn.dlsym(handle, 'cuLibraryGetGlobal') + {{endif}} + {{if 'cuLibraryGetManaged' in found_functions}} + global __cuLibraryGetManaged + __cuLibraryGetManaged = dlfcn.dlsym(handle, 'cuLibraryGetManaged') + {{endif}} + {{if 'cuLibraryGetUnifiedFunction' in found_functions}} + global __cuLibraryGetUnifiedFunction + __cuLibraryGetUnifiedFunction = dlfcn.dlsym(handle, 'cuLibraryGetUnifiedFunction') + {{endif}} + {{if 'cuKernelGetAttribute' in found_functions}} + global __cuKernelGetAttribute + __cuKernelGetAttribute = dlfcn.dlsym(handle, 'cuKernelGetAttribute') + {{endif}} + {{if 'cuKernelSetAttribute' in found_functions}} + global __cuKernelSetAttribute + __cuKernelSetAttribute = dlfcn.dlsym(handle, 'cuKernelSetAttribute') + {{endif}} + {{if 'cuKernelSetCacheConfig' in found_functions}} + global __cuKernelSetCacheConfig + __cuKernelSetCacheConfig = dlfcn.dlsym(handle, 'cuKernelSetCacheConfig') + {{endif}} + {{if 'cuKernelGetName' in found_functions}} + global __cuKernelGetName + __cuKernelGetName = dlfcn.dlsym(handle, 'cuKernelGetName') + {{endif}} + {{if 'cuKernelGetParamInfo' in found_functions}} + global __cuKernelGetParamInfo + __cuKernelGetParamInfo = dlfcn.dlsym(handle, 'cuKernelGetParamInfo') + {{endif}} + {{if 'cuMemGetInfo_v2' in found_functions}} + global __cuMemGetInfo_v2 + __cuMemGetInfo_v2 = dlfcn.dlsym(handle, 'cuMemGetInfo_v2') + {{endif}} + {{if 'cuMemAlloc_v2' in found_functions}} + global __cuMemAlloc_v2 + __cuMemAlloc_v2 = dlfcn.dlsym(handle, 'cuMemAlloc_v2') + {{endif}} + {{if 'cuMemAllocPitch_v2' in found_functions}} + global __cuMemAllocPitch_v2 + __cuMemAllocPitch_v2 = dlfcn.dlsym(handle, 'cuMemAllocPitch_v2') + {{endif}} + {{if 'cuMemFree_v2' in found_functions}} + global __cuMemFree_v2 + __cuMemFree_v2 = dlfcn.dlsym(handle, 'cuMemFree_v2') + {{endif}} + {{if 'cuMemGetAddressRange_v2' in found_functions}} + global __cuMemGetAddressRange_v2 + __cuMemGetAddressRange_v2 = dlfcn.dlsym(handle, 'cuMemGetAddressRange_v2') + {{endif}} + {{if 'cuMemAllocHost_v2' in found_functions}} + global __cuMemAllocHost_v2 + __cuMemAllocHost_v2 = dlfcn.dlsym(handle, 'cuMemAllocHost_v2') + {{endif}} + {{if 'cuMemFreeHost' in found_functions}} + global __cuMemFreeHost + __cuMemFreeHost = dlfcn.dlsym(handle, 'cuMemFreeHost') + {{endif}} + {{if 'cuMemHostAlloc' in found_functions}} + global __cuMemHostAlloc + __cuMemHostAlloc = dlfcn.dlsym(handle, 'cuMemHostAlloc') + {{endif}} + {{if 'cuMemHostGetDevicePointer_v2' in found_functions}} + global __cuMemHostGetDevicePointer_v2 + __cuMemHostGetDevicePointer_v2 = dlfcn.dlsym(handle, 'cuMemHostGetDevicePointer_v2') + {{endif}} + {{if 'cuMemHostGetFlags' in found_functions}} + global __cuMemHostGetFlags + __cuMemHostGetFlags = dlfcn.dlsym(handle, 'cuMemHostGetFlags') + {{endif}} + {{if 'cuMemAllocManaged' in found_functions}} + global __cuMemAllocManaged + __cuMemAllocManaged = dlfcn.dlsym(handle, 'cuMemAllocManaged') + {{endif}} + {{if 'cuDeviceRegisterAsyncNotification' in found_functions}} + global __cuDeviceRegisterAsyncNotification + __cuDeviceRegisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceRegisterAsyncNotification') + {{endif}} + {{if 'cuDeviceUnregisterAsyncNotification' in found_functions}} + global __cuDeviceUnregisterAsyncNotification + __cuDeviceUnregisterAsyncNotification = dlfcn.dlsym(handle, 'cuDeviceUnregisterAsyncNotification') + {{endif}} + {{if 'cuDeviceGetByPCIBusId' in found_functions}} + global __cuDeviceGetByPCIBusId + __cuDeviceGetByPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetByPCIBusId') + {{endif}} + {{if 'cuDeviceGetPCIBusId' in found_functions}} + global __cuDeviceGetPCIBusId + __cuDeviceGetPCIBusId = dlfcn.dlsym(handle, 'cuDeviceGetPCIBusId') + {{endif}} + {{if 'cuIpcGetEventHandle' in found_functions}} + global __cuIpcGetEventHandle + __cuIpcGetEventHandle = dlfcn.dlsym(handle, 'cuIpcGetEventHandle') + {{endif}} + {{if 'cuIpcOpenEventHandle' in found_functions}} + global __cuIpcOpenEventHandle + __cuIpcOpenEventHandle = dlfcn.dlsym(handle, 'cuIpcOpenEventHandle') + {{endif}} + {{if 'cuIpcGetMemHandle' in found_functions}} + global __cuIpcGetMemHandle + __cuIpcGetMemHandle = dlfcn.dlsym(handle, 'cuIpcGetMemHandle') + {{endif}} + {{if 'cuIpcOpenMemHandle_v2' in found_functions}} + global __cuIpcOpenMemHandle_v2 + __cuIpcOpenMemHandle_v2 = dlfcn.dlsym(handle, 'cuIpcOpenMemHandle_v2') + {{endif}} + {{if 'cuIpcCloseMemHandle' in found_functions}} + global __cuIpcCloseMemHandle + __cuIpcCloseMemHandle = dlfcn.dlsym(handle, 'cuIpcCloseMemHandle') + {{endif}} + {{if 'cuMemHostRegister_v2' in found_functions}} + global __cuMemHostRegister_v2 + __cuMemHostRegister_v2 = dlfcn.dlsym(handle, 'cuMemHostRegister_v2') + {{endif}} + {{if 'cuMemHostUnregister' in found_functions}} + global __cuMemHostUnregister + __cuMemHostUnregister = dlfcn.dlsym(handle, 'cuMemHostUnregister') + {{endif}} + {{if 'cuArrayCreate_v2' in found_functions}} + global __cuArrayCreate_v2 + __cuArrayCreate_v2 = dlfcn.dlsym(handle, 'cuArrayCreate_v2') + {{endif}} + {{if 'cuArrayGetDescriptor_v2' in found_functions}} + global __cuArrayGetDescriptor_v2 + __cuArrayGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArrayGetDescriptor_v2') + {{endif}} + {{if 'cuArrayGetSparseProperties' in found_functions}} + global __cuArrayGetSparseProperties + __cuArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuArrayGetSparseProperties') + {{endif}} + {{if 'cuMipmappedArrayGetSparseProperties' in found_functions}} + global __cuMipmappedArrayGetSparseProperties + __cuMipmappedArrayGetSparseProperties = dlfcn.dlsym(handle, 'cuMipmappedArrayGetSparseProperties') + {{endif}} + {{if 'cuArrayGetMemoryRequirements' in found_functions}} + global __cuArrayGetMemoryRequirements + __cuArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuArrayGetMemoryRequirements') + {{endif}} + {{if 'cuMipmappedArrayGetMemoryRequirements' in found_functions}} + global __cuMipmappedArrayGetMemoryRequirements + __cuMipmappedArrayGetMemoryRequirements = dlfcn.dlsym(handle, 'cuMipmappedArrayGetMemoryRequirements') + {{endif}} + {{if 'cuArrayGetPlane' in found_functions}} + global __cuArrayGetPlane + __cuArrayGetPlane = dlfcn.dlsym(handle, 'cuArrayGetPlane') + {{endif}} + {{if 'cuArrayDestroy' in found_functions}} + global __cuArrayDestroy + __cuArrayDestroy = dlfcn.dlsym(handle, 'cuArrayDestroy') + {{endif}} + {{if 'cuArray3DCreate_v2' in found_functions}} + global __cuArray3DCreate_v2 + __cuArray3DCreate_v2 = dlfcn.dlsym(handle, 'cuArray3DCreate_v2') + {{endif}} + {{if 'cuArray3DGetDescriptor_v2' in found_functions}} + global __cuArray3DGetDescriptor_v2 + __cuArray3DGetDescriptor_v2 = dlfcn.dlsym(handle, 'cuArray3DGetDescriptor_v2') + {{endif}} + {{if 'cuMipmappedArrayCreate' in found_functions}} + global __cuMipmappedArrayCreate + __cuMipmappedArrayCreate = dlfcn.dlsym(handle, 'cuMipmappedArrayCreate') + {{endif}} + {{if 'cuMipmappedArrayGetLevel' in found_functions}} + global __cuMipmappedArrayGetLevel + __cuMipmappedArrayGetLevel = dlfcn.dlsym(handle, 'cuMipmappedArrayGetLevel') + {{endif}} + {{if 'cuMipmappedArrayDestroy' in found_functions}} + global __cuMipmappedArrayDestroy + __cuMipmappedArrayDestroy = dlfcn.dlsym(handle, 'cuMipmappedArrayDestroy') + {{endif}} + {{if 'cuMemGetHandleForAddressRange' in found_functions}} + global __cuMemGetHandleForAddressRange + __cuMemGetHandleForAddressRange = dlfcn.dlsym(handle, 'cuMemGetHandleForAddressRange') + {{endif}} + {{if 'cuMemAddressReserve' in found_functions}} + global __cuMemAddressReserve + __cuMemAddressReserve = dlfcn.dlsym(handle, 'cuMemAddressReserve') + {{endif}} + {{if 'cuMemAddressFree' in found_functions}} + global __cuMemAddressFree + __cuMemAddressFree = dlfcn.dlsym(handle, 'cuMemAddressFree') + {{endif}} + {{if 'cuMemCreate' in found_functions}} + global __cuMemCreate + __cuMemCreate = dlfcn.dlsym(handle, 'cuMemCreate') + {{endif}} + {{if 'cuMemRelease' in found_functions}} + global __cuMemRelease + __cuMemRelease = dlfcn.dlsym(handle, 'cuMemRelease') + {{endif}} + {{if 'cuMemMap' in found_functions}} + global __cuMemMap + __cuMemMap = dlfcn.dlsym(handle, 'cuMemMap') + {{endif}} + {{if 'cuMemUnmap' in found_functions}} + global __cuMemUnmap + __cuMemUnmap = dlfcn.dlsym(handle, 'cuMemUnmap') + {{endif}} + {{if 'cuMemSetAccess' in found_functions}} + global __cuMemSetAccess + __cuMemSetAccess = dlfcn.dlsym(handle, 'cuMemSetAccess') + {{endif}} + {{if 'cuMemGetAccess' in found_functions}} + global __cuMemGetAccess + __cuMemGetAccess = dlfcn.dlsym(handle, 'cuMemGetAccess') + {{endif}} + {{if 'cuMemExportToShareableHandle' in found_functions}} + global __cuMemExportToShareableHandle + __cuMemExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemExportToShareableHandle') + {{endif}} + {{if 'cuMemImportFromShareableHandle' in found_functions}} + global __cuMemImportFromShareableHandle + __cuMemImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemImportFromShareableHandle') + {{endif}} + {{if 'cuMemGetAllocationGranularity' in found_functions}} + global __cuMemGetAllocationGranularity + __cuMemGetAllocationGranularity = dlfcn.dlsym(handle, 'cuMemGetAllocationGranularity') + {{endif}} + {{if 'cuMemGetAllocationPropertiesFromHandle' in found_functions}} + global __cuMemGetAllocationPropertiesFromHandle + __cuMemGetAllocationPropertiesFromHandle = dlfcn.dlsym(handle, 'cuMemGetAllocationPropertiesFromHandle') + {{endif}} + {{if 'cuMemRetainAllocationHandle' in found_functions}} + global __cuMemRetainAllocationHandle + __cuMemRetainAllocationHandle = dlfcn.dlsym(handle, 'cuMemRetainAllocationHandle') + {{endif}} + {{if 'cuMemPoolTrimTo' in found_functions}} + global __cuMemPoolTrimTo + __cuMemPoolTrimTo = dlfcn.dlsym(handle, 'cuMemPoolTrimTo') + {{endif}} + {{if 'cuMemPoolSetAttribute' in found_functions}} + global __cuMemPoolSetAttribute + __cuMemPoolSetAttribute = dlfcn.dlsym(handle, 'cuMemPoolSetAttribute') + {{endif}} + {{if 'cuMemPoolGetAttribute' in found_functions}} + global __cuMemPoolGetAttribute + __cuMemPoolGetAttribute = dlfcn.dlsym(handle, 'cuMemPoolGetAttribute') + {{endif}} + {{if 'cuMemPoolSetAccess' in found_functions}} + global __cuMemPoolSetAccess + __cuMemPoolSetAccess = dlfcn.dlsym(handle, 'cuMemPoolSetAccess') + {{endif}} + {{if 'cuMemPoolGetAccess' in found_functions}} + global __cuMemPoolGetAccess + __cuMemPoolGetAccess = dlfcn.dlsym(handle, 'cuMemPoolGetAccess') + {{endif}} + {{if 'cuMemPoolCreate' in found_functions}} + global __cuMemPoolCreate + __cuMemPoolCreate = dlfcn.dlsym(handle, 'cuMemPoolCreate') + {{endif}} + {{if 'cuMemPoolDestroy' in found_functions}} + global __cuMemPoolDestroy + __cuMemPoolDestroy = dlfcn.dlsym(handle, 'cuMemPoolDestroy') + {{endif}} + {{if 'cuMemPoolExportToShareableHandle' in found_functions}} + global __cuMemPoolExportToShareableHandle + __cuMemPoolExportToShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolExportToShareableHandle') + {{endif}} + {{if 'cuMemPoolImportFromShareableHandle' in found_functions}} + global __cuMemPoolImportFromShareableHandle + __cuMemPoolImportFromShareableHandle = dlfcn.dlsym(handle, 'cuMemPoolImportFromShareableHandle') + {{endif}} + {{if 'cuMemPoolExportPointer' in found_functions}} + global __cuMemPoolExportPointer + __cuMemPoolExportPointer = dlfcn.dlsym(handle, 'cuMemPoolExportPointer') + {{endif}} + {{if 'cuMemPoolImportPointer' in found_functions}} + global __cuMemPoolImportPointer + __cuMemPoolImportPointer = dlfcn.dlsym(handle, 'cuMemPoolImportPointer') + {{endif}} + {{if 'cuMulticastCreate' in found_functions}} + global __cuMulticastCreate + __cuMulticastCreate = dlfcn.dlsym(handle, 'cuMulticastCreate') + {{endif}} + {{if 'cuMulticastAddDevice' in found_functions}} + global __cuMulticastAddDevice + __cuMulticastAddDevice = dlfcn.dlsym(handle, 'cuMulticastAddDevice') + {{endif}} + {{if 'cuMulticastBindMem' in found_functions}} + global __cuMulticastBindMem + __cuMulticastBindMem = dlfcn.dlsym(handle, 'cuMulticastBindMem') + {{endif}} + {{if 'cuMulticastBindAddr' in found_functions}} + global __cuMulticastBindAddr + __cuMulticastBindAddr = dlfcn.dlsym(handle, 'cuMulticastBindAddr') + {{endif}} + {{if 'cuMulticastUnbind' in found_functions}} + global __cuMulticastUnbind + __cuMulticastUnbind = dlfcn.dlsym(handle, 'cuMulticastUnbind') + {{endif}} + {{if 'cuMulticastGetGranularity' in found_functions}} + global __cuMulticastGetGranularity + __cuMulticastGetGranularity = dlfcn.dlsym(handle, 'cuMulticastGetGranularity') + {{endif}} + {{if 'cuPointerGetAttribute' in found_functions}} + global __cuPointerGetAttribute + __cuPointerGetAttribute = dlfcn.dlsym(handle, 'cuPointerGetAttribute') + {{endif}} + {{if 'cuMemAdvise' in found_functions}} + global __cuMemAdvise + __cuMemAdvise = dlfcn.dlsym(handle, 'cuMemAdvise') + {{endif}} + {{if 'cuMemAdvise_v2' in found_functions}} + global __cuMemAdvise_v2 + __cuMemAdvise_v2 = dlfcn.dlsym(handle, 'cuMemAdvise_v2') + {{endif}} + {{if 'cuMemRangeGetAttribute' in found_functions}} + global __cuMemRangeGetAttribute + __cuMemRangeGetAttribute = dlfcn.dlsym(handle, 'cuMemRangeGetAttribute') + {{endif}} + {{if 'cuMemRangeGetAttributes' in found_functions}} + global __cuMemRangeGetAttributes + __cuMemRangeGetAttributes = dlfcn.dlsym(handle, 'cuMemRangeGetAttributes') + {{endif}} + {{if 'cuPointerSetAttribute' in found_functions}} + global __cuPointerSetAttribute + __cuPointerSetAttribute = dlfcn.dlsym(handle, 'cuPointerSetAttribute') + {{endif}} + {{if 'cuPointerGetAttributes' in found_functions}} + global __cuPointerGetAttributes + __cuPointerGetAttributes = dlfcn.dlsym(handle, 'cuPointerGetAttributes') + {{endif}} + {{if 'cuStreamCreate' in found_functions}} + global __cuStreamCreate + __cuStreamCreate = dlfcn.dlsym(handle, 'cuStreamCreate') + {{endif}} + {{if 'cuStreamCreateWithPriority' in found_functions}} + global __cuStreamCreateWithPriority + __cuStreamCreateWithPriority = dlfcn.dlsym(handle, 'cuStreamCreateWithPriority') + {{endif}} + {{if 'cuThreadExchangeStreamCaptureMode' in found_functions}} + global __cuThreadExchangeStreamCaptureMode + __cuThreadExchangeStreamCaptureMode = dlfcn.dlsym(handle, 'cuThreadExchangeStreamCaptureMode') + {{endif}} + {{if 'cuStreamDestroy_v2' in found_functions}} + global __cuStreamDestroy_v2 + __cuStreamDestroy_v2 = dlfcn.dlsym(handle, 'cuStreamDestroy_v2') + {{endif}} + {{if 'cuEventCreate' in found_functions}} + global __cuEventCreate + __cuEventCreate = dlfcn.dlsym(handle, 'cuEventCreate') + {{endif}} + {{if 'cuEventQuery' in found_functions}} + global __cuEventQuery + __cuEventQuery = dlfcn.dlsym(handle, 'cuEventQuery') + {{endif}} + {{if 'cuEventSynchronize' in found_functions}} + global __cuEventSynchronize + __cuEventSynchronize = dlfcn.dlsym(handle, 'cuEventSynchronize') + {{endif}} + {{if 'cuEventDestroy_v2' in found_functions}} + global __cuEventDestroy_v2 + __cuEventDestroy_v2 = dlfcn.dlsym(handle, 'cuEventDestroy_v2') + {{endif}} + {{if 'cuEventElapsedTime' in found_functions}} + global __cuEventElapsedTime + __cuEventElapsedTime = dlfcn.dlsym(handle, 'cuEventElapsedTime') + {{endif}} + {{if 'cuEventElapsedTime_v2' in found_functions}} + global __cuEventElapsedTime_v2 + __cuEventElapsedTime_v2 = dlfcn.dlsym(handle, 'cuEventElapsedTime_v2') + {{endif}} + {{if 'cuImportExternalMemory' in found_functions}} + global __cuImportExternalMemory + __cuImportExternalMemory = dlfcn.dlsym(handle, 'cuImportExternalMemory') + {{endif}} + {{if 'cuExternalMemoryGetMappedBuffer' in found_functions}} + global __cuExternalMemoryGetMappedBuffer + __cuExternalMemoryGetMappedBuffer = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedBuffer') + {{endif}} + {{if 'cuExternalMemoryGetMappedMipmappedArray' in found_functions}} + global __cuExternalMemoryGetMappedMipmappedArray + __cuExternalMemoryGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuExternalMemoryGetMappedMipmappedArray') + {{endif}} + {{if 'cuDestroyExternalMemory' in found_functions}} + global __cuDestroyExternalMemory + __cuDestroyExternalMemory = dlfcn.dlsym(handle, 'cuDestroyExternalMemory') + {{endif}} + {{if 'cuImportExternalSemaphore' in found_functions}} + global __cuImportExternalSemaphore + __cuImportExternalSemaphore = dlfcn.dlsym(handle, 'cuImportExternalSemaphore') + {{endif}} + {{if 'cuDestroyExternalSemaphore' in found_functions}} + global __cuDestroyExternalSemaphore + __cuDestroyExternalSemaphore = dlfcn.dlsym(handle, 'cuDestroyExternalSemaphore') + {{endif}} + {{if 'cuFuncGetAttribute' in found_functions}} + global __cuFuncGetAttribute + __cuFuncGetAttribute = dlfcn.dlsym(handle, 'cuFuncGetAttribute') + {{endif}} + {{if 'cuFuncSetAttribute' in found_functions}} + global __cuFuncSetAttribute + __cuFuncSetAttribute = dlfcn.dlsym(handle, 'cuFuncSetAttribute') + {{endif}} + {{if 'cuFuncSetCacheConfig' in found_functions}} + global __cuFuncSetCacheConfig + __cuFuncSetCacheConfig = dlfcn.dlsym(handle, 'cuFuncSetCacheConfig') + {{endif}} + {{if 'cuFuncGetModule' in found_functions}} + global __cuFuncGetModule + __cuFuncGetModule = dlfcn.dlsym(handle, 'cuFuncGetModule') + {{endif}} + {{if 'cuFuncGetName' in found_functions}} + global __cuFuncGetName + __cuFuncGetName = dlfcn.dlsym(handle, 'cuFuncGetName') + {{endif}} + {{if 'cuFuncGetParamInfo' in found_functions}} + global __cuFuncGetParamInfo + __cuFuncGetParamInfo = dlfcn.dlsym(handle, 'cuFuncGetParamInfo') + {{endif}} + {{if 'cuFuncIsLoaded' in found_functions}} + global __cuFuncIsLoaded + __cuFuncIsLoaded = dlfcn.dlsym(handle, 'cuFuncIsLoaded') + {{endif}} + {{if 'cuFuncLoad' in found_functions}} + global __cuFuncLoad + __cuFuncLoad = dlfcn.dlsym(handle, 'cuFuncLoad') + {{endif}} + {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} + global __cuLaunchCooperativeKernelMultiDevice + __cuLaunchCooperativeKernelMultiDevice = dlfcn.dlsym(handle, 'cuLaunchCooperativeKernelMultiDevice') + {{endif}} + {{if 'cuFuncSetBlockShape' in found_functions}} + global __cuFuncSetBlockShape + __cuFuncSetBlockShape = dlfcn.dlsym(handle, 'cuFuncSetBlockShape') + {{endif}} + {{if 'cuFuncSetSharedSize' in found_functions}} + global __cuFuncSetSharedSize + __cuFuncSetSharedSize = dlfcn.dlsym(handle, 'cuFuncSetSharedSize') + {{endif}} + {{if 'cuParamSetSize' in found_functions}} + global __cuParamSetSize + __cuParamSetSize = dlfcn.dlsym(handle, 'cuParamSetSize') + {{endif}} + {{if 'cuParamSeti' in found_functions}} + global __cuParamSeti + __cuParamSeti = dlfcn.dlsym(handle, 'cuParamSeti') + {{endif}} + {{if 'cuParamSetf' in found_functions}} + global __cuParamSetf + __cuParamSetf = dlfcn.dlsym(handle, 'cuParamSetf') + {{endif}} + {{if 'cuParamSetv' in found_functions}} + global __cuParamSetv + __cuParamSetv = dlfcn.dlsym(handle, 'cuParamSetv') + {{endif}} + {{if 'cuLaunch' in found_functions}} + global __cuLaunch + __cuLaunch = dlfcn.dlsym(handle, 'cuLaunch') + {{endif}} + {{if 'cuLaunchGrid' in found_functions}} + global __cuLaunchGrid + __cuLaunchGrid = dlfcn.dlsym(handle, 'cuLaunchGrid') + {{endif}} + {{if 'cuLaunchGridAsync' in found_functions}} + global __cuLaunchGridAsync + __cuLaunchGridAsync = dlfcn.dlsym(handle, 'cuLaunchGridAsync') + {{endif}} + {{if 'cuParamSetTexRef' in found_functions}} + global __cuParamSetTexRef + __cuParamSetTexRef = dlfcn.dlsym(handle, 'cuParamSetTexRef') + {{endif}} + {{if 'cuFuncSetSharedMemConfig' in found_functions}} + global __cuFuncSetSharedMemConfig + __cuFuncSetSharedMemConfig = dlfcn.dlsym(handle, 'cuFuncSetSharedMemConfig') + {{endif}} + {{if 'cuGraphCreate' in found_functions}} + global __cuGraphCreate + __cuGraphCreate = dlfcn.dlsym(handle, 'cuGraphCreate') + {{endif}} + {{if 'cuGraphAddKernelNode_v2' in found_functions}} + global __cuGraphAddKernelNode_v2 + __cuGraphAddKernelNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddKernelNode_v2') + {{endif}} + {{if 'cuGraphKernelNodeGetParams_v2' in found_functions}} + global __cuGraphKernelNodeGetParams_v2 + __cuGraphKernelNodeGetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetParams_v2') + {{endif}} + {{if 'cuGraphKernelNodeSetParams_v2' in found_functions}} + global __cuGraphKernelNodeSetParams_v2 + __cuGraphKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetParams_v2') + {{endif}} + {{if 'cuGraphAddMemcpyNode' in found_functions}} + global __cuGraphAddMemcpyNode + __cuGraphAddMemcpyNode = dlfcn.dlsym(handle, 'cuGraphAddMemcpyNode') + {{endif}} + {{if 'cuGraphMemcpyNodeGetParams' in found_functions}} + global __cuGraphMemcpyNodeGetParams + __cuGraphMemcpyNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeGetParams') + {{endif}} + {{if 'cuGraphMemcpyNodeSetParams' in found_functions}} + global __cuGraphMemcpyNodeSetParams + __cuGraphMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemcpyNodeSetParams') + {{endif}} + {{if 'cuGraphAddMemsetNode' in found_functions}} + global __cuGraphAddMemsetNode + __cuGraphAddMemsetNode = dlfcn.dlsym(handle, 'cuGraphAddMemsetNode') + {{endif}} + {{if 'cuGraphMemsetNodeGetParams' in found_functions}} + global __cuGraphMemsetNodeGetParams + __cuGraphMemsetNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeGetParams') + {{endif}} + {{if 'cuGraphMemsetNodeSetParams' in found_functions}} + global __cuGraphMemsetNodeSetParams + __cuGraphMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphMemsetNodeSetParams') + {{endif}} + {{if 'cuGraphAddHostNode' in found_functions}} + global __cuGraphAddHostNode + __cuGraphAddHostNode = dlfcn.dlsym(handle, 'cuGraphAddHostNode') + {{endif}} + {{if 'cuGraphHostNodeGetParams' in found_functions}} + global __cuGraphHostNodeGetParams + __cuGraphHostNodeGetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeGetParams') + {{endif}} + {{if 'cuGraphHostNodeSetParams' in found_functions}} + global __cuGraphHostNodeSetParams + __cuGraphHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphHostNodeSetParams') + {{endif}} + {{if 'cuGraphAddChildGraphNode' in found_functions}} + global __cuGraphAddChildGraphNode + __cuGraphAddChildGraphNode = dlfcn.dlsym(handle, 'cuGraphAddChildGraphNode') + {{endif}} + {{if 'cuGraphChildGraphNodeGetGraph' in found_functions}} + global __cuGraphChildGraphNodeGetGraph + __cuGraphChildGraphNodeGetGraph = dlfcn.dlsym(handle, 'cuGraphChildGraphNodeGetGraph') + {{endif}} + {{if 'cuGraphAddEmptyNode' in found_functions}} + global __cuGraphAddEmptyNode + __cuGraphAddEmptyNode = dlfcn.dlsym(handle, 'cuGraphAddEmptyNode') + {{endif}} + {{if 'cuGraphAddEventRecordNode' in found_functions}} + global __cuGraphAddEventRecordNode + __cuGraphAddEventRecordNode = dlfcn.dlsym(handle, 'cuGraphAddEventRecordNode') + {{endif}} + {{if 'cuGraphEventRecordNodeGetEvent' in found_functions}} + global __cuGraphEventRecordNodeGetEvent + __cuGraphEventRecordNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeGetEvent') + {{endif}} + {{if 'cuGraphEventRecordNodeSetEvent' in found_functions}} + global __cuGraphEventRecordNodeSetEvent + __cuGraphEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventRecordNodeSetEvent') + {{endif}} + {{if 'cuGraphAddEventWaitNode' in found_functions}} + global __cuGraphAddEventWaitNode + __cuGraphAddEventWaitNode = dlfcn.dlsym(handle, 'cuGraphAddEventWaitNode') + {{endif}} + {{if 'cuGraphEventWaitNodeGetEvent' in found_functions}} + global __cuGraphEventWaitNodeGetEvent + __cuGraphEventWaitNodeGetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeGetEvent') + {{endif}} + {{if 'cuGraphEventWaitNodeSetEvent' in found_functions}} + global __cuGraphEventWaitNodeSetEvent + __cuGraphEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphEventWaitNodeSetEvent') + {{endif}} + {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} + global __cuGraphAddExternalSemaphoresSignalNode + __cuGraphAddExternalSemaphoresSignalNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresSignalNode') + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeGetParams + __cuGraphExternalSemaphoresSignalNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeGetParams') + {{endif}} + {{if 'cuGraphExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresSignalNodeSetParams + __cuGraphExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresSignalNodeSetParams') + {{endif}} + {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} + global __cuGraphAddExternalSemaphoresWaitNode + __cuGraphAddExternalSemaphoresWaitNode = dlfcn.dlsym(handle, 'cuGraphAddExternalSemaphoresWaitNode') + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeGetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeGetParams + __cuGraphExternalSemaphoresWaitNodeGetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeGetParams') + {{endif}} + {{if 'cuGraphExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExternalSemaphoresWaitNodeSetParams + __cuGraphExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExternalSemaphoresWaitNodeSetParams') + {{endif}} + {{if 'cuGraphAddBatchMemOpNode' in found_functions}} + global __cuGraphAddBatchMemOpNode + __cuGraphAddBatchMemOpNode = dlfcn.dlsym(handle, 'cuGraphAddBatchMemOpNode') + {{endif}} + {{if 'cuGraphBatchMemOpNodeGetParams' in found_functions}} + global __cuGraphBatchMemOpNodeGetParams + __cuGraphBatchMemOpNodeGetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeGetParams') + {{endif}} + {{if 'cuGraphBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphBatchMemOpNodeSetParams + __cuGraphBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphBatchMemOpNodeSetParams') + {{endif}} + {{if 'cuGraphExecBatchMemOpNodeSetParams' in found_functions}} + global __cuGraphExecBatchMemOpNodeSetParams + __cuGraphExecBatchMemOpNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecBatchMemOpNodeSetParams') + {{endif}} + {{if 'cuGraphAddMemAllocNode' in found_functions}} + global __cuGraphAddMemAllocNode + __cuGraphAddMemAllocNode = dlfcn.dlsym(handle, 'cuGraphAddMemAllocNode') + {{endif}} + {{if 'cuGraphMemAllocNodeGetParams' in found_functions}} + global __cuGraphMemAllocNodeGetParams + __cuGraphMemAllocNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemAllocNodeGetParams') + {{endif}} + {{if 'cuGraphAddMemFreeNode' in found_functions}} + global __cuGraphAddMemFreeNode + __cuGraphAddMemFreeNode = dlfcn.dlsym(handle, 'cuGraphAddMemFreeNode') + {{endif}} + {{if 'cuGraphMemFreeNodeGetParams' in found_functions}} + global __cuGraphMemFreeNodeGetParams + __cuGraphMemFreeNodeGetParams = dlfcn.dlsym(handle, 'cuGraphMemFreeNodeGetParams') + {{endif}} + {{if 'cuDeviceGraphMemTrim' in found_functions}} + global __cuDeviceGraphMemTrim + __cuDeviceGraphMemTrim = dlfcn.dlsym(handle, 'cuDeviceGraphMemTrim') + {{endif}} + {{if 'cuDeviceGetGraphMemAttribute' in found_functions}} + global __cuDeviceGetGraphMemAttribute + __cuDeviceGetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceGetGraphMemAttribute') + {{endif}} + {{if 'cuDeviceSetGraphMemAttribute' in found_functions}} + global __cuDeviceSetGraphMemAttribute + __cuDeviceSetGraphMemAttribute = dlfcn.dlsym(handle, 'cuDeviceSetGraphMemAttribute') + {{endif}} + {{if 'cuGraphClone' in found_functions}} + global __cuGraphClone + __cuGraphClone = dlfcn.dlsym(handle, 'cuGraphClone') + {{endif}} + {{if 'cuGraphNodeFindInClone' in found_functions}} + global __cuGraphNodeFindInClone + __cuGraphNodeFindInClone = dlfcn.dlsym(handle, 'cuGraphNodeFindInClone') + {{endif}} + {{if 'cuGraphNodeGetType' in found_functions}} + global __cuGraphNodeGetType + __cuGraphNodeGetType = dlfcn.dlsym(handle, 'cuGraphNodeGetType') + {{endif}} + {{if 'cuGraphGetNodes' in found_functions}} + global __cuGraphGetNodes + __cuGraphGetNodes = dlfcn.dlsym(handle, 'cuGraphGetNodes') + {{endif}} + {{if 'cuGraphGetRootNodes' in found_functions}} + global __cuGraphGetRootNodes + __cuGraphGetRootNodes = dlfcn.dlsym(handle, 'cuGraphGetRootNodes') + {{endif}} + {{if 'cuGraphGetEdges' in found_functions}} + global __cuGraphGetEdges + __cuGraphGetEdges = dlfcn.dlsym(handle, 'cuGraphGetEdges') + {{endif}} + {{if 'cuGraphGetEdges_v2' in found_functions}} + global __cuGraphGetEdges_v2 + __cuGraphGetEdges_v2 = dlfcn.dlsym(handle, 'cuGraphGetEdges_v2') + {{endif}} + {{if 'cuGraphNodeGetDependencies' in found_functions}} + global __cuGraphNodeGetDependencies + __cuGraphNodeGetDependencies = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies') + {{endif}} + {{if 'cuGraphNodeGetDependencies_v2' in found_functions}} + global __cuGraphNodeGetDependencies_v2 + __cuGraphNodeGetDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependencies_v2') + {{endif}} + {{if 'cuGraphNodeGetDependentNodes' in found_functions}} + global __cuGraphNodeGetDependentNodes + __cuGraphNodeGetDependentNodes = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes') + {{endif}} + {{if 'cuGraphNodeGetDependentNodes_v2' in found_functions}} + global __cuGraphNodeGetDependentNodes_v2 + __cuGraphNodeGetDependentNodes_v2 = dlfcn.dlsym(handle, 'cuGraphNodeGetDependentNodes_v2') + {{endif}} + {{if 'cuGraphAddDependencies' in found_functions}} + global __cuGraphAddDependencies + __cuGraphAddDependencies = dlfcn.dlsym(handle, 'cuGraphAddDependencies') + {{endif}} + {{if 'cuGraphAddDependencies_v2' in found_functions}} + global __cuGraphAddDependencies_v2 + __cuGraphAddDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphAddDependencies_v2') + {{endif}} + {{if 'cuGraphRemoveDependencies' in found_functions}} + global __cuGraphRemoveDependencies + __cuGraphRemoveDependencies = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies') + {{endif}} + {{if 'cuGraphRemoveDependencies_v2' in found_functions}} + global __cuGraphRemoveDependencies_v2 + __cuGraphRemoveDependencies_v2 = dlfcn.dlsym(handle, 'cuGraphRemoveDependencies_v2') + {{endif}} + {{if 'cuGraphDestroyNode' in found_functions}} + global __cuGraphDestroyNode + __cuGraphDestroyNode = dlfcn.dlsym(handle, 'cuGraphDestroyNode') + {{endif}} + {{if 'cuGraphInstantiateWithFlags' in found_functions}} + global __cuGraphInstantiateWithFlags + __cuGraphInstantiateWithFlags = dlfcn.dlsym(handle, 'cuGraphInstantiateWithFlags') + {{endif}} + {{if 'cuGraphExecGetFlags' in found_functions}} + global __cuGraphExecGetFlags + __cuGraphExecGetFlags = dlfcn.dlsym(handle, 'cuGraphExecGetFlags') + {{endif}} + {{if 'cuGraphExecKernelNodeSetParams_v2' in found_functions}} + global __cuGraphExecKernelNodeSetParams_v2 + __cuGraphExecKernelNodeSetParams_v2 = dlfcn.dlsym(handle, 'cuGraphExecKernelNodeSetParams_v2') + {{endif}} + {{if 'cuGraphExecMemcpyNodeSetParams' in found_functions}} + global __cuGraphExecMemcpyNodeSetParams + __cuGraphExecMemcpyNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemcpyNodeSetParams') + {{endif}} + {{if 'cuGraphExecMemsetNodeSetParams' in found_functions}} + global __cuGraphExecMemsetNodeSetParams + __cuGraphExecMemsetNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecMemsetNodeSetParams') + {{endif}} + {{if 'cuGraphExecHostNodeSetParams' in found_functions}} + global __cuGraphExecHostNodeSetParams + __cuGraphExecHostNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecHostNodeSetParams') + {{endif}} + {{if 'cuGraphExecChildGraphNodeSetParams' in found_functions}} + global __cuGraphExecChildGraphNodeSetParams + __cuGraphExecChildGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecChildGraphNodeSetParams') + {{endif}} + {{if 'cuGraphExecEventRecordNodeSetEvent' in found_functions}} + global __cuGraphExecEventRecordNodeSetEvent + __cuGraphExecEventRecordNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventRecordNodeSetEvent') + {{endif}} + {{if 'cuGraphExecEventWaitNodeSetEvent' in found_functions}} + global __cuGraphExecEventWaitNodeSetEvent + __cuGraphExecEventWaitNodeSetEvent = dlfcn.dlsym(handle, 'cuGraphExecEventWaitNodeSetEvent') + {{endif}} + {{if 'cuGraphExecExternalSemaphoresSignalNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresSignalNodeSetParams + __cuGraphExecExternalSemaphoresSignalNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresSignalNodeSetParams') + {{endif}} + {{if 'cuGraphExecExternalSemaphoresWaitNodeSetParams' in found_functions}} + global __cuGraphExecExternalSemaphoresWaitNodeSetParams + __cuGraphExecExternalSemaphoresWaitNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecExternalSemaphoresWaitNodeSetParams') + {{endif}} + {{if 'cuGraphNodeSetEnabled' in found_functions}} + global __cuGraphNodeSetEnabled + __cuGraphNodeSetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeSetEnabled') + {{endif}} + {{if 'cuGraphNodeGetEnabled' in found_functions}} + global __cuGraphNodeGetEnabled + __cuGraphNodeGetEnabled = dlfcn.dlsym(handle, 'cuGraphNodeGetEnabled') + {{endif}} + {{if 'cuGraphExecDestroy' in found_functions}} + global __cuGraphExecDestroy + __cuGraphExecDestroy = dlfcn.dlsym(handle, 'cuGraphExecDestroy') + {{endif}} + {{if 'cuGraphDestroy' in found_functions}} + global __cuGraphDestroy + __cuGraphDestroy = dlfcn.dlsym(handle, 'cuGraphDestroy') + {{endif}} + {{if 'cuGraphExecUpdate_v2' in found_functions}} + global __cuGraphExecUpdate_v2 + __cuGraphExecUpdate_v2 = dlfcn.dlsym(handle, 'cuGraphExecUpdate_v2') + {{endif}} + {{if 'cuGraphKernelNodeCopyAttributes' in found_functions}} + global __cuGraphKernelNodeCopyAttributes + __cuGraphKernelNodeCopyAttributes = dlfcn.dlsym(handle, 'cuGraphKernelNodeCopyAttributes') + {{endif}} + {{if 'cuGraphKernelNodeGetAttribute' in found_functions}} + global __cuGraphKernelNodeGetAttribute + __cuGraphKernelNodeGetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeGetAttribute') + {{endif}} + {{if 'cuGraphKernelNodeSetAttribute' in found_functions}} + global __cuGraphKernelNodeSetAttribute + __cuGraphKernelNodeSetAttribute = dlfcn.dlsym(handle, 'cuGraphKernelNodeSetAttribute') + {{endif}} + {{if 'cuGraphDebugDotPrint' in found_functions}} + global __cuGraphDebugDotPrint + __cuGraphDebugDotPrint = dlfcn.dlsym(handle, 'cuGraphDebugDotPrint') + {{endif}} + {{if 'cuUserObjectCreate' in found_functions}} + global __cuUserObjectCreate + __cuUserObjectCreate = dlfcn.dlsym(handle, 'cuUserObjectCreate') + {{endif}} + {{if 'cuUserObjectRetain' in found_functions}} + global __cuUserObjectRetain + __cuUserObjectRetain = dlfcn.dlsym(handle, 'cuUserObjectRetain') + {{endif}} + {{if 'cuUserObjectRelease' in found_functions}} + global __cuUserObjectRelease + __cuUserObjectRelease = dlfcn.dlsym(handle, 'cuUserObjectRelease') + {{endif}} + {{if 'cuGraphRetainUserObject' in found_functions}} + global __cuGraphRetainUserObject + __cuGraphRetainUserObject = dlfcn.dlsym(handle, 'cuGraphRetainUserObject') + {{endif}} + {{if 'cuGraphReleaseUserObject' in found_functions}} + global __cuGraphReleaseUserObject + __cuGraphReleaseUserObject = dlfcn.dlsym(handle, 'cuGraphReleaseUserObject') + {{endif}} + {{if 'cuGraphAddNode' in found_functions}} + global __cuGraphAddNode + __cuGraphAddNode = dlfcn.dlsym(handle, 'cuGraphAddNode') + {{endif}} + {{if 'cuGraphAddNode_v2' in found_functions}} + global __cuGraphAddNode_v2 + __cuGraphAddNode_v2 = dlfcn.dlsym(handle, 'cuGraphAddNode_v2') + {{endif}} + {{if 'cuGraphNodeSetParams' in found_functions}} + global __cuGraphNodeSetParams + __cuGraphNodeSetParams = dlfcn.dlsym(handle, 'cuGraphNodeSetParams') + {{endif}} + {{if 'cuGraphExecNodeSetParams' in found_functions}} + global __cuGraphExecNodeSetParams + __cuGraphExecNodeSetParams = dlfcn.dlsym(handle, 'cuGraphExecNodeSetParams') + {{endif}} + {{if 'cuGraphConditionalHandleCreate' in found_functions}} + global __cuGraphConditionalHandleCreate + __cuGraphConditionalHandleCreate = dlfcn.dlsym(handle, 'cuGraphConditionalHandleCreate') + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessor' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessor + __cuOccupancyMaxActiveBlocksPerMultiprocessor = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessor') + {{endif}} + {{if 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags' in found_functions}} + global __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags + __cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags') + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSize' in found_functions}} + global __cuOccupancyMaxPotentialBlockSize + __cuOccupancyMaxPotentialBlockSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSize') + {{endif}} + {{if 'cuOccupancyMaxPotentialBlockSizeWithFlags' in found_functions}} + global __cuOccupancyMaxPotentialBlockSizeWithFlags + __cuOccupancyMaxPotentialBlockSizeWithFlags = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialBlockSizeWithFlags') + {{endif}} + {{if 'cuOccupancyAvailableDynamicSMemPerBlock' in found_functions}} + global __cuOccupancyAvailableDynamicSMemPerBlock + __cuOccupancyAvailableDynamicSMemPerBlock = dlfcn.dlsym(handle, 'cuOccupancyAvailableDynamicSMemPerBlock') + {{endif}} + {{if 'cuOccupancyMaxPotentialClusterSize' in found_functions}} + global __cuOccupancyMaxPotentialClusterSize + __cuOccupancyMaxPotentialClusterSize = dlfcn.dlsym(handle, 'cuOccupancyMaxPotentialClusterSize') + {{endif}} + {{if 'cuOccupancyMaxActiveClusters' in found_functions}} + global __cuOccupancyMaxActiveClusters + __cuOccupancyMaxActiveClusters = dlfcn.dlsym(handle, 'cuOccupancyMaxActiveClusters') + {{endif}} + {{if 'cuTexRefSetArray' in found_functions}} + global __cuTexRefSetArray + __cuTexRefSetArray = dlfcn.dlsym(handle, 'cuTexRefSetArray') + {{endif}} + {{if 'cuTexRefSetMipmappedArray' in found_functions}} + global __cuTexRefSetMipmappedArray + __cuTexRefSetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefSetMipmappedArray') + {{endif}} + {{if 'cuTexRefSetAddress_v2' in found_functions}} + global __cuTexRefSetAddress_v2 + __cuTexRefSetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefSetAddress_v2') + {{endif}} + {{if 'cuTexRefSetAddress2D_v3' in found_functions}} + global __cuTexRefSetAddress2D_v3 + __cuTexRefSetAddress2D_v3 = dlfcn.dlsym(handle, 'cuTexRefSetAddress2D_v3') + {{endif}} + {{if 'cuTexRefSetFormat' in found_functions}} + global __cuTexRefSetFormat + __cuTexRefSetFormat = dlfcn.dlsym(handle, 'cuTexRefSetFormat') + {{endif}} + {{if 'cuTexRefSetAddressMode' in found_functions}} + global __cuTexRefSetAddressMode + __cuTexRefSetAddressMode = dlfcn.dlsym(handle, 'cuTexRefSetAddressMode') + {{endif}} + {{if 'cuTexRefSetFilterMode' in found_functions}} + global __cuTexRefSetFilterMode + __cuTexRefSetFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetFilterMode') + {{endif}} + {{if 'cuTexRefSetMipmapFilterMode' in found_functions}} + global __cuTexRefSetMipmapFilterMode + __cuTexRefSetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefSetMipmapFilterMode') + {{endif}} + {{if 'cuTexRefSetMipmapLevelBias' in found_functions}} + global __cuTexRefSetMipmapLevelBias + __cuTexRefSetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelBias') + {{endif}} + {{if 'cuTexRefSetMipmapLevelClamp' in found_functions}} + global __cuTexRefSetMipmapLevelClamp + __cuTexRefSetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefSetMipmapLevelClamp') + {{endif}} + {{if 'cuTexRefSetMaxAnisotropy' in found_functions}} + global __cuTexRefSetMaxAnisotropy + __cuTexRefSetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefSetMaxAnisotropy') + {{endif}} + {{if 'cuTexRefSetBorderColor' in found_functions}} + global __cuTexRefSetBorderColor + __cuTexRefSetBorderColor = dlfcn.dlsym(handle, 'cuTexRefSetBorderColor') + {{endif}} + {{if 'cuTexRefSetFlags' in found_functions}} + global __cuTexRefSetFlags + __cuTexRefSetFlags = dlfcn.dlsym(handle, 'cuTexRefSetFlags') + {{endif}} + {{if 'cuTexRefGetAddress_v2' in found_functions}} + global __cuTexRefGetAddress_v2 + __cuTexRefGetAddress_v2 = dlfcn.dlsym(handle, 'cuTexRefGetAddress_v2') + {{endif}} + {{if 'cuTexRefGetArray' in found_functions}} + global __cuTexRefGetArray + __cuTexRefGetArray = dlfcn.dlsym(handle, 'cuTexRefGetArray') + {{endif}} + {{if 'cuTexRefGetMipmappedArray' in found_functions}} + global __cuTexRefGetMipmappedArray + __cuTexRefGetMipmappedArray = dlfcn.dlsym(handle, 'cuTexRefGetMipmappedArray') + {{endif}} + {{if 'cuTexRefGetAddressMode' in found_functions}} + global __cuTexRefGetAddressMode + __cuTexRefGetAddressMode = dlfcn.dlsym(handle, 'cuTexRefGetAddressMode') + {{endif}} + {{if 'cuTexRefGetFilterMode' in found_functions}} + global __cuTexRefGetFilterMode + __cuTexRefGetFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetFilterMode') + {{endif}} + {{if 'cuTexRefGetFormat' in found_functions}} + global __cuTexRefGetFormat + __cuTexRefGetFormat = dlfcn.dlsym(handle, 'cuTexRefGetFormat') + {{endif}} + {{if 'cuTexRefGetMipmapFilterMode' in found_functions}} + global __cuTexRefGetMipmapFilterMode + __cuTexRefGetMipmapFilterMode = dlfcn.dlsym(handle, 'cuTexRefGetMipmapFilterMode') + {{endif}} + {{if 'cuTexRefGetMipmapLevelBias' in found_functions}} + global __cuTexRefGetMipmapLevelBias + __cuTexRefGetMipmapLevelBias = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelBias') + {{endif}} + {{if 'cuTexRefGetMipmapLevelClamp' in found_functions}} + global __cuTexRefGetMipmapLevelClamp + __cuTexRefGetMipmapLevelClamp = dlfcn.dlsym(handle, 'cuTexRefGetMipmapLevelClamp') + {{endif}} + {{if 'cuTexRefGetMaxAnisotropy' in found_functions}} + global __cuTexRefGetMaxAnisotropy + __cuTexRefGetMaxAnisotropy = dlfcn.dlsym(handle, 'cuTexRefGetMaxAnisotropy') + {{endif}} + {{if 'cuTexRefGetBorderColor' in found_functions}} + global __cuTexRefGetBorderColor + __cuTexRefGetBorderColor = dlfcn.dlsym(handle, 'cuTexRefGetBorderColor') + {{endif}} + {{if 'cuTexRefGetFlags' in found_functions}} + global __cuTexRefGetFlags + __cuTexRefGetFlags = dlfcn.dlsym(handle, 'cuTexRefGetFlags') + {{endif}} + {{if 'cuTexRefCreate' in found_functions}} + global __cuTexRefCreate + __cuTexRefCreate = dlfcn.dlsym(handle, 'cuTexRefCreate') + {{endif}} + {{if 'cuTexRefDestroy' in found_functions}} + global __cuTexRefDestroy + __cuTexRefDestroy = dlfcn.dlsym(handle, 'cuTexRefDestroy') + {{endif}} + {{if 'cuSurfRefSetArray' in found_functions}} + global __cuSurfRefSetArray + __cuSurfRefSetArray = dlfcn.dlsym(handle, 'cuSurfRefSetArray') + {{endif}} + {{if 'cuSurfRefGetArray' in found_functions}} + global __cuSurfRefGetArray + __cuSurfRefGetArray = dlfcn.dlsym(handle, 'cuSurfRefGetArray') + {{endif}} + {{if 'cuTexObjectCreate' in found_functions}} + global __cuTexObjectCreate + __cuTexObjectCreate = dlfcn.dlsym(handle, 'cuTexObjectCreate') + {{endif}} + {{if 'cuTexObjectDestroy' in found_functions}} + global __cuTexObjectDestroy + __cuTexObjectDestroy = dlfcn.dlsym(handle, 'cuTexObjectDestroy') + {{endif}} + {{if 'cuTexObjectGetResourceDesc' in found_functions}} + global __cuTexObjectGetResourceDesc + __cuTexObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceDesc') + {{endif}} + {{if 'cuTexObjectGetTextureDesc' in found_functions}} + global __cuTexObjectGetTextureDesc + __cuTexObjectGetTextureDesc = dlfcn.dlsym(handle, 'cuTexObjectGetTextureDesc') + {{endif}} + {{if 'cuTexObjectGetResourceViewDesc' in found_functions}} + global __cuTexObjectGetResourceViewDesc + __cuTexObjectGetResourceViewDesc = dlfcn.dlsym(handle, 'cuTexObjectGetResourceViewDesc') + {{endif}} + {{if 'cuSurfObjectCreate' in found_functions}} + global __cuSurfObjectCreate + __cuSurfObjectCreate = dlfcn.dlsym(handle, 'cuSurfObjectCreate') + {{endif}} + {{if 'cuSurfObjectDestroy' in found_functions}} + global __cuSurfObjectDestroy + __cuSurfObjectDestroy = dlfcn.dlsym(handle, 'cuSurfObjectDestroy') + {{endif}} + {{if 'cuSurfObjectGetResourceDesc' in found_functions}} + global __cuSurfObjectGetResourceDesc + __cuSurfObjectGetResourceDesc = dlfcn.dlsym(handle, 'cuSurfObjectGetResourceDesc') + {{endif}} + {{if 'cuTensorMapEncodeTiled' in found_functions}} + global __cuTensorMapEncodeTiled + __cuTensorMapEncodeTiled = dlfcn.dlsym(handle, 'cuTensorMapEncodeTiled') + {{endif}} + {{if 'cuTensorMapEncodeIm2col' in found_functions}} + global __cuTensorMapEncodeIm2col + __cuTensorMapEncodeIm2col = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2col') + {{endif}} + {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} + global __cuTensorMapEncodeIm2colWide + __cuTensorMapEncodeIm2colWide = dlfcn.dlsym(handle, 'cuTensorMapEncodeIm2colWide') + {{endif}} + {{if 'cuTensorMapReplaceAddress' in found_functions}} + global __cuTensorMapReplaceAddress + __cuTensorMapReplaceAddress = dlfcn.dlsym(handle, 'cuTensorMapReplaceAddress') + {{endif}} + {{if 'cuDeviceCanAccessPeer' in found_functions}} + global __cuDeviceCanAccessPeer + __cuDeviceCanAccessPeer = dlfcn.dlsym(handle, 'cuDeviceCanAccessPeer') + {{endif}} + {{if 'cuCtxEnablePeerAccess' in found_functions}} + global __cuCtxEnablePeerAccess + __cuCtxEnablePeerAccess = dlfcn.dlsym(handle, 'cuCtxEnablePeerAccess') + {{endif}} + {{if 'cuCtxDisablePeerAccess' in found_functions}} + global __cuCtxDisablePeerAccess + __cuCtxDisablePeerAccess = dlfcn.dlsym(handle, 'cuCtxDisablePeerAccess') + {{endif}} + {{if 'cuDeviceGetP2PAttribute' in found_functions}} + global __cuDeviceGetP2PAttribute + __cuDeviceGetP2PAttribute = dlfcn.dlsym(handle, 'cuDeviceGetP2PAttribute') + {{endif}} + {{if 'cuGraphicsUnregisterResource' in found_functions}} + global __cuGraphicsUnregisterResource + __cuGraphicsUnregisterResource = dlfcn.dlsym(handle, 'cuGraphicsUnregisterResource') + {{endif}} + {{if 'cuGraphicsSubResourceGetMappedArray' in found_functions}} + global __cuGraphicsSubResourceGetMappedArray + __cuGraphicsSubResourceGetMappedArray = dlfcn.dlsym(handle, 'cuGraphicsSubResourceGetMappedArray') + {{endif}} + {{if 'cuGraphicsResourceGetMappedMipmappedArray' in found_functions}} + global __cuGraphicsResourceGetMappedMipmappedArray + __cuGraphicsResourceGetMappedMipmappedArray = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedMipmappedArray') + {{endif}} + {{if 'cuGraphicsResourceGetMappedPointer_v2' in found_functions}} + global __cuGraphicsResourceGetMappedPointer_v2 + __cuGraphicsResourceGetMappedPointer_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedPointer_v2') + {{endif}} + {{if 'cuGraphicsResourceSetMapFlags_v2' in found_functions}} + global __cuGraphicsResourceSetMapFlags_v2 + __cuGraphicsResourceSetMapFlags_v2 = dlfcn.dlsym(handle, 'cuGraphicsResourceSetMapFlags_v2') + {{endif}} + {{if 'cuGetProcAddress_v2' in found_functions}} + global __cuGetProcAddress_v2 + __cuGetProcAddress_v2 = dlfcn.dlsym(handle, 'cuGetProcAddress_v2') + {{endif}} + {{if 'cuCoredumpGetAttribute' in found_functions}} + global __cuCoredumpGetAttribute + __cuCoredumpGetAttribute = dlfcn.dlsym(handle, 'cuCoredumpGetAttribute') + {{endif}} + {{if 'cuCoredumpGetAttributeGlobal' in found_functions}} + global __cuCoredumpGetAttributeGlobal + __cuCoredumpGetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpGetAttributeGlobal') + {{endif}} + {{if 'cuCoredumpSetAttribute' in found_functions}} + global __cuCoredumpSetAttribute + __cuCoredumpSetAttribute = dlfcn.dlsym(handle, 'cuCoredumpSetAttribute') + {{endif}} + {{if 'cuCoredumpSetAttributeGlobal' in found_functions}} + global __cuCoredumpSetAttributeGlobal + __cuCoredumpSetAttributeGlobal = dlfcn.dlsym(handle, 'cuCoredumpSetAttributeGlobal') + {{endif}} + {{if 'cuGetExportTable' in found_functions}} + global __cuGetExportTable + __cuGetExportTable = dlfcn.dlsym(handle, 'cuGetExportTable') + {{endif}} + {{if 'cuGreenCtxCreate' in found_functions}} + global __cuGreenCtxCreate + __cuGreenCtxCreate = dlfcn.dlsym(handle, 'cuGreenCtxCreate') + {{endif}} + {{if 'cuGreenCtxDestroy' in found_functions}} + global __cuGreenCtxDestroy + __cuGreenCtxDestroy = dlfcn.dlsym(handle, 'cuGreenCtxDestroy') + {{endif}} + {{if 'cuCtxFromGreenCtx' in found_functions}} + global __cuCtxFromGreenCtx + __cuCtxFromGreenCtx = dlfcn.dlsym(handle, 'cuCtxFromGreenCtx') + {{endif}} + {{if 'cuDeviceGetDevResource' in found_functions}} + global __cuDeviceGetDevResource + __cuDeviceGetDevResource = dlfcn.dlsym(handle, 'cuDeviceGetDevResource') + {{endif}} + {{if 'cuCtxGetDevResource' in found_functions}} + global __cuCtxGetDevResource + __cuCtxGetDevResource = dlfcn.dlsym(handle, 'cuCtxGetDevResource') + {{endif}} + {{if 'cuGreenCtxGetDevResource' in found_functions}} + global __cuGreenCtxGetDevResource + __cuGreenCtxGetDevResource = dlfcn.dlsym(handle, 'cuGreenCtxGetDevResource') + {{endif}} + {{if 'cuDevSmResourceSplitByCount' in found_functions}} + global __cuDevSmResourceSplitByCount + __cuDevSmResourceSplitByCount = dlfcn.dlsym(handle, 'cuDevSmResourceSplitByCount') + {{endif}} + {{if 'cuDevResourceGenerateDesc' in found_functions}} + global __cuDevResourceGenerateDesc + __cuDevResourceGenerateDesc = dlfcn.dlsym(handle, 'cuDevResourceGenerateDesc') + {{endif}} + {{if 'cuGreenCtxRecordEvent' in found_functions}} + global __cuGreenCtxRecordEvent + __cuGreenCtxRecordEvent = dlfcn.dlsym(handle, 'cuGreenCtxRecordEvent') + {{endif}} + {{if 'cuGreenCtxWaitEvent' in found_functions}} + global __cuGreenCtxWaitEvent + __cuGreenCtxWaitEvent = dlfcn.dlsym(handle, 'cuGreenCtxWaitEvent') + {{endif}} + {{if 'cuStreamGetGreenCtx' in found_functions}} + global __cuStreamGetGreenCtx + __cuStreamGetGreenCtx = dlfcn.dlsym(handle, 'cuStreamGetGreenCtx') + {{endif}} + {{if 'cuGreenCtxStreamCreate' in found_functions}} + global __cuGreenCtxStreamCreate + __cuGreenCtxStreamCreate = dlfcn.dlsym(handle, 'cuGreenCtxStreamCreate') + {{endif}} + {{if 'cuLogsRegisterCallback' in found_functions}} + global __cuLogsRegisterCallback + __cuLogsRegisterCallback = dlfcn.dlsym(handle, 'cuLogsRegisterCallback') + {{endif}} + {{if 'cuLogsUnregisterCallback' in found_functions}} + global __cuLogsUnregisterCallback + __cuLogsUnregisterCallback = dlfcn.dlsym(handle, 'cuLogsUnregisterCallback') + {{endif}} + {{if 'cuLogsCurrent' in found_functions}} + global __cuLogsCurrent + __cuLogsCurrent = dlfcn.dlsym(handle, 'cuLogsCurrent') + {{endif}} + {{if 'cuLogsDumpToFile' in found_functions}} + global __cuLogsDumpToFile + __cuLogsDumpToFile = dlfcn.dlsym(handle, 'cuLogsDumpToFile') + {{endif}} + {{if 'cuLogsDumpToMemory' in found_functions}} + global __cuLogsDumpToMemory + __cuLogsDumpToMemory = dlfcn.dlsym(handle, 'cuLogsDumpToMemory') + {{endif}} + {{if 'cuCheckpointProcessGetRestoreThreadId' in found_functions}} + global __cuCheckpointProcessGetRestoreThreadId + __cuCheckpointProcessGetRestoreThreadId = dlfcn.dlsym(handle, 'cuCheckpointProcessGetRestoreThreadId') + {{endif}} + {{if 'cuCheckpointProcessGetState' in found_functions}} + global __cuCheckpointProcessGetState + __cuCheckpointProcessGetState = dlfcn.dlsym(handle, 'cuCheckpointProcessGetState') + {{endif}} + {{if 'cuCheckpointProcessLock' in found_functions}} + global __cuCheckpointProcessLock + __cuCheckpointProcessLock = dlfcn.dlsym(handle, 'cuCheckpointProcessLock') + {{endif}} + {{if 'cuCheckpointProcessCheckpoint' in found_functions}} + global __cuCheckpointProcessCheckpoint + __cuCheckpointProcessCheckpoint = dlfcn.dlsym(handle, 'cuCheckpointProcessCheckpoint') + {{endif}} + {{if 'cuCheckpointProcessRestore' in found_functions}} + global __cuCheckpointProcessRestore + __cuCheckpointProcessRestore = dlfcn.dlsym(handle, 'cuCheckpointProcessRestore') + {{endif}} + {{if 'cuCheckpointProcessUnlock' in found_functions}} + global __cuCheckpointProcessUnlock + __cuCheckpointProcessUnlock = dlfcn.dlsym(handle, 'cuCheckpointProcessUnlock') + {{endif}} + {{if 'cuProfilerStart' in found_functions}} + global __cuProfilerStart + __cuProfilerStart = dlfcn.dlsym(handle, 'cuProfilerStart') + {{endif}} + {{if 'cuProfilerStop' in found_functions}} + global __cuProfilerStop + __cuProfilerStop = dlfcn.dlsym(handle, 'cuProfilerStop') + {{endif}} + {{if True}} + global __cuGraphicsEGLRegisterImage + __cuGraphicsEGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsEGLRegisterImage') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnect + __cuEGLStreamConsumerConnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnect') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerConnectWithFlags + __cuEGLStreamConsumerConnectWithFlags = dlfcn.dlsym(handle, 'cuEGLStreamConsumerConnectWithFlags') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerDisconnect + __cuEGLStreamConsumerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamConsumerDisconnect') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerAcquireFrame + __cuEGLStreamConsumerAcquireFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerAcquireFrame') + {{endif}} + {{if True}} + global __cuEGLStreamConsumerReleaseFrame + __cuEGLStreamConsumerReleaseFrame = dlfcn.dlsym(handle, 'cuEGLStreamConsumerReleaseFrame') + {{endif}} + {{if True}} + global __cuEGLStreamProducerConnect + __cuEGLStreamProducerConnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerConnect') + {{endif}} + {{if True}} + global __cuEGLStreamProducerDisconnect + __cuEGLStreamProducerDisconnect = dlfcn.dlsym(handle, 'cuEGLStreamProducerDisconnect') + {{endif}} + {{if True}} + global __cuEGLStreamProducerPresentFrame + __cuEGLStreamProducerPresentFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerPresentFrame') + {{endif}} + {{if True}} + global __cuEGLStreamProducerReturnFrame + __cuEGLStreamProducerReturnFrame = dlfcn.dlsym(handle, 'cuEGLStreamProducerReturnFrame') + {{endif}} + {{if True}} + global __cuGraphicsResourceGetMappedEglFrame + __cuGraphicsResourceGetMappedEglFrame = dlfcn.dlsym(handle, 'cuGraphicsResourceGetMappedEglFrame') + {{endif}} + {{if True}} + global __cuEventCreateFromEGLSync + __cuEventCreateFromEGLSync = dlfcn.dlsym(handle, 'cuEventCreateFromEGLSync') + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterBuffer + __cuGraphicsGLRegisterBuffer = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterBuffer') + {{endif}} + {{if True}} + global __cuGraphicsGLRegisterImage + __cuGraphicsGLRegisterImage = dlfcn.dlsym(handle, 'cuGraphicsGLRegisterImage') + {{endif}} + {{if True}} + global __cuGLGetDevices_v2 + __cuGLGetDevices_v2 = dlfcn.dlsym(handle, 'cuGLGetDevices_v2') + {{endif}} + {{if True}} + global __cuVDPAUGetDevice + __cuVDPAUGetDevice = dlfcn.dlsym(handle, 'cuVDPAUGetDevice') + {{endif}} + {{if True}} + global __cuVDPAUCtxCreate_v2 + __cuVDPAUCtxCreate_v2 = dlfcn.dlsym(handle, 'cuVDPAUCtxCreate_v2') + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterVideoSurface + __cuGraphicsVDPAURegisterVideoSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterVideoSurface') + {{endif}} + {{if True}} + global __cuGraphicsVDPAURegisterOutputSurface + __cuGraphicsVDPAURegisterOutputSurface = dlfcn.dlsym(handle, 'cuGraphicsVDPAURegisterOutputSurface') + {{endif}} + {{endif}} + __cuPythonInit = True + return 0 + +# Create a very small function to check whether we are init'ed, so the C +# compiler can inline it. +cdef inline int cuPythonInit() except -1 nogil: + if __cuPythonInit: + return 0 + return _cuPythonInit() {{if 'cuGetErrorString' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in index c498b0f675..091ce52e99 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in @@ -4,14 +4,15 @@ # This code was automatically generated with version 12.9.0. Do not modify it directly. {{if 'Windows' == platform.system()}} import os -import win32api +cimport cuda.bindings._lib.windll as windll {{else}} cimport cuda.bindings._lib.dlfcn as dlfcn -from libc.stdint cimport uintptr_t {{endif}} -from cuda.bindings import path_finder -from libc.stdint cimport intptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +from libc.stdint cimport intptr_t, uintptr_t +import threading +cdef object __symbol_lock = threading.Lock() cdef bint __cuPythonInit = False {{if 'nvrtcGetErrorString' in found_functions}}cdef void *__nvrtcGetErrorString = NULL{{endif}} {{if 'nvrtcVersion' in found_functions}}cdef void *__nvrtcVersion = NULL{{endif}} @@ -40,315 +41,239 @@ cdef bint __cuPythonInit = False {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}}cdef void *__nvrtcGetPCHHeapSizeRequired = NULL{{endif}} {{if 'nvrtcSetFlowCallback' in found_functions}}cdef void *__nvrtcSetFlowCallback = NULL{{endif}} -cdef int cuPythonInit() except -1 nogil: +cdef int _cuPythonInit() except -1 nogil: global __cuPythonInit - if __cuPythonInit: - return 0 - __cuPythonInit = True # Load library - {{if 'Windows' == platform.system()}} - with gil: - handle = path_finder._load_nvidia_dynamic_library("nvrtc").handle - {{else}} - with gil: - handle = path_finder._load_nvidia_dynamic_library("nvrtc").handle - {{endif}} + with gil, __symbol_lock: + {{if 'Windows' == platform.system()}} + handle = load_nvidia_dynamic_lib("nvrtc")._handle_uint + # Load function + {{if 'nvrtcGetErrorString' in found_functions}} + global __nvrtcGetErrorString + __nvrtcGetErrorString = windll.GetProcAddress(handle, 'nvrtcGetErrorString') + {{endif}} + {{if 'nvrtcVersion' in found_functions}} + global __nvrtcVersion + __nvrtcVersion = windll.GetProcAddress(handle, 'nvrtcVersion') + {{endif}} + {{if 'nvrtcGetNumSupportedArchs' in found_functions}} + global __nvrtcGetNumSupportedArchs + __nvrtcGetNumSupportedArchs = windll.GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') + {{endif}} + {{if 'nvrtcGetSupportedArchs' in found_functions}} + global __nvrtcGetSupportedArchs + __nvrtcGetSupportedArchs = windll.GetProcAddress(handle, 'nvrtcGetSupportedArchs') + {{endif}} + {{if 'nvrtcCreateProgram' in found_functions}} + global __nvrtcCreateProgram + __nvrtcCreateProgram = windll.GetProcAddress(handle, 'nvrtcCreateProgram') + {{endif}} + {{if 'nvrtcDestroyProgram' in found_functions}} + global __nvrtcDestroyProgram + __nvrtcDestroyProgram = windll.GetProcAddress(handle, 'nvrtcDestroyProgram') + {{endif}} + {{if 'nvrtcCompileProgram' in found_functions}} + global __nvrtcCompileProgram + __nvrtcCompileProgram = windll.GetProcAddress(handle, 'nvrtcCompileProgram') + {{endif}} + {{if 'nvrtcGetPTXSize' in found_functions}} + global __nvrtcGetPTXSize + __nvrtcGetPTXSize = windll.GetProcAddress(handle, 'nvrtcGetPTXSize') + {{endif}} + {{if 'nvrtcGetPTX' in found_functions}} + global __nvrtcGetPTX + __nvrtcGetPTX = windll.GetProcAddress(handle, 'nvrtcGetPTX') + {{endif}} + {{if 'nvrtcGetCUBINSize' in found_functions}} + global __nvrtcGetCUBINSize + __nvrtcGetCUBINSize = windll.GetProcAddress(handle, 'nvrtcGetCUBINSize') + {{endif}} + {{if 'nvrtcGetCUBIN' in found_functions}} + global __nvrtcGetCUBIN + __nvrtcGetCUBIN = windll.GetProcAddress(handle, 'nvrtcGetCUBIN') + {{endif}} + {{if 'nvrtcGetNVVMSize' in found_functions}} + global __nvrtcGetNVVMSize + __nvrtcGetNVVMSize = windll.GetProcAddress(handle, 'nvrtcGetNVVMSize') + {{endif}} + {{if 'nvrtcGetNVVM' in found_functions}} + global __nvrtcGetNVVM + __nvrtcGetNVVM = windll.GetProcAddress(handle, 'nvrtcGetNVVM') + {{endif}} + {{if 'nvrtcGetLTOIRSize' in found_functions}} + global __nvrtcGetLTOIRSize + __nvrtcGetLTOIRSize = windll.GetProcAddress(handle, 'nvrtcGetLTOIRSize') + {{endif}} + {{if 'nvrtcGetLTOIR' in found_functions}} + global __nvrtcGetLTOIR + __nvrtcGetLTOIR = windll.GetProcAddress(handle, 'nvrtcGetLTOIR') + {{endif}} + {{if 'nvrtcGetOptiXIRSize' in found_functions}} + global __nvrtcGetOptiXIRSize + __nvrtcGetOptiXIRSize = windll.GetProcAddress(handle, 'nvrtcGetOptiXIRSize') + {{endif}} + {{if 'nvrtcGetOptiXIR' in found_functions}} + global __nvrtcGetOptiXIR + __nvrtcGetOptiXIR = windll.GetProcAddress(handle, 'nvrtcGetOptiXIR') + {{endif}} + {{if 'nvrtcGetProgramLogSize' in found_functions}} + global __nvrtcGetProgramLogSize + __nvrtcGetProgramLogSize = windll.GetProcAddress(handle, 'nvrtcGetProgramLogSize') + {{endif}} + {{if 'nvrtcGetProgramLog' in found_functions}} + global __nvrtcGetProgramLog + __nvrtcGetProgramLog = windll.GetProcAddress(handle, 'nvrtcGetProgramLog') + {{endif}} + {{if 'nvrtcAddNameExpression' in found_functions}} + global __nvrtcAddNameExpression + __nvrtcAddNameExpression = windll.GetProcAddress(handle, 'nvrtcAddNameExpression') + {{endif}} + {{if 'nvrtcGetLoweredName' in found_functions}} + global __nvrtcGetLoweredName + __nvrtcGetLoweredName = windll.GetProcAddress(handle, 'nvrtcGetLoweredName') + {{endif}} + {{if 'nvrtcGetPCHHeapSize' in found_functions}} + global __nvrtcGetPCHHeapSize + __nvrtcGetPCHHeapSize = windll.GetProcAddress(handle, 'nvrtcGetPCHHeapSize') + {{endif}} + {{if 'nvrtcSetPCHHeapSize' in found_functions}} + global __nvrtcSetPCHHeapSize + __nvrtcSetPCHHeapSize = windll.GetProcAddress(handle, 'nvrtcSetPCHHeapSize') + {{endif}} + {{if 'nvrtcGetPCHCreateStatus' in found_functions}} + global __nvrtcGetPCHCreateStatus + __nvrtcGetPCHCreateStatus = windll.GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') + {{endif}} + {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} + global __nvrtcGetPCHHeapSizeRequired + __nvrtcGetPCHHeapSizeRequired = windll.GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') + {{endif}} + {{if 'nvrtcSetFlowCallback' in found_functions}} + global __nvrtcSetFlowCallback + __nvrtcSetFlowCallback = windll.GetProcAddress(handle, 'nvrtcSetFlowCallback') + {{endif}} + + {{else}} + handle = (load_nvidia_dynamic_lib("nvrtc")._handle_uint) - # Load function - {{if 'Windows' == platform.system()}} - with gil: + # Load function {{if 'nvrtcGetErrorString' in found_functions}} - try: - global __nvrtcGetErrorString - __nvrtcGetErrorString = win32api.GetProcAddress(handle, 'nvrtcGetErrorString') - except: - pass + global __nvrtcGetErrorString + __nvrtcGetErrorString = dlfcn.dlsym(handle, 'nvrtcGetErrorString') {{endif}} {{if 'nvrtcVersion' in found_functions}} - try: - global __nvrtcVersion - __nvrtcVersion = win32api.GetProcAddress(handle, 'nvrtcVersion') - except: - pass + global __nvrtcVersion + __nvrtcVersion = dlfcn.dlsym(handle, 'nvrtcVersion') {{endif}} {{if 'nvrtcGetNumSupportedArchs' in found_functions}} - try: - global __nvrtcGetNumSupportedArchs - __nvrtcGetNumSupportedArchs = win32api.GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') - except: - pass + global __nvrtcGetNumSupportedArchs + __nvrtcGetNumSupportedArchs = dlfcn.dlsym(handle, 'nvrtcGetNumSupportedArchs') {{endif}} {{if 'nvrtcGetSupportedArchs' in found_functions}} - try: - global __nvrtcGetSupportedArchs - __nvrtcGetSupportedArchs = win32api.GetProcAddress(handle, 'nvrtcGetSupportedArchs') - except: - pass + global __nvrtcGetSupportedArchs + __nvrtcGetSupportedArchs = dlfcn.dlsym(handle, 'nvrtcGetSupportedArchs') {{endif}} {{if 'nvrtcCreateProgram' in found_functions}} - try: - global __nvrtcCreateProgram - __nvrtcCreateProgram = win32api.GetProcAddress(handle, 'nvrtcCreateProgram') - except: - pass + global __nvrtcCreateProgram + __nvrtcCreateProgram = dlfcn.dlsym(handle, 'nvrtcCreateProgram') {{endif}} {{if 'nvrtcDestroyProgram' in found_functions}} - try: - global __nvrtcDestroyProgram - __nvrtcDestroyProgram = win32api.GetProcAddress(handle, 'nvrtcDestroyProgram') - except: - pass + global __nvrtcDestroyProgram + __nvrtcDestroyProgram = dlfcn.dlsym(handle, 'nvrtcDestroyProgram') {{endif}} {{if 'nvrtcCompileProgram' in found_functions}} - try: - global __nvrtcCompileProgram - __nvrtcCompileProgram = win32api.GetProcAddress(handle, 'nvrtcCompileProgram') - except: - pass + global __nvrtcCompileProgram + __nvrtcCompileProgram = dlfcn.dlsym(handle, 'nvrtcCompileProgram') {{endif}} {{if 'nvrtcGetPTXSize' in found_functions}} - try: - global __nvrtcGetPTXSize - __nvrtcGetPTXSize = win32api.GetProcAddress(handle, 'nvrtcGetPTXSize') - except: - pass + global __nvrtcGetPTXSize + __nvrtcGetPTXSize = dlfcn.dlsym(handle, 'nvrtcGetPTXSize') {{endif}} {{if 'nvrtcGetPTX' in found_functions}} - try: - global __nvrtcGetPTX - __nvrtcGetPTX = win32api.GetProcAddress(handle, 'nvrtcGetPTX') - except: - pass + global __nvrtcGetPTX + __nvrtcGetPTX = dlfcn.dlsym(handle, 'nvrtcGetPTX') {{endif}} {{if 'nvrtcGetCUBINSize' in found_functions}} - try: - global __nvrtcGetCUBINSize - __nvrtcGetCUBINSize = win32api.GetProcAddress(handle, 'nvrtcGetCUBINSize') - except: - pass + global __nvrtcGetCUBINSize + __nvrtcGetCUBINSize = dlfcn.dlsym(handle, 'nvrtcGetCUBINSize') {{endif}} {{if 'nvrtcGetCUBIN' in found_functions}} - try: - global __nvrtcGetCUBIN - __nvrtcGetCUBIN = win32api.GetProcAddress(handle, 'nvrtcGetCUBIN') - except: - pass + global __nvrtcGetCUBIN + __nvrtcGetCUBIN = dlfcn.dlsym(handle, 'nvrtcGetCUBIN') {{endif}} {{if 'nvrtcGetNVVMSize' in found_functions}} - try: - global __nvrtcGetNVVMSize - __nvrtcGetNVVMSize = win32api.GetProcAddress(handle, 'nvrtcGetNVVMSize') - except: - pass + global __nvrtcGetNVVMSize + __nvrtcGetNVVMSize = dlfcn.dlsym(handle, 'nvrtcGetNVVMSize') {{endif}} {{if 'nvrtcGetNVVM' in found_functions}} - try: - global __nvrtcGetNVVM - __nvrtcGetNVVM = win32api.GetProcAddress(handle, 'nvrtcGetNVVM') - except: - pass + global __nvrtcGetNVVM + __nvrtcGetNVVM = dlfcn.dlsym(handle, 'nvrtcGetNVVM') {{endif}} {{if 'nvrtcGetLTOIRSize' in found_functions}} - try: - global __nvrtcGetLTOIRSize - __nvrtcGetLTOIRSize = win32api.GetProcAddress(handle, 'nvrtcGetLTOIRSize') - except: - pass + global __nvrtcGetLTOIRSize + __nvrtcGetLTOIRSize = dlfcn.dlsym(handle, 'nvrtcGetLTOIRSize') {{endif}} {{if 'nvrtcGetLTOIR' in found_functions}} - try: - global __nvrtcGetLTOIR - __nvrtcGetLTOIR = win32api.GetProcAddress(handle, 'nvrtcGetLTOIR') - except: - pass + global __nvrtcGetLTOIR + __nvrtcGetLTOIR = dlfcn.dlsym(handle, 'nvrtcGetLTOIR') {{endif}} {{if 'nvrtcGetOptiXIRSize' in found_functions}} - try: - global __nvrtcGetOptiXIRSize - __nvrtcGetOptiXIRSize = win32api.GetProcAddress(handle, 'nvrtcGetOptiXIRSize') - except: - pass + global __nvrtcGetOptiXIRSize + __nvrtcGetOptiXIRSize = dlfcn.dlsym(handle, 'nvrtcGetOptiXIRSize') {{endif}} {{if 'nvrtcGetOptiXIR' in found_functions}} - try: - global __nvrtcGetOptiXIR - __nvrtcGetOptiXIR = win32api.GetProcAddress(handle, 'nvrtcGetOptiXIR') - except: - pass + global __nvrtcGetOptiXIR + __nvrtcGetOptiXIR = dlfcn.dlsym(handle, 'nvrtcGetOptiXIR') {{endif}} {{if 'nvrtcGetProgramLogSize' in found_functions}} - try: - global __nvrtcGetProgramLogSize - __nvrtcGetProgramLogSize = win32api.GetProcAddress(handle, 'nvrtcGetProgramLogSize') - except: - pass + global __nvrtcGetProgramLogSize + __nvrtcGetProgramLogSize = dlfcn.dlsym(handle, 'nvrtcGetProgramLogSize') {{endif}} {{if 'nvrtcGetProgramLog' in found_functions}} - try: - global __nvrtcGetProgramLog - __nvrtcGetProgramLog = win32api.GetProcAddress(handle, 'nvrtcGetProgramLog') - except: - pass + global __nvrtcGetProgramLog + __nvrtcGetProgramLog = dlfcn.dlsym(handle, 'nvrtcGetProgramLog') {{endif}} {{if 'nvrtcAddNameExpression' in found_functions}} - try: - global __nvrtcAddNameExpression - __nvrtcAddNameExpression = win32api.GetProcAddress(handle, 'nvrtcAddNameExpression') - except: - pass + global __nvrtcAddNameExpression + __nvrtcAddNameExpression = dlfcn.dlsym(handle, 'nvrtcAddNameExpression') {{endif}} {{if 'nvrtcGetLoweredName' in found_functions}} - try: - global __nvrtcGetLoweredName - __nvrtcGetLoweredName = win32api.GetProcAddress(handle, 'nvrtcGetLoweredName') - except: - pass + global __nvrtcGetLoweredName + __nvrtcGetLoweredName = dlfcn.dlsym(handle, 'nvrtcGetLoweredName') {{endif}} {{if 'nvrtcGetPCHHeapSize' in found_functions}} - try: - global __nvrtcGetPCHHeapSize - __nvrtcGetPCHHeapSize = win32api.GetProcAddress(handle, 'nvrtcGetPCHHeapSize') - except: - pass + global __nvrtcGetPCHHeapSize + __nvrtcGetPCHHeapSize = dlfcn.dlsym(handle, 'nvrtcGetPCHHeapSize') {{endif}} {{if 'nvrtcSetPCHHeapSize' in found_functions}} - try: - global __nvrtcSetPCHHeapSize - __nvrtcSetPCHHeapSize = win32api.GetProcAddress(handle, 'nvrtcSetPCHHeapSize') - except: - pass + global __nvrtcSetPCHHeapSize + __nvrtcSetPCHHeapSize = dlfcn.dlsym(handle, 'nvrtcSetPCHHeapSize') {{endif}} {{if 'nvrtcGetPCHCreateStatus' in found_functions}} - try: - global __nvrtcGetPCHCreateStatus - __nvrtcGetPCHCreateStatus = win32api.GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') - except: - pass + global __nvrtcGetPCHCreateStatus + __nvrtcGetPCHCreateStatus = dlfcn.dlsym(handle, 'nvrtcGetPCHCreateStatus') {{endif}} {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - try: - global __nvrtcGetPCHHeapSizeRequired - __nvrtcGetPCHHeapSizeRequired = win32api.GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') - except: - pass + global __nvrtcGetPCHHeapSizeRequired + __nvrtcGetPCHHeapSizeRequired = dlfcn.dlsym(handle, 'nvrtcGetPCHHeapSizeRequired') {{endif}} {{if 'nvrtcSetFlowCallback' in found_functions}} - try: - global __nvrtcSetFlowCallback - __nvrtcSetFlowCallback = win32api.GetProcAddress(handle, 'nvrtcSetFlowCallback') - except: - pass + global __nvrtcSetFlowCallback + __nvrtcSetFlowCallback = dlfcn.dlsym(handle, 'nvrtcSetFlowCallback') {{endif}} - {{else}} - {{if 'nvrtcGetErrorString' in found_functions}} - global __nvrtcGetErrorString - __nvrtcGetErrorString = dlfcn.dlsym(handle, 'nvrtcGetErrorString') - {{endif}} - {{if 'nvrtcVersion' in found_functions}} - global __nvrtcVersion - __nvrtcVersion = dlfcn.dlsym(handle, 'nvrtcVersion') - {{endif}} - {{if 'nvrtcGetNumSupportedArchs' in found_functions}} - global __nvrtcGetNumSupportedArchs - __nvrtcGetNumSupportedArchs = dlfcn.dlsym(handle, 'nvrtcGetNumSupportedArchs') - {{endif}} - {{if 'nvrtcGetSupportedArchs' in found_functions}} - global __nvrtcGetSupportedArchs - __nvrtcGetSupportedArchs = dlfcn.dlsym(handle, 'nvrtcGetSupportedArchs') - {{endif}} - {{if 'nvrtcCreateProgram' in found_functions}} - global __nvrtcCreateProgram - __nvrtcCreateProgram = dlfcn.dlsym(handle, 'nvrtcCreateProgram') - {{endif}} - {{if 'nvrtcDestroyProgram' in found_functions}} - global __nvrtcDestroyProgram - __nvrtcDestroyProgram = dlfcn.dlsym(handle, 'nvrtcDestroyProgram') - {{endif}} - {{if 'nvrtcCompileProgram' in found_functions}} - global __nvrtcCompileProgram - __nvrtcCompileProgram = dlfcn.dlsym(handle, 'nvrtcCompileProgram') - {{endif}} - {{if 'nvrtcGetPTXSize' in found_functions}} - global __nvrtcGetPTXSize - __nvrtcGetPTXSize = dlfcn.dlsym(handle, 'nvrtcGetPTXSize') - {{endif}} - {{if 'nvrtcGetPTX' in found_functions}} - global __nvrtcGetPTX - __nvrtcGetPTX = dlfcn.dlsym(handle, 'nvrtcGetPTX') - {{endif}} - {{if 'nvrtcGetCUBINSize' in found_functions}} - global __nvrtcGetCUBINSize - __nvrtcGetCUBINSize = dlfcn.dlsym(handle, 'nvrtcGetCUBINSize') - {{endif}} - {{if 'nvrtcGetCUBIN' in found_functions}} - global __nvrtcGetCUBIN - __nvrtcGetCUBIN = dlfcn.dlsym(handle, 'nvrtcGetCUBIN') - {{endif}} - {{if 'nvrtcGetNVVMSize' in found_functions}} - global __nvrtcGetNVVMSize - __nvrtcGetNVVMSize = dlfcn.dlsym(handle, 'nvrtcGetNVVMSize') - {{endif}} - {{if 'nvrtcGetNVVM' in found_functions}} - global __nvrtcGetNVVM - __nvrtcGetNVVM = dlfcn.dlsym(handle, 'nvrtcGetNVVM') - {{endif}} - {{if 'nvrtcGetLTOIRSize' in found_functions}} - global __nvrtcGetLTOIRSize - __nvrtcGetLTOIRSize = dlfcn.dlsym(handle, 'nvrtcGetLTOIRSize') - {{endif}} - {{if 'nvrtcGetLTOIR' in found_functions}} - global __nvrtcGetLTOIR - __nvrtcGetLTOIR = dlfcn.dlsym(handle, 'nvrtcGetLTOIR') - {{endif}} - {{if 'nvrtcGetOptiXIRSize' in found_functions}} - global __nvrtcGetOptiXIRSize - __nvrtcGetOptiXIRSize = dlfcn.dlsym(handle, 'nvrtcGetOptiXIRSize') - {{endif}} - {{if 'nvrtcGetOptiXIR' in found_functions}} - global __nvrtcGetOptiXIR - __nvrtcGetOptiXIR = dlfcn.dlsym(handle, 'nvrtcGetOptiXIR') - {{endif}} - {{if 'nvrtcGetProgramLogSize' in found_functions}} - global __nvrtcGetProgramLogSize - __nvrtcGetProgramLogSize = dlfcn.dlsym(handle, 'nvrtcGetProgramLogSize') - {{endif}} - {{if 'nvrtcGetProgramLog' in found_functions}} - global __nvrtcGetProgramLog - __nvrtcGetProgramLog = dlfcn.dlsym(handle, 'nvrtcGetProgramLog') - {{endif}} - {{if 'nvrtcAddNameExpression' in found_functions}} - global __nvrtcAddNameExpression - __nvrtcAddNameExpression = dlfcn.dlsym(handle, 'nvrtcAddNameExpression') - {{endif}} - {{if 'nvrtcGetLoweredName' in found_functions}} - global __nvrtcGetLoweredName - __nvrtcGetLoweredName = dlfcn.dlsym(handle, 'nvrtcGetLoweredName') - {{endif}} - {{if 'nvrtcGetPCHHeapSize' in found_functions}} - global __nvrtcGetPCHHeapSize - __nvrtcGetPCHHeapSize = dlfcn.dlsym(handle, 'nvrtcGetPCHHeapSize') - {{endif}} - {{if 'nvrtcSetPCHHeapSize' in found_functions}} - global __nvrtcSetPCHHeapSize - __nvrtcSetPCHHeapSize = dlfcn.dlsym(handle, 'nvrtcSetPCHHeapSize') - {{endif}} - {{if 'nvrtcGetPCHCreateStatus' in found_functions}} - global __nvrtcGetPCHCreateStatus - __nvrtcGetPCHCreateStatus = dlfcn.dlsym(handle, 'nvrtcGetPCHCreateStatus') - {{endif}} - {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} - global __nvrtcGetPCHHeapSizeRequired - __nvrtcGetPCHHeapSizeRequired = dlfcn.dlsym(handle, 'nvrtcGetPCHHeapSizeRequired') - {{endif}} - {{if 'nvrtcSetFlowCallback' in found_functions}} - global __nvrtcSetFlowCallback - __nvrtcSetFlowCallback = dlfcn.dlsym(handle, 'nvrtcSetFlowCallback') - {{endif}} + {{endif}} + __cuPythonInit = True + return 0 - {{endif}} +# Create a very small function to check whether we are init'ed, so the C +# compiler can inline it. +cdef inline int cuPythonInit() except -1 nogil: + if __cuPythonInit: + return 0 + return _cuPythonInit() {{if 'nvrtcGetErrorString' in found_functions}} diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in index cb08830d71..7a1039ed8a 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in @@ -4,6 +4,8 @@ # This code was automatically generated with version 12.9.0. Do not modify it directly. include "../cyruntime_types.pxi" +include "../_lib/cyruntime/cyruntime.pxd" + {{if 'cudaDeviceReset' in found_functions}} cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in index 92c0ceb159..99690bbfd9 100644 --- a/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in @@ -10,16 +10,22 @@ cimport cython cdef bint __cudaPythonInit = False cdef bint __usePTDS = False -cdef int cudaPythonInit() except -1 nogil: +cdef int _cudaPythonInit() except -1 nogil: global __cudaPythonInit global __usePTDS - if __cudaPythonInit: - return __usePTDS + with gil: __usePTDS = os.getenv('CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM', default=False) __cudaPythonInit = True return __usePTDS +# Create a very small function to check whether we are init'ed, so the C +# compiler can inline it. +cdef inline int cudaPythonInit() except -1 nogil: + if __cudaPythonInit: + return __usePTDS + return _cudaPythonInit() + {{if 'cudaDeviceReset' in found_functions}} cdef cudaError_t _cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil: @@ -2647,3 +2653,6 @@ cdef cudaError_t _cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver no return ptds._cudaProfilerStop() return cudaProfilerStop() {{endif}} + + +include "../_lib/cyruntime/cyruntime.pxi" diff --git a/cuda_bindings/cuda/bindings/_internal/cufile.pxd b/cuda_bindings/cuda/bindings/_internal/cufile.pxd index 9cccb9fee6..880343da3f 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile.pxd +++ b/cuda_bindings/cuda/bindings/_internal/cufile.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 12.9.1. Do not modify it directly. from ..cycufile cimport * @@ -41,3 +41,4 @@ cdef CUfileError_t _cuFileGetParameterString(CUFileStringConfigParameter_t param cdef CUfileError_t _cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 66cb24ea71..dafeec2816 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -2,16 +2,18 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib import cython + ############################################################################### # Extern ############################################################################### @@ -35,6 +37,7 @@ cdef extern from "" nogil: # Wrapper init ############################################################################### +cdef object __symbol_lock = threading.Lock() cdef bint __py_cufile_init = False cdef void* __cuDriverGetVersion = NULL @@ -68,252 +71,247 @@ cdef void* __cuFileGetParameterString = NULL cdef void* __cuFileSetParameterSizeT = NULL cdef void* __cuFileSetParameterBool = NULL cdef void* __cuFileSetParameterString = NULL +cdef void* __cuFileDriverClose = NULL -cdef void* load_library(const int driver_ver) except* with gil: - cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("cufile").handle +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("cufile")._handle_uint return handle -cdef int _check_or_init_cufile() except -1 nogil: +cdef int __check_or_init_cufile() except -1 nogil: global __py_cufile_init - if __py_cufile_init: - return 0 - # Load driver to check version cdef void* handle = NULL - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - with gil: - err_msg = dlerror() - raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - with gil: - raise RuntimeError('something went wrong') - cdef int err, driver_ver - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - with gil: - raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL - - # Load function - global __cuFileHandleRegister - __cuFileHandleRegister = dlsym(RTLD_DEFAULT, 'cuFileHandleRegister') - if __cuFileHandleRegister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileHandleRegister = dlsym(handle, 'cuFileHandleRegister') - - global __cuFileHandleDeregister - __cuFileHandleDeregister = dlsym(RTLD_DEFAULT, 'cuFileHandleDeregister') - if __cuFileHandleDeregister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileHandleDeregister = dlsym(handle, 'cuFileHandleDeregister') - - global __cuFileBufRegister - __cuFileBufRegister = dlsym(RTLD_DEFAULT, 'cuFileBufRegister') - if __cuFileBufRegister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBufRegister = dlsym(handle, 'cuFileBufRegister') - - global __cuFileBufDeregister - __cuFileBufDeregister = dlsym(RTLD_DEFAULT, 'cuFileBufDeregister') - if __cuFileBufDeregister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBufDeregister = dlsym(handle, 'cuFileBufDeregister') - - global __cuFileRead - __cuFileRead = dlsym(RTLD_DEFAULT, 'cuFileRead') - if __cuFileRead == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileRead = dlsym(handle, 'cuFileRead') - - global __cuFileWrite - __cuFileWrite = dlsym(RTLD_DEFAULT, 'cuFileWrite') - if __cuFileWrite == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileWrite = dlsym(handle, 'cuFileWrite') - - global __cuFileDriverOpen - __cuFileDriverOpen = dlsym(RTLD_DEFAULT, 'cuFileDriverOpen') - if __cuFileDriverOpen == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverOpen = dlsym(handle, 'cuFileDriverOpen') - - global __cuFileDriverClose_v2 - __cuFileDriverClose_v2 = dlsym(RTLD_DEFAULT, 'cuFileDriverClose_v2') - if __cuFileDriverClose_v2 == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverClose_v2 = dlsym(handle, 'cuFileDriverClose_v2') - - global __cuFileUseCount - __cuFileUseCount = dlsym(RTLD_DEFAULT, 'cuFileUseCount') - if __cuFileUseCount == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileUseCount = dlsym(handle, 'cuFileUseCount') - - global __cuFileDriverGetProperties - __cuFileDriverGetProperties = dlsym(RTLD_DEFAULT, 'cuFileDriverGetProperties') - if __cuFileDriverGetProperties == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverGetProperties = dlsym(handle, 'cuFileDriverGetProperties') - - global __cuFileDriverSetPollMode - __cuFileDriverSetPollMode = dlsym(RTLD_DEFAULT, 'cuFileDriverSetPollMode') - if __cuFileDriverSetPollMode == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverSetPollMode = dlsym(handle, 'cuFileDriverSetPollMode') - - global __cuFileDriverSetMaxDirectIOSize - __cuFileDriverSetMaxDirectIOSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxDirectIOSize') - if __cuFileDriverSetMaxDirectIOSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverSetMaxDirectIOSize = dlsym(handle, 'cuFileDriverSetMaxDirectIOSize') - - global __cuFileDriverSetMaxCacheSize - __cuFileDriverSetMaxCacheSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxCacheSize') - if __cuFileDriverSetMaxCacheSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverSetMaxCacheSize = dlsym(handle, 'cuFileDriverSetMaxCacheSize') - - global __cuFileDriverSetMaxPinnedMemSize - __cuFileDriverSetMaxPinnedMemSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxPinnedMemSize') - if __cuFileDriverSetMaxPinnedMemSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileDriverSetMaxPinnedMemSize = dlsym(handle, 'cuFileDriverSetMaxPinnedMemSize') - - global __cuFileBatchIOSetUp - __cuFileBatchIOSetUp = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSetUp') - if __cuFileBatchIOSetUp == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIOSetUp = dlsym(handle, 'cuFileBatchIOSetUp') - global __cuFileBatchIOSubmit - __cuFileBatchIOSubmit = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSubmit') - if __cuFileBatchIOSubmit == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIOSubmit = dlsym(handle, 'cuFileBatchIOSubmit') - - global __cuFileBatchIOGetStatus - __cuFileBatchIOGetStatus = dlsym(RTLD_DEFAULT, 'cuFileBatchIOGetStatus') - if __cuFileBatchIOGetStatus == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIOGetStatus = dlsym(handle, 'cuFileBatchIOGetStatus') - - global __cuFileBatchIOCancel - __cuFileBatchIOCancel = dlsym(RTLD_DEFAULT, 'cuFileBatchIOCancel') - if __cuFileBatchIOCancel == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIOCancel = dlsym(handle, 'cuFileBatchIOCancel') - - global __cuFileBatchIODestroy - __cuFileBatchIODestroy = dlsym(RTLD_DEFAULT, 'cuFileBatchIODestroy') - if __cuFileBatchIODestroy == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileBatchIODestroy = dlsym(handle, 'cuFileBatchIODestroy') - - global __cuFileReadAsync - __cuFileReadAsync = dlsym(RTLD_DEFAULT, 'cuFileReadAsync') - if __cuFileReadAsync == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileReadAsync = dlsym(handle, 'cuFileReadAsync') - - global __cuFileWriteAsync - __cuFileWriteAsync = dlsym(RTLD_DEFAULT, 'cuFileWriteAsync') - if __cuFileWriteAsync == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileWriteAsync = dlsym(handle, 'cuFileWriteAsync') - - global __cuFileStreamRegister - __cuFileStreamRegister = dlsym(RTLD_DEFAULT, 'cuFileStreamRegister') - if __cuFileStreamRegister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileStreamRegister = dlsym(handle, 'cuFileStreamRegister') - - global __cuFileStreamDeregister - __cuFileStreamDeregister = dlsym(RTLD_DEFAULT, 'cuFileStreamDeregister') - if __cuFileStreamDeregister == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileStreamDeregister = dlsym(handle, 'cuFileStreamDeregister') - - global __cuFileGetVersion - __cuFileGetVersion = dlsym(RTLD_DEFAULT, 'cuFileGetVersion') - if __cuFileGetVersion == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetVersion = dlsym(handle, 'cuFileGetVersion') - - global __cuFileGetParameterSizeT - __cuFileGetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileGetParameterSizeT') - if __cuFileGetParameterSizeT == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetParameterSizeT = dlsym(handle, 'cuFileGetParameterSizeT') - - global __cuFileGetParameterBool - __cuFileGetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileGetParameterBool') - if __cuFileGetParameterBool == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetParameterBool = dlsym(handle, 'cuFileGetParameterBool') - - global __cuFileGetParameterString - __cuFileGetParameterString = dlsym(RTLD_DEFAULT, 'cuFileGetParameterString') - if __cuFileGetParameterString == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileGetParameterString = dlsym(handle, 'cuFileGetParameterString') + with gil, __symbol_lock: + # Load function + global __cuFileHandleRegister + __cuFileHandleRegister = dlsym(RTLD_DEFAULT, 'cuFileHandleRegister') + if __cuFileHandleRegister == NULL: + if handle == NULL: + handle = load_library() + __cuFileHandleRegister = dlsym(handle, 'cuFileHandleRegister') + + global __cuFileHandleDeregister + __cuFileHandleDeregister = dlsym(RTLD_DEFAULT, 'cuFileHandleDeregister') + if __cuFileHandleDeregister == NULL: + if handle == NULL: + handle = load_library() + __cuFileHandleDeregister = dlsym(handle, 'cuFileHandleDeregister') + + global __cuFileBufRegister + __cuFileBufRegister = dlsym(RTLD_DEFAULT, 'cuFileBufRegister') + if __cuFileBufRegister == NULL: + if handle == NULL: + handle = load_library() + __cuFileBufRegister = dlsym(handle, 'cuFileBufRegister') + + global __cuFileBufDeregister + __cuFileBufDeregister = dlsym(RTLD_DEFAULT, 'cuFileBufDeregister') + if __cuFileBufDeregister == NULL: + if handle == NULL: + handle = load_library() + __cuFileBufDeregister = dlsym(handle, 'cuFileBufDeregister') + + global __cuFileRead + __cuFileRead = dlsym(RTLD_DEFAULT, 'cuFileRead') + if __cuFileRead == NULL: + if handle == NULL: + handle = load_library() + __cuFileRead = dlsym(handle, 'cuFileRead') + + global __cuFileWrite + __cuFileWrite = dlsym(RTLD_DEFAULT, 'cuFileWrite') + if __cuFileWrite == NULL: + if handle == NULL: + handle = load_library() + __cuFileWrite = dlsym(handle, 'cuFileWrite') + + global __cuFileDriverOpen + __cuFileDriverOpen = dlsym(RTLD_DEFAULT, 'cuFileDriverOpen') + if __cuFileDriverOpen == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverOpen = dlsym(handle, 'cuFileDriverOpen') + + global __cuFileDriverClose_v2 + __cuFileDriverClose_v2 = dlsym(RTLD_DEFAULT, 'cuFileDriverClose_v2') + if __cuFileDriverClose_v2 == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverClose_v2 = dlsym(handle, 'cuFileDriverClose_v2') + + global __cuFileUseCount + __cuFileUseCount = dlsym(RTLD_DEFAULT, 'cuFileUseCount') + if __cuFileUseCount == NULL: + if handle == NULL: + handle = load_library() + __cuFileUseCount = dlsym(handle, 'cuFileUseCount') + + global __cuFileDriverGetProperties + __cuFileDriverGetProperties = dlsym(RTLD_DEFAULT, 'cuFileDriverGetProperties') + if __cuFileDriverGetProperties == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverGetProperties = dlsym(handle, 'cuFileDriverGetProperties') + + global __cuFileDriverSetPollMode + __cuFileDriverSetPollMode = dlsym(RTLD_DEFAULT, 'cuFileDriverSetPollMode') + if __cuFileDriverSetPollMode == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverSetPollMode = dlsym(handle, 'cuFileDriverSetPollMode') + + global __cuFileDriverSetMaxDirectIOSize + __cuFileDriverSetMaxDirectIOSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxDirectIOSize') + if __cuFileDriverSetMaxDirectIOSize == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverSetMaxDirectIOSize = dlsym(handle, 'cuFileDriverSetMaxDirectIOSize') + + global __cuFileDriverSetMaxCacheSize + __cuFileDriverSetMaxCacheSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxCacheSize') + if __cuFileDriverSetMaxCacheSize == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverSetMaxCacheSize = dlsym(handle, 'cuFileDriverSetMaxCacheSize') + + global __cuFileDriverSetMaxPinnedMemSize + __cuFileDriverSetMaxPinnedMemSize = dlsym(RTLD_DEFAULT, 'cuFileDriverSetMaxPinnedMemSize') + if __cuFileDriverSetMaxPinnedMemSize == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverSetMaxPinnedMemSize = dlsym(handle, 'cuFileDriverSetMaxPinnedMemSize') + + global __cuFileBatchIOSetUp + __cuFileBatchIOSetUp = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSetUp') + if __cuFileBatchIOSetUp == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIOSetUp = dlsym(handle, 'cuFileBatchIOSetUp') + + global __cuFileBatchIOSubmit + __cuFileBatchIOSubmit = dlsym(RTLD_DEFAULT, 'cuFileBatchIOSubmit') + if __cuFileBatchIOSubmit == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIOSubmit = dlsym(handle, 'cuFileBatchIOSubmit') + + global __cuFileBatchIOGetStatus + __cuFileBatchIOGetStatus = dlsym(RTLD_DEFAULT, 'cuFileBatchIOGetStatus') + if __cuFileBatchIOGetStatus == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIOGetStatus = dlsym(handle, 'cuFileBatchIOGetStatus') + + global __cuFileBatchIOCancel + __cuFileBatchIOCancel = dlsym(RTLD_DEFAULT, 'cuFileBatchIOCancel') + if __cuFileBatchIOCancel == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIOCancel = dlsym(handle, 'cuFileBatchIOCancel') + + global __cuFileBatchIODestroy + __cuFileBatchIODestroy = dlsym(RTLD_DEFAULT, 'cuFileBatchIODestroy') + if __cuFileBatchIODestroy == NULL: + if handle == NULL: + handle = load_library() + __cuFileBatchIODestroy = dlsym(handle, 'cuFileBatchIODestroy') + + global __cuFileReadAsync + __cuFileReadAsync = dlsym(RTLD_DEFAULT, 'cuFileReadAsync') + if __cuFileReadAsync == NULL: + if handle == NULL: + handle = load_library() + __cuFileReadAsync = dlsym(handle, 'cuFileReadAsync') + + global __cuFileWriteAsync + __cuFileWriteAsync = dlsym(RTLD_DEFAULT, 'cuFileWriteAsync') + if __cuFileWriteAsync == NULL: + if handle == NULL: + handle = load_library() + __cuFileWriteAsync = dlsym(handle, 'cuFileWriteAsync') + + global __cuFileStreamRegister + __cuFileStreamRegister = dlsym(RTLD_DEFAULT, 'cuFileStreamRegister') + if __cuFileStreamRegister == NULL: + if handle == NULL: + handle = load_library() + __cuFileStreamRegister = dlsym(handle, 'cuFileStreamRegister') + + global __cuFileStreamDeregister + __cuFileStreamDeregister = dlsym(RTLD_DEFAULT, 'cuFileStreamDeregister') + if __cuFileStreamDeregister == NULL: + if handle == NULL: + handle = load_library() + __cuFileStreamDeregister = dlsym(handle, 'cuFileStreamDeregister') + + global __cuFileGetVersion + __cuFileGetVersion = dlsym(RTLD_DEFAULT, 'cuFileGetVersion') + if __cuFileGetVersion == NULL: + if handle == NULL: + handle = load_library() + __cuFileGetVersion = dlsym(handle, 'cuFileGetVersion') + + global __cuFileGetParameterSizeT + __cuFileGetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileGetParameterSizeT') + if __cuFileGetParameterSizeT == NULL: + if handle == NULL: + handle = load_library() + __cuFileGetParameterSizeT = dlsym(handle, 'cuFileGetParameterSizeT') + + global __cuFileGetParameterBool + __cuFileGetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileGetParameterBool') + if __cuFileGetParameterBool == NULL: + if handle == NULL: + handle = load_library() + __cuFileGetParameterBool = dlsym(handle, 'cuFileGetParameterBool') + + global __cuFileGetParameterString + __cuFileGetParameterString = dlsym(RTLD_DEFAULT, 'cuFileGetParameterString') + if __cuFileGetParameterString == NULL: + if handle == NULL: + handle = load_library() + __cuFileGetParameterString = dlsym(handle, 'cuFileGetParameterString') + + global __cuFileSetParameterSizeT + __cuFileSetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileSetParameterSizeT') + if __cuFileSetParameterSizeT == NULL: + if handle == NULL: + handle = load_library() + __cuFileSetParameterSizeT = dlsym(handle, 'cuFileSetParameterSizeT') + + global __cuFileSetParameterBool + __cuFileSetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileSetParameterBool') + if __cuFileSetParameterBool == NULL: + if handle == NULL: + handle = load_library() + __cuFileSetParameterBool = dlsym(handle, 'cuFileSetParameterBool') + + global __cuFileSetParameterString + __cuFileSetParameterString = dlsym(RTLD_DEFAULT, 'cuFileSetParameterString') + if __cuFileSetParameterString == NULL: + if handle == NULL: + handle = load_library() + __cuFileSetParameterString = dlsym(handle, 'cuFileSetParameterString') + + global __cuFileDriverClose + __cuFileDriverClose = dlsym(RTLD_DEFAULT, 'cuFileDriverClose') + if __cuFileDriverClose == NULL: + if handle == NULL: + handle = load_library() + __cuFileDriverClose = dlsym(handle, 'cuFileDriverClose') + + __py_cufile_init = True + return 0 - global __cuFileSetParameterSizeT - __cuFileSetParameterSizeT = dlsym(RTLD_DEFAULT, 'cuFileSetParameterSizeT') - if __cuFileSetParameterSizeT == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileSetParameterSizeT = dlsym(handle, 'cuFileSetParameterSizeT') - global __cuFileSetParameterBool - __cuFileSetParameterBool = dlsym(RTLD_DEFAULT, 'cuFileSetParameterBool') - if __cuFileSetParameterBool == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileSetParameterBool = dlsym(handle, 'cuFileSetParameterBool') - - global __cuFileSetParameterString - __cuFileSetParameterString = dlsym(RTLD_DEFAULT, 'cuFileSetParameterString') - if __cuFileSetParameterString == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __cuFileSetParameterString = dlsym(handle, 'cuFileSetParameterString') +cdef inline int _check_or_init_cufile() except -1 nogil: + if __py_cufile_init: + return 0 - __py_cufile_init = True - return 0 + return __check_or_init_cufile() cdef dict func_ptrs = None @@ -417,6 +415,9 @@ cpdef dict _inspect_function_pointers(): global __cuFileSetParameterString data["__cuFileSetParameterString"] = __cuFileSetParameterString + global __cuFileDriverClose + data["__cuFileDriverClose"] = __cuFileDriverClose + func_ptrs = data return data @@ -732,3 +733,13 @@ cdef CUfileError_t _cuFileSetParameterString(CUFileStringConfigParameter_t param raise FunctionNotFoundError("function cuFileSetParameterString is not found") return (__cuFileSetParameterString)( param, desc_str) + + +cdef CUfileError_t _cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil: + global __cuFileDriverClose + _check_or_init_cufile() + if __cuFileDriverClose == NULL: + with gil: + raise FunctionNotFoundError("function cuFileDriverClose is not found") + return (__cuFileDriverClose)( + ) diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd index 3d30af9278..85d7c843a6 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from ..cynvjitlink cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index 22b2e0835d..076df1c544 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -1,14 +1,16 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib + ############################################################################### # Extern @@ -33,6 +35,7 @@ cdef extern from "" nogil: # Wrapper init ############################################################################### +cdef object __symbol_lock = threading.Lock() cdef bint __py_nvjitlink_init = False cdef void* __cuDriverGetVersion = NULL @@ -52,139 +55,125 @@ cdef void* __nvJitLinkGetInfoLog = NULL cdef void* __nvJitLinkVersion = NULL -cdef void* load_library(int driver_ver) except* with gil: - cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("nvJitLink").handle +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint return handle -cdef int _check_or_init_nvjitlink() except -1 nogil: +cdef int __check_or_init_nvjitlink() except -1 nogil: global __py_nvjitlink_init - if __py_nvjitlink_init: - return 0 - # Load driver to check version cdef void* handle = NULL - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - with gil: - err_msg = dlerror() - raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - with gil: - raise RuntimeError('something went wrong') - cdef int err, driver_ver - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - with gil: - raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL - # Load function - global __nvJitLinkCreate - __nvJitLinkCreate = dlsym(RTLD_DEFAULT, 'nvJitLinkCreate') - if __nvJitLinkCreate == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkCreate = dlsym(handle, 'nvJitLinkCreate') - - global __nvJitLinkDestroy - __nvJitLinkDestroy = dlsym(RTLD_DEFAULT, 'nvJitLinkDestroy') - if __nvJitLinkDestroy == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkDestroy = dlsym(handle, 'nvJitLinkDestroy') - - global __nvJitLinkAddData - __nvJitLinkAddData = dlsym(RTLD_DEFAULT, 'nvJitLinkAddData') - if __nvJitLinkAddData == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkAddData = dlsym(handle, 'nvJitLinkAddData') - - global __nvJitLinkAddFile - __nvJitLinkAddFile = dlsym(RTLD_DEFAULT, 'nvJitLinkAddFile') - if __nvJitLinkAddFile == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkAddFile = dlsym(handle, 'nvJitLinkAddFile') - - global __nvJitLinkComplete - __nvJitLinkComplete = dlsym(RTLD_DEFAULT, 'nvJitLinkComplete') - if __nvJitLinkComplete == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkComplete = dlsym(handle, 'nvJitLinkComplete') - - global __nvJitLinkGetLinkedCubinSize - __nvJitLinkGetLinkedCubinSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubinSize') - if __nvJitLinkGetLinkedCubinSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetLinkedCubinSize = dlsym(handle, 'nvJitLinkGetLinkedCubinSize') - - global __nvJitLinkGetLinkedCubin - __nvJitLinkGetLinkedCubin = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubin') - if __nvJitLinkGetLinkedCubin == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetLinkedCubin = dlsym(handle, 'nvJitLinkGetLinkedCubin') - - global __nvJitLinkGetLinkedPtxSize - __nvJitLinkGetLinkedPtxSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtxSize') - if __nvJitLinkGetLinkedPtxSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetLinkedPtxSize = dlsym(handle, 'nvJitLinkGetLinkedPtxSize') - - global __nvJitLinkGetLinkedPtx - __nvJitLinkGetLinkedPtx = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtx') - if __nvJitLinkGetLinkedPtx == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetLinkedPtx = dlsym(handle, 'nvJitLinkGetLinkedPtx') - - global __nvJitLinkGetErrorLogSize - __nvJitLinkGetErrorLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLogSize') - if __nvJitLinkGetErrorLogSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetErrorLogSize = dlsym(handle, 'nvJitLinkGetErrorLogSize') - - global __nvJitLinkGetErrorLog - __nvJitLinkGetErrorLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLog') - if __nvJitLinkGetErrorLog == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetErrorLog = dlsym(handle, 'nvJitLinkGetErrorLog') - - global __nvJitLinkGetInfoLogSize - __nvJitLinkGetInfoLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLogSize') - if __nvJitLinkGetInfoLogSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetInfoLogSize = dlsym(handle, 'nvJitLinkGetInfoLogSize') - - global __nvJitLinkGetInfoLog - __nvJitLinkGetInfoLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLog') - if __nvJitLinkGetInfoLog == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkGetInfoLog = dlsym(handle, 'nvJitLinkGetInfoLog') + with gil, __symbol_lock: + # Load function + global __nvJitLinkCreate + __nvJitLinkCreate = dlsym(RTLD_DEFAULT, 'nvJitLinkCreate') + if __nvJitLinkCreate == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkCreate = dlsym(handle, 'nvJitLinkCreate') + + global __nvJitLinkDestroy + __nvJitLinkDestroy = dlsym(RTLD_DEFAULT, 'nvJitLinkDestroy') + if __nvJitLinkDestroy == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkDestroy = dlsym(handle, 'nvJitLinkDestroy') + + global __nvJitLinkAddData + __nvJitLinkAddData = dlsym(RTLD_DEFAULT, 'nvJitLinkAddData') + if __nvJitLinkAddData == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkAddData = dlsym(handle, 'nvJitLinkAddData') + + global __nvJitLinkAddFile + __nvJitLinkAddFile = dlsym(RTLD_DEFAULT, 'nvJitLinkAddFile') + if __nvJitLinkAddFile == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkAddFile = dlsym(handle, 'nvJitLinkAddFile') + + global __nvJitLinkComplete + __nvJitLinkComplete = dlsym(RTLD_DEFAULT, 'nvJitLinkComplete') + if __nvJitLinkComplete == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkComplete = dlsym(handle, 'nvJitLinkComplete') + + global __nvJitLinkGetLinkedCubinSize + __nvJitLinkGetLinkedCubinSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubinSize') + if __nvJitLinkGetLinkedCubinSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedCubinSize = dlsym(handle, 'nvJitLinkGetLinkedCubinSize') + + global __nvJitLinkGetLinkedCubin + __nvJitLinkGetLinkedCubin = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedCubin') + if __nvJitLinkGetLinkedCubin == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedCubin = dlsym(handle, 'nvJitLinkGetLinkedCubin') + + global __nvJitLinkGetLinkedPtxSize + __nvJitLinkGetLinkedPtxSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtxSize') + if __nvJitLinkGetLinkedPtxSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedPtxSize = dlsym(handle, 'nvJitLinkGetLinkedPtxSize') + + global __nvJitLinkGetLinkedPtx + __nvJitLinkGetLinkedPtx = dlsym(RTLD_DEFAULT, 'nvJitLinkGetLinkedPtx') + if __nvJitLinkGetLinkedPtx == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetLinkedPtx = dlsym(handle, 'nvJitLinkGetLinkedPtx') + + global __nvJitLinkGetErrorLogSize + __nvJitLinkGetErrorLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLogSize') + if __nvJitLinkGetErrorLogSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetErrorLogSize = dlsym(handle, 'nvJitLinkGetErrorLogSize') + + global __nvJitLinkGetErrorLog + __nvJitLinkGetErrorLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetErrorLog') + if __nvJitLinkGetErrorLog == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetErrorLog = dlsym(handle, 'nvJitLinkGetErrorLog') + + global __nvJitLinkGetInfoLogSize + __nvJitLinkGetInfoLogSize = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLogSize') + if __nvJitLinkGetInfoLogSize == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetInfoLogSize = dlsym(handle, 'nvJitLinkGetInfoLogSize') + + global __nvJitLinkGetInfoLog + __nvJitLinkGetInfoLog = dlsym(RTLD_DEFAULT, 'nvJitLinkGetInfoLog') + if __nvJitLinkGetInfoLog == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkGetInfoLog = dlsym(handle, 'nvJitLinkGetInfoLog') + + global __nvJitLinkVersion + __nvJitLinkVersion = dlsym(RTLD_DEFAULT, 'nvJitLinkVersion') + if __nvJitLinkVersion == NULL: + if handle == NULL: + handle = load_library() + __nvJitLinkVersion = dlsym(handle, 'nvJitLinkVersion') + + __py_nvjitlink_init = True + return 0 - global __nvJitLinkVersion - __nvJitLinkVersion = dlsym(RTLD_DEFAULT, 'nvJitLinkVersion') - if __nvJitLinkVersion == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvJitLinkVersion = dlsym(handle, 'nvJitLinkVersion') - __py_nvjitlink_init = True - return 0 +cdef inline int _check_or_init_nvjitlink() except -1 nogil: + if __py_nvjitlink_init: + return 0 + return __check_or_init_nvjitlink() cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 988ead7a8c..1ad0def5ab 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -1,27 +1,81 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib + +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +from .utils import NotSupportedError + +cdef extern from "windows.h" nogil: + ctypedef void* HMODULE + ctypedef void* HANDLE + ctypedef void* FARPROC + ctypedef unsigned long DWORD + ctypedef const wchar_t *LPCWSTR + ctypedef const char *LPCSTR + + cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + cdef DWORD LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 + cdef DWORD LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 + + HMODULE _LoadLibraryExW "LoadLibraryExW"( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) + + FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + +cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): + cdef uintptr_t result + cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) + with nogil: + result = _LoadLibraryExW( + wpath, + hFile, + dwFlags + ) + PyMem_Free(wpath) + return result + +cdef inline void *GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: + return _GetProcAddress(hModule, lpProcName) + +cdef int get_cuda_version(): + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = LoadLibraryExW("nvcuda.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32) + if handle == 0: + raise NotSupportedError('CUDA driver is not found') + cuDriverGetVersion = GetProcAddress(handle, 'cuDriverGetVersion') + if cuDriverGetVersion == NULL: + raise RuntimeError('something went wrong') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError('something went wrong') + + return driver_ver -import win32api ############################################################################### # Wrapper init ############################################################################### -LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 -LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 -LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 +cdef object __symbol_lock = threading.Lock() cdef bint __py_nvjitlink_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __nvJitLinkCreate = NULL cdef void* __nvJitLinkDestroy = NULL @@ -39,117 +93,65 @@ cdef void* __nvJitLinkGetInfoLog = NULL cdef void* __nvJitLinkVersion = NULL -cdef int _check_or_init_nvjitlink() except -1 nogil: +cdef int __check_or_init_nvjitlink() except -1 nogil: global __py_nvjitlink_init - if __py_nvjitlink_init: - return 0 - - cdef int err, driver_ver - with gil: - # Load driver to check version - try: - handle = win32api.LoadLibraryEx("nvcuda.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32) - except Exception as e: - raise NotSupportedError(f'CUDA driver is not found ({e})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = win32api.GetProcAddress(handle, 'cuDriverGetVersion') - if __cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - raise RuntimeError('something went wrong') + with gil, __symbol_lock: # Load library - handle = path_finder._load_nvidia_dynamic_library("nvJitLink").handle + handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint # Load function global __nvJitLinkCreate - try: - __nvJitLinkCreate = win32api.GetProcAddress(handle, 'nvJitLinkCreate') - except: - pass + __nvJitLinkCreate = GetProcAddress(handle, 'nvJitLinkCreate') global __nvJitLinkDestroy - try: - __nvJitLinkDestroy = win32api.GetProcAddress(handle, 'nvJitLinkDestroy') - except: - pass + __nvJitLinkDestroy = GetProcAddress(handle, 'nvJitLinkDestroy') global __nvJitLinkAddData - try: - __nvJitLinkAddData = win32api.GetProcAddress(handle, 'nvJitLinkAddData') - except: - pass + __nvJitLinkAddData = GetProcAddress(handle, 'nvJitLinkAddData') global __nvJitLinkAddFile - try: - __nvJitLinkAddFile = win32api.GetProcAddress(handle, 'nvJitLinkAddFile') - except: - pass + __nvJitLinkAddFile = GetProcAddress(handle, 'nvJitLinkAddFile') global __nvJitLinkComplete - try: - __nvJitLinkComplete = win32api.GetProcAddress(handle, 'nvJitLinkComplete') - except: - pass + __nvJitLinkComplete = GetProcAddress(handle, 'nvJitLinkComplete') global __nvJitLinkGetLinkedCubinSize - try: - __nvJitLinkGetLinkedCubinSize = win32api.GetProcAddress(handle, 'nvJitLinkGetLinkedCubinSize') - except: - pass + __nvJitLinkGetLinkedCubinSize = GetProcAddress(handle, 'nvJitLinkGetLinkedCubinSize') global __nvJitLinkGetLinkedCubin - try: - __nvJitLinkGetLinkedCubin = win32api.GetProcAddress(handle, 'nvJitLinkGetLinkedCubin') - except: - pass + __nvJitLinkGetLinkedCubin = GetProcAddress(handle, 'nvJitLinkGetLinkedCubin') global __nvJitLinkGetLinkedPtxSize - try: - __nvJitLinkGetLinkedPtxSize = win32api.GetProcAddress(handle, 'nvJitLinkGetLinkedPtxSize') - except: - pass + __nvJitLinkGetLinkedPtxSize = GetProcAddress(handle, 'nvJitLinkGetLinkedPtxSize') global __nvJitLinkGetLinkedPtx - try: - __nvJitLinkGetLinkedPtx = win32api.GetProcAddress(handle, 'nvJitLinkGetLinkedPtx') - except: - pass + __nvJitLinkGetLinkedPtx = GetProcAddress(handle, 'nvJitLinkGetLinkedPtx') global __nvJitLinkGetErrorLogSize - try: - __nvJitLinkGetErrorLogSize = win32api.GetProcAddress(handle, 'nvJitLinkGetErrorLogSize') - except: - pass + __nvJitLinkGetErrorLogSize = GetProcAddress(handle, 'nvJitLinkGetErrorLogSize') global __nvJitLinkGetErrorLog - try: - __nvJitLinkGetErrorLog = win32api.GetProcAddress(handle, 'nvJitLinkGetErrorLog') - except: - pass + __nvJitLinkGetErrorLog = GetProcAddress(handle, 'nvJitLinkGetErrorLog') global __nvJitLinkGetInfoLogSize - try: - __nvJitLinkGetInfoLogSize = win32api.GetProcAddress(handle, 'nvJitLinkGetInfoLogSize') - except: - pass + __nvJitLinkGetInfoLogSize = GetProcAddress(handle, 'nvJitLinkGetInfoLogSize') global __nvJitLinkGetInfoLog - try: - __nvJitLinkGetInfoLog = win32api.GetProcAddress(handle, 'nvJitLinkGetInfoLog') - except: - pass + __nvJitLinkGetInfoLog = GetProcAddress(handle, 'nvJitLinkGetInfoLog') global __nvJitLinkVersion - try: - __nvJitLinkVersion = win32api.GetProcAddress(handle, 'nvJitLinkVersion') - except: - pass + __nvJitLinkVersion = GetProcAddress(handle, 'nvJitLinkVersion') + + __py_nvjitlink_init = True + return 0 + + +cdef inline int _check_or_init_nvjitlink() except -1 nogil: + if __py_nvjitlink_init: + return 0 - __py_nvjitlink_init = True - return 0 + return __check_or_init_nvjitlink() cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd index 3f0c2c430a..8ca17dbc4d 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from ..cynvvm cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 02c6ba0366..7e82d2a9aa 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -2,13 +2,15 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib + ############################################################################### # Extern @@ -28,11 +30,30 @@ cdef extern from "" nogil: const void* RTLD_DEFAULT 'RTLD_DEFAULT' +cdef int get_cuda_version(): + cdef void* handle = NULL + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) + if handle == NULL: + err_msg = dlerror() + raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') + cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") + if cuDriverGetVersion == NULL: + raise RuntimeError('Did not find cuDriverGetVersion symbol in libcuda.so.1') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') + + return driver_ver + ############################################################################### # Wrapper init ############################################################################### +cdef object __symbol_lock = threading.Lock() cdef bint __py_nvvm_init = False cdef void* __cuDriverGetVersion = NULL @@ -51,131 +72,118 @@ cdef void* __nvvmGetProgramLogSize = NULL cdef void* __nvvmGetProgramLog = NULL -cdef void* load_library(const int driver_ver) except* with gil: - cdef uintptr_t handle = path_finder._load_nvidia_dynamic_library("nvvm").handle +cdef void* load_library() except* with gil: + cdef uintptr_t handle = load_nvidia_dynamic_lib("nvvm")._handle_uint return handle -cdef int _check_or_init_nvvm() except -1 nogil: +cdef int __check_or_init_nvvm() except -1 nogil: global __py_nvvm_init - if __py_nvvm_init: - return 0 - # Load driver to check version cdef void* handle = NULL - handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) - if handle == NULL: - with gil: - err_msg = dlerror() - raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") - if __cuDriverGetVersion == NULL: - with gil: - raise RuntimeError('something went wrong') - cdef int err, driver_ver - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - with gil: - raise RuntimeError('something went wrong') - #dlclose(handle) - handle = NULL - # Load function - global __nvvmGetErrorString - __nvvmGetErrorString = dlsym(RTLD_DEFAULT, 'nvvmGetErrorString') - if __nvvmGetErrorString == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetErrorString = dlsym(handle, 'nvvmGetErrorString') - - global __nvvmVersion - __nvvmVersion = dlsym(RTLD_DEFAULT, 'nvvmVersion') - if __nvvmVersion == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmVersion = dlsym(handle, 'nvvmVersion') - - global __nvvmIRVersion - __nvvmIRVersion = dlsym(RTLD_DEFAULT, 'nvvmIRVersion') - if __nvvmIRVersion == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmIRVersion = dlsym(handle, 'nvvmIRVersion') - - global __nvvmCreateProgram - __nvvmCreateProgram = dlsym(RTLD_DEFAULT, 'nvvmCreateProgram') - if __nvvmCreateProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmCreateProgram = dlsym(handle, 'nvvmCreateProgram') - - global __nvvmDestroyProgram - __nvvmDestroyProgram = dlsym(RTLD_DEFAULT, 'nvvmDestroyProgram') - if __nvvmDestroyProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmDestroyProgram = dlsym(handle, 'nvvmDestroyProgram') - - global __nvvmAddModuleToProgram - __nvvmAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmAddModuleToProgram') - if __nvvmAddModuleToProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmAddModuleToProgram = dlsym(handle, 'nvvmAddModuleToProgram') - - global __nvvmLazyAddModuleToProgram - __nvvmLazyAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmLazyAddModuleToProgram') - if __nvvmLazyAddModuleToProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmLazyAddModuleToProgram = dlsym(handle, 'nvvmLazyAddModuleToProgram') - - global __nvvmCompileProgram - __nvvmCompileProgram = dlsym(RTLD_DEFAULT, 'nvvmCompileProgram') - if __nvvmCompileProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmCompileProgram = dlsym(handle, 'nvvmCompileProgram') - - global __nvvmVerifyProgram - __nvvmVerifyProgram = dlsym(RTLD_DEFAULT, 'nvvmVerifyProgram') - if __nvvmVerifyProgram == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmVerifyProgram = dlsym(handle, 'nvvmVerifyProgram') - - global __nvvmGetCompiledResultSize - __nvvmGetCompiledResultSize = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResultSize') - if __nvvmGetCompiledResultSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetCompiledResultSize = dlsym(handle, 'nvvmGetCompiledResultSize') - - global __nvvmGetCompiledResult - __nvvmGetCompiledResult = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResult') - if __nvvmGetCompiledResult == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetCompiledResult = dlsym(handle, 'nvvmGetCompiledResult') + with gil, __symbol_lock: + # Load function + global __nvvmGetErrorString + __nvvmGetErrorString = dlsym(RTLD_DEFAULT, 'nvvmGetErrorString') + if __nvvmGetErrorString == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetErrorString = dlsym(handle, 'nvvmGetErrorString') + + global __nvvmVersion + __nvvmVersion = dlsym(RTLD_DEFAULT, 'nvvmVersion') + if __nvvmVersion == NULL: + if handle == NULL: + handle = load_library() + __nvvmVersion = dlsym(handle, 'nvvmVersion') + + global __nvvmIRVersion + __nvvmIRVersion = dlsym(RTLD_DEFAULT, 'nvvmIRVersion') + if __nvvmIRVersion == NULL: + if handle == NULL: + handle = load_library() + __nvvmIRVersion = dlsym(handle, 'nvvmIRVersion') + + global __nvvmCreateProgram + __nvvmCreateProgram = dlsym(RTLD_DEFAULT, 'nvvmCreateProgram') + if __nvvmCreateProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmCreateProgram = dlsym(handle, 'nvvmCreateProgram') + + global __nvvmDestroyProgram + __nvvmDestroyProgram = dlsym(RTLD_DEFAULT, 'nvvmDestroyProgram') + if __nvvmDestroyProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmDestroyProgram = dlsym(handle, 'nvvmDestroyProgram') + + global __nvvmAddModuleToProgram + __nvvmAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmAddModuleToProgram') + if __nvvmAddModuleToProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmAddModuleToProgram = dlsym(handle, 'nvvmAddModuleToProgram') + + global __nvvmLazyAddModuleToProgram + __nvvmLazyAddModuleToProgram = dlsym(RTLD_DEFAULT, 'nvvmLazyAddModuleToProgram') + if __nvvmLazyAddModuleToProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmLazyAddModuleToProgram = dlsym(handle, 'nvvmLazyAddModuleToProgram') + + global __nvvmCompileProgram + __nvvmCompileProgram = dlsym(RTLD_DEFAULT, 'nvvmCompileProgram') + if __nvvmCompileProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmCompileProgram = dlsym(handle, 'nvvmCompileProgram') + + global __nvvmVerifyProgram + __nvvmVerifyProgram = dlsym(RTLD_DEFAULT, 'nvvmVerifyProgram') + if __nvvmVerifyProgram == NULL: + if handle == NULL: + handle = load_library() + __nvvmVerifyProgram = dlsym(handle, 'nvvmVerifyProgram') + + global __nvvmGetCompiledResultSize + __nvvmGetCompiledResultSize = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResultSize') + if __nvvmGetCompiledResultSize == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetCompiledResultSize = dlsym(handle, 'nvvmGetCompiledResultSize') + + global __nvvmGetCompiledResult + __nvvmGetCompiledResult = dlsym(RTLD_DEFAULT, 'nvvmGetCompiledResult') + if __nvvmGetCompiledResult == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetCompiledResult = dlsym(handle, 'nvvmGetCompiledResult') + + global __nvvmGetProgramLogSize + __nvvmGetProgramLogSize = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLogSize') + if __nvvmGetProgramLogSize == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetProgramLogSize = dlsym(handle, 'nvvmGetProgramLogSize') + + global __nvvmGetProgramLog + __nvvmGetProgramLog = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLog') + if __nvvmGetProgramLog == NULL: + if handle == NULL: + handle = load_library() + __nvvmGetProgramLog = dlsym(handle, 'nvvmGetProgramLog') + + __py_nvvm_init = True + return 0 - global __nvvmGetProgramLogSize - __nvvmGetProgramLogSize = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLogSize') - if __nvvmGetProgramLogSize == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetProgramLogSize = dlsym(handle, 'nvvmGetProgramLogSize') - global __nvvmGetProgramLog - __nvvmGetProgramLog = dlsym(RTLD_DEFAULT, 'nvvmGetProgramLog') - if __nvvmGetProgramLog == NULL: - if handle == NULL: - handle = load_library(driver_ver) - __nvvmGetProgramLog = dlsym(handle, 'nvvmGetProgramLog') +cdef int _check_or_init_nvvm() except -1 nogil: + if __py_nvvm_init: + return 0 - __py_nvvm_init = True - return 0 + return __check_or_init_nvvm() cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index f8c5502cd5..a667642958 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -2,26 +2,80 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t +import threading from .utils import FunctionNotFoundError, NotSupportedError -from cuda.bindings import path_finder +from cuda.pathfinder import load_nvidia_dynamic_lib + +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +from .utils import NotSupportedError + +cdef extern from "windows.h" nogil: + ctypedef void* HMODULE + ctypedef void* HANDLE + ctypedef void* FARPROC + ctypedef unsigned long DWORD + ctypedef const wchar_t *LPCWSTR + ctypedef const char *LPCSTR + + cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + cdef DWORD LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 + cdef DWORD LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 + + HMODULE _LoadLibraryExW "LoadLibraryExW"( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) + + FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + +cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): + cdef uintptr_t result + cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) + with nogil: + result = _LoadLibraryExW( + wpath, + hFile, + dwFlags + ) + PyMem_Free(wpath) + return result + +cdef inline void *GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: + return _GetProcAddress(hModule, lpProcName) + +cdef int get_cuda_version(): + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = LoadLibraryExW("nvcuda.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32) + if handle == 0: + raise NotSupportedError('CUDA driver is not found') + cuDriverGetVersion = GetProcAddress(handle, 'cuDriverGetVersion') + if cuDriverGetVersion == NULL: + raise RuntimeError('something went wrong') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError('something went wrong') + + return driver_ver -import win32api ############################################################################### # Wrapper init ############################################################################### -LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 -LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000 -LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100 +cdef object __symbol_lock = threading.Lock() cdef bint __py_nvvm_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __nvvmGetErrorString = NULL cdef void* __nvvmVersion = NULL @@ -38,111 +92,62 @@ cdef void* __nvvmGetProgramLogSize = NULL cdef void* __nvvmGetProgramLog = NULL -cdef int _check_or_init_nvvm() except -1 nogil: +cdef int __check_or_init_nvvm() except -1 nogil: global __py_nvvm_init - if __py_nvvm_init: - return 0 - - cdef int err, driver_ver - with gil: - # Load driver to check version - try: - handle = win32api.LoadLibraryEx("nvcuda.dll", 0, LOAD_LIBRARY_SEARCH_SYSTEM32) - except Exception as e: - raise NotSupportedError(f'CUDA driver is not found ({e})') - global __cuDriverGetVersion - if __cuDriverGetVersion == NULL: - __cuDriverGetVersion = win32api.GetProcAddress(handle, 'cuDriverGetVersion') - if __cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') - err = (__cuDriverGetVersion)(&driver_ver) - if err != 0: - raise RuntimeError('something went wrong') + with gil, __symbol_lock: # Load library - handle = path_finder._load_nvidia_dynamic_library("nvvm").handle + handle = load_nvidia_dynamic_lib("nvvm")._handle_uint # Load function global __nvvmGetErrorString - try: - __nvvmGetErrorString = win32api.GetProcAddress(handle, 'nvvmGetErrorString') - except: - pass + __nvvmGetErrorString = GetProcAddress(handle, 'nvvmGetErrorString') global __nvvmVersion - try: - __nvvmVersion = win32api.GetProcAddress(handle, 'nvvmVersion') - except: - pass + __nvvmVersion = GetProcAddress(handle, 'nvvmVersion') global __nvvmIRVersion - try: - __nvvmIRVersion = win32api.GetProcAddress(handle, 'nvvmIRVersion') - except: - pass + __nvvmIRVersion = GetProcAddress(handle, 'nvvmIRVersion') global __nvvmCreateProgram - try: - __nvvmCreateProgram = win32api.GetProcAddress(handle, 'nvvmCreateProgram') - except: - pass + __nvvmCreateProgram = GetProcAddress(handle, 'nvvmCreateProgram') global __nvvmDestroyProgram - try: - __nvvmDestroyProgram = win32api.GetProcAddress(handle, 'nvvmDestroyProgram') - except: - pass + __nvvmDestroyProgram = GetProcAddress(handle, 'nvvmDestroyProgram') global __nvvmAddModuleToProgram - try: - __nvvmAddModuleToProgram = win32api.GetProcAddress(handle, 'nvvmAddModuleToProgram') - except: - pass + __nvvmAddModuleToProgram = GetProcAddress(handle, 'nvvmAddModuleToProgram') global __nvvmLazyAddModuleToProgram - try: - __nvvmLazyAddModuleToProgram = win32api.GetProcAddress(handle, 'nvvmLazyAddModuleToProgram') - except: - pass + __nvvmLazyAddModuleToProgram = GetProcAddress(handle, 'nvvmLazyAddModuleToProgram') global __nvvmCompileProgram - try: - __nvvmCompileProgram = win32api.GetProcAddress(handle, 'nvvmCompileProgram') - except: - pass + __nvvmCompileProgram = GetProcAddress(handle, 'nvvmCompileProgram') global __nvvmVerifyProgram - try: - __nvvmVerifyProgram = win32api.GetProcAddress(handle, 'nvvmVerifyProgram') - except: - pass + __nvvmVerifyProgram = GetProcAddress(handle, 'nvvmVerifyProgram') global __nvvmGetCompiledResultSize - try: - __nvvmGetCompiledResultSize = win32api.GetProcAddress(handle, 'nvvmGetCompiledResultSize') - except: - pass + __nvvmGetCompiledResultSize = GetProcAddress(handle, 'nvvmGetCompiledResultSize') global __nvvmGetCompiledResult - try: - __nvvmGetCompiledResult = win32api.GetProcAddress(handle, 'nvvmGetCompiledResult') - except: - pass + __nvvmGetCompiledResult = GetProcAddress(handle, 'nvvmGetCompiledResult') global __nvvmGetProgramLogSize - try: - __nvvmGetProgramLogSize = win32api.GetProcAddress(handle, 'nvvmGetProgramLogSize') - except: - pass + __nvvmGetProgramLogSize = GetProcAddress(handle, 'nvvmGetProgramLogSize') global __nvvmGetProgramLog - try: - __nvvmGetProgramLog = win32api.GetProcAddress(handle, 'nvvmGetProgramLog') - except: - pass + __nvvmGetProgramLog = GetProcAddress(handle, 'nvvmGetProgramLog') + + __py_nvvm_init = True + return 0 + + +cdef inline int _check_or_init_nvvm() except -1 nogil: + if __py_nvvm_init: + return 0 - __py_nvvm_init = True - return 0 + return __check_or_init_nvvm() cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd new file mode 100644 index 0000000000..48f87f29ca --- /dev/null +++ b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd @@ -0,0 +1,43 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +cimport cuda.bindings.cyruntime as cyruntime +cimport cuda.bindings._bindings.cydriver as _cydriver + +# These graphics API are the reimplemented version of what's supported by CUDA Runtime. +# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us +# use call into the static library directly. +# +# This is an ABI breaking change which can only happen in a major version bump. + +# This file is included from cuda/bindings/_bindings/cyruntime.pxd.in but kept in a +# separate file to keep it separated from the auto-generated code there. + +# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two +# independent modules (c.b._lib.cyruntime.cyruntime and +# c.b._lib.cyruntime.utils), but was merged into one. + +cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil + +# utility functions + +cdef cudaError_t getDriverEglFrame(_cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, _cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in deleted file mode 100644 index 055958e1ad..0000000000 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxd.in +++ /dev/null @@ -1,29 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cyruntime cimport * - -# These graphics API are the reimplemented version of what's supported by CUDA Runtime. -# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us -# use call into the static library directly. -# -# This is an ABI breaking change which can only happen in a major version bump. -{{if True}}cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} -{{if True}}cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil{{endif}} diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi similarity index 66% rename from cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in rename to cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi index 292d19cb9c..7d5960ced1 100644 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pyx.in +++ b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pxi @@ -1,11 +1,202 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -import cython -from cuda.bindings.cyruntime cimport * +# These graphics API are the reimplemented version of what's supported by CUDA Runtime. +# Issue https://github.com/NVIDIA/cuda-python/issues/488 will remove them by letting us +# use call into the static library directly. + +# This file is included from cuda/bindings/_bindings/cyruntime.pyx.in but kept in a +# separate file to keep it separated from the auto-generated code there. + +# Prior to https://github.com/NVIDIA/cuda-python/pull/914, this was two +# independent modules (c.b._lib.cyruntime.cyruntime and +# c.b._lib.cyruntime.utils), but was merged into one. + from libc.string cimport memset -cimport cuda.bindings._bindings.cydriver as cydriver +cimport cuda.bindings.cydriver as cydriver + +cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + cdef cydriver.CUeglFrame cueglFrame + err = getDriverEglFrame(&cueglFrame, eglframe) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamProducerPresentFrame(conn, cueglFrame, pStream) + return err + +cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cyruntime.cudaEglStreamConnection* conn, cyruntime.cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + if eglframe == NULL: + err = cudaErrorInvalidResourceHandle + return err + cdef cydriver.CUeglFrame cueglFrame + # err = cydriver._cuEGLStreamProducerReturnFrame(conn, &cueglFrame, pStream) + if err != cudaSuccess: + return err + err = getRuntimeEglFrame(eglframe, cueglFrame) + return err + +cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cyruntime.cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + cdef cydriver.CUeglFrame cueglFrame + memset(&cueglFrame, 0, sizeof(cueglFrame)) + # err = cydriver._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, resource, index, mipLevel) + if err != cudaSuccess: + return err + err = getRuntimeEglFrame(eglFrame, cueglFrame) + return err +cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + return cudaErrorNotSupported + +cdef cudaError_t _cudaVDPAUGetDevice(int* device, cyruntime.VdpDevice vdpDevice, cyruntime.VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) + return err + +cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, cyruntime.VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) + return err + +cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, cyruntime.VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) + return err + +cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cyruntime.cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + return err + +cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, cyruntime.GLuint image, cyruntime.GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsGLRegisterImage(resource, image, target, flags) + return err + +cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, cyruntime.GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsGLRegisterBuffer(resource, buffer, flags) + return err + +cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, cyruntime.EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) + return err + +cdef cudaError_t _cudaEGLStreamConsumerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerConnect(conn, eglStream) + return err + +cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) + return err + +cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerDisconnect(conn) + return err + +cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) + return err + +cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cyruntime.cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) + return err + +cdef cudaError_t _cudaEGLStreamProducerConnect(cyruntime.cudaEglStreamConnection* conn, cyruntime.EGLStreamKHR eglStream, cyruntime.EGLint width, cyruntime.EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamProducerConnect(conn, eglStream, width, height) + return err + +cdef cudaError_t _cudaEGLStreamProducerDisconnect(cyruntime.cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEGLStreamProducerDisconnect(conn) + return err + +cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, cyruntime.EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef cudaError_t err = cudaSuccess + # cudaFree(0) is a NOP operations that initializes the context state + err = cudaFree(0) + if err != cudaSuccess: + return err + # err = cydriver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) + return err + +## utility functions cdef int case_desc(const cudaChannelFormatDesc* d, int x, int y, int z, int w, int f) except ?cudaErrorCallRequiresNewerDriver nogil: return d[0].x == x and d[0].y == y and d[0].z == z and d[0].w == w and d[0].f == f @@ -228,9 +419,7 @@ cdef cudaError_t getDescInfo(const cudaChannelFormatDesc* d, int *numberOfChanne return cudaErrorInvalidChannelDescriptor return cudaSuccess - cdef cudaError_t getChannelFormatDescFromDriverDesc(cudaChannelFormatDesc* pRuntimeDesc, size_t* pDepth, size_t* pHeight, size_t* pWidth, const cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2* pDriverDesc) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef int channel_size = 0 if pDriverDesc[0].Format == cydriver.CU_AD_FORMAT_UNSIGNED_INT8: pRuntimeDesc[0].f = cudaChannelFormatKind.cudaChannelFormatKindUnsigned @@ -375,8 +564,7 @@ cdef cudaError_t getChannelFormatDescFromDriverDesc(cudaChannelFormatDesc* pRunt pWidth[0] = pDriverDesc[0].Width return cudaSuccess - -cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cyruntime.cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: cdef cudaError_t err = cudaSuccess cdef unsigned int i = 0 @@ -384,7 +572,7 @@ cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cudaEglFrame if err != cudaSuccess: return err for i in range(eglFrame.planeCount): - if eglFrame.frameType == cudaEglFrameTypeArray: + if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: cuEglFrame[0].frame.pArray[i] = eglFrame.frame.pArray[i] else: cuEglFrame[0].frame.pPitch[i] = eglFrame.frame.pPitch[i].ptr @@ -393,244 +581,243 @@ cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cudaEglFrame cuEglFrame[0].depth = eglFrame.planeDesc[0].depth cuEglFrame[0].pitch = eglFrame.planeDesc[0].pitch cuEglFrame[0].planeCount = eglFrame.planeCount - if eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar: + if eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV422: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV422: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422 - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY422: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY422: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422 - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatARGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatARGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB - elif eglFrame.eglColorFormat == cudaEglColorFormatRGBA: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRGBA: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA - elif eglFrame.eglColorFormat == cudaEglColorFormatABGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatABGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBGRA: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBGRA: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA - elif eglFrame.eglColorFormat == cudaEglColorFormatL: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatL: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L - elif eglFrame.eglColorFormat == cudaEglColorFormatR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R - elif eglFrame.eglColorFormat == cudaEglColorFormatA: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatA: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A - elif eglFrame.eglColorFormat == cudaEglColorFormatRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG - elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatUYVY_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatUYVY_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUYV_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUYV_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatAYUV_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatAYUV_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV444SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV422SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerGBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerGBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10RGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10RGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10BGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10BGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10GBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10GBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12GBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12GBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14RGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14RGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14BGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14BGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer14GBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer14GBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20RGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20RGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20BGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20BGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer20GBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer20GBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspRGGB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspRGGB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspBGGR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspBGGR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGRBG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGRBG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerIspGBRG: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerIspGBRG: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU444Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU444Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU422Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU422Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerBCCR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerBCCR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerRCCB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerRCCB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCRBC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCRBC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayerCBRC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayerCBRC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer10CCCC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer10CCCC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12BCCR: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12BCCR: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12RCCB: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12RCCB: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CRBC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CRBC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CBRC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CBRC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC - elif eglFrame.eglColorFormat == cudaEglColorFormatBayer12CCCC: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatBayer12CCCC: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC - elif eglFrame.eglColorFormat == cudaEglColorFormatY: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420SemiPlanar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420SemiPlanar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420SemiPlanar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420SemiPlanar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatYUV420Planar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUV420Planar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatYVU420Planar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVU420Planar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_2020: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020 - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_422SemiPlanar_709: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709 - elif eglFrame.eglColorFormat == cudaEglColorFormatY_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatYUVA: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYUVA: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA - elif eglFrame.eglColorFormat == cudaEglColorFormatYVYU: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatYVYU: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU - elif eglFrame.eglColorFormat == cudaEglColorFormatVYUY: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatVYUY: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER - elif eglFrame.eglColorFormat == cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER: + elif eglFrame.eglColorFormat == cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER: cuEglFrame[0].eglColorFormat = cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER else: return cudaErrorInvalidValue - if eglFrame.frameType == cudaEglFrameTypeArray: + if eglFrame.frameType == cyruntime.cudaEglFrameTypeArray: cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY - elif eglFrame.frameType == cudaEglFrameTypePitch: + elif eglFrame.frameType == cyruntime.cudaEglFrameTypePitch: cuEglFrame[0].frameType = cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH else: return cudaErrorInvalidValue - @cython.show_performance_hints(False) -cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: +cdef cudaError_t getRuntimeEglFrame(cyruntime.cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil: cdef cudaError_t err = cudaSuccess cdef unsigned int i cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR_v2 ad @@ -675,7 +862,7 @@ cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709 or - cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or + cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020 or cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER or @@ -754,236 +941,236 @@ cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, cydriver.CUeglFrame eglFrame[0].planeCount = cueglFrame.planeCount if cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_422: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV422 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV422 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_422: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY422 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY422 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ARGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatARGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatARGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RGBA: - eglFrame[0].eglColorFormat = cudaEglColorFormatRGBA + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRGBA elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_ABGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatABGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatABGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BGRA: - eglFrame[0].eglColorFormat = cudaEglColorFormatBGRA + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBGRA elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_L: - eglFrame[0].eglColorFormat = cudaEglColorFormatL + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatL elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_R: - eglFrame[0].eglColorFormat = cudaEglColorFormatR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_A: - eglFrame[0].eglColorFormat = cudaEglColorFormatA + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatA elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_RG: - eglFrame[0].eglColorFormat = cudaEglColorFormatRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV: - eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_UYVY_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatUYVY_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatUYVY_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUYV_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUYV_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUYV_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_AYUV_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatAYUV_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatAYUV_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV444_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV444SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV444SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV422_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV422SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV422SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerGBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerGBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10RGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10RGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10BGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10BGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10GBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10GBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12GBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12GBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14RGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14RGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14BGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14BGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER14_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer14GBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer14GBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20RGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20RGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20BGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20BGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER20_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer20GBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer20GBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_RGGB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspRGGB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspRGGB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_BGGR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspBGGR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspBGGR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GRBG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGRBG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGRBG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_ISP_GBRG: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerIspGBRG + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerIspGBRG elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU444_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU444Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU444Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU422_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU422Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU422Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_BCCR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerBCCR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerBCCR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_RCCB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerRCCB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerRCCB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CRBC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCRBC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCRBC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER_CBRC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayerCBRC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayerCBRC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER10_CCCC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer10CCCC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer10CCCC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_BCCR: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12BCCR + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12BCCR elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_RCCB: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12RCCB + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12RCCB elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CRBC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CRBC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CRBC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CBRC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CBRC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CBRC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_BAYER12_CCCC: - eglFrame[0].eglColorFormat = cudaEglColorFormatBayer12CCCC + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatBayer12CCCC elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y: - eglFrame[0].eglColorFormat = cudaEglColorFormatY + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_SEMIPLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420SemiPlanar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420SemiPlanar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_SEMIPLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420SemiPlanar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420SemiPlanar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUV420_PLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUV420Planar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUV420Planar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVU420_PLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVU420Planar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVU420Planar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_2020: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_2020 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_2020 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_422_SEMIPLANAR_709: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_422SemiPlanar_709 + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_422SemiPlanar_709 elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YUVA: - eglFrame[0].eglColorFormat = cudaEglColorFormatYUVA + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYUVA elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_YVYU: - eglFrame[0].eglColorFormat = cudaEglColorFormatYVYU + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatYVYU elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_VYUY: - eglFrame[0].eglColorFormat = cudaEglColorFormatVYUY + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatVYUY elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_420_SEMIPLANAR_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_420SemiPlanar_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y10V10U10_444_SEMIPLANAR_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY10V10U10_444SemiPlanar_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_420_SEMIPLANAR_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_420SemiPlanar_709_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_ER elif cueglFrame.eglColorFormat == cydriver.CUeglColorFormat_enum.CU_EGL_COLOR_FORMAT_Y12V12U12_444_SEMIPLANAR_709_ER: - eglFrame[0].eglColorFormat = cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER + eglFrame[0].eglColorFormat = cyruntime.cudaEglColorFormatY12V12U12_444SemiPlanar_709_ER else: return cudaErrorInvalidValue if cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_ARRAY: - eglFrame[0].frameType = cudaEglFrameTypeArray + eglFrame[0].frameType = cyruntime.cudaEglFrameTypeArray elif cueglFrame.frameType == cydriver.CUeglFrameType_enum.CU_EGL_FRAME_TYPE_PITCH: - eglFrame[0].frameType = cudaEglFrameTypePitch + eglFrame[0].frameType = cyruntime.cudaEglFrameTypePitch else: return cudaErrorInvalidValue diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in deleted file mode 100644 index 72bebb670b..0000000000 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/cyruntime.pyx.in +++ /dev/null @@ -1,246 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cyruntime cimport * -from cuda.bindings._lib.cyruntime.utils cimport * -from libc.string cimport memset -cimport cuda.bindings._bindings.cydriver as cydriver - -{{if True}} - -cdef cudaError_t _cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - cdef cydriver.CUeglFrame cueglFrame - err = getDriverEglFrame(&cueglFrame, eglframe) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamProducerPresentFrame(conn, cueglFrame, pStream) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - if eglframe == NULL: - err = cudaErrorInvalidResourceHandle - return err - cdef cydriver.CUeglFrame cueglFrame - err = cydriver._cuEGLStreamProducerReturnFrame(conn, &cueglFrame, pStream) - if err != cudaSuccess: - return err - err = getRuntimeEglFrame(eglframe, cueglFrame) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - cdef cydriver.CUeglFrame cueglFrame - memset(&cueglFrame, 0, sizeof(cueglFrame)) - err = cydriver._cuGraphicsResourceGetMappedEglFrame(&cueglFrame, resource, index, mipLevel) - if err != cudaSuccess: - return err - err = getRuntimeEglFrame(eglFrame, cueglFrame) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: - return cudaErrorNotSupported - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGLGetDevices_v2(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsGLRegisterImage(resource, image, target, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsGLRegisterBuffer(resource, buffer, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaGraphicsEGLRegisterImage(cudaGraphicsResource_t* pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuGraphicsEGLRegisterImage(pCudaResource, image, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerConnect(conn, eglStream) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerDisconnect(conn) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamProducerConnect(conn, eglStream, width, height) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEGLStreamProducerDisconnect(conn) - return err - -{{endif}} -{{if True}} - -cdef cudaError_t _cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - cdef cudaError_t err = cudaSuccess - # cudaFree(0) is a NOP operations that initializes the context state - err = cudaFree(0) - if err != cudaSuccess: - return err - err = cydriver._cuEventCreateFromEGLSync(phEvent, eglSync, flags) - return err - -{{endif}} diff --git a/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in b/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in deleted file mode 100644 index f021fb2aae..0000000000 --- a/cuda_bindings/cuda/bindings/_lib/cyruntime/utils.pxd.in +++ /dev/null @@ -1,10 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -from cuda.bindings.cyruntime cimport * -cimport cuda.bindings._bindings.cydriver as cydriver - -# These are hard-coded helper function from the initial reimplementation of CUDA Runtime -# and will be removed as part of https://github.com/NVIDIA/cuda-python/issues/488 -cdef cudaError_t getDriverEglFrame(cydriver.CUeglFrame *cuEglFrame, cudaEglFrame eglFrame) except ?cudaErrorCallRequiresNewerDriver nogil -cdef cudaError_t getRuntimeEglFrame(cudaEglFrame *eglFrame, cydriver.CUeglFrame cueglFrame) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.cpp b/cuda_bindings/cuda/bindings/_lib/param_packer.cpp deleted file mode 100644 index 6f99c29e33..0000000000 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.cpp +++ /dev/null @@ -1,159 +0,0 @@ -// SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -// SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -#include -#include "param_packer.h" - -#include -#include -#include -#include - -PyObject* enum_module = nullptr; -PyTypeObject* enum_Enum = nullptr; - -PyObject* ctypes_module = nullptr; -PyObject* ctypes_addressof = nullptr; -PyObject* addressof_param_tuple = nullptr; - -PyTypeObject* ctypes_c_char = nullptr; -PyTypeObject* ctypes_c_bool = nullptr; -PyTypeObject* ctypes_c_wchar = nullptr; -PyTypeObject* ctypes_c_byte = nullptr; -PyTypeObject* ctypes_c_ubyte = nullptr; -PyTypeObject* ctypes_c_short = nullptr; -PyTypeObject* ctypes_c_ushort = nullptr; -PyTypeObject* ctypes_c_int = nullptr; -PyTypeObject* ctypes_c_uint = nullptr; -PyTypeObject* ctypes_c_long = nullptr; -PyTypeObject* ctypes_c_ulong = nullptr; -PyTypeObject* ctypes_c_longlong = nullptr; -PyTypeObject* ctypes_c_ulonglong = nullptr; -PyTypeObject* ctypes_c_size_t = nullptr; -PyTypeObject* ctypes_c_float = nullptr; -PyTypeObject* ctypes_c_double = nullptr; -PyTypeObject* ctypes_c_void_p = nullptr; - -PyTypeObject* ctypes_c_ssize_t = nullptr; -PyTypeObject* ctypes_c_longdouble = nullptr; -PyTypeObject* ctypes_c_char_p = nullptr; -PyTypeObject* ctypes_c_wchar_p = nullptr; -PyTypeObject* ctypes_c_structure = nullptr; - -void fetch_ctypes() -{ - ctypes_module = PyImport_ImportModule("ctypes"); - if (ctypes_module == nullptr) - throw std::runtime_error("Cannot import ctypes module"); - // get method addressof - PyObject* ctypes_dict = PyModule_GetDict(ctypes_module); - if (ctypes_dict == nullptr) - throw std::runtime_error(std::string("FAILURE @ ") + std::string(__FILE__) + " : " + std::to_string(__LINE__)); - // supportedtypes - ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); - ctypes_c_char = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_char"); - ctypes_c_bool = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_bool"); - ctypes_c_wchar = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_wchar"); - ctypes_c_byte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_byte"); - ctypes_c_ubyte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ubyte"); - ctypes_c_short = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_short"); - ctypes_c_ushort = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ushort"); - ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); - ctypes_c_uint = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_uint"); - ctypes_c_long = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_long"); - ctypes_c_ulong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulong"); - ctypes_c_longlong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_longlong"); - ctypes_c_ulonglong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulonglong"); - ctypes_c_size_t = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_size_t"); - ctypes_c_float = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_float"); - ctypes_c_double = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_double"); - ctypes_c_void_p = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_void_p"); // == c_voidp -} - - -// (target type, source type) -std::map, std::function> m_feeders; - -void populate_feeders(PyTypeObject* target_t, PyTypeObject* source_t) -{ - if (target_t == ctypes_c_int) - { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((int*)ptr) = (int)PyLong_AsLong(value); - return sizeof(int); - }; - return; - } - } else if (target_t == ctypes_c_bool) { - if (source_t == &PyBool_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((bool*)ptr) = (value == Py_True); - return sizeof(bool); - }; - return; - } - } else if (target_t == ctypes_c_byte) { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((int8_t*)ptr) = (int8_t)PyLong_AsLong(value); - return sizeof(int8_t); - }; - return; - } - } else if (target_t == ctypes_c_double) { - if (source_t == &PyFloat_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((double*)ptr) = (double)PyFloat_AsDouble(value); - return sizeof(double); - }; - return; - } - } else if (target_t == ctypes_c_float) { - if (source_t == &PyFloat_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((float*)ptr) = (float)PyFloat_AsDouble(value); - return sizeof(float); - }; - return; - } - } else if (target_t == ctypes_c_longlong) { - if (source_t == &PyLong_Type) - { - m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int - { - *((long long*)ptr) = (long long)PyLong_AsLongLong(value); - return sizeof(long long); - }; - return; - } - } -} - -int feed(void* ptr, PyObject* value, PyObject* type) -{ - PyTypeObject* pto = (PyTypeObject*)type; - if (ctypes_c_int == nullptr) - fetch_ctypes(); - auto found = m_feeders.find({pto,value->ob_type}); - if (found == m_feeders.end()) - { - populate_feeders(pto, value->ob_type); - found = m_feeders.find({pto,value->ob_type}); - } - if (found != m_feeders.end()) - { - return found->second(ptr, value); - } - return 0; -} diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.h b/cuda_bindings/cuda/bindings/_lib/param_packer.h index c69f474984..96c56b4fe4 100644 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.h +++ b/cuda_bindings/cuda/bindings/_lib/param_packer.h @@ -1,12 +1,152 @@ // SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. // SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -// + // Please refer to the NVIDIA end user license agreement (EULA) associated // with this source code for terms and conditions that govern your use of // this software. Any use, reproduction, disclosure, or distribution of // this software and related documentation outside the terms of the EULA // is strictly prohibited. -#pragma once + #include -int feed(void* ptr, PyObject* value, PyObject* type); +#include +#include +#include +#include + +static PyObject* ctypes_module = nullptr; + +static PyTypeObject* ctypes_c_char = nullptr; +static PyTypeObject* ctypes_c_bool = nullptr; +static PyTypeObject* ctypes_c_wchar = nullptr; +static PyTypeObject* ctypes_c_byte = nullptr; +static PyTypeObject* ctypes_c_ubyte = nullptr; +static PyTypeObject* ctypes_c_short = nullptr; +static PyTypeObject* ctypes_c_ushort = nullptr; +static PyTypeObject* ctypes_c_int = nullptr; +static PyTypeObject* ctypes_c_uint = nullptr; +static PyTypeObject* ctypes_c_long = nullptr; +static PyTypeObject* ctypes_c_ulong = nullptr; +static PyTypeObject* ctypes_c_longlong = nullptr; +static PyTypeObject* ctypes_c_ulonglong = nullptr; +static PyTypeObject* ctypes_c_size_t = nullptr; +static PyTypeObject* ctypes_c_float = nullptr; +static PyTypeObject* ctypes_c_double = nullptr; +static PyTypeObject* ctypes_c_void_p = nullptr; + +static void fetch_ctypes() +{ + ctypes_module = PyImport_ImportModule("ctypes"); + if (ctypes_module == nullptr) + throw std::runtime_error("Cannot import ctypes module"); + // get method addressof + PyObject* ctypes_dict = PyModule_GetDict(ctypes_module); + if (ctypes_dict == nullptr) + throw std::runtime_error(std::string("FAILURE @ ") + std::string(__FILE__) + " : " + std::to_string(__LINE__)); + // supportedtypes + ctypes_c_char = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_char"); + ctypes_c_bool = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_bool"); + ctypes_c_wchar = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_wchar"); + ctypes_c_byte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_byte"); + ctypes_c_ubyte = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ubyte"); + ctypes_c_short = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_short"); + ctypes_c_ushort = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ushort"); + ctypes_c_int = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_int"); + ctypes_c_uint = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_uint"); + ctypes_c_long = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_long"); + ctypes_c_ulong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulong"); + ctypes_c_longlong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_longlong"); + ctypes_c_ulonglong = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_ulonglong"); + ctypes_c_size_t = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_size_t"); + ctypes_c_float = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_float"); + ctypes_c_double = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_double"); + ctypes_c_void_p = (PyTypeObject*) PyDict_GetItemString(ctypes_dict, "c_void_p"); // == c_voidp +} + + +// (target type, source type) +static std::map, std::function> m_feeders; + +static void populate_feeders(PyTypeObject* target_t, PyTypeObject* source_t) +{ + if (target_t == ctypes_c_int) + { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((int*)ptr) = (int)PyLong_AsLong(value); + return sizeof(int); + }; + return; + } + } else if (target_t == ctypes_c_bool) { + if (source_t == &PyBool_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((bool*)ptr) = (value == Py_True); + return sizeof(bool); + }; + return; + } + } else if (target_t == ctypes_c_byte) { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((int8_t*)ptr) = (int8_t)PyLong_AsLong(value); + return sizeof(int8_t); + }; + return; + } + } else if (target_t == ctypes_c_double) { + if (source_t == &PyFloat_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((double*)ptr) = (double)PyFloat_AsDouble(value); + return sizeof(double); + }; + return; + } + } else if (target_t == ctypes_c_float) { + if (source_t == &PyFloat_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((float*)ptr) = (float)PyFloat_AsDouble(value); + return sizeof(float); + }; + return; + } + } else if (target_t == ctypes_c_longlong) { + if (source_t == &PyLong_Type) + { + m_feeders[{target_t,source_t}] = [](void* ptr, PyObject* value) -> int + { + *((long long*)ptr) = (long long)PyLong_AsLongLong(value); + return sizeof(long long); + }; + return; + } + } +} + +static int feed(void* ptr, PyObject* value, PyObject* type) +{ + PyTypeObject* pto = (PyTypeObject*)type; + if (ctypes_c_int == nullptr) + fetch_ctypes(); + auto found = m_feeders.find({pto,value->ob_type}); + if (found == m_feeders.end()) + { + populate_feeders(pto, value->ob_type); + found = m_feeders.find({pto,value->ob_type}); + } + if (found != m_feeders.end()) + { + return found->second(ptr, value); + } + return 0; +} diff --git a/cuda_bindings/cuda/bindings/_lib/param_packer.pxd b/cuda_bindings/cuda/bindings/_lib/param_packer.pxd index 82b0d94971..ad7fd95668 100644 --- a/cuda_bindings/cuda/bindings/_lib/param_packer.pxd +++ b/cuda_bindings/cuda/bindings/_lib/param_packer.pxd @@ -1,5 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +# Include "param_packer.h" so its contents get compiled into every +# Cython extension module that depends on param_packer.pxd. cdef extern from "param_packer.h": int feed(void* ptr, object o, object ct) diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pxd.in b/cuda_bindings/cuda/bindings/_lib/utils.pxd.in index b66ac71f01..d317e69e89 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pxd.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxd.in @@ -6,7 +6,7 @@ cimport cuda.bindings.cydriver as cydriver cimport cuda.bindings.cyruntime as cyruntime from libcpp.vector cimport vector -cdef class HelperKernelParams: +cdef class _HelperKernelParams: cdef Py_buffer _pybuffer cdef bint _pyobj_acquired cdef void** _ckernelParams @@ -14,13 +14,13 @@ cdef class HelperKernelParams: cdef int _length cdef bint _malloc_list_created -cdef class HelperInputVoidPtr: +cdef class _HelperInputVoidPtr: cdef Py_buffer _pybuffer cdef void* _cptr cdef bint _pyobj_acquired {{if 'CUmemPool_attribute_enum' in found_types}} -cdef class HelperCUmemPool_attribute: +cdef class _HelperCUmemPool_attribute: cdef void* _cptr cdef cydriver.CUmemPool_attribute_enum _attr cdef bint _is_getter @@ -31,7 +31,7 @@ cdef class HelperCUmemPool_attribute: {{endif}} {{if 'CUmem_range_attribute_enum' in found_types}} -cdef class HelperCUmem_range_attribute: +cdef class _HelperCUmem_range_attribute: cdef void* _cptr cdef cydriver.CUmem_range_attribute_enum _attr cdef size_t _data_size @@ -42,7 +42,7 @@ cdef class HelperCUmem_range_attribute: {{endif}} {{if 'CUpointer_attribute_enum' in found_types}} -cdef class HelperCUpointer_attribute: +cdef class _HelperCUpointer_attribute: cdef void* _cptr cdef cydriver.CUpointer_attribute_enum _attr cdef bint _is_getter @@ -60,7 +60,7 @@ cdef class HelperCUpointer_attribute: {{endif}} {{if 'CUgraphMem_attribute_enum' in found_types}} -cdef class HelperCUgraphMem_attribute: +cdef class _HelperCUgraphMem_attribute: cdef void* _cptr cdef cydriver.CUgraphMem_attribute_enum _attr cdef bint _is_getter @@ -70,7 +70,7 @@ cdef class HelperCUgraphMem_attribute: {{endif}} {{if 'CUjit_option_enum' in found_types}} -cdef class HelperCUjit_option: +cdef class _HelperCUjit_option: cdef void* _cptr cdef cydriver.CUjit_option_enum _attr @@ -83,11 +83,11 @@ cdef class HelperCUjit_option: cdef int _int cdef cydriver.CUjit_cacheMode_enum _cacheMode cdef vector[char*] _charstarstar # list of names - cdef InputVoidPtrPtrHelper _voidstarstar # list of addresses + cdef _InputVoidPtrPtrHelper _voidstarstar # list of addresses {{endif}} {{if 'cudaJitOption' in found_types}} -cdef class HelperCudaJitOption: +cdef class _HelperCudaJitOption: cdef void* _cptr cdef cyruntime.cudaJitOption _attr @@ -101,7 +101,7 @@ cdef class HelperCudaJitOption: {{endif}} {{if 'CUlibraryOption_enum' in found_types}} -cdef class HelperCUlibraryOption: +cdef class _HelperCUlibraryOption: cdef void* _cptr cdef cydriver.CUlibraryOption_enum _attr @@ -110,7 +110,7 @@ cdef class HelperCUlibraryOption: {{endif}} {{if 'cudaLibraryOption' in found_types}} -cdef class HelperCudaLibraryOption: +cdef class _HelperCudaLibraryOption: cdef void* _cptr cdef cyruntime.cudaLibraryOption _attr @@ -119,7 +119,7 @@ cdef class HelperCudaLibraryOption: {{endif}} {{if 'CUmemAllocationHandleType_enum' in found_types}} -cdef class HelperCUmemAllocationHandleType: +cdef class _HelperCUmemAllocationHandleType: cdef void* _cptr cdef cydriver.CUmemAllocationHandleType_enum _type @@ -132,12 +132,12 @@ cdef class HelperCUmemAllocationHandleType: {{endif}} {{endif}} -cdef class InputVoidPtrPtrHelper: +cdef class _InputVoidPtrPtrHelper: cdef void** _cptr {{if 'CUcoredumpSettings_enum' in found_types}} -cdef class HelperCUcoredumpSettings: +cdef class _HelperCUcoredumpSettings: cdef void* _cptr cdef cydriver.CUcoredumpSettings_enum _attrib cdef bint _is_getter diff --git a/cuda_bindings/cuda/bindings/_lib/utils.pyx.in b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in similarity index 91% rename from cuda_bindings/cuda/bindings/_lib/utils.pyx.in rename to cuda_bindings/cuda/bindings/_lib/utils.pxi.in index 9dd1e4ce50..a0470af799 100644 --- a/cuda_bindings/cuda/bindings/_lib/utils.pyx.in +++ b/cuda_bindings/cuda/bindings/_lib/utils.pxi.in @@ -6,42 +6,39 @@ from libc.stdlib cimport calloc, free from libc.stdint cimport int32_t, uint32_t, int64_t, uint64_t from libc.stddef cimport wchar_t from libc.string cimport memcpy -from enum import Enum -from typing import List, Tuple -import ctypes +from enum import Enum as _Enum +import ctypes as _ctypes cimport cuda.bindings.cydriver as cydriver -import cuda.bindings.driver as driver +import cuda.bindings.driver as _driver cimport cuda.bindings._lib.param_packer as param_packer -ctypedef unsigned long long void_ptr - -cdef void* callocWrapper(length, size): +cdef void* _callocWrapper(length, size): cdef void* out = calloc(length, size) if out is NULL: raise MemoryError('Failed to allocated length x size memory: {}x{}'.format(length, size)) return out -cdef class HelperKernelParams: +cdef class _HelperKernelParams: supported_types = { # excluding void_p and None, which are handled specially - ctypes.c_bool, - ctypes.c_char, - ctypes.c_wchar, - ctypes.c_byte, - ctypes.c_ubyte, - ctypes.c_short, - ctypes.c_ushort, - ctypes.c_int, - ctypes.c_uint, - ctypes.c_long, - ctypes.c_ulong, - ctypes.c_longlong, - ctypes.c_ulonglong, - ctypes.c_size_t, - ctypes.c_float, - ctypes.c_double + _ctypes.c_bool, + _ctypes.c_char, + _ctypes.c_wchar, + _ctypes.c_byte, + _ctypes.c_ubyte, + _ctypes.c_short, + _ctypes.c_ushort, + _ctypes.c_int, + _ctypes.c_uint, + _ctypes.c_long, + _ctypes.c_ulong, + _ctypes.c_longlong, + _ctypes.c_ulonglong, + _ctypes.c_size_t, + _ctypes.c_float, + _ctypes.c_double } - max_param_size = max(ctypes.sizeof(max(HelperKernelParams.supported_types, key=lambda t:ctypes.sizeof(t))), sizeof(void_ptr)) + max_param_size = max(_ctypes.sizeof(max(_HelperKernelParams.supported_types, key=lambda t:_ctypes.sizeof(t))), sizeof(void_ptr)) def __cinit__(self, kernelParams): self._pyobj_acquired = False @@ -58,14 +55,14 @@ cdef class HelperKernelParams: raise RuntimeError("Argument 'kernelParams' failed to retrieve buffer through Buffer Protocol") self._pyobj_acquired = True self._ckernelParams = self._pybuffer.buf - elif isinstance(kernelParams, (Tuple)) and len(kernelParams) == 2 and isinstance(kernelParams[0], (Tuple)) and isinstance(kernelParams[1], (Tuple)): + elif isinstance(kernelParams, (tuple)) and len(kernelParams) == 2 and isinstance(kernelParams[0], (tuple)) and isinstance(kernelParams[1], (tuple)): # Hard run, construct and fill out contigues memory using provided kernel values and types based if len(kernelParams[0]) != len(kernelParams[1]): raise TypeError("Argument 'kernelParams' has tuples with different length") if len(kernelParams[0]) != 0: self._length = len(kernelParams[0]) - self._ckernelParams = callocWrapper(len(kernelParams[0]), sizeof(void*)) - self._ckernelParamsData = callocWrapper(len(kernelParams[0]), HelperKernelParams.max_param_size) + self._ckernelParams = _callocWrapper(len(kernelParams[0]), sizeof(void*)) + self._ckernelParamsData = _callocWrapper(len(kernelParams[0]), _HelperKernelParams.max_param_size) self._malloc_list_created = True idx = 0 @@ -75,49 +72,49 @@ cdef class HelperKernelParams: # special cases for None if callable(getattr(value, 'getPtr', None)): self._ckernelParams[idx] = value.getPtr() - elif isinstance(value, (ctypes.Structure)): - self._ckernelParams[idx] = ctypes.addressof(value) - elif isinstance(value, (Enum)): + elif isinstance(value, (_ctypes.Structure)): + self._ckernelParams[idx] = _ctypes.addressof(value) + elif isinstance(value, (_Enum)): self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) (self._ckernelParams[idx])[0] = value.value data_idx += sizeof(int) else: - raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(ctypes.Structure), type(ctypes.c_void_p))) - elif ctype in HelperKernelParams.supported_types: + raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(_ctypes.Structure), type(_ctypes.c_void_p))) + elif ctype in _HelperKernelParams.supported_types: self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) # handle case where a float is passed as a double - if ctype == ctypes.c_double and isinstance(value, ctypes.c_float): + if ctype == _ctypes.c_double and isinstance(value, _ctypes.c_float): value = ctype(value.value) if not isinstance(value, ctype): # make it a ctype size = param_packer.feed(self._ckernelParams[idx], value, ctype) if size == 0: # feed failed value = ctype(value) - size = ctypes.sizeof(ctype) - addr = (ctypes.addressof(value)) + size = _ctypes.sizeof(ctype) + addr = (_ctypes.addressof(value)) memcpy(self._ckernelParams[idx], addr, size) else: - size = ctypes.sizeof(ctype) - addr = (ctypes.addressof(value)) + size = _ctypes.sizeof(ctype) + addr = (_ctypes.addressof(value)) memcpy(self._ckernelParams[idx], addr, size) data_idx += size - elif ctype == ctypes.c_void_p: + elif ctype == _ctypes.c_void_p: # special cases for void_p - if isinstance(value, (int, ctypes.c_void_p)): + if isinstance(value, (int, _ctypes.c_void_p)): self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) - (self._ckernelParams[idx])[0] = value.value if isinstance(value, (ctypes.c_void_p)) else value + (self._ckernelParams[idx])[0] = value.value if isinstance(value, (_ctypes.c_void_p)) else value data_idx += sizeof(void_ptr) elif callable(getattr(value, 'getPtr', None)): self._ckernelParams[idx] = &(self._ckernelParamsData[data_idx]) (self._ckernelParams[idx])[0] = value.getPtr() data_idx += sizeof(void_ptr) else: - raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(int), type(ctypes.c_void_p))) + raise TypeError("Provided argument is of type {} but expected Type {}, {} or CUDA Binding structure with getPtr() attribute".format(type(value), type(int), type(_ctypes.c_void_p))) else: raise TypeError("Unsupported type: " + str(type(ctype))) idx += 1 else: - raise TypeError("Argument 'kernelParams' is not a valid type: Tuple[Tuple[Any, ...], Tuple[Any, ...]] or PyObject implimenting Buffer Protocol or Int") + raise TypeError("Argument 'kernelParams' is not a valid type: tuple[tuple[Any, ...], tuple[Any, ...]] or PyObject implimenting Buffer Protocol or Int") def __dealloc__(self): if self._pyobj_acquired is True: @@ -130,7 +127,7 @@ cdef class HelperKernelParams: def ckernelParams(self): return self._ckernelParams -cdef class HelperInputVoidPtr: +cdef class _HelperInputVoidPtr: def __cinit__(self, ptr): self._pyobj_acquired = False if ptr is None: @@ -138,7 +135,7 @@ cdef class HelperInputVoidPtr: elif isinstance(ptr, (int)): # Easy run, user gave us an already configured void** address self._cptr = ptr - elif isinstance(ptr, (driver.CUdeviceptr)): + elif isinstance(ptr, (_driver.CUdeviceptr)): self._cptr = int(ptr) elif PyObject_CheckBuffer(ptr): # Easy run, get address from Python Buffer Protocol @@ -160,7 +157,7 @@ cdef class HelperInputVoidPtr: {{if 'CUmemPool_attribute_enum' in found_types}} -cdef class HelperCUmemPool_attribute: +cdef class _HelperCUmemPool_attribute: def __cinit__(self, attr, init_value, is_getter=False): self._is_getter = is_getter self._attr = attr.value @@ -175,7 +172,7 @@ cdef class HelperCUmemPool_attribute: {{if 'CU_MEMPOOL_ATTR_USED_MEM_CURRENT'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_CURRENT,{{endif}} {{if 'CU_MEMPOOL_ATTR_USED_MEM_HIGH'}}cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_USED_MEM_HIGH,{{endif}}): if self._is_getter: - self._cuuint64_t_val = driver.cuuint64_t() + self._cuuint64_t_val = _driver.cuuint64_t() self._cptr = self._cuuint64_t_val.getPtr() else: self._cptr = init_value.getPtr() @@ -206,7 +203,7 @@ cdef class HelperCUmemPool_attribute: {{endif}} {{if 'CUmem_range_attribute_enum' in found_types}} -cdef class HelperCUmem_range_attribute: +cdef class _HelperCUmem_range_attribute: def __cinit__(self, attr, data_size): self._data_size = data_size self._attr = attr.value @@ -215,7 +212,7 @@ cdef class HelperCUmem_range_attribute: {{if 'CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION,{{endif}}): self._cptr = &self._int_val elif self._attr in ({{if 'CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY'}}cydriver.CUmem_range_attribute_enum.CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY,{{endif}}): - self._cptr = callocWrapper(1, self._data_size) + self._cptr = _callocWrapper(1, self._data_size) self._int_val_list = self._cptr else: raise TypeError('Unsupported attribute: {}'.format(attr.name)) @@ -240,13 +237,13 @@ cdef class HelperCUmem_range_attribute: {{endif}} {{if 'CUpointer_attribute_enum' in found_types}} -cdef class HelperCUpointer_attribute: +cdef class _HelperCUpointer_attribute: def __cinit__(self, attr, init_value, is_getter=False): self._is_getter = is_getter self._attr = attr.value if self._attr in ({{if 'CU_POINTER_ATTRIBUTE_CONTEXT'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_CONTEXT,{{endif}}): if self._is_getter: - self._ctx = driver.CUcontext() + self._ctx = _driver.CUcontext() self._cptr = self._ctx.getPtr() else: self._cptr = init_value.getPtr() @@ -260,7 +257,7 @@ cdef class HelperCUpointer_attribute: elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_DEVICE_POINTER'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_DEVICE_POINTER,{{endif}} {{if 'CU_POINTER_ATTRIBUTE_RANGE_START_ADDR'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_RANGE_START_ADDR,{{endif}}): if self._is_getter: - self._devptr = driver.CUdeviceptr() + self._devptr = _driver.CUdeviceptr() self._cptr = self._devptr.getPtr() else: self._cptr = init_value.getPtr() @@ -269,7 +266,7 @@ cdef class HelperCUpointer_attribute: self._cptr = &self._void elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_P2P_TOKENS'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_P2P_TOKENS,{{endif}}): if self._is_getter: - self._token = driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS() + self._token = _driver.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS() self._cptr = self._token.getPtr() else: self._cptr = init_value.getPtr() @@ -287,7 +284,7 @@ cdef class HelperCUpointer_attribute: self._cptr = &self._size elif self._attr in ({{if 'CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE'}}cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE,{{endif}}): if self._is_getter: - self._mempool = driver.CUmemoryPool() + self._mempool = _driver.CUmemoryPool() self._cptr = self._mempool.getPtr() else: self._cptr = init_value.getPtr() @@ -334,7 +331,7 @@ cdef class HelperCUpointer_attribute: {{endif}} {{if 'CUgraphMem_attribute_enum' in found_types}} -cdef class HelperCUgraphMem_attribute: +cdef class _HelperCUgraphMem_attribute: def __cinit__(self, attr, init_value, is_getter=False): self._is_getter = is_getter self._attr = attr.value @@ -343,7 +340,7 @@ cdef class HelperCUgraphMem_attribute: {{if 'CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT,{{endif}} {{if 'CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH' in found_values}}cydriver.CUgraphMem_attribute_enum.CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH,{{endif}}): if self._is_getter: - self._cuuint64_t_val = driver.cuuint64_t() + self._cuuint64_t_val = _driver.cuuint64_t() self._cptr = self._cuuint64_t_val.getPtr() else: self._cptr = init_value.getPtr() @@ -369,7 +366,7 @@ cdef class HelperCUgraphMem_attribute: {{endif}} {{if 'CUjit_option_enum' in found_types}} -cdef class HelperCUjit_option: +cdef class _HelperCUjit_option: def __cinit__(self, attr, init_value): self._attr = attr.value if self._attr in ({{if 'CU_JIT_MAX_REGISTERS' in found_values}}cydriver.CUjit_option_enum.CU_JIT_MAX_REGISTERS,{{endif}} @@ -417,8 +414,8 @@ cdef class HelperCUjit_option: self._charstarstar = init_value self._cptr = &self._charstarstar[0] elif self._attr in ({{if 'CU_JIT_GLOBAL_SYMBOL_ADDRESSES' in found_values}}cydriver.CUjit_option_enum.CU_JIT_GLOBAL_SYMBOL_ADDRESSES,{{endif}}): - pylist = [HelperInputVoidPtr(val) for val in init_value] - self._voidstarstar = InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(val) for val in init_value] + self._voidstarstar = _InputVoidPtrPtrHelper(pylist) self._cptr = self._voidstarstar.cptr else: raise TypeError('Unsupported attribute: {}'.format(attr.name)) @@ -433,7 +430,7 @@ cdef class HelperCUjit_option: {{if 'cudaJitOption' in found_types}} -cdef class HelperCudaJitOption: +cdef class _HelperCudaJitOption: def __cinit__(self, attr, init_value): self._attr = attr.value if self._attr in ({{if 'cudaJitMaxRegisters' in found_values}}cyruntime.cudaJitOption.cudaJitMaxRegisters,{{endif}} @@ -478,7 +475,7 @@ cdef class HelperCudaJitOption: {{if 'CUlibraryOption_enum' in found_types}} -cdef class HelperCUlibraryOption: +cdef class _HelperCUlibraryOption: def __cinit__(self, attr, init_value): self._attr = attr.value if False: @@ -505,7 +502,7 @@ cdef class HelperCUlibraryOption: {{if 'cudaLibraryOption' in found_types}} -cdef class HelperCudaLibraryOption: +cdef class _HelperCudaLibraryOption: def __cinit__(self, attr, init_value): self._attr = attr.value if False: @@ -532,7 +529,7 @@ cdef class HelperCudaLibraryOption: {{if 'CUmemAllocationHandleType_enum' in found_types}} -cdef class HelperCUmemAllocationHandleType: +cdef class _HelperCUmemAllocationHandleType: def __cinit__(self, attr): self._type = attr.value if False: @@ -555,7 +552,7 @@ cdef class HelperCUmemAllocationHandleType: {{endif}} {{if 'CU_MEM_HANDLE_TYPE_FABRIC' in found_values}} elif self._type in (cydriver.CUmemAllocationHandleType_enum.CU_MEM_HANDLE_TYPE_FABRIC,): - self._mem_fabric_handle = driver.CUmemFabricHandle() + self._mem_fabric_handle = _driver.CUmemFabricHandle() self._cptr = self._mem_fabric_handle.getPtr() {{endif}} else: @@ -595,9 +592,9 @@ cdef class HelperCUmemAllocationHandleType: raise TypeError('Unsupported attribute: {}'.format(self._type)) {{endif}} -cdef class InputVoidPtrPtrHelper: +cdef class _InputVoidPtrPtrHelper: def __cinit__(self, lst): - self._cptr = callocWrapper(len(lst), sizeof(void*)) + self._cptr = _callocWrapper(len(lst), sizeof(void*)) for idx in range(len(lst)): self._cptr[idx] = lst[idx].cptr @@ -610,14 +607,14 @@ cdef class InputVoidPtrPtrHelper: {{if 'CUcoredumpSettings_enum' in found_types}} -cdef class HelperCUcoredumpSettings: +cdef class _HelperCUcoredumpSettings: def __cinit__(self, attr, init_value, is_getter=False): self._is_getter = is_getter self._attrib = attr.value if self._attrib in ({{if 'CU_COREDUMP_FILE' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_FILE,{{endif}} {{if 'CU_COREDUMP_PIPE' in found_values}}cydriver.CUcoredumpSettings_enum.CU_COREDUMP_PIPE,{{endif}}): if self._is_getter: - self._charstar = callocWrapper(1024, 1) + self._charstar = _callocWrapper(1024, 1) self._cptr = self._charstar self._size = 1024 else: diff --git a/cuda_bindings/cuda/bindings/_lib/windll.pxd b/cuda_bindings/cuda/bindings/_lib/windll.pxd new file mode 100644 index 0000000000..7b190f3595 --- /dev/null +++ b/cuda_bindings/cuda/bindings/_lib/windll.pxd @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +from libc.stddef cimport wchar_t +from libc.stdint cimport uintptr_t +from cpython cimport PyUnicode_AsWideCharString, PyMem_Free + +cdef extern from "windows.h" nogil: + ctypedef void* HMODULE + ctypedef void* HANDLE + ctypedef void* FARPROC + ctypedef unsigned long DWORD + ctypedef const wchar_t *LPCWSTR + ctypedef const char *LPCSTR + ctypedef int BOOL + + cdef DWORD LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 + + HMODULE _LoadLibraryExW "LoadLibraryExW"( + LPCWSTR lpLibFileName, + HANDLE hFile, + DWORD dwFlags + ) + + FARPROC _GetProcAddress "GetProcAddress"(HMODULE hModule, LPCSTR lpProcName) + + BOOL _FreeLibrary "FreeLibrary"(HMODULE hLibModule) + +cdef inline uintptr_t LoadLibraryExW(str path, HANDLE hFile, DWORD dwFlags): + cdef uintptr_t result + cdef wchar_t* wpath = PyUnicode_AsWideCharString(path, NULL) + with nogil: + result = _LoadLibraryExW( + wpath, + hFile, + dwFlags + ) + PyMem_Free(wpath) + return result + +cdef inline FARPROC GetProcAddress(uintptr_t hModule, const char* lpProcName) nogil: + return _GetProcAddress(hModule, lpProcName) + +cdef inline BOOL FreeLibrary(uintptr_t hLibModule) nogil: + return _FreeLibrary(hLibModule) diff --git a/cuda_bindings/cuda/bindings/_path_finder/README.md b/cuda_bindings/cuda/bindings/_path_finder/README.md deleted file mode 100644 index 48b12163ec..0000000000 --- a/cuda_bindings/cuda/bindings/_path_finder/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# The `cuda.bindings.path_finder` module was moved → `cuda.pathfinder` - -`cuda.bindings.path_finder` is deprecated and slated to be removed in the next `cuda-bindings` major version release. diff --git a/cuda_bindings/cuda/bindings/_path_finder/temporary_backward_compatibility.py b/cuda_bindings/cuda/bindings/_path_finder/temporary_backward_compatibility.py deleted file mode 100644 index 0b7cb4d277..0000000000 --- a/cuda_bindings/cuda/bindings/_path_finder/temporary_backward_compatibility.py +++ /dev/null @@ -1,41 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This is for TEMPORARY BACKWARD COMPATIBILITY only. -# cuda.bindings.path_finder is deprecated and slated to be removed in the next cuda-bindings major version release. - -from dataclasses import dataclass -from typing import Optional - -from cuda.pathfinder import load_nvidia_dynamic_lib -from cuda.pathfinder._dynamic_libs import supported_nvidia_libs - -if supported_nvidia_libs.IS_WINDOWS: - import pywintypes - - from cuda.pathfinder._dynamic_libs.load_dl_windows import POINTER_ADDRESS_SPACE - - def _unsigned_int_to_pywintypes_handle(handle_uint: int) -> pywintypes.HANDLE: - handle_int = handle_uint - POINTER_ADDRESS_SPACE if handle_uint >= POINTER_ADDRESS_SPACE // 2 else handle_uint - return pywintypes.HANDLE(handle_int) - - HandleType = pywintypes.HANDLE -else: - HandleType = int - - -# Original implementation, before making handle private as _handle_uint. -@dataclass -class LoadedDL: - handle: HandleType # type: ignore[valid-type] - abs_path: Optional[str] - was_already_loaded_from_elsewhere: bool - - -def load_nvidia_dynamic_library(libname: str) -> LoadedDL: - loaded_dl_uint = load_nvidia_dynamic_lib(libname) - if supported_nvidia_libs.IS_WINDOWS: - handle = _unsigned_int_to_pywintypes_handle(loaded_dl_uint._handle_uint) - else: - handle = loaded_dl_uint._handle_uint - return LoadedDL(handle, loaded_dl_uint.abs_path, loaded_dl_uint.was_already_loaded_from_elsewhere) diff --git a/cuda_bindings/cuda/bindings/_version.py b/cuda_bindings/cuda/bindings/_version.py index 2dc71972db..41ff260a11 100644 --- a/cuda_bindings/cuda/bindings/_version.py +++ b/cuda_bindings/cuda/bindings/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -__version__ = "12.9.0" +__version__ = "12.9.3" diff --git a/cuda_bindings/cuda/bindings/cufile.pxd b/cuda_bindings/cuda/bindings/cufile.pxd index 69fc6fc679..a0cc3016dc 100644 --- a/cuda_bindings/cuda/bindings/cufile.pxd +++ b/cuda_bindings/cuda/bindings/cufile.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/cuda/bindings/cufile.pyx index 9fe54009e2..176149a6e3 100644 --- a/cuda_bindings/cuda/bindings/cufile.pyx +++ b/cuda_bindings/cuda/bindings/cufile.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 12.9.1. Do not modify it directly. cimport cython # NOQA from libc cimport errno diff --git a/cuda_bindings/cuda/bindings/cycufile.pxd b/cuda_bindings/cuda/bindings/cycufile.pxd index ac19e14e20..65f5568bf6 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pxd +++ b/cuda_bindings/cuda/bindings/cycufile.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 12.9.1. Do not modify it directly. +from libc.stdint cimport uint32_t, uint64_t from libc.time cimport time_t from libcpp cimport bool as cpp_bool from posix.types cimport off_t @@ -254,3 +255,4 @@ cdef CUfileError_t cuFileGetParameterString(CUFileStringConfigParameter_t param, cdef CUfileError_t cuFileSetParameterSizeT(CUFileSizeTConfigParameter_t param, size_t value) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp_bool value) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil +cdef CUfileError_t cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cycufile.pyx b/cuda_bindings/cuda/bindings/cycufile.pyx index 621bd083c8..7437924609 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pyx +++ b/cuda_bindings/cuda/bindings/cycufile.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated with version 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 12.9.1. Do not modify it directly. from ._internal cimport cufile as _cufile @@ -132,3 +132,7 @@ cdef CUfileError_t cuFileSetParameterBool(CUFileBoolConfigParameter_t param, cpp cdef CUfileError_t cuFileSetParameterString(CUFileStringConfigParameter_t param, const char* desc_str) except?CUFILE_LOADING_ERROR nogil: return _cufile._cuFileSetParameterString(param, desc_str) + + +cdef CUfileError_t cuFileDriverClose() except?CUFILE_LOADING_ERROR nogil: + return _cufile._cuFileDriverClose() diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/cuda/bindings/cynvjitlink.pxd index eaf0d0a0e8..c1ba67a517 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t, uint32_t @@ -23,6 +23,15 @@ ctypedef enum nvJitLinkResult "nvJitLinkResult": NVJITLINK_ERROR_THREADPOOL "NVJITLINK_ERROR_THREADPOOL" NVJITLINK_ERROR_UNRECOGNIZED_INPUT "NVJITLINK_ERROR_UNRECOGNIZED_INPUT" NVJITLINK_ERROR_FINALIZE "NVJITLINK_ERROR_FINALIZE" + NVJITLINK_ERROR_NULL_INPUT "NVJITLINK_ERROR_NULL_INPUT" + NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS "NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS" + NVJITLINK_ERROR_INCORRECT_INPUT_TYPE "NVJITLINK_ERROR_INCORRECT_INPUT_TYPE" + NVJITLINK_ERROR_ARCH_MISMATCH "NVJITLINK_ERROR_ARCH_MISMATCH" + NVJITLINK_ERROR_OUTDATED_LIBRARY "NVJITLINK_ERROR_OUTDATED_LIBRARY" + NVJITLINK_ERROR_MISSING_FATBIN "NVJITLINK_ERROR_MISSING_FATBIN" + NVJITLINK_ERROR_UNRECOGNIZED_ARCH "NVJITLINK_ERROR_UNRECOGNIZED_ARCH" + NVJITLINK_ERROR_UNSUPPORTED_ARCH "NVJITLINK_ERROR_UNSUPPORTED_ARCH" + NVJITLINK_ERROR_LTO_NOT_ENABLED "NVJITLINK_ERROR_LTO_NOT_ENABLED" _NVJITLINKRESULT_INTERNAL_LOADING_ERROR "_NVJITLINKRESULT_INTERNAL_LOADING_ERROR" = -42 ctypedef enum nvJitLinkInputType "nvJitLinkInputType": diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/cuda/bindings/cynvjitlink.pyx index b19f1a8469..cfaeff2dc4 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pyx @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from ._internal cimport nvjitlink as _nvjitlink diff --git a/cuda_bindings/cuda/bindings/cynvvm.pxd b/cuda_bindings/cuda/bindings/cynvvm.pxd index 94e2034a8a..5453b09219 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pxd +++ b/cuda_bindings/cuda/bindings/cynvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. ############################################################################### diff --git a/cuda_bindings/cuda/bindings/cynvvm.pyx b/cuda_bindings/cuda/bindings/cynvvm.pyx index a5b9a43686..bb5b5b4c05 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pyx +++ b/cuda_bindings/cuda/bindings/cynvvm.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from ._internal cimport nvvm as _nvvm diff --git a/cuda_bindings/cuda/bindings/cyruntime.pyx.in b/cuda_bindings/cuda/bindings/cyruntime.pyx.in index 01183a53c4..d1ea27e846 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pyx.in +++ b/cuda_bindings/cuda/bindings/cyruntime.pyx.in @@ -3,7 +3,6 @@ # This code was automatically generated with version 12.9.0. Do not modify it directly. cimport cuda.bindings._bindings.cyruntime as cyruntime -cimport cuda.bindings._lib.cyruntime.cyruntime as custom_cyruntime cimport cython {{if 'cudaDeviceReset' in found_functions}} @@ -1749,73 +1748,73 @@ cdef cudaExtent make_cudaExtent(size_t w, size_t h, size_t d) except* nogil: {{if True}} cdef cudaError_t cudaGraphicsEGLRegisterImage(cudaGraphicsResource** pCudaResource, EGLImageKHR image, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsEGLRegisterImage(pCudaResource, image, flags) + return cyruntime._cudaGraphicsEGLRegisterImage(pCudaResource, image, flags) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerConnect(conn, eglStream) + return cyruntime._cudaEGLStreamConsumerConnect(conn, eglStream) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerConnectWithFlags(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) + return cyruntime._cudaEGLStreamConsumerConnectWithFlags(conn, eglStream, flags) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerDisconnect(conn) + return cyruntime._cudaEGLStreamConsumerDisconnect(conn) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerAcquireFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t* pCudaResource, cudaStream_t* pStream, unsigned int timeout) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) + return cyruntime._cudaEGLStreamConsumerAcquireFrame(conn, pCudaResource, pStream, timeout) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamConsumerReleaseFrame(cudaEglStreamConnection* conn, cudaGraphicsResource_t pCudaResource, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) + return cyruntime._cudaEGLStreamConsumerReleaseFrame(conn, pCudaResource, pStream) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamProducerConnect(cudaEglStreamConnection* conn, EGLStreamKHR eglStream, EGLint width, EGLint height) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamProducerConnect(conn, eglStream, width, height) + return cyruntime._cudaEGLStreamProducerConnect(conn, eglStream, width, height) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamProducerDisconnect(cudaEglStreamConnection* conn) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamProducerDisconnect(conn) + return cyruntime._cudaEGLStreamProducerDisconnect(conn) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamProducerPresentFrame(cudaEglStreamConnection* conn, cudaEglFrame eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamProducerPresentFrame(conn, eglframe, pStream) + return cyruntime._cudaEGLStreamProducerPresentFrame(conn, eglframe, pStream) {{endif}} {{if True}} cdef cudaError_t cudaEGLStreamProducerReturnFrame(cudaEglStreamConnection* conn, cudaEglFrame* eglframe, cudaStream_t* pStream) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEGLStreamProducerReturnFrame(conn, eglframe, pStream) + return cyruntime._cudaEGLStreamProducerReturnFrame(conn, eglframe, pStream) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsResourceGetMappedEglFrame(cudaEglFrame* eglFrame, cudaGraphicsResource_t resource, unsigned int index, unsigned int mipLevel) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) + return cyruntime._cudaGraphicsResourceGetMappedEglFrame(eglFrame, resource, index, mipLevel) {{endif}} {{if True}} cdef cudaError_t cudaEventCreateFromEGLSync(cudaEvent_t* phEvent, EGLSyncKHR eglSync, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaEventCreateFromEGLSync(phEvent, eglSync, flags) + return cyruntime._cudaEventCreateFromEGLSync(phEvent, eglSync, flags) {{endif}} {{if 'cudaProfilerStart' in found_functions}} @@ -1833,76 +1832,86 @@ cdef cudaError_t cudaProfilerStop() except ?cudaErrorCallRequiresNewerDriver nog {{if True}} cdef cudaError_t cudaGLGetDevices(unsigned int* pCudaDeviceCount, int* pCudaDevices, unsigned int cudaDeviceCount, cudaGLDeviceList deviceList) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGLGetDevices(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) + return cyruntime._cudaGLGetDevices(pCudaDeviceCount, pCudaDevices, cudaDeviceCount, deviceList) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsGLRegisterImage(cudaGraphicsResource** resource, GLuint image, GLenum target, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsGLRegisterImage(resource, image, target, flags) + return cyruntime._cudaGraphicsGLRegisterImage(resource, image, target, flags) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsGLRegisterBuffer(cudaGraphicsResource** resource, GLuint buffer, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsGLRegisterBuffer(resource, buffer, flags) + return cyruntime._cudaGraphicsGLRegisterBuffer(resource, buffer, flags) {{endif}} {{if True}} cdef cudaError_t cudaVDPAUGetDevice(int* device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) + return cyruntime._cudaVDPAUGetDevice(device, vdpDevice, vdpGetProcAddress) {{endif}} {{if True}} cdef cudaError_t cudaVDPAUSetVDPAUDevice(int device, VdpDevice vdpDevice, VdpGetProcAddress* vdpGetProcAddress) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaVDPAUSetVDPAUDevice(device, vdpDevice, vdpGetProcAddress) + return cyruntime._cudaVDPAUSetVDPAUDevice(device, vdpDevice, vdpGetProcAddress) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsVDPAURegisterVideoSurface(cudaGraphicsResource** resource, VdpVideoSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) + return cyruntime._cudaGraphicsVDPAURegisterVideoSurface(resource, vdpSurface, flags) {{endif}} {{if True}} cdef cudaError_t cudaGraphicsVDPAURegisterOutputSurface(cudaGraphicsResource** resource, VdpOutputSurface vdpSurface, unsigned int flags) except ?cudaErrorCallRequiresNewerDriver nogil: - return custom_cyruntime._cudaGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) + return cyruntime._cudaGraphicsVDPAURegisterOutputSurface(resource, vdpSurface, flags) {{endif}} {{if True}} -{{if 'Windows' != platform.system()}} +from libc.stdint cimport uintptr_t +from cuda.pathfinder import load_nvidia_dynamic_lib +{{if 'Windows' == platform.system()}} +cimport cuda.bindings._lib.windll as windll +{{else}} cimport cuda.bindings._lib.dlfcn as dlfcn {{endif}} cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCallRequiresNewerDriver nogil: - {{if 'Windows' == platform.system()}} - with gil: - raise NotImplementedError('"getLocalRuntimeVersion" is unsupported on Windows') - {{else}} # Load - handle = dlfcn.dlopen('libcudart.so.12', dlfcn.RTLD_NOW) - if handle == NULL: - with gil: - raise RuntimeError(f'Failed to dlopen libcudart.so.12') + with gil: + loaded_dl = load_nvidia_dynamic_lib("cudart") + {{if 'Windows' == platform.system()}} + handle = loaded_dl._handle_uint + {{else}} + handle = loaded_dl._handle_uint + {{endif}} + {{if 'Windows' == platform.system()}} + __cudaRuntimeGetVersion = windll.GetProcAddress(handle, b'cudaRuntimeGetVersion') + {{else}} __cudaRuntimeGetVersion = dlfcn.dlsym(handle, 'cudaRuntimeGetVersion') + {{endif}} if __cudaRuntimeGetVersion == NULL: with gil: - raise RuntimeError(f'Function "cudaRuntimeGetVersion" not found in libcudart.so.12') + raise RuntimeError(f'Function "cudaRuntimeGetVersion" not found in {loaded_dl.abs_path}') # Call cdef cudaError_t err = cudaSuccess err = ( __cudaRuntimeGetVersion)(runtimeVersion) # Unload + {{if 'Windows' == platform.system()}} + windll.FreeLibrary(handle) + {{else}} dlfcn.dlclose(handle) + {{endif}} # Return return err - {{endif}} {{endif}} diff --git a/cuda_bindings/cuda/bindings/driver.pxd.in b/cuda_bindings/cuda/bindings/driver.pxd.in index 938bbdcede..65da11390c 100644 --- a/cuda_bindings/cuda/bindings/driver.pxd.in +++ b/cuda_bindings/cuda/bindings/driver.pxd.in @@ -3,7 +3,8 @@ # This code was automatically generated with version 12.9.0. Do not modify it directly. cimport cuda.bindings.cydriver as cydriver -cimport cuda.bindings._lib.utils as utils + +include "_lib/utils.pxd" {{if 'CUcontext' in found_types}} @@ -822,7 +823,7 @@ cdef class CUstreamBatchMemOpParams_union: {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} - pad : List[cuuint64_t] + pad : list[cuuint64_t] {{endif}} @@ -1005,11 +1006,11 @@ cdef class CUdevprop_st: Maximum number of threads per block {{endif}} {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'CUdevprop_st.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} @@ -1158,7 +1159,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: cdef CUfunction _func {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_st.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st' in found_struct}} @@ -1231,7 +1232,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: cdef CUfunction _func {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.kern' in found_struct}} cdef CUkernel _kern @@ -1310,7 +1311,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: cdef CUfunction _func {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.kern' in found_struct}} cdef CUkernel _kern @@ -2712,7 +2713,7 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL {{endif}} {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2744,7 +2745,7 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: alignment requirement {{endif}} {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2879,7 +2880,7 @@ cdef class anon_struct11: Attributes ---------- {{if 'CUDA_RESOURCE_DESC_st.res.reserved.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -2980,7 +2981,7 @@ cdef class CUDA_TEXTURE_DESC_st: Attributes ---------- {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} - addressMode : List[CUaddress_mode] + addressMode : list[CUaddress_mode] Address modes {{endif}} {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @@ -3012,11 +3013,11 @@ cdef class CUDA_TEXTURE_DESC_st: Mipmap maximum level clamp {{endif}} {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Border Color {{endif}} {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -3069,7 +3070,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: Last layer index {{endif}} {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3091,7 +3092,7 @@ cdef class CUtensorMap_st: Attributes ---------- {{if 'CUtensorMap_st.opaque' in found_struct}} - opaque : List[cuuint64_t] + opaque : list[cuuint64_t] {{endif}} @@ -3191,7 +3192,7 @@ cdef class CUDA_LAUNCH_PARAMS_st: cdef CUstream _hStream {{endif}} {{if 'CUDA_LAUNCH_PARAMS_st.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32' in found_struct}} @@ -3270,7 +3271,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3306,7 +3307,7 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: Flags reserved for future use. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3340,7 +3341,7 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: Total number of levels in the mipmap chain {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3427,7 +3428,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Flags reserved for the future. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3519,7 +3520,7 @@ cdef class anon_struct16: {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3563,7 +3564,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3659,7 +3660,7 @@ cdef class anon_struct19: {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -3703,7 +3704,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -4069,7 +4070,7 @@ cdef class CUarrayMapInfo_st: flags for future use, must be zero now. {{endif}} {{if 'CUarrayMapInfo_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use, must be zero now. {{endif}} @@ -4854,11 +4855,11 @@ cdef class CUgraphNodeParams_st: Type of the node {{endif}} {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'CUgraphNodeParams_st.kernel' in found_struct}} @@ -4983,7 +4984,7 @@ cdef class CUcheckpointLockArgs_st: Reserved for future use, must be zero {{endif}} {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} - reserved1 : List[cuuint64_t] + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -5004,7 +5005,7 @@ cdef class CUcheckpointCheckpointArgs_st: Attributes ---------- {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -5025,7 +5026,7 @@ cdef class CUcheckpointRestoreArgs_st: Attributes ---------- {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -5046,7 +5047,7 @@ cdef class CUcheckpointUnlockArgs_st: Attributes ---------- {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -5174,11 +5175,11 @@ cdef class anon_union15: Attributes ---------- {{if True}} - pArray : List[CUarray] + pArray : list[CUarray] {{endif}} {{if True}} - pPitch : List[Any] + pPitch : list[Any] {{endif}} @@ -5502,7 +5503,7 @@ cdef class CUstreamBatchMemOpParams_v1(CUstreamBatchMemOpParams_union): {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} - pad : List[cuuint64_t] + pad : list[cuuint64_t] {{endif}} @@ -5542,7 +5543,7 @@ cdef class CUstreamBatchMemOpParams(CUstreamBatchMemOpParams_v1): {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} - pad : List[cuuint64_t] + pad : list[cuuint64_t] {{endif}} @@ -5683,11 +5684,11 @@ cdef class CUdevprop_v1(CUdevprop_st): Maximum number of threads per block {{endif}} {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'CUdevprop_st.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} @@ -5739,11 +5740,11 @@ cdef class CUdevprop(CUdevprop_v1): Maximum number of threads per block {{endif}} {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'CUdevprop_st.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} @@ -8109,7 +8110,7 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_v1(CUDA_ARRAY_SPARSE_PROPERTIES_st): CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL {{endif}} {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8146,7 +8147,7 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES(CUDA_ARRAY_SPARSE_PROPERTIES_v1): CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL {{endif}} {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8174,7 +8175,7 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_v1(CUDA_ARRAY_MEMORY_REQUIREMENTS_st): alignment requirement {{endif}} {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8202,7 +8203,7 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1): alignment requirement {{endif}} {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8278,7 +8279,7 @@ cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): Attributes ---------- {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} - addressMode : List[CUaddress_mode] + addressMode : list[CUaddress_mode] Address modes {{endif}} {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @@ -8310,11 +8311,11 @@ cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): Mipmap maximum level clamp {{endif}} {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Border Color {{endif}} {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -8334,7 +8335,7 @@ cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): Attributes ---------- {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} - addressMode : List[CUaddress_mode] + addressMode : list[CUaddress_mode] Address modes {{endif}} {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @@ -8366,11 +8367,11 @@ cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): Mipmap maximum level clamp {{endif}} {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Border Color {{endif}} {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -8422,7 +8423,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC_v1(CUDA_RESOURCE_VIEW_DESC_st): Last layer index {{endif}} {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8474,7 +8475,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): Last layer index {{endif}} {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8495,7 +8496,7 @@ cdef class CUtensorMap(CUtensorMap_st): Attributes ---------- {{if 'CUtensorMap_st.opaque' in found_struct}} - opaque : List[cuuint64_t] + opaque : list[cuuint64_t] {{endif}} @@ -8691,7 +8692,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_ Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8727,7 +8728,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1) Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8759,7 +8760,7 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_ Flags reserved for future use. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8791,7 +8792,7 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1) Flags reserved for future use. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8824,7 +8825,7 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1(CUDA_EXTERNAL_MEMORY_MIP Total number of levels in the mipmap chain {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8857,7 +8858,7 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC(CUDA_EXTERNAL_MEMORY_MIPMAP Total number of levels in the mipmap chain {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8889,7 +8890,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE Flags reserved for the future. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8921,7 +8922,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DE Flags reserved for the future. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8956,7 +8957,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_SIGN For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -8991,7 +8992,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_ For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -9026,7 +9027,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_WAIT_P For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -9061,7 +9062,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARA For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -9310,7 +9311,7 @@ cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): flags for future use, must be zero now. {{endif}} {{if 'CUarrayMapInfo_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use, must be zero now. {{endif}} @@ -9371,7 +9372,7 @@ cdef class CUarrayMapInfo(CUarrayMapInfo_v1): flags for future use, must be zero now. {{endif}} {{if 'CUarrayMapInfo_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use, must be zero now. {{endif}} @@ -10353,11 +10354,11 @@ cdef class CUgraphNodeParams(CUgraphNodeParams_st): Type of the node {{endif}} {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'CUgraphNodeParams_st.kernel' in found_struct}} @@ -10442,7 +10443,7 @@ cdef class CUcheckpointLockArgs(CUcheckpointLockArgs_st): Reserved for future use, must be zero {{endif}} {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} - reserved1 : List[cuuint64_t] + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -10462,7 +10463,7 @@ cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): Attributes ---------- {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -10482,7 +10483,7 @@ cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): Attributes ---------- {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -10502,7 +10503,7 @@ cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): Attributes ---------- {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} diff --git a/cuda_bindings/cuda/bindings/driver.pyx.in b/cuda_bindings/cuda/bindings/driver.pyx.in index adce0af721..5a9174b365 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx.in +++ b/cuda_bindings/cuda/bindings/driver.pyx.in @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # This code was automatically generated with version 12.9.0. Do not modify it directly. -from typing import List, Tuple, Any, Optional +from typing import Any, Optional from enum import IntEnum import cython import ctypes @@ -17,6 +17,9 @@ from cpython.bytes cimport PyBytes_FromStringAndSize import cuda.bindings.driver from libcpp.map cimport map +_driver = globals() +include "_lib/utils.pxi" + ctypedef unsigned long long signed_char_ptr ctypedef unsigned long long unsigned_char_ptr ctypedef unsigned long long char_ptr @@ -8472,7 +8475,7 @@ cdef class CUstreamBatchMemOpParams_union: {{endif}} {{if 'CUstreamBatchMemOpParams_union.pad' in found_struct}} - pad : List[cuuint64_t] + pad : list[cuuint64_t] {{endif}} @@ -9050,11 +9053,11 @@ cdef class CUdevprop_st: Maximum number of threads per block {{endif}} {{if 'CUdevprop_st.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'CUdevprop_st.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'CUdevprop_st.sharedMemPerBlock' in found_struct}} @@ -9348,7 +9351,7 @@ cdef class CUaccessPolicyWindow_st: return self._pvt_ptr[0].base_ptr @base_ptr.setter def base_ptr(self, base_ptr): - _cbase_ptr = utils.HelperInputVoidPtr(base_ptr) + _cbase_ptr = _HelperInputVoidPtr(base_ptr) self._pvt_ptr[0].base_ptr = _cbase_ptr.cptr {{endif}} {{if 'CUaccessPolicyWindow_st.num_bytes' in found_struct}} @@ -9601,7 +9604,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_st: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_st.extra' in found_struct}} @@ -9854,7 +9857,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v2_st: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v2_st.extra' in found_struct}} @@ -10141,7 +10144,7 @@ cdef class CUDA_KERNEL_NODE_PARAMS_v3_st: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'CUDA_KERNEL_NODE_PARAMS_v3_st.extra' in found_struct}} @@ -10600,7 +10603,7 @@ cdef class CUDA_HOST_NODE_PARAMS_st: return self._pvt_ptr[0].userData @userData.setter def userData(self, userData): - _cuserData = utils.HelperInputVoidPtr(userData) + _cuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = _cuserData.cptr {{endif}} {{endif}} @@ -10681,7 +10684,7 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: return self._pvt_ptr[0].userData @userData.setter def userData(self, userData): - _cuserData = utils.HelperInputVoidPtr(userData) + _cuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = _cuserData.cptr {{endif}} {{endif}} @@ -12542,7 +12545,7 @@ cdef class CUctxCigParam_st: return self._pvt_ptr[0].sharedData @sharedData.setter def sharedData(self, sharedData): - _csharedData = utils.HelperInputVoidPtr(sharedData) + _csharedData = _HelperInputVoidPtr(sharedData) self._pvt_ptr[0].sharedData = _csharedData.cptr {{endif}} {{endif}} @@ -12746,7 +12749,7 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable_st: return self._pvt_ptr[0].functionTable @functionTable.setter def functionTable(self, functionTable): - _cfunctionTable = utils.HelperInputVoidPtr(functionTable) + _cfunctionTable = _HelperInputVoidPtr(functionTable) self._pvt_ptr[0].functionTable = _cfunctionTable.cptr {{endif}} {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.functionWindowSize' in found_struct}} @@ -12763,7 +12766,7 @@ cdef class CUlibraryHostUniversalFunctionAndDataTable_st: return self._pvt_ptr[0].dataTable @dataTable.setter def dataTable(self, dataTable): - _cdataTable = utils.HelperInputVoidPtr(dataTable) + _cdataTable = _HelperInputVoidPtr(dataTable) self._pvt_ptr[0].dataTable = _cdataTable.cptr {{endif}} {{if 'CUlibraryHostUniversalFunctionAndDataTable_st.dataWindowSize' in found_struct}} @@ -13010,7 +13013,7 @@ cdef class CUDA_MEMCPY2D_st: return self._pvt_ptr[0].srcHost @srcHost.setter def srcHost(self, srcHost): - _csrcHost = utils.HelperInputVoidPtr(srcHost) + _csrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = _csrcHost.cptr {{endif}} {{if 'CUDA_MEMCPY2D_st.srcDevice' in found_struct}} @@ -13088,7 +13091,7 @@ cdef class CUDA_MEMCPY2D_st: return self._pvt_ptr[0].dstHost @dstHost.setter def dstHost(self, dstHost): - _cdstHost = utils.HelperInputVoidPtr(dstHost) + _cdstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = _cdstHost.cptr {{endif}} {{if 'CUDA_MEMCPY2D_st.dstDevice' in found_struct}} @@ -13493,7 +13496,7 @@ cdef class CUDA_MEMCPY3D_st: return self._pvt_ptr[0].srcHost @srcHost.setter def srcHost(self, srcHost): - _csrcHost = utils.HelperInputVoidPtr(srcHost) + _csrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = _csrcHost.cptr {{endif}} {{if 'CUDA_MEMCPY3D_st.srcDevice' in found_struct}} @@ -13537,7 +13540,7 @@ cdef class CUDA_MEMCPY3D_st: return self._pvt_ptr[0].reserved0 @reserved0.setter def reserved0(self, reserved0): - _creserved0 = utils.HelperInputVoidPtr(reserved0) + _creserved0 = _HelperInputVoidPtr(reserved0) self._pvt_ptr[0].reserved0 = _creserved0.cptr {{endif}} {{if 'CUDA_MEMCPY3D_st.srcPitch' in found_struct}} @@ -13604,7 +13607,7 @@ cdef class CUDA_MEMCPY3D_st: return self._pvt_ptr[0].dstHost @dstHost.setter def dstHost(self, dstHost): - _cdstHost = utils.HelperInputVoidPtr(dstHost) + _cdstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = _cdstHost.cptr {{endif}} {{if 'CUDA_MEMCPY3D_st.dstDevice' in found_struct}} @@ -13648,7 +13651,7 @@ cdef class CUDA_MEMCPY3D_st: return self._pvt_ptr[0].reserved1 @reserved1.setter def reserved1(self, reserved1): - _creserved1 = utils.HelperInputVoidPtr(reserved1) + _creserved1 = _HelperInputVoidPtr(reserved1) self._pvt_ptr[0].reserved1 = _creserved1.cptr {{endif}} {{if 'CUDA_MEMCPY3D_st.dstPitch' in found_struct}} @@ -14041,7 +14044,7 @@ cdef class CUDA_MEMCPY3D_PEER_st: return self._pvt_ptr[0].srcHost @srcHost.setter def srcHost(self, srcHost): - _csrcHost = utils.HelperInputVoidPtr(srcHost) + _csrcHost = _HelperInputVoidPtr(srcHost) self._pvt_ptr[0].srcHost = _csrcHost.cptr {{endif}} {{if 'CUDA_MEMCPY3D_PEER_st.srcDevice' in found_struct}} @@ -14160,7 +14163,7 @@ cdef class CUDA_MEMCPY3D_PEER_st: return self._pvt_ptr[0].dstHost @dstHost.setter def dstHost(self, dstHost): - _cdstHost = utils.HelperInputVoidPtr(dstHost) + _cdstHost = _HelperInputVoidPtr(dstHost) self._pvt_ptr[0].dstHost = _cdstHost.cptr {{endif}} {{if 'CUDA_MEMCPY3D_PEER_st.dstDevice' in found_struct}} @@ -14731,7 +14734,7 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL {{endif}} {{if 'CUDA_ARRAY_SPARSE_PROPERTIES_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -14848,7 +14851,7 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: alignment requirement {{endif}} {{if 'CUDA_ARRAY_MEMORY_REQUIREMENTS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -15306,7 +15309,7 @@ cdef class anon_struct11: Attributes ---------- {{if 'CUDA_RESOURCE_DESC_st.res.reserved.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -15580,7 +15583,7 @@ cdef class CUDA_TEXTURE_DESC_st: Attributes ---------- {{if 'CUDA_TEXTURE_DESC_st.addressMode' in found_struct}} - addressMode : List[CUaddress_mode] + addressMode : list[CUaddress_mode] Address modes {{endif}} {{if 'CUDA_TEXTURE_DESC_st.filterMode' in found_struct}} @@ -15612,11 +15615,11 @@ cdef class CUDA_TEXTURE_DESC_st: Mipmap maximum level clamp {{endif}} {{if 'CUDA_TEXTURE_DESC_st.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Border Color {{endif}} {{if 'CUDA_TEXTURE_DESC_st.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] {{endif}} @@ -15828,7 +15831,7 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: Last layer index {{endif}} {{if 'CUDA_RESOURCE_VIEW_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -15993,7 +15996,7 @@ cdef class CUtensorMap_st: Attributes ---------- {{if 'CUtensorMap_st.opaque' in found_struct}} - opaque : List[cuuint64_t] + opaque : list[cuuint64_t] {{endif}} @@ -16336,7 +16339,7 @@ cdef class CUDA_LAUNCH_PARAMS_st: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{endif}} @@ -16393,7 +16396,7 @@ cdef class anon_struct12: return self._pvt_ptr[0].handle.win32.handle @handle.setter def handle(self, handle): - _chandle = utils.HelperInputVoidPtr(handle) + _chandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = _chandle.cptr {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.handle.win32.name' in found_struct}} @@ -16402,7 +16405,7 @@ cdef class anon_struct12: return self._pvt_ptr[0].handle.win32.name @name.setter def name(self, name): - _cname = utils.HelperInputVoidPtr(name) + _cname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = _cname.cptr {{endif}} {{endif}} @@ -16488,7 +16491,7 @@ cdef class anon_union5: return self._pvt_ptr[0].handle.nvSciBufObject @nvSciBufObject.setter def nvSciBufObject(self, nvSciBufObject): - _cnvSciBufObject = utils.HelperInputVoidPtr(nvSciBufObject) + _cnvSciBufObject = _HelperInputVoidPtr(nvSciBufObject) self._pvt_ptr[0].handle.nvSciBufObject = _cnvSciBufObject.cptr {{endif}} {{endif}} @@ -16517,7 +16520,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -16642,7 +16645,7 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: Flags reserved for future use. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -16747,7 +16750,7 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: Total number of levels in the mipmap chain {{endif}} {{if 'CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -16886,7 +16889,7 @@ cdef class anon_struct13: return self._pvt_ptr[0].handle.win32.handle @handle.setter def handle(self, handle): - _chandle = utils.HelperInputVoidPtr(handle) + _chandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = _chandle.cptr {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.handle.win32.name' in found_struct}} @@ -16895,7 +16898,7 @@ cdef class anon_struct13: return self._pvt_ptr[0].handle.win32.name @name.setter def name(self, name): - _cname = utils.HelperInputVoidPtr(name) + _cname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = _cname.cptr {{endif}} {{endif}} @@ -16981,7 +16984,7 @@ cdef class anon_union6: return self._pvt_ptr[0].handle.nvSciSyncObj @nvSciSyncObj.setter def nvSciSyncObj(self, nvSciSyncObj): - _cnvSciSyncObj = utils.HelperInputVoidPtr(nvSciSyncObj) + _cnvSciSyncObj = _HelperInputVoidPtr(nvSciSyncObj) self._pvt_ptr[0].handle.nvSciSyncObj = _cnvSciSyncObj.cptr {{endif}} {{endif}} @@ -17006,7 +17009,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Flags reserved for the future. Must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17195,7 +17198,7 @@ cdef class anon_union7: return self._pvt_ptr[0].params.nvSciSync.fence @fence.setter def fence(self, fence): - _cfence = utils.HelperInputVoidPtr(fence) + _cfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = _cfence.cptr {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.nvSciSync.reserved' in found_struct}} @@ -17272,7 +17275,7 @@ cdef class anon_struct16: {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17386,7 +17389,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17557,7 +17560,7 @@ cdef class anon_union8: return self._pvt_ptr[0].params.nvSciSync.fence @fence.setter def fence(self, fence): - _cfence = utils.HelperInputVoidPtr(fence) + _cfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = _cfence.cptr {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.nvSciSync.reserved' in found_struct}} @@ -17652,7 +17655,7 @@ cdef class anon_struct19: {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -17766,7 +17769,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. {{endif}} {{if 'CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -18859,7 +18862,7 @@ cdef class CUarrayMapInfo_st: flags for future use, must be zero now. {{endif}} {{if 'CUarrayMapInfo_st.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use, must be zero now. {{endif}} @@ -19357,7 +19360,7 @@ cdef class CUmemAllocationProp_st: return self._pvt_ptr[0].win32HandleMetaData @win32HandleMetaData.setter def win32HandleMetaData(self, win32HandleMetaData): - _cwin32HandleMetaData = utils.HelperInputVoidPtr(win32HandleMetaData) + _cwin32HandleMetaData = _HelperInputVoidPtr(win32HandleMetaData) self._pvt_ptr[0].win32HandleMetaData = _cwin32HandleMetaData.cptr {{endif}} {{if 'CUmemAllocationProp_st.allocFlags' in found_struct}} @@ -19808,7 +19811,7 @@ cdef class CUmemPoolProps_st: return self._pvt_ptr[0].win32SecurityAttributes @win32SecurityAttributes.setter def win32SecurityAttributes(self, win32SecurityAttributes): - _cwin32SecurityAttributes = utils.HelperInputVoidPtr(win32SecurityAttributes) + _cwin32SecurityAttributes = _HelperInputVoidPtr(win32SecurityAttributes) self._pvt_ptr[0].win32SecurityAttributes = _cwin32SecurityAttributes.cptr {{endif}} {{if 'CUmemPoolProps_st.maxSize' in found_struct}} @@ -21260,11 +21263,11 @@ cdef class CUgraphNodeParams_st: Type of the node {{endif}} {{if 'CUgraphNodeParams_st.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'CUgraphNodeParams_st.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'CUgraphNodeParams_st.kernel' in found_struct}} @@ -21646,7 +21649,7 @@ cdef class CUcheckpointLockArgs_st: Reserved for future use, must be zero {{endif}} {{if 'CUcheckpointLockArgs_st.reserved1' in found_struct}} - reserved1 : List[cuuint64_t] + reserved1 : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -21725,7 +21728,7 @@ cdef class CUcheckpointCheckpointArgs_st: Attributes ---------- {{if 'CUcheckpointCheckpointArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -21776,7 +21779,7 @@ cdef class CUcheckpointRestoreArgs_st: Attributes ---------- {{if 'CUcheckpointRestoreArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -21827,7 +21830,7 @@ cdef class CUcheckpointUnlockArgs_st: Attributes ---------- {{if 'CUcheckpointUnlockArgs_st.reserved' in found_struct}} - reserved : List[cuuint64_t] + reserved : list[cuuint64_t] Reserved for future use, must be zeroed {{endif}} @@ -22007,7 +22010,7 @@ cdef class CUmemDecompressParams_st: return self._pvt_ptr[0].src @src.setter def src(self, src): - _csrc = utils.HelperInputVoidPtr(src) + _csrc = _HelperInputVoidPtr(src) self._pvt_ptr[0].src = _csrc.cptr {{endif}} {{if 'CUmemDecompressParams_st.dst' in found_struct}} @@ -22016,7 +22019,7 @@ cdef class CUmemDecompressParams_st: return self._pvt_ptr[0].dst @dst.setter def dst(self, dst): - _cdst = utils.HelperInputVoidPtr(dst) + _cdst = _HelperInputVoidPtr(dst) self._pvt_ptr[0].dst = _cdst.cptr {{endif}} {{if 'CUmemDecompressParams_st.algo' in found_struct}} @@ -22212,11 +22215,11 @@ cdef class anon_union15: Attributes ---------- {{if True}} - pArray : List[CUarray] + pArray : list[CUarray] {{endif}} {{if True}} - pPitch : List[Any] + pPitch : list[Any] {{endif}} @@ -22257,7 +22260,7 @@ cdef class anon_union15: def pArray(self): return [CUarray(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @pArray.setter - def pArray(self, pArray : List[CUarray]): + def pArray(self, pArray : list[CUarray]): if len(pArray) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) pArray = [int(_pArray) for _pArray in pArray] @@ -22270,7 +22273,7 @@ cdef class anon_union15: def pPitch(self): return [_pPitch for _pPitch in self._pvt_ptr[0].frame.pPitch] @pPitch.setter - def pPitch(self, pPitch : List[int]): + def pPitch(self, pPitch : list[int]): if len(pPitch) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pPitch)) pPitch = [_pPitch for _pPitch in pPitch] @@ -23921,7 +23924,7 @@ def cuDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, dev, int flags): else: pdev = int(CUdevice(dev)) cydev = pdev - cynvSciSyncAttrList = utils.HelperInputVoidPtr(nvSciSyncAttrList) + cynvSciSyncAttrList = _HelperInputVoidPtr(nvSciSyncAttrList) cdef void* cynvSciSyncAttrList_ptr = cynvSciSyncAttrList.cptr with nogil: err = cydriver.cuDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList_ptr, cydev, flags) @@ -24749,7 +24752,7 @@ def cuCtxCreate(unsigned int flags, dev): {{if 'cuCtxCreate_v3' in found_functions}} @cython.embedsignature(True) -def cuCtxCreate_v3(paramsArray : Optional[Tuple[CUexecAffinityParam] | List[CUexecAffinityParam]], int numParams, unsigned int flags, dev): +def cuCtxCreate_v3(paramsArray : Optional[tuple[CUexecAffinityParam] | list[CUexecAffinityParam]], int numParams, unsigned int flags, dev): """ Create a CUDA context with execution affinity. Creates a new CUDA context with execution affinity and associates it @@ -24865,7 +24868,7 @@ def cuCtxCreate_v3(paramsArray : Optional[Tuple[CUexecAffinityParam] | List[CUex Parameters ---------- - paramsArray : List[:py:obj:`~.CUexecAffinityParam`] + paramsArray : list[:py:obj:`~.CUexecAffinityParam`] Execution affinity parameters numParams : int Number of execution affinity parameters @@ -24895,7 +24898,7 @@ def cuCtxCreate_v3(paramsArray : Optional[Tuple[CUexecAffinityParam] | List[CUex cydev = pdev paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (CUexecAffinityParam,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cydriver.CUexecAffinityParam,] or List[cydriver.CUexecAffinityParam,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cydriver.CUexecAffinityParam,] or list[cydriver.CUexecAffinityParam,]") cdef CUcontext pctx = CUcontext() cdef cydriver.CUexecAffinityParam* cyparamsArray = NULL if len(paramsArray) > 1: @@ -25090,7 +25093,7 @@ def cuCtxCreate_v4(ctxCreateParams : Optional[CUctxCreateParams], unsigned int f pdev = int(CUdevice(dev)) cydev = pdev cdef CUcontext pctx = CUcontext() - cdef cydriver.CUctxCreateParams* cyctxCreateParams_ptr = ctxCreateParams._pvt_ptr if ctxCreateParams != None else NULL + cdef cydriver.CUctxCreateParams* cyctxCreateParams_ptr = ctxCreateParams._pvt_ptr if ctxCreateParams is not None else NULL with nogil: err = cydriver.cuCtxCreate_v4(pctx._pvt_ptr, cyctxCreateParams_ptr, flags, cydev) if err != cydriver.CUDA_SUCCESS: @@ -26254,7 +26257,7 @@ def cuModuleLoadData(image): :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleLoadFatBinary`, :py:obj:`~.cuModuleUnload` """ cdef CUmodule module = CUmodule() - cyimage = utils.HelperInputVoidPtr(image) + cyimage = _HelperInputVoidPtr(image) cdef void* cyimage_ptr = cyimage.cptr with nogil: err = cydriver.cuModuleLoadData(module._pvt_ptr, cyimage_ptr) @@ -26266,7 +26269,7 @@ def cuModuleLoadData(image): {{if 'cuModuleLoadDataEx' in found_functions}} @cython.embedsignature(True) -def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[Tuple[CUjit_option] | List[CUjit_option]], optionValues : Optional[Tuple[Any] | List[Any]]): +def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): """ Load a module's data with options. Takes a pointer `image` and loads the corresponding module `module` @@ -26280,9 +26283,9 @@ def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[Tuple[ Module data to load numOptions : unsigned int Number of options - options : List[:py:obj:`~.CUjit_option`] + options : list[:py:obj:`~.CUjit_option`] Options for JIT - optionValues : List[Any] + optionValues : list[Any] Option values for JIT Returns @@ -26299,15 +26302,15 @@ def cuModuleLoadDataEx(image, unsigned int numOptions, options : Optional[Tuple[ optionValues = [] if optionValues is None else optionValues options = [] if options is None else options if not all(isinstance(_x, (CUjit_option)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef CUmodule module = CUmodule() - cyimage = utils.HelperInputVoidPtr(image) + cyimage = _HelperInputVoidPtr(image) cdef void* cyimage_ptr = cyimage.cptr if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperoptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr with nogil: err = cydriver.cuModuleLoadDataEx(module._pvt_ptr, cyimage_ptr, numOptions, cyoptions.data(), cyoptionValues_ptr) @@ -26350,7 +26353,7 @@ def cuModuleLoadFatBinary(fatCubin): :py:obj:`~.cuModuleGetFunction`, :py:obj:`~.cuModuleGetGlobal`, :py:obj:`~.cuModuleGetTexRef`, :py:obj:`~.cuModuleLoad`, :py:obj:`~.cuModuleLoadData`, :py:obj:`~.cuModuleLoadDataEx`, :py:obj:`~.cuModuleUnload` """ cdef CUmodule module = CUmodule() - cyfatCubin = utils.HelperInputVoidPtr(fatCubin) + cyfatCubin = _HelperInputVoidPtr(fatCubin) cdef void* cyfatCubin_ptr = cyfatCubin.cptr with nogil: err = cydriver.cuModuleLoadFatBinary(module._pvt_ptr, cyfatCubin_ptr) @@ -26533,7 +26536,7 @@ def cuModuleEnumerateFunctions(unsigned int numFunctions, mod): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - functions : List[:py:obj:`~.CUfunction`] + functions : list[:py:obj:`~.CUfunction`] Buffer where the function handles are returned to See Also @@ -26617,7 +26620,7 @@ def cuModuleGetGlobal(hmod, char* name): {{if 'cuLinkCreate_v2' in found_functions}} @cython.embedsignature(True) -def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] | List[CUjit_option]], optionValues : Optional[Tuple[Any] | List[Any]]): +def cuLinkCreate(unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): """ Creates a pending JIT linker invocation. If the call is successful, the caller owns the returned CUlinkState, @@ -26646,9 +26649,9 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] ---------- numOptions : unsigned int Size of options arrays - options : List[:py:obj:`~.CUjit_option`] + options : list[:py:obj:`~.CUjit_option`] Array of linker and compiler options - optionValues : List[Any] + optionValues : list[Any] Array of option values, each cast to void * Returns @@ -26670,12 +26673,12 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] optionValues = [] if optionValues is None else optionValues options = [] if options is None else options if not all(isinstance(_x, (CUjit_option)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperoptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr cdef CUlinkState stateOut = CUlinkState() with nogil: @@ -26691,7 +26694,7 @@ def cuLinkCreate(unsigned int numOptions, options : Optional[Tuple[CUjit_option] {{if 'cuLinkAddData_v2' in found_functions}} @cython.embedsignature(True) -def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, char* name, unsigned int numOptions, options : Optional[Tuple[CUjit_option] | List[CUjit_option]], optionValues : Optional[Tuple[Any] | List[Any]]): +def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, char* name, unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): """ Add an input to a pending linker invocation. Ownership of `data` is retained by the caller. No reference is retained @@ -26717,10 +26720,10 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, An optional name for this input in log messages. numOptions : unsigned int Size of options. - options : List[:py:obj:`~.CUjit_option`] + options : list[:py:obj:`~.CUjit_option`] Options to be applied only for this input (overrides options from :py:obj:`~.cuLinkCreate`). - optionValues : List[Any] + optionValues : list[Any] Array of option values, each cast to void *. Returns @@ -26739,7 +26742,7 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, optionValues = [] if optionValues is None else optionValues options = [] if options is None else options if not all(isinstance(_x, (CUjit_option)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef cydriver.CUlinkState cystate if state is None: pstate = 0 @@ -26749,13 +26752,13 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, pstate = int(CUlinkState(state)) cystate = pstate cdef cydriver.CUjitInputType cytypename = typename.value - cydata = utils.HelperInputVoidPtr(data) + cydata = _HelperInputVoidPtr(data) cdef void* cydata_ptr = cydata.cptr if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperoptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr with nogil: err = cydriver.cuLinkAddData(cystate, cytypename, cydata_ptr, size, name, numOptions, cyoptions.data(), cyoptionValues_ptr) @@ -26765,7 +26768,7 @@ def cuLinkAddData(state, typename not None : CUjitInputType, data, size_t size, {{if 'cuLinkAddFile_v2' in found_functions}} @cython.embedsignature(True) -def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigned int numOptions, options : Optional[Tuple[CUjit_option] | List[CUjit_option]], optionValues : Optional[Tuple[Any] | List[Any]]): +def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigned int numOptions, options : Optional[tuple[CUjit_option] | list[CUjit_option]], optionValues : Optional[tuple[Any] | list[Any]]): """ Add a file input to a pending linker invocation. No reference is retained to any inputs after this call returns. @@ -26789,10 +26792,10 @@ def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigne Path to the input file numOptions : unsigned int Size of options - options : List[:py:obj:`~.CUjit_option`] + options : list[:py:obj:`~.CUjit_option`] Options to be applied only for this input (overrides options from :py:obj:`~.cuLinkCreate`) - optionValues : List[Any] + optionValues : list[Any] Array of option values, each cast to void * Returns @@ -26811,7 +26814,7 @@ def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigne optionValues = [] if optionValues is None else optionValues options = [] if options is None else options if not all(isinstance(_x, (CUjit_option)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef cydriver.CUlinkState cystate if state is None: pstate = 0 @@ -26824,8 +26827,8 @@ def cuLinkAddFile(state, typename not None : CUjitInputType, char* path, unsigne if numOptions > len(options): raise RuntimeError("List is too small: " + str(len(options)) + " < " + str(numOptions)) if numOptions > len(optionValues): raise RuntimeError("List is too small: " + str(len(optionValues)) + " < " + str(numOptions)) cdef vector[cydriver.CUjit_option] cyoptions = [pyoptions.value for pyoptions in (options)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperoptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(options, optionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperoptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyoptionValues_ptr = voidStarHelperoptionValues.cptr with nogil: err = cydriver.cuLinkAddFile(cystate, cytypename, path, numOptions, cyoptions.data(), cyoptionValues_ptr) @@ -27011,7 +27014,7 @@ def cuModuleGetSurfRef(hmod, char* name): {{if 'cuLibraryLoadData' in found_functions}} @cython.embedsignature(True) -def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUjit_option]], jitOptionsValues : Optional[Tuple[Any] | List[Any]], unsigned int numJitOptions, libraryOptions : Optional[Tuple[CUlibraryOption] | List[CUlibraryOption]], libraryOptionValues : Optional[Tuple[Any] | List[Any]], unsigned int numLibraryOptions): +def cuLibraryLoadData(code, jitOptions : Optional[tuple[CUjit_option] | list[CUjit_option]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[CUlibraryOption] | list[CUlibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): """ Load a library with specified code and options. Takes a pointer `code` and loads the corresponding library `library` @@ -27048,15 +27051,15 @@ def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUj ---------- code : Any Code to load - jitOptions : List[:py:obj:`~.CUjit_option`] + jitOptions : list[:py:obj:`~.CUjit_option`] Options for JIT - jitOptionsValues : List[Any] + jitOptionsValues : list[Any] Option values for JIT numJitOptions : unsigned int Number of options - libraryOptions : List[:py:obj:`~.CUlibraryOption`] + libraryOptions : list[:py:obj:`~.CUlibraryOption`] Options for loading - libraryOptionValues : List[Any] + libraryOptionValues : list[Any] Option values for loading numLibraryOptions : unsigned int Number of options for loading @@ -27079,23 +27082,23 @@ def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUj libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues libraryOptions = [] if libraryOptions is None else libraryOptions if not all(isinstance(_x, (CUlibraryOption)) for _x in libraryOptions): - raise TypeError("Argument 'libraryOptions' is not instance of type (expected Tuple[cydriver.CUlibraryOption] or List[cydriver.CUlibraryOption]") + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cydriver.CUlibraryOption] or list[cydriver.CUlibraryOption]") jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues jitOptions = [] if jitOptions is None else jitOptions if not all(isinstance(_x, (CUjit_option)) for _x in jitOptions): - raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef CUlibrary library = CUlibrary() - cycode = utils.HelperInputVoidPtr(code) + cycode = _HelperInputVoidPtr(code) cdef void* cycode_ptr = cycode.cptr cdef vector[cydriver.CUjit_option] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) cdef vector[cydriver.CUlibraryOption] cylibraryOptions = [pylibraryOptions.value for pylibraryOptions in (libraryOptions)] - pylist = [utils.HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) @@ -27109,7 +27112,7 @@ def cuLibraryLoadData(code, jitOptions : Optional[Tuple[CUjit_option] | List[CUj {{if 'cuLibraryLoadFromFile' in found_functions}} @cython.embedsignature(True) -def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[CUjit_option] | List[CUjit_option]], jitOptionsValues : Optional[Tuple[Any] | List[Any]], unsigned int numJitOptions, libraryOptions : Optional[Tuple[CUlibraryOption] | List[CUlibraryOption]], libraryOptionValues : Optional[Tuple[Any] | List[Any]], unsigned int numLibraryOptions): +def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[tuple[CUjit_option] | list[CUjit_option]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[CUlibraryOption] | list[CUlibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): """ Load a library with specified file and options. Takes a pointer `code` and loads the corresponding library `library` @@ -27147,15 +27150,15 @@ def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[CUjit_opti ---------- fileName : bytes File to load from - jitOptions : List[:py:obj:`~.CUjit_option`] + jitOptions : list[:py:obj:`~.CUjit_option`] Options for JIT - jitOptionsValues : List[Any] + jitOptionsValues : list[Any] Option values for JIT numJitOptions : unsigned int Number of options - libraryOptions : List[:py:obj:`~.CUlibraryOption`] + libraryOptions : list[:py:obj:`~.CUlibraryOption`] Options for loading - libraryOptionValues : List[Any] + libraryOptionValues : list[Any] Option values for loading numLibraryOptions : unsigned int Number of options for loading @@ -27178,21 +27181,21 @@ def cuLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[CUjit_opti libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues libraryOptions = [] if libraryOptions is None else libraryOptions if not all(isinstance(_x, (CUlibraryOption)) for _x in libraryOptions): - raise TypeError("Argument 'libraryOptions' is not instance of type (expected Tuple[cydriver.CUlibraryOption] or List[cydriver.CUlibraryOption]") + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cydriver.CUlibraryOption] or list[cydriver.CUlibraryOption]") jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues jitOptions = [] if jitOptions is None else jitOptions if not all(isinstance(_x, (CUjit_option)) for _x in jitOptions): - raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cydriver.CUjit_option] or List[cydriver.CUjit_option]") + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cydriver.CUjit_option] or list[cydriver.CUjit_option]") cdef CUlibrary library = CUlibrary() cdef vector[cydriver.CUjit_option] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] - pylist = [utils.HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUjit_option(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) cdef vector[cydriver.CUlibraryOption] cylibraryOptions = [pylibraryOptions.value for pylibraryOptions in (libraryOptions)] - pylist = [utils.HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUlibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) @@ -27339,7 +27342,7 @@ def cuLibraryEnumerateKernels(unsigned int numKernels, lib): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - kernels : List[:py:obj:`~.CUkernel`] + kernels : list[:py:obj:`~.CUkernel`] Buffer where the kernel handles are returned to See Also @@ -28398,7 +28401,7 @@ def cuMemFreeHost(p): -------- :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaFreeHost` """ - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemFreeHost(cyp_ptr) @@ -28552,7 +28555,7 @@ def cuMemHostGetDevicePointer(p, unsigned int Flags): :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaHostGetDevicePointer` """ cdef CUdeviceptr pdptr = CUdeviceptr() - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostGetDevicePointer(pdptr._pvt_ptr, cyp_ptr, Flags) @@ -28591,7 +28594,7 @@ def cuMemHostGetFlags(p): :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cudaHostGetFlags` """ cdef unsigned int pFlags = 0 - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostGetFlags(&pFlags, cyp_ptr) @@ -28810,7 +28813,7 @@ def cuDeviceRegisterAsyncNotification(device, callbackFunc, userData): else: pdevice = int(CUdevice(device)) cydevice = pdevice - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cuAsyncCallbackData *cbData = NULL @@ -29346,7 +29349,7 @@ def cuMemHostRegister(p, size_t bytesize, unsigned int Flags): -------- :py:obj:`~.cuMemHostUnregister`, :py:obj:`~.cuMemHostGetFlags`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cudaHostRegister` """ - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostRegister(cyp_ptr, bytesize, Flags) @@ -29379,7 +29382,7 @@ def cuMemHostUnregister(p): -------- :py:obj:`~.cuMemHostRegister`, :py:obj:`~.cudaHostUnregister` """ - cyp = utils.HelperInputVoidPtr(p) + cyp = _HelperInputVoidPtr(p) cdef void* cyp_ptr = cyp.cptr with nogil: err = cydriver.cuMemHostUnregister(cyp_ptr) @@ -29545,7 +29548,7 @@ def cuMemcpyHtoD(dstDevice, srcHost, size_t ByteCount): else: pdstDevice = int(CUdeviceptr(dstDevice)) cydstDevice = pdstDevice - cysrcHost = utils.HelperInputVoidPtr(srcHost) + cysrcHost = _HelperInputVoidPtr(srcHost) cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoD(cydstDevice, cysrcHost_ptr, ByteCount) @@ -29588,7 +29591,7 @@ def cuMemcpyDtoH(dstHost, srcDevice, size_t ByteCount): else: psrcDevice = int(CUdeviceptr(srcDevice)) cysrcDevice = psrcDevice - cydstHost = utils.HelperInputVoidPtr(dstHost) + cydstHost = _HelperInputVoidPtr(dstHost) cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyDtoH(cydstHost_ptr, cysrcDevice, ByteCount) @@ -29789,7 +29792,7 @@ def cuMemcpyHtoA(dstArray, size_t dstOffset, srcHost, size_t ByteCount): else: pdstArray = int(CUarray(dstArray)) cydstArray = pdstArray - cysrcHost = utils.HelperInputVoidPtr(srcHost) + cysrcHost = _HelperInputVoidPtr(srcHost) cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoA(cydstArray, dstOffset, cysrcHost_ptr, ByteCount) @@ -29835,7 +29838,7 @@ def cuMemcpyAtoH(dstHost, srcArray, size_t srcOffset, size_t ByteCount): else: psrcArray = int(CUarray(srcArray)) cysrcArray = psrcArray - cydstHost = utils.HelperInputVoidPtr(dstHost) + cydstHost = _HelperInputVoidPtr(dstHost) cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyAtoH(cydstHost_ptr, cysrcArray, srcOffset, ByteCount) @@ -30020,7 +30023,7 @@ def cuMemcpy2D(pCopy : Optional[CUDA_MEMCPY2D]): -------- :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray` """ - cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2D(cypCopy_ptr) return (_dict_CUresult[err],) @@ -30147,7 +30150,7 @@ def cuMemcpy2DUnaligned(pCopy : Optional[CUDA_MEMCPY2D]): -------- :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray` """ - cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2DUnaligned(cypCopy_ptr) return (_dict_CUresult[err],) @@ -30277,7 +30280,7 @@ def cuMemcpy3D(pCopy : Optional[CUDA_MEMCPY3D]): -------- :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMemcpy3D` """ - cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3D(cypCopy_ptr) return (_dict_CUresult[err],) @@ -30307,7 +30310,7 @@ def cuMemcpy3DPeer(pCopy : Optional[CUDA_MEMCPY3D_PEER]): -------- :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyPeer`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyPeerAsync`, :py:obj:`~.cuMemcpy3DPeerAsync`, :py:obj:`~.cudaMemcpy3DPeer` """ - cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DPeer(cypCopy_ptr) return (_dict_CUresult[err],) @@ -30502,7 +30505,7 @@ def cuMemcpyHtoDAsync(dstDevice, srcHost, size_t ByteCount, hStream): else: pdstDevice = int(CUdeviceptr(dstDevice)) cydstDevice = pdstDevice - cysrcHost = utils.HelperInputVoidPtr(srcHost) + cysrcHost = _HelperInputVoidPtr(srcHost) cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoDAsync(cydstDevice, cysrcHost_ptr, ByteCount, cyhStream) @@ -30555,7 +30558,7 @@ def cuMemcpyDtoHAsync(dstHost, srcDevice, size_t ByteCount, hStream): else: psrcDevice = int(CUdeviceptr(srcDevice)) cysrcDevice = psrcDevice - cydstHost = utils.HelperInputVoidPtr(dstHost) + cydstHost = _HelperInputVoidPtr(dstHost) cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyDtoHAsync(cydstHost_ptr, cysrcDevice, ByteCount, cyhStream) @@ -30670,7 +30673,7 @@ def cuMemcpyHtoAAsync(dstArray, size_t dstOffset, srcHost, size_t ByteCount, hSt else: pdstArray = int(CUarray(dstArray)) cydstArray = pdstArray - cysrcHost = utils.HelperInputVoidPtr(srcHost) + cysrcHost = _HelperInputVoidPtr(srcHost) cdef void* cysrcHost_ptr = cysrcHost.cptr with nogil: err = cydriver.cuMemcpyHtoAAsync(cydstArray, dstOffset, cysrcHost_ptr, ByteCount, cyhStream) @@ -30726,7 +30729,7 @@ def cuMemcpyAtoHAsync(dstHost, srcArray, size_t srcOffset, size_t ByteCount, hSt else: psrcArray = int(CUarray(srcArray)) cysrcArray = psrcArray - cydstHost = utils.HelperInputVoidPtr(dstHost) + cydstHost = _HelperInputVoidPtr(dstHost) cdef void* cydstHost_ptr = cydstHost.cptr with nogil: err = cydriver.cuMemcpyAtoHAsync(cydstHost_ptr, cysrcArray, srcOffset, ByteCount, cyhStream) @@ -30871,7 +30874,7 @@ def cuMemcpy2DAsync(pCopy : Optional[CUDA_MEMCPY2D], hStream): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY2D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy2DAsync(cypCopy_ptr, cyhStream) return (_dict_CUresult[err],) @@ -31011,7 +31014,7 @@ def cuMemcpy3DAsync(pCopy : Optional[CUDA_MEMCPY3D], hStream): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DAsync(cypCopy_ptr, cyhStream) return (_dict_CUresult[err],) @@ -31051,7 +31054,7 @@ def cuMemcpy3DPeerAsync(pCopy : Optional[CUDA_MEMCPY3D_PEER], hStream): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy != None else NULL + cdef cydriver.CUDA_MEMCPY3D_PEER* cypCopy_ptr = pCopy._pvt_ptr if pCopy is not None else NULL with nogil: err = cydriver.cuMemcpy3DPeerAsync(cypCopy_ptr, cyhStream) return (_dict_CUresult[err],) @@ -31060,7 +31063,7 @@ def cuMemcpy3DPeerAsync(pCopy : Optional[CUDA_MEMCPY3D_PEER], hStream): {{if 'cuMemcpyBatchAsync' in found_functions}} @cython.embedsignature(True) -def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], srcs : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], sizes : Tuple[int] | List[int], size_t count, attrs : Optional[Tuple[CUmemcpyAttributes] | List[CUmemcpyAttributes]], attrsIdxs : Tuple[int] | List[int], size_t numAttrs, hStream): +def cuMemcpyBatchAsync(dsts : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], srcs : Optional[tuple[CUdeviceptr] | list[CUdeviceptr]], sizes : tuple[int] | list[int], size_t count, attrs : Optional[tuple[CUmemcpyAttributes] | list[CUmemcpyAttributes]], attrsIdxs : tuple[int] | list[int], size_t numAttrs, hStream): """ Performs a batch of memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in @@ -31138,17 +31141,17 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], Parameters ---------- - dsts : List[:py:obj:`~.CUdeviceptr`] + dsts : list[:py:obj:`~.CUdeviceptr`] Array of destination pointers. - srcs : List[:py:obj:`~.CUdeviceptr`] + srcs : list[:py:obj:`~.CUdeviceptr`] Array of memcpy source pointers. - sizes : List[int] + sizes : list[int] Array of sizes for memcpy operations. count : size_t Size of `dsts`, `srcs` and `sizes` arrays - attrs : List[:py:obj:`~.CUmemcpyAttributes`] + attrs : list[:py:obj:`~.CUmemcpyAttributes`] Array of memcpy attributes. - attrsIdxs : List[int] + attrsIdxs : list[int] Array of indices to specify which copies each entry in the `attrs` array applies to. The attributes specified in attrs[k] will be applied to copies starting from attrsIdxs[k] through attrsIdxs[k+1] @@ -31178,18 +31181,18 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], phStream = int(CUstream(hStream)) cyhStream = phStream if not all(isinstance(_x, (int)) for _x in attrsIdxs): - raise TypeError("Argument 'attrsIdxs' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'attrsIdxs' is not instance of type (expected tuple[int] or list[int]") attrs = [] if attrs is None else attrs if not all(isinstance(_x, (CUmemcpyAttributes,)) for _x in attrs): - raise TypeError("Argument 'attrs' is not instance of type (expected Tuple[cydriver.CUmemcpyAttributes,] or List[cydriver.CUmemcpyAttributes,]") + raise TypeError("Argument 'attrs' is not instance of type (expected tuple[cydriver.CUmemcpyAttributes,] or list[cydriver.CUmemcpyAttributes,]") if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") srcs = [] if srcs is None else srcs if not all(isinstance(_x, (CUdeviceptr,)) for _x in srcs): - raise TypeError("Argument 'srcs' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + raise TypeError("Argument 'srcs' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") dsts = [] if dsts is None else dsts if not all(isinstance(_x, (CUdeviceptr,)) for _x in dsts): - raise TypeError("Argument 'dsts' is not instance of type (expected Tuple[cydriver.CUdeviceptr,] or List[cydriver.CUdeviceptr,]") + raise TypeError("Argument 'dsts' is not instance of type (expected tuple[cydriver.CUdeviceptr,] or list[cydriver.CUdeviceptr,]") cdef cydriver.CUdeviceptr* cydsts = NULL if len(dsts) > 1: cydsts = calloc(len(dsts), sizeof(cydriver.CUdeviceptr)) @@ -31243,7 +31246,7 @@ def cuMemcpyBatchAsync(dsts : Optional[Tuple[CUdeviceptr] | List[CUdeviceptr]], {{if 'cuMemcpy3DBatchAsync' in found_functions}} @cython.embedsignature(True) -def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BATCH_OP] | List[CUDA_MEMCPY3D_BATCH_OP]], unsigned long long flags, hStream): +def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[CUDA_MEMCPY3D_BATCH_OP] | list[CUDA_MEMCPY3D_BATCH_OP]], unsigned long long flags, hStream): """ Performs a batch of 3D memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in @@ -31334,7 +31337,7 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BA ---------- numOps : size_t Total number of memcpy operations. - opList : List[:py:obj:`~.CUDA_MEMCPY3D_BATCH_OP`] + opList : list[:py:obj:`~.CUDA_MEMCPY3D_BATCH_OP`] Array of size `numOps` containing the actual memcpy operations. flags : unsigned long long Flags for future use, must be zero now. @@ -31361,7 +31364,7 @@ def cuMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[CUDA_MEMCPY3D_BA cyhStream = phStream opList = [] if opList is None else opList if not all(isinstance(_x, (CUDA_MEMCPY3D_BATCH_OP,)) for _x in opList): - raise TypeError("Argument 'opList' is not instance of type (expected Tuple[cydriver.CUDA_MEMCPY3D_BATCH_OP,] or List[cydriver.CUDA_MEMCPY3D_BATCH_OP,]") + raise TypeError("Argument 'opList' is not instance of type (expected tuple[cydriver.CUDA_MEMCPY3D_BATCH_OP,] or list[cydriver.CUDA_MEMCPY3D_BATCH_OP,]") if numOps > len(opList): raise RuntimeError("List is too small: " + str(len(opList)) + " < " + str(numOps)) cdef cydriver.CUDA_MEMCPY3D_BATCH_OP* cyopList = NULL if len(opList) > 1: @@ -32029,7 +32032,7 @@ def cuArrayCreate(pAllocateArray : Optional[CUDA_ARRAY_DESCRIPTOR]): :py:obj:`~.cuArray3DCreate`, :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMallocArray` """ cdef CUarray pHandle = CUarray() - cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cypAllocateArray_ptr = pAllocateArray._pvt_ptr if pAllocateArray != None else NULL + cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cypAllocateArray_ptr = pAllocateArray._pvt_ptr if pAllocateArray is not None else NULL with nogil: err = cydriver.cuArrayCreate(pHandle._pvt_ptr, cypAllocateArray_ptr) if err != cydriver.CUDA_SUCCESS: @@ -32529,7 +32532,7 @@ def cuArray3DCreate(pAllocateArray : Optional[CUDA_ARRAY3D_DESCRIPTOR]): :py:obj:`~.cuArray3DGetDescriptor`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cuArrayDestroy`, :py:obj:`~.cuArrayGetDescriptor`, :py:obj:`~.cuMemAlloc`, :py:obj:`~.cuMemAllocHost`, :py:obj:`~.cuMemAllocPitch`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DAsync`, :py:obj:`~.cuMemcpy2DUnaligned`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuMemcpy3DAsync`, :py:obj:`~.cuMemcpyAtoA`, :py:obj:`~.cuMemcpyAtoD`, :py:obj:`~.cuMemcpyAtoH`, :py:obj:`~.cuMemcpyAtoHAsync`, :py:obj:`~.cuMemcpyDtoA`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpyDtoDAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyDtoHAsync`, :py:obj:`~.cuMemcpyHtoA`, :py:obj:`~.cuMemcpyHtoAAsync`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyHtoDAsync`, :py:obj:`~.cuMemFree`, :py:obj:`~.cuMemFreeHost`, :py:obj:`~.cuMemGetAddressRange`, :py:obj:`~.cuMemGetInfo`, :py:obj:`~.cuMemHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32`, :py:obj:`~.cudaMalloc3DArray` """ cdef CUarray pHandle = CUarray() - cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR* cypAllocateArray_ptr = pAllocateArray._pvt_ptr if pAllocateArray != None else NULL + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR* cypAllocateArray_ptr = pAllocateArray._pvt_ptr if pAllocateArray is not None else NULL with nogil: err = cydriver.cuArray3DCreate(pHandle._pvt_ptr, cypAllocateArray_ptr) if err != cydriver.CUDA_SUCCESS: @@ -32699,7 +32702,7 @@ def cuMipmappedArrayCreate(pMipmappedArrayDesc : Optional[CUDA_ARRAY3D_DESCRIPTO :py:obj:`~.cuMipmappedArrayDestroy`, :py:obj:`~.cuMipmappedArrayGetLevel`, :py:obj:`~.cuArrayCreate`, :py:obj:`~.cudaMallocMipmappedArray` """ cdef CUmipmappedArray pHandle = CUmipmappedArray() - cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR* cypMipmappedArrayDesc_ptr = pMipmappedArrayDesc._pvt_ptr if pMipmappedArrayDesc != None else NULL + cdef cydriver.CUDA_ARRAY3D_DESCRIPTOR* cypMipmappedArrayDesc_ptr = pMipmappedArrayDesc._pvt_ptr if pMipmappedArrayDesc is not None else NULL with nogil: err = cydriver.cuMipmappedArrayCreate(pHandle._pvt_ptr, cypMipmappedArrayDesc_ptr, numMipmapLevels) if err != cydriver.CUDA_SUCCESS: @@ -32943,7 +32946,7 @@ def cuMemBatchDecompressAsync(paramsArray : Optional[CUmemDecompressParams], siz else: pstream = int(CUstream(stream)) cystream = pstream - cdef cydriver.CUmemDecompressParams* cyparamsArray_ptr = paramsArray._pvt_ptr if paramsArray != None else NULL + cdef cydriver.CUmemDecompressParams* cyparamsArray_ptr = paramsArray._pvt_ptr if paramsArray is not None else NULL cdef size_t errorIndex = 0 with nogil: err = cydriver.cuMemBatchDecompressAsync(cyparamsArray_ptr, count, flags, &errorIndex, cystream) @@ -33122,7 +33125,7 @@ def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long :py:obj:`~.cuMemRelease`, :py:obj:`~.cuMemExportToShareableHandle`, :py:obj:`~.cuMemImportFromShareableHandle` """ cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() - cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL with nogil: err = cydriver.cuMemCreate(handle._pvt_ptr, size, cyprop_ptr, flags) if err != cydriver.CUDA_SUCCESS: @@ -33260,7 +33263,7 @@ def cuMemMap(ptr, size_t size, size_t offset, handle, unsigned long long flags): {{if 'cuMemMapArrayAsync' in found_functions}} @cython.embedsignature(True) -def cuMemMapArrayAsync(mapInfoList : Optional[Tuple[CUarrayMapInfo] | List[CUarrayMapInfo]], unsigned int count, hStream): +def cuMemMapArrayAsync(mapInfoList : Optional[tuple[CUarrayMapInfo] | list[CUarrayMapInfo]], unsigned int count, hStream): """ Maps or unmaps subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays. Performs map or unmap operations on subregions of sparse CUDA arrays @@ -33387,7 +33390,7 @@ def cuMemMapArrayAsync(mapInfoList : Optional[Tuple[CUarrayMapInfo] | List[CUarr Parameters ---------- - mapInfoList : List[:py:obj:`~.CUarrayMapInfo`] + mapInfoList : list[:py:obj:`~.CUarrayMapInfo`] List of :py:obj:`~.CUarrayMapInfo` count : unsigned int Count of :py:obj:`~.CUarrayMapInfo` in `mapInfoList` @@ -33413,7 +33416,7 @@ def cuMemMapArrayAsync(mapInfoList : Optional[Tuple[CUarrayMapInfo] | List[CUarr cyhStream = phStream mapInfoList = [] if mapInfoList is None else mapInfoList if not all(isinstance(_x, (CUarrayMapInfo,)) for _x in mapInfoList): - raise TypeError("Argument 'mapInfoList' is not instance of type (expected Tuple[cydriver.CUarrayMapInfo,] or List[cydriver.CUarrayMapInfo,]") + raise TypeError("Argument 'mapInfoList' is not instance of type (expected tuple[cydriver.CUarrayMapInfo,] or list[cydriver.CUarrayMapInfo,]") cdef cydriver.CUarrayMapInfo* cymapInfoList = NULL if len(mapInfoList) > 1: cymapInfoList = calloc(len(mapInfoList), sizeof(cydriver.CUarrayMapInfo)) @@ -33482,7 +33485,7 @@ def cuMemUnmap(ptr, size_t size): {{if 'cuMemSetAccess' in found_functions}} @cython.embedsignature(True) -def cuMemSetAccess(ptr, size_t size, desc : Optional[Tuple[CUmemAccessDesc] | List[CUmemAccessDesc]], size_t count): +def cuMemSetAccess(ptr, size_t size, desc : Optional[tuple[CUmemAccessDesc] | list[CUmemAccessDesc]], size_t count): """ Set the access flags for each location specified in `desc` for the given virtual address range. Given the virtual address range via `ptr` and `size`, and the locations @@ -33509,7 +33512,7 @@ def cuMemSetAccess(ptr, size_t size, desc : Optional[Tuple[CUmemAccessDesc] | Li Starting address for the virtual address range size : size_t Length of the virtual address range - desc : List[:py:obj:`~.CUmemAccessDesc`] + desc : list[:py:obj:`~.CUmemAccessDesc`] Array of :py:obj:`~.CUmemAccessDesc` that describe how to change the count : size_t @@ -33526,7 +33529,7 @@ def cuMemSetAccess(ptr, size_t size, desc : Optional[Tuple[CUmemAccessDesc] | Li """ desc = [] if desc is None else desc if not all(isinstance(_x, (CUmemAccessDesc,)) for _x in desc): - raise TypeError("Argument 'desc' is not instance of type (expected Tuple[cydriver.CUmemAccessDesc,] or List[cydriver.CUmemAccessDesc,]") + raise TypeError("Argument 'desc' is not instance of type (expected tuple[cydriver.CUmemAccessDesc,] or list[cydriver.CUmemAccessDesc,]") cdef cydriver.CUdeviceptr cyptr if ptr is None: pptr = 0 @@ -33585,7 +33588,7 @@ def cuMemGetAccess(location : Optional[CUmemLocation], ptr): pptr = int(CUdeviceptr(ptr)) cyptr = pptr cdef unsigned long long flags = 0 - cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL with nogil: err = cydriver.cuMemGetAccess(&flags, cylocation_ptr, cyptr) if err != cydriver.CUDA_SUCCESS: @@ -33643,7 +33646,7 @@ def cuMemExportToShareableHandle(handle, handleType not None : CUmemAllocationHa else: phandle = int(CUmemGenericAllocationHandle(handle)) cyhandle = phandle - cdef utils.HelperCUmemAllocationHandleType cyshareableHandle = utils.HelperCUmemAllocationHandleType(handleType) + cdef _HelperCUmemAllocationHandleType cyshareableHandle = _HelperCUmemAllocationHandleType(handleType) cdef void* cyshareableHandle_ptr = cyshareableHandle.cptr cdef cydriver.CUmemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -33693,7 +33696,7 @@ def cuMemImportFromShareableHandle(osHandle, shHandleType not None : CUmemAlloca Importing shareable handles exported from some graphics APIs(VUlkan, OpenGL, etc) created on devices under an SLI group may not be supported, and thus this API will return CUDA_ERROR_NOT_SUPPORTED. There is no guarantee that the contents of `handle` will be the same CUDA memory handle for the same given OS shareable handle, or the same underlying allocation. """ cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() - cyosHandle = utils.HelperInputVoidPtr(osHandle) + cyosHandle = _HelperInputVoidPtr(osHandle) cdef void* cyosHandle_ptr = cyosHandle.cptr cdef cydriver.CUmemAllocationHandleType cyshHandleType = shHandleType.value with nogil: @@ -33733,7 +33736,7 @@ def cuMemGetAllocationGranularity(prop : Optional[CUmemAllocationProp], option n :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` """ cdef size_t granularity = 0 - cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL cdef cydriver.CUmemAllocationGranularity_flags cyoption = option.value with nogil: err = cydriver.cuMemGetAllocationGranularity(&granularity, cyprop_ptr, cyoption) @@ -33813,7 +33816,7 @@ def cuMemRetainAllocationHandle(addr): The address `addr`, can be any address in a range previously mapped by :py:obj:`~.cuMemMap`, and not necessarily the start address. """ cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() - cyaddr = utils.HelperInputVoidPtr(addr) + cyaddr = _HelperInputVoidPtr(addr) cdef void* cyaddr_ptr = cyaddr.cptr with nogil: err = cydriver.cuMemRetainAllocationHandle(handle._pvt_ptr, cyaddr_ptr) @@ -34042,7 +34045,7 @@ def cuMemPoolSetAttribute(pool, attr not None : CUmemPool_attribute, value): ppool = int(CUmemoryPool(pool)) cypool = ppool cdef cydriver.CUmemPool_attribute cyattr = attr.value - cdef utils.HelperCUmemPool_attribute cyvalue = utils.HelperCUmemPool_attribute(attr, value, is_getter=False) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuMemPoolSetAttribute(cypool, cyattr, cyvalue_ptr) @@ -34124,7 +34127,7 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): ppool = int(CUmemoryPool(pool)) cypool = ppool cdef cydriver.CUmemPool_attribute cyattr = attr.value - cdef utils.HelperCUmemPool_attribute cyvalue = utils.HelperCUmemPool_attribute(attr, 0, is_getter=True) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuMemPoolGetAttribute(cypool, cyattr, cyvalue_ptr) @@ -34136,14 +34139,14 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): {{if 'cuMemPoolSetAccess' in found_functions}} @cython.embedsignature(True) -def cuMemPoolSetAccess(pool, map : Optional[Tuple[CUmemAccessDesc] | List[CUmemAccessDesc]], size_t count): +def cuMemPoolSetAccess(pool, map : Optional[tuple[CUmemAccessDesc] | list[CUmemAccessDesc]], size_t count): """ Controls visibility of pools between devices. Parameters ---------- pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` The pool being modified - map : List[:py:obj:`~.CUmemAccessDesc`] + map : list[:py:obj:`~.CUmemAccessDesc`] Array of access descriptors. Each descriptor instructs the access to enable for a single gpu. count : size_t @@ -34160,7 +34163,7 @@ def cuMemPoolSetAccess(pool, map : Optional[Tuple[CUmemAccessDesc] | List[CUmemA """ map = [] if map is None else map if not all(isinstance(_x, (CUmemAccessDesc,)) for _x in map): - raise TypeError("Argument 'map' is not instance of type (expected Tuple[cydriver.CUmemAccessDesc,] or List[cydriver.CUmemAccessDesc,]") + raise TypeError("Argument 'map' is not instance of type (expected tuple[cydriver.CUmemAccessDesc,] or list[cydriver.CUmemAccessDesc,]") cdef cydriver.CUmemoryPool cypool if pool is None: ppool = 0 @@ -34222,7 +34225,7 @@ def cuMemPoolGetAccess(memPool, location : Optional[CUmemLocation]): pmemPool = int(CUmemoryPool(memPool)) cymemPool = pmemPool cdef cydriver.CUmemAccess_flags flags - cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cydriver.CUmemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL with nogil: err = cydriver.cuMemPoolGetAccess(&flags, cymemPool, cylocation_ptr) if err != cydriver.CUDA_SUCCESS: @@ -34297,7 +34300,7 @@ def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): Specifying CU_MEM_HANDLE_TYPE_NONE creates a memory pool that will not support IPC. """ cdef CUmemoryPool pool = CUmemoryPool() - cdef cydriver.CUmemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps != None else NULL + cdef cydriver.CUmemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps is not None else NULL with nogil: err = cydriver.cuMemPoolCreate(pool._pvt_ptr, cypoolProps_ptr) if err != cydriver.CUDA_SUCCESS: @@ -34457,7 +34460,7 @@ def cuMemPoolExportToShareableHandle(pool, handleType not None : CUmemAllocation else: ppool = int(CUmemoryPool(pool)) cypool = ppool - cdef utils.HelperCUmemAllocationHandleType cyhandle_out = utils.HelperCUmemAllocationHandleType(handleType) + cdef _HelperCUmemAllocationHandleType cyhandle_out = _HelperCUmemAllocationHandleType(handleType) cdef void* cyhandle_out_ptr = cyhandle_out.cptr cdef cydriver.CUmemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -34506,7 +34509,7 @@ def cuMemPoolImportFromShareableHandle(handle, handleType not None : CUmemAlloca Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in cuDeviceSetMemPool or :py:obj:`~.cuMemAllocFromPoolAsync` calls. """ cdef CUmemoryPool pool_out = CUmemoryPool() - cyhandle = utils.HelperInputVoidPtr(handle) + cyhandle = _HelperInputVoidPtr(handle) cdef void* cyhandle_ptr = cyhandle.cptr cdef cydriver.CUmemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -34604,7 +34607,7 @@ def cuMemPoolImportPointer(pool, shareData : Optional[CUmemPoolPtrExportData]): ppool = int(CUmemoryPool(pool)) cypool = ppool cdef CUdeviceptr ptr_out = CUdeviceptr() - cdef cydriver.CUmemPoolPtrExportData* cyshareData_ptr = shareData._pvt_ptr if shareData != None else NULL + cdef cydriver.CUmemPoolPtrExportData* cyshareData_ptr = shareData._pvt_ptr if shareData is not None else NULL with nogil: err = cydriver.cuMemPoolImportPointer(ptr_out._pvt_ptr, cypool, cyshareData_ptr) if err != cydriver.CUDA_SUCCESS: @@ -34665,7 +34668,7 @@ def cuMulticastCreate(prop : Optional[CUmulticastObjectProp]): :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemRelease`, :py:obj:`~.cuMemExportToShareableHandle`, :py:obj:`~.cuMemImportFromShareableHandle` """ cdef CUmemGenericAllocationHandle mcHandle = CUmemGenericAllocationHandle() - cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL with nogil: err = cydriver.cuMulticastCreate(mcHandle._pvt_ptr, cyprop_ptr) if err != cydriver.CUDA_SUCCESS: @@ -34974,7 +34977,7 @@ def cuMulticastGetGranularity(prop : Optional[CUmulticastObjectProp], option not :py:obj:`~.cuMulticastCreate`, :py:obj:`~.cuMulticastBindMem`, :py:obj:`~.cuMulticastBindAddr`, :py:obj:`~.cuMulticastUnbind` """ cdef size_t granularity = 0 - cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cydriver.CUmulticastObjectProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL cdef cydriver.CUmulticastGranularity_flags cyoption = option.value with nogil: err = cydriver.cuMulticastGetGranularity(&granularity, cyprop_ptr, cyoption) @@ -35186,7 +35189,7 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): else: pptr = int(CUdeviceptr(ptr)) cyptr = pptr - cdef utils.HelperCUpointer_attribute cydata = utils.HelperCUpointer_attribute(attribute, 0, is_getter=True) + cdef _HelperCUpointer_attribute cydata = _HelperCUpointer_attribute(attribute, 0, is_getter=True) cdef void* cydata_ptr = cydata.cptr cdef cydriver.CUpointer_attribute cyattribute = attribute.value with nogil: @@ -35974,7 +35977,7 @@ def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_att else: pdevPtr = int(CUdeviceptr(devPtr)) cydevPtr = pdevPtr - cdef utils.HelperCUmem_range_attribute cydata = utils.HelperCUmem_range_attribute(attribute, dataSize) + cdef _HelperCUmem_range_attribute cydata = _HelperCUmem_range_attribute(attribute, dataSize) cdef void* cydata_ptr = cydata.cptr cdef cydriver.CUmem_range_attribute cyattribute = attribute.value with nogil: @@ -35987,7 +35990,7 @@ def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_att {{if 'cuMemRangeGetAttributes' in found_functions}} @cython.embedsignature(True) -def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Optional[Tuple[CUmem_range_attribute] | List[CUmem_range_attribute]], size_t numAttributes, devPtr, size_t count): +def cuMemRangeGetAttributes(dataSizes : tuple[int] | list[int], attributes : Optional[tuple[CUmem_range_attribute] | list[CUmem_range_attribute]], size_t numAttributes, devPtr, size_t count): """ Query attributes of a given memory range. Query attributes of the memory range starting at `devPtr` with a size @@ -36020,9 +36023,9 @@ def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Opt Parameters ---------- - dataSizes : List[int] + dataSizes : list[int] Array containing the sizes of each result - attributes : List[:py:obj:`~.CUmem_range_attribute`] + attributes : list[:py:obj:`~.CUmem_range_attribute`] An array of attributes to query (numAttributes and the number of attributes in this array should match) numAttributes : size_t @@ -36036,7 +36039,7 @@ def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Opt ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` - data : List[Any] + data : list[Any] A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to. @@ -36054,11 +36057,11 @@ def cuMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Opt cydevPtr = pdevPtr attributes = [] if attributes is None else attributes if not all(isinstance(_x, (CUmem_range_attribute)) for _x in attributes): - raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cydriver.CUmem_range_attribute] or List[cydriver.CUmem_range_attribute]") + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cydriver.CUmem_range_attribute] or list[cydriver.CUmem_range_attribute]") if not all(isinstance(_x, (int)) for _x in dataSizes): - raise TypeError("Argument 'dataSizes' is not instance of type (expected Tuple[int] or List[int]") - pylist = [utils.HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdata = utils.InputVoidPtrPtrHelper(pylist) + raise TypeError("Argument 'dataSizes' is not instance of type (expected tuple[int] or list[int]") + pylist = [_HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr cdef vector[size_t] cydataSizes = dataSizes cdef vector[cydriver.CUmem_range_attribute] cyattributes = [pyattributes.value for pyattributes in (attributes)] @@ -36119,7 +36122,7 @@ def cuPointerSetAttribute(value, attribute not None : CUpointer_attribute, ptr): else: pptr = int(CUdeviceptr(ptr)) cyptr = pptr - cdef utils.HelperCUpointer_attribute cyvalue = utils.HelperCUpointer_attribute(attribute, value, is_getter=False) + cdef _HelperCUpointer_attribute cyvalue = _HelperCUpointer_attribute(attribute, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr cdef cydriver.CUpointer_attribute cyattribute = attribute.value with nogil: @@ -36130,7 +36133,7 @@ def cuPointerSetAttribute(value, attribute not None : CUpointer_attribute, ptr): {{if 'cuPointerGetAttributes' in found_functions}} @cython.embedsignature(True) -def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tuple[CUpointer_attribute] | List[CUpointer_attribute]], ptr): +def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[tuple[CUpointer_attribute] | list[CUpointer_attribute]], ptr): """ Returns information about a pointer. The supported attributes are (refer to @@ -36180,7 +36183,7 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tup ---------- numAttributes : unsigned int Number of attributes to query - attributes : List[:py:obj:`~.CUpointer_attribute`] + attributes : list[:py:obj:`~.CUpointer_attribute`] An array of attributes to query (numAttributes and the number of attributes in this array should match) ptr : :py:obj:`~.CUdeviceptr` @@ -36190,7 +36193,7 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tup ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` - data : List[Any] + data : list[Any] A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to. @@ -36208,11 +36211,11 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[Tup cyptr = pptr attributes = [] if attributes is None else attributes if not all(isinstance(_x, (CUpointer_attribute)) for _x in attributes): - raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cydriver.CUpointer_attribute] or List[cydriver.CUpointer_attribute]") + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cydriver.CUpointer_attribute] or list[cydriver.CUpointer_attribute]") if numAttributes > len(attributes): raise RuntimeError("List is too small: " + str(len(attributes)) + " < " + str(numAttributes)) cdef vector[cydriver.CUpointer_attribute] cyattributes = [pyattributes.value for pyattributes in (attributes)] - pylist = [utils.HelperCUpointer_attribute(pyattributes, 0, is_getter=True) for pyattributes in attributes] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdata = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCUpointer_attribute(pyattributes, 0, is_getter=True) for pyattributes in attributes] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr with nogil: err = cydriver.cuPointerGetAttributes(numAttributes, cyattributes.data(), cyvoidStarHelper_ptr, cyptr) @@ -36811,7 +36814,7 @@ def cuStreamAddCallback(hStream, callback, userData, unsigned int flags): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cuStreamCallbackData *cbData = NULL @@ -36887,7 +36890,7 @@ def cuStreamBeginCapture(hStream, mode not None : CUstreamCaptureMode): {{if 'cuStreamBeginCaptureToGraph' in found_functions}} @cython.embedsignature(True) -def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, mode not None : CUstreamCaptureMode): +def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, mode not None : CUstreamCaptureMode): """ Begins graph capture on a stream to an existing graph. Begin graph capture on `hStream`, placing new nodes into an existing @@ -36913,10 +36916,10 @@ def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[Tuple[C Stream in which to initiate capture. hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to capture into. - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the first node captured in the stream. Can be NULL if numDependencies is 0. - dependencyData : List[:py:obj:`~.CUgraphEdgeData`] + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] Optional array of data associated with each dependency. numDependencies : size_t Number of dependencies. @@ -36940,10 +36943,10 @@ def cuStreamBeginCaptureToGraph(hStream, hGraph, dependencies : Optional[Tuple[C """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -37220,7 +37223,7 @@ def cuStreamGetCaptureInfo(hStream): are or become unreachable from the original stream at :py:obj:`~.cuStreamEndCapture` due to direct actions on the graph do not trigger :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED`. - dependencies_out : List[:py:obj:`~.CUgraphNode`] + dependencies_out : list[:py:obj:`~.CUgraphNode`] Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this set of nodes, absent operations such as event wait which modify this set. The @@ -37309,7 +37312,7 @@ def cuStreamGetCaptureInfo_v3(hStream): are or become unreachable from the original stream at :py:obj:`~.cuStreamEndCapture` due to direct actions on the graph do not trigger :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNJOINED`. - dependencies_out : List[:py:obj:`~.CUgraphNode`] + dependencies_out : list[:py:obj:`~.CUgraphNode`] Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this set of nodes, absent operations such as event wait which modify this set. The @@ -37318,7 +37321,7 @@ def cuStreamGetCaptureInfo_v3(hStream): be copied out and are valid until they or the graph is destroyed. The driver-owned array may also be passed directly to APIs that operate on the graph (not the stream) without copying. - edgeData_out : List[:py:obj:`~.CUgraphEdgeData`] + edgeData_out : list[:py:obj:`~.CUgraphEdgeData`] Optional location to store a pointer to an array of graph edge data. This array parallels `dependencies_out`; the next node to be added has an edge to `dependencies_out`[i] with annotation @@ -37363,7 +37366,7 @@ def cuStreamGetCaptureInfo_v3(hStream): {{if 'cuStreamUpdateCaptureDependencies' in found_functions}} @cython.embedsignature(True) -def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, unsigned int flags): +def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, unsigned int flags): """ Update the set of dependencies in a capturing stream (11.3+) Modifies the dependency set of a capturing stream. The dependency set @@ -37391,7 +37394,7 @@ def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUg ---------- hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to update - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] The set of dependencies to add numDependencies : size_t The size of the dependencies array @@ -37409,7 +37412,7 @@ def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUg """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUstream cyhStream if hStream is None: phStream = 0 @@ -37439,7 +37442,7 @@ def cuStreamUpdateCaptureDependencies(hStream, dependencies : Optional[Tuple[CUg {{if 'cuStreamUpdateCaptureDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuStreamUpdateCaptureDependencies_v2(hStream, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, unsigned int flags): +def cuStreamUpdateCaptureDependencies_v2(hStream, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, unsigned int flags): """ Update the set of dependencies in a capturing stream (12.3+) Modifies the dependency set of a capturing stream. The dependency set @@ -37463,9 +37466,9 @@ def cuStreamUpdateCaptureDependencies_v2(hStream, dependencies : Optional[Tuple[ ---------- hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to update - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] The set of dependencies to add - dependencyData : List[:py:obj:`~.CUgraphEdgeData`] + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] Optional array of data associated with each dependency. numDependencies : size_t The size of the dependencies array @@ -37483,10 +37486,10 @@ def cuStreamUpdateCaptureDependencies_v2(hStream, dependencies : Optional[Tuple[ """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUstream cyhStream if hStream is None: phStream = 0 @@ -37885,7 +37888,7 @@ def cuStreamSetAttribute(hStream, attr not None : CUstreamAttrID, value : Option phStream = int(CUstream(hStream)) cyhStream = phStream cdef cydriver.CUstreamAttrID cyattr = attr.value - cdef cydriver.CUstreamAttrValue* cyvalue_ptr = value._pvt_ptr if value != None else NULL + cdef cydriver.CUstreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cydriver.cuStreamSetAttribute(cyhStream, cyattr, cyvalue_ptr) return (_dict_CUresult[err],) @@ -38496,7 +38499,7 @@ def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_ and Cache Control" chapter from Vulkan specification. """ cdef CUexternalMemory extMem_out = CUexternalMemory() - cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc != None else NULL + cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc is not None else NULL with nogil: err = cydriver.cuImportExternalMemory(extMem_out._pvt_ptr, cymemHandleDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -38566,7 +38569,7 @@ def cuExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[CUDA_EXTERNAL_ pextMem = int(CUexternalMemory(extMem)) cyextMem = pextMem cdef CUdeviceptr devPtr = CUdeviceptr() - cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc != None else NULL + cdef cydriver.CUDA_EXTERNAL_MEMORY_BUFFER_DESC* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc is not None else NULL with nogil: err = cydriver.cuExternalMemoryGetMappedBuffer(devPtr._pvt_ptr, cyextMem, cybufferDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -38639,7 +38642,7 @@ def cuExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[CUDA_E pextMem = int(CUexternalMemory(extMem)) cyextMem = pextMem cdef CUmipmappedArray mipmap = CUmipmappedArray() - cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc != None else NULL + cdef cydriver.CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc is not None else NULL with nogil: err = cydriver.cuExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -38828,7 +38831,7 @@ def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_H :py:obj:`~.cuDestroyExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` """ cdef CUexternalSemaphore extSem_out = CUexternalSemaphore() - cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc != None else NULL + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc is not None else NULL with nogil: err = cydriver.cuImportExternalSemaphore(extSem_out._pvt_ptr, cysemHandleDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -38839,7 +38842,7 @@ def cuImportExternalSemaphore(semHandleDesc : Optional[CUDA_EXTERNAL_SEMAPHORE_H {{if 'cuSignalExternalSemaphoresAsync' in found_functions}} @cython.embedsignature(True) -def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemaphore] | List[CUexternalSemaphore]], paramsArray : Optional[Tuple[CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS] | List[CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS]], unsigned int numExtSems, stream): +def cuSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemaphore] | list[CUexternalSemaphore]], paramsArray : Optional[tuple[CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS] | list[CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS]], unsigned int numExtSems, stream): """ Signals a set of external semaphore objects. Enqueues a signal operation on a set of externally allocated semaphore @@ -38913,9 +38916,9 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemap Parameters ---------- - extSemArray : List[:py:obj:`~.CUexternalSemaphore`] + extSemArray : list[:py:obj:`~.CUexternalSemaphore`] Set of external semaphores to be signaled - paramsArray : List[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`] + paramsArray : list[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS`] Array of semaphore parameters numExtSems : unsigned int Number of semaphores to signal @@ -38941,10 +38944,10 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemap cystream = pstream paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,] or List[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,] or list[cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,]") extSemArray = [] if extSemArray is None else extSemArray if not all(isinstance(_x, (CUexternalSemaphore,)) for _x in extSemArray): - raise TypeError("Argument 'extSemArray' is not instance of type (expected Tuple[cydriver.CUexternalSemaphore,] or List[cydriver.CUexternalSemaphore,]") + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cydriver.CUexternalSemaphore,] or list[cydriver.CUexternalSemaphore,]") cdef cydriver.CUexternalSemaphore* cyextSemArray = NULL if len(extSemArray) > 1: cyextSemArray = calloc(len(extSemArray), sizeof(cydriver.CUexternalSemaphore)) @@ -38978,7 +38981,7 @@ def cuSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemap {{if 'cuWaitExternalSemaphoresAsync' in found_functions}} @cython.embedsignature(True) -def cuWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemaphore] | List[CUexternalSemaphore]], paramsArray : Optional[Tuple[CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS] | List[CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS]], unsigned int numExtSems, stream): +def cuWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[CUexternalSemaphore] | list[CUexternalSemaphore]], paramsArray : Optional[tuple[CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS] | list[CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS]], unsigned int numExtSems, stream): """ Waits on a set of external semaphore objects. Enqueues a wait operation on a set of externally allocated semaphore @@ -39043,9 +39046,9 @@ def cuWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemapho Parameters ---------- - extSemArray : List[:py:obj:`~.CUexternalSemaphore`] + extSemArray : list[:py:obj:`~.CUexternalSemaphore`] External semaphores to be waited on - paramsArray : List[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS`] + paramsArray : list[:py:obj:`~.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS`] Array of semaphore parameters numExtSems : unsigned int Number of semaphores to wait on @@ -39071,10 +39074,10 @@ def cuWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[CUexternalSemapho cystream = pstream paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,] or List[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,] or list[cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,]") extSemArray = [] if extSemArray is None else extSemArray if not all(isinstance(_x, (CUexternalSemaphore,)) for _x in extSemArray): - raise TypeError("Argument 'extSemArray' is not instance of type (expected Tuple[cydriver.CUexternalSemaphore,] or List[cydriver.CUexternalSemaphore,]") + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cydriver.CUexternalSemaphore,] or list[cydriver.CUexternalSemaphore,]") cdef cydriver.CUexternalSemaphore* cyextSemArray = NULL if len(extSemArray) > 1: cyextSemArray = calloc(len(extSemArray), sizeof(cydriver.CUexternalSemaphore)) @@ -39417,7 +39420,7 @@ def cuStreamWriteValue64(stream, addr, value, unsigned int flags): {{if 'cuStreamBatchMemOp_v2' in found_functions}} @cython.embedsignature(True) -def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[Tuple[CUstreamBatchMemOpParams] | List[CUstreamBatchMemOpParams]], unsigned int flags): +def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[tuple[CUstreamBatchMemOpParams] | list[CUstreamBatchMemOpParams]], unsigned int flags): """ Batch operations to synchronize the stream via memory operations. This is a batch version of :py:obj:`~.cuStreamWaitValue32()` and @@ -39441,7 +39444,7 @@ def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[Tuple[C The stream to enqueue the operations in. count : unsigned int The number of operations in the array. Must be less than 256. - paramArray : List[:py:obj:`~.CUstreamBatchMemOpParams`] + paramArray : list[:py:obj:`~.CUstreamBatchMemOpParams`] The types and parameters of the individual operations. flags : unsigned int Reserved for future expansion; must be 0. @@ -39461,7 +39464,7 @@ def cuStreamBatchMemOp(stream, unsigned int count, paramArray : Optional[Tuple[C """ paramArray = [] if paramArray is None else paramArray if not all(isinstance(_x, (CUstreamBatchMemOpParams,)) for _x in paramArray): - raise TypeError("Argument 'paramArray' is not instance of type (expected Tuple[cydriver.CUstreamBatchMemOpParams,] or List[cydriver.CUstreamBatchMemOpParams,]") + raise TypeError("Argument 'paramArray' is not instance of type (expected tuple[cydriver.CUstreamBatchMemOpParams,] or list[cydriver.CUstreamBatchMemOpParams,]") cdef cydriver.CUstream cystream if stream is None: pstream = 0 @@ -40098,7 +40101,7 @@ def cuLaunchKernel(f, unsigned int gridDimX, unsigned int gridDimY, unsigned int Stream identifier kernelParams : Any Array of pointers to kernel parameters - extra : List[Any] + extra : list[Any] Extra options Returns @@ -40126,7 +40129,7 @@ def cuLaunchKernel(f, unsigned int gridDimX, unsigned int gridDimY, unsigned int else: pf = int(CUfunction(f)) cyf = pf - cykernelParams = utils.HelperKernelParams(kernelParams) + cykernelParams = _HelperKernelParams(kernelParams) cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr, extra) @@ -40346,7 +40349,7 @@ def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_pt launch kernelParams : Any Array of pointers to kernel parameters - extra : List[Any] + extra : list[Any] Extra options Returns @@ -40366,8 +40369,8 @@ def cuLaunchKernelEx(config : Optional[CUlaunchConfig], f, kernelParams, void_pt else: pf = int(CUfunction(f)) cyf = pf - cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config != None else NULL - cykernelParams = utils.HelperKernelParams(kernelParams) + cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config is not None else NULL + cykernelParams = _HelperKernelParams(kernelParams) cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchKernelEx(cyconfig_ptr, cyf, cykernelParams_ptr, extra) @@ -40480,7 +40483,7 @@ def cuLaunchCooperativeKernel(f, unsigned int gridDimX, unsigned int gridDimY, u else: pf = int(CUfunction(f)) cyf = pf - cykernelParams = utils.HelperKernelParams(kernelParams) + cykernelParams = _HelperKernelParams(kernelParams) cdef void** cykernelParams_ptr = cykernelParams.ckernelParams with nogil: err = cydriver.cuLaunchCooperativeKernel(cyf, gridDimX, gridDimY, gridDimZ, blockDimX, blockDimY, blockDimZ, sharedMemBytes, cyhStream, cykernelParams_ptr) @@ -40490,7 +40493,7 @@ def cuLaunchCooperativeKernel(f, unsigned int gridDimX, unsigned int gridDimY, u {{if 'cuLaunchCooperativeKernelMultiDevice' in found_functions}} @cython.embedsignature(True) -def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[Tuple[CUDA_LAUNCH_PARAMS] | List[CUDA_LAUNCH_PARAMS]], unsigned int numDevices, unsigned int flags): +def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[tuple[CUDA_LAUNCH_PARAMS] | list[CUDA_LAUNCH_PARAMS]], unsigned int numDevices, unsigned int flags): """ Launches CUDA functions on multiple devices where thread blocks can cooperate and synchronize as they execute. [Deprecated] @@ -40625,7 +40628,7 @@ def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[Tuple[CUDA_ Parameters ---------- - launchParamsList : List[:py:obj:`~.CUDA_LAUNCH_PARAMS`] + launchParamsList : list[:py:obj:`~.CUDA_LAUNCH_PARAMS`] List of launch parameters, one per device numDevices : unsigned int Size of the `launchParamsList` array @@ -40643,7 +40646,7 @@ def cuLaunchCooperativeKernelMultiDevice(launchParamsList : Optional[Tuple[CUDA_ """ launchParamsList = [] if launchParamsList is None else launchParamsList if not all(isinstance(_x, (CUDA_LAUNCH_PARAMS,)) for _x in launchParamsList): - raise TypeError("Argument 'launchParamsList' is not instance of type (expected Tuple[cydriver.CUDA_LAUNCH_PARAMS,] or List[cydriver.CUDA_LAUNCH_PARAMS,]") + raise TypeError("Argument 'launchParamsList' is not instance of type (expected tuple[cydriver.CUDA_LAUNCH_PARAMS,] or list[cydriver.CUDA_LAUNCH_PARAMS,]") cdef cydriver.CUDA_LAUNCH_PARAMS* cylaunchParamsList = NULL if len(launchParamsList) > 1: cylaunchParamsList = calloc(len(launchParamsList), sizeof(cydriver.CUDA_LAUNCH_PARAMS)) @@ -40753,7 +40756,7 @@ def cuLaunchHostFunc(hStream, fn, userData): else: phStream = int(CUstream(hStream)) cyhStream = phStream - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cuHostCallbackData *cbData = NULL @@ -41021,7 +41024,7 @@ def cuParamSetv(hfunc, int offset, ptr, unsigned int numbytes): else: phfunc = int(CUfunction(hfunc)) cyhfunc = phfunc - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cydriver.cuParamSetv(cyhfunc, offset, cyptr_ptr, numbytes) @@ -41362,7 +41365,7 @@ def cuGraphCreate(unsigned int flags): {{if 'cuGraphAddKernelNode_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphAddKernelNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): +def cuGraphAddKernelNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_KERNEL_NODE_PARAMS]): """ Creates a kernel execution node and adds it to a graph. Creates a new kernel execution node and adds it to `hGraph` with @@ -41428,7 +41431,7 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41452,7 +41455,7 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41473,7 +41476,7 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddKernelNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -41564,7 +41567,7 @@ def cuGraphKernelNodeSetParams(hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PAR else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphKernelNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -41573,7 +41576,7 @@ def cuGraphKernelNodeSetParams(hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PAR {{if 'cuGraphAddMemcpyNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, copyParams : Optional[CUDA_MEMCPY3D], ctx): +def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, copyParams : Optional[CUDA_MEMCPY3D], ctx): """ Creates a memcpy node and adds it to a graph. Creates a new memcpy node and adds it to `hGraph` with @@ -41600,7 +41603,7 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41630,7 +41633,7 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li cyctx = pctx dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41651,7 +41654,7 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams is not None else NULL with nogil: err = cydriver.cuGraphAddMemcpyNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cycopyParams_ptr, cyctx) if len(dependencies) > 1 and cydependencies is not NULL: @@ -41733,7 +41736,7 @@ def cuGraphMemcpyNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMCPY3D]): else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_MEMCPY3D* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphMemcpyNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -41742,7 +41745,7 @@ def cuGraphMemcpyNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMCPY3D]): {{if 'cuGraphAddMemsetNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddMemsetNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, memsetParams : Optional[CUDA_MEMSET_NODE_PARAMS], ctx): +def cuGraphAddMemsetNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, memsetParams : Optional[CUDA_MEMSET_NODE_PARAMS], ctx): """ Creates a memset node and adds it to a graph. Creates a new memset node and adds it to `hGraph` with @@ -41759,7 +41762,7 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41789,7 +41792,7 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li cyctx = pctx dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41810,7 +41813,7 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Li elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams != None else NULL + cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams is not None else NULL with nogil: err = cydriver.cuGraphAddMemsetNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cymemsetParams_ptr, cyctx) if len(dependencies) > 1 and cydependencies is not NULL: @@ -41892,7 +41895,7 @@ def cuGraphMemsetNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMSET_NODE_PAR else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphMemsetNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -41901,7 +41904,7 @@ def cuGraphMemsetNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMSET_NODE_PAR {{if 'cuGraphAddHostNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddHostNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): +def cuGraphAddHostNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_HOST_NODE_PARAMS]): """ Creates a host execution node and adds it to a graph. Creates a new CPU execution node and adds it to `hGraph` with @@ -41918,7 +41921,7 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -41938,7 +41941,7 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -41959,7 +41962,7 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddHostNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -42041,7 +42044,7 @@ def cuGraphHostNodeSetParams(hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS] else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphHostNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -42050,7 +42053,7 @@ def cuGraphHostNodeSetParams(hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS] {{if 'cuGraphAddChildGraphNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, childGraph): +def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, childGraph): """ Creates a child graph node and adds it to a graph. Creates a new node which executes an embedded graph, and adds it to @@ -42070,7 +42073,7 @@ def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42098,7 +42101,7 @@ def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] cychildGraph = pchildGraph dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42176,7 +42179,7 @@ def cuGraphChildGraphNodeGetGraph(hNode): {{if 'cuGraphAddEmptyNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddEmptyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies): +def cuGraphAddEmptyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies): """ Creates an empty node and adds it to a graph. Creates a new node which performs no operation, and adds it to `hGraph` @@ -42196,7 +42199,7 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Lis ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42214,7 +42217,7 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Lis """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42247,7 +42250,7 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | Lis {{if 'cuGraphAddEventRecordNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, event): +def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, event): """ Creates an event record node and adds it to a graph. Creates a new event record node and adds it to `hGraph` with @@ -42264,7 +42267,7 @@ def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42292,7 +42295,7 @@ def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] cyevent = pevent dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42410,7 +42413,7 @@ def cuGraphEventRecordNodeSetEvent(hNode, event): {{if 'cuGraphAddEventWaitNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, event): +def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, event): """ Creates an event wait node and adds it to a graph. Creates a new event wait node and adds it to `hGraph` with @@ -42429,7 +42432,7 @@ def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42457,7 +42460,7 @@ def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | cyevent = pevent dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42575,7 +42578,7 @@ def cuGraphEventWaitNodeSetEvent(hNode, event): {{if 'cuGraphAddExternalSemaphoresSignalNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): +def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_SIGNAL_NODE_PARAMS]): """ Creates an external semaphore signal node and adds it to a graph. Creates a new external semaphore signal node and adds it to `hGraph` @@ -42593,7 +42596,7 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[Tuple ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42613,7 +42616,7 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[Tuple """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42634,7 +42637,7 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[Tuple elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddExternalSemaphoresSignalNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -42723,7 +42726,7 @@ def cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[CU else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExternalSemaphoresSignalNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -42732,7 +42735,7 @@ def cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[CU {{if 'cuGraphAddExternalSemaphoresWaitNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): +def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_EXT_SEM_WAIT_NODE_PARAMS]): """ Creates an external semaphore wait node and adds it to a graph. Creates a new external semaphore wait node and adds it to `hGraph` with @@ -42750,7 +42753,7 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[Tuple[C ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42770,7 +42773,7 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[Tuple[C """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42791,7 +42794,7 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[Tuple[C elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddExternalSemaphoresWaitNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -42880,7 +42883,7 @@ def cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[CUDA else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExternalSemaphoresWaitNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -42889,7 +42892,7 @@ def cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[CUDA {{if 'cuGraphAddBatchMemOpNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): +def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_BATCH_MEM_OP_NODE_PARAMS]): """ Creates a batch memory operation node and adds it to a graph. Creates a new batch memory operation node and adds it to `hGraph` with @@ -42906,7 +42909,7 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -42930,7 +42933,7 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -42951,7 +42954,7 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddBatchMemOpNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -43041,7 +43044,7 @@ def cuGraphBatchMemOpNodeSetParams(hNode, nodeParams : Optional[CUDA_BATCH_MEM_O else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphBatchMemOpNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -43112,7 +43115,7 @@ def cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams : Optional[ else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_BATCH_MEM_OP_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecBatchMemOpNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -43121,7 +43124,7 @@ def cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams : Optional[ {{if 'cuGraphAddMemAllocNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_MEM_ALLOC_NODE_PARAMS]): +def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUDA_MEM_ALLOC_NODE_PARAMS]): """ Creates an allocation node and adds it to a graph. Creates a new allocation node and adds it to `hGraph` with @@ -43179,7 +43182,7 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -43199,7 +43202,7 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -43220,7 +43223,7 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_MEM_ALLOC_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddMemAllocNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -43276,7 +43279,7 @@ def cuGraphMemAllocNodeGetParams(hNode): {{if 'cuGraphAddMemFreeNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, dptr): +def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, dptr): """ Creates a memory free node and adds it to a graph. Creates a new memory free node and adds it to `hGraph` with @@ -43311,7 +43314,7 @@ def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | L ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -43339,7 +43342,7 @@ def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | L cydptr = pdptr dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -43496,7 +43499,7 @@ def cuDeviceGetGraphMemAttribute(device, attr not None : CUgraphMem_attribute): pdevice = int(CUdevice(device)) cydevice = pdevice cdef cydriver.CUgraphMem_attribute cyattr = attr.value - cdef utils.HelperCUgraphMem_attribute cyvalue = utils.HelperCUgraphMem_attribute(attr, 0, is_getter=True) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuDeviceGetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) @@ -43548,7 +43551,7 @@ def cuDeviceSetGraphMemAttribute(device, attr not None : CUgraphMem_attribute, v pdevice = int(CUdevice(device)) cydevice = pdevice cdef cydriver.CUgraphMem_attribute cyattr = attr.value - cdef utils.HelperCUgraphMem_attribute cyvalue = utils.HelperCUgraphMem_attribute(attr, value, is_getter=False) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cydriver.cuDeviceSetGraphMemAttribute(cydevice, cyattr, cyvalue_ptr) @@ -43726,7 +43729,7 @@ def cuGraphGetNodes(hGraph, size_t numNodes = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - nodes : List[:py:obj:`~.CUgraphNode`] + nodes : list[:py:obj:`~.CUgraphNode`] Pointer to return the nodes numNodes : int See description @@ -43785,7 +43788,7 @@ def cuGraphGetRootNodes(hGraph, size_t numRootNodes = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - rootNodes : List[:py:obj:`~.CUgraphNode`] + rootNodes : list[:py:obj:`~.CUgraphNode`] Pointer to return the root nodes numRootNodes : int See description @@ -43846,9 +43849,9 @@ def cuGraphGetEdges(hGraph, size_t numEdges = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Location to return edge endpoints - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Location to return edge endpoints numEdges : int See description @@ -43924,11 +43927,11 @@ def cuGraphGetEdges_v2(hGraph, size_t numEdges = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Location to return edge endpoints - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Location to return edge endpoints - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional location to return edge data numEdges : int See description @@ -44008,7 +44011,7 @@ def cuGraphNodeGetDependencies(hNode, size_t numDependencies = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Pointer to return the dependencies numDependencies : int See description @@ -44073,9 +44076,9 @@ def cuGraphNodeGetDependencies_v2(hNode, size_t numDependencies = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Pointer to return the dependencies - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional array to return edge data for each dependency numDependencies : int See description @@ -44145,7 +44148,7 @@ def cuGraphNodeGetDependentNodes(hNode, size_t numDependentNodes = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - dependentNodes : List[:py:obj:`~.CUgraphNode`] + dependentNodes : list[:py:obj:`~.CUgraphNode`] Pointer to return the dependent nodes numDependentNodes : int See description @@ -44210,9 +44213,9 @@ def cuGraphNodeGetDependentNodes_v2(hNode, size_t numDependentNodes = 0): ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_LOSSY_QUERY`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - dependentNodes : List[:py:obj:`~.CUgraphNode`] + dependentNodes : list[:py:obj:`~.CUgraphNode`] Pointer to return the dependent nodes - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional pointer to return edge data for dependent nodes numDependentNodes : int See description @@ -44260,7 +44263,7 @@ def cuGraphNodeGetDependentNodes_v2(hNode, size_t numDependentNodes = 0): {{if 'cuGraphAddDependencies' in found_functions}} @cython.embedsignature(True) -def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies): +def cuGraphAddDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies): """ Adds dependency edges to a graph. The number of dependencies to be added is defined by `numDependencies` @@ -44274,9 +44277,9 @@ def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CU ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which dependencies are added - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Array of dependent nodes numDependencies : size_t Number of dependencies to be added @@ -44292,10 +44295,10 @@ def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CU """ to = [] if to is None else to if not all(isinstance(_x, (CUgraphNode,)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -44336,7 +44339,7 @@ def cuGraphAddDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CU {{if 'cuGraphAddDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphAddDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], edgeData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies): +def cuGraphAddDependencies_v2(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], edgeData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies): """ Adds dependency edges to a graph (12.3+) The number of dependencies to be added is defined by `numDependencies` @@ -44350,11 +44353,11 @@ def cuGraphAddDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which dependencies are added - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Array of dependent nodes - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional array of edge data. If NULL, default (zeroed) edge data is assumed. numDependencies : size_t @@ -44371,13 +44374,13 @@ def cuGraphAddDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List """ edgeData = [] if edgeData is None else edgeData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in edgeData): - raise TypeError("Argument 'edgeData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") to = [] if to is None else to if not all(isinstance(_x, (CUgraphNode,)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -44429,7 +44432,7 @@ def cuGraphAddDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List {{if 'cuGraphRemoveDependencies' in found_functions}} @cython.embedsignature(True) -def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies): +def cuGraphRemoveDependencies(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies): """ Removes dependency edges from a graph. The number of `dependencies` to be removed is defined by @@ -44447,9 +44450,9 @@ def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph from which to remove dependencies - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Array of dependent nodes numDependencies : size_t Number of dependencies to be removed @@ -44465,10 +44468,10 @@ def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List """ to = [] if to is None else to if not all(isinstance(_x, (CUgraphNode,)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -44509,7 +44512,7 @@ def cuGraphRemoveDependencies(hGraph, from_ : Optional[Tuple[CUgraphNode] | List {{if 'cuGraphRemoveDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphRemoveDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], to : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], edgeData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies): +def cuGraphRemoveDependencies_v2(hGraph, from_ : Optional[tuple[CUgraphNode] | list[CUgraphNode]], to : Optional[tuple[CUgraphNode] | list[CUgraphNode]], edgeData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies): """ Removes dependency edges from a graph (12.3+) The number of `dependencies` to be removed is defined by @@ -44529,11 +44532,11 @@ def cuGraphRemoveDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | L ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph from which to remove dependencies - from : List[:py:obj:`~.CUgraphNode`] + from : list[:py:obj:`~.CUgraphNode`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.CUgraphNode`] + to : list[:py:obj:`~.CUgraphNode`] Array of dependent nodes - edgeData : List[:py:obj:`~.CUgraphEdgeData`] + edgeData : list[:py:obj:`~.CUgraphEdgeData`] Optional array of edge data. If NULL, edge data is assumed to be default (zeroed). numDependencies : size_t @@ -44550,13 +44553,13 @@ def cuGraphRemoveDependencies_v2(hGraph, from_ : Optional[Tuple[CUgraphNode] | L """ edgeData = [] if edgeData is None else edgeData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in edgeData): - raise TypeError("Argument 'edgeData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") to = [] if to is None else to if not all(isinstance(_x, (CUgraphNode,)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (CUgraphNode,)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -44887,7 +44890,7 @@ def cuGraphInstantiateWithParams(hGraph, instantiateParams : Optional[CUDA_GRAPH phGraph = int(CUgraph(hGraph)) cyhGraph = phGraph cdef CUgraphExec phGraphExec = CUgraphExec() - cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams != None else NULL + cdef cydriver.CUDA_GRAPH_INSTANTIATE_PARAMS* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams is not None else NULL with nogil: err = cydriver.cuGraphInstantiateWithParams(phGraphExec._pvt_ptr, cyhGraph, cyinstantiateParams_ptr) if err != cydriver.CUDA_SUCCESS: @@ -45013,7 +45016,7 @@ def cuGraphExecKernelNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_KERNEL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecKernelNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -45088,7 +45091,7 @@ def cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams : Optional[CUDA else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams != None else NULL + cdef cydriver.CUDA_MEMCPY3D* cycopyParams_ptr = copyParams._pvt_ptr if copyParams is not None else NULL with nogil: err = cydriver.cuGraphExecMemcpyNodeSetParams(cyhGraphExec, cyhNode, cycopyParams_ptr, cyctx) return (_dict_CUresult[err],) @@ -45168,7 +45171,7 @@ def cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams : Optional[CU else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams != None else NULL + cdef cydriver.CUDA_MEMSET_NODE_PARAMS* cymemsetParams_ptr = memsetParams._pvt_ptr if memsetParams is not None else NULL with nogil: err = cydriver.cuGraphExecMemsetNodeSetParams(cyhGraphExec, cyhNode, cymemsetParams_ptr, cyctx) return (_dict_CUresult[err],) @@ -45223,7 +45226,7 @@ def cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_H else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_HOST_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecHostNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -45479,7 +45482,7 @@ def cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePara else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecExternalSemaphoresSignalNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -45539,7 +45542,7 @@ def cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecExternalSemaphoresWaitNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -46157,7 +46160,7 @@ def cuGraphKernelNodeSetAttribute(hNode, attr not None : CUkernelNodeAttrID, val phNode = int(CUgraphNode(hNode)) cyhNode = phNode cdef cydriver.CUkernelNodeAttrID cyattr = attr.value - cdef cydriver.CUkernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value != None else NULL + cdef cydriver.CUkernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cydriver.cuGraphKernelNodeSetAttribute(cyhNode, cyattr, cyvalue_ptr) return (_dict_CUresult[err],) @@ -46256,7 +46259,7 @@ def cuUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned int pdestroy = int(CUhostFn(destroy)) cydestroy = pdestroy cdef CUuserObject object_out = CUuserObject() - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cydriver.cuUserObjectCreate(object_out._pvt_ptr, cyptr_ptr, cydestroy, initialRefcount, flags) @@ -46462,7 +46465,7 @@ def cuGraphReleaseUserObject(graph, object, unsigned int count): {{if 'cuGraphAddNode' in found_functions}} @cython.embedsignature(True) -def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): +def cuGraphAddNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): """ Adds a node of arbitrary type to a graph. Creates a new node in `hGraph` described by `nodeParams` with @@ -46488,7 +46491,7 @@ def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUg ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -46508,7 +46511,7 @@ def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUg """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -46529,7 +46532,7 @@ def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUg elif len(dependencies) == 1: cydependencies = (dependencies[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddNode(phGraphNode._pvt_ptr, cyhGraph, cydependencies, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -46542,7 +46545,7 @@ def cuGraphAddNode(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUg {{if 'cuGraphAddNode_v2' in found_functions}} @cython.embedsignature(True) -def cuGraphAddNode_v2(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[CUgraphNode]], dependencyData : Optional[Tuple[CUgraphEdgeData] | List[CUgraphEdgeData]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): +def cuGraphAddNode_v2(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): """ Adds a node of arbitrary type to a graph (12.3+) Creates a new node in `hGraph` described by `nodeParams` with @@ -46568,9 +46571,9 @@ def cuGraphAddNode_v2(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[ ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.CUgraphNode`] + dependencies : list[:py:obj:`~.CUgraphNode`] Dependencies of the node - dependencyData : List[:py:obj:`~.CUgraphEdgeData`] + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies. numDependencies : size_t @@ -46591,10 +46594,10 @@ def cuGraphAddNode_v2(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[ """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cydriver.CUgraphEdgeData,] or List[cydriver.CUgraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cydriver.CUgraphNode,] or List[cydriver.CUgraphNode,]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") cdef cydriver.CUgraph cyhGraph if hGraph is None: phGraph = 0 @@ -46625,7 +46628,7 @@ def cuGraphAddNode_v2(hGraph, dependencies : Optional[Tuple[CUgraphNode] | List[ cydependencyData = (dependencyData[0])._pvt_ptr if numDependencies > len(dependencies): raise RuntimeError("List is too small: " + str(len(dependencies)) + " < " + str(numDependencies)) if numDependencies > len(dependencyData): raise RuntimeError("List is too small: " + str(len(dependencyData)) + " < " + str(numDependencies)) - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphAddNode_v2(phGraphNode._pvt_ptr, cyhGraph, cydependencies, cydependencyData, numDependencies, cynodeParams_ptr) if len(dependencies) > 1 and cydependencies is not NULL: @@ -46675,7 +46678,7 @@ def cuGraphNodeSetParams(hNode, nodeParams : Optional[CUgraphNodeParams]): else: phNode = int(CUgraphNode(hNode)) cyhNode = phNode - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -46735,7 +46738,7 @@ def cuGraphExecNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUgraphNod else: phGraphExec = int(CUgraphExec(hGraphExec)) cyhGraphExec = phGraphExec - cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cydriver.cuGraphExecNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_CUresult[err],) @@ -47198,7 +47201,7 @@ def cuOccupancyMaxPotentialClusterSize(func, config : Optional[CUlaunchConfig]): pfunc = int(CUfunction(func)) cyfunc = pfunc cdef int clusterSize = 0 - cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config != None else NULL + cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config is not None else NULL with nogil: err = cydriver.cuOccupancyMaxPotentialClusterSize(&clusterSize, cyfunc, cyconfig_ptr) if err != cydriver.CUDA_SUCCESS: @@ -47258,7 +47261,7 @@ def cuOccupancyMaxActiveClusters(func, config : Optional[CUlaunchConfig]): pfunc = int(CUfunction(func)) cyfunc = pfunc cdef int numClusters = 0 - cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config != None else NULL + cdef cydriver.CUlaunchConfig* cyconfig_ptr = config._pvt_ptr if config is not None else NULL with nogil: err = cydriver.cuOccupancyMaxActiveClusters(&numClusters, cyfunc, cyconfig_ptr) if err != cydriver.CUDA_SUCCESS: @@ -47522,7 +47525,7 @@ def cuTexRefSetAddress2D(hTexRef, desc : Optional[CUDA_ARRAY_DESCRIPTOR], dptr, else: phTexRef = int(CUtexref(hTexRef)) cyhTexRef = phTexRef - cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cydesc_ptr = desc._pvt_ptr if desc != None else NULL + cdef cydriver.CUDA_ARRAY_DESCRIPTOR* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cydriver.cuTexRefSetAddress2D(cyhTexRef, cydesc_ptr, cydptr, Pitch) return (_dict_CUresult[err],) @@ -48893,9 +48896,9 @@ def cuTexObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC], pTexDesc : Option :py:obj:`~.cuTexObjectDestroy`, :py:obj:`~.cudaCreateTextureObject` """ cdef CUtexObject pTexObject = CUtexObject() - cdef cydriver.CUDA_RESOURCE_DESC* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc != None else NULL - cdef cydriver.CUDA_TEXTURE_DESC* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc != None else NULL - cdef cydriver.CUDA_RESOURCE_VIEW_DESC* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc != None else NULL + cdef cydriver.CUDA_RESOURCE_DESC* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL + cdef cydriver.CUDA_TEXTURE_DESC* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc is not None else NULL + cdef cydriver.CUDA_RESOURCE_VIEW_DESC* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc is not None else NULL with nogil: err = cydriver.cuTexObjectCreate(pTexObject._pvt_ptr, cypResDesc_ptr, cypTexDesc_ptr, cypResViewDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -49097,7 +49100,7 @@ def cuSurfObjectCreate(pResDesc : Optional[CUDA_RESOURCE_DESC]): :py:obj:`~.cuSurfObjectDestroy`, :py:obj:`~.cudaCreateSurfaceObject` """ cdef CUsurfObject pSurfObject = CUsurfObject() - cdef cydriver.CUDA_RESOURCE_DESC* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc != None else NULL + cdef cydriver.CUDA_RESOURCE_DESC* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL with nogil: err = cydriver.cuSurfObjectCreate(pSurfObject._pvt_ptr, cypResDesc_ptr) if err != cydriver.CUDA_SUCCESS: @@ -49184,7 +49187,7 @@ def cuSurfObjectGetResourceDesc(surfObject): {{if 'cuTensorMapEncodeTiled' in found_functions}} @cython.embedsignature(True) -def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], globalStrides : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], boxDim : Optional[Tuple[cuuint32_t] | List[cuuint32_t]], elementStrides : Optional[Tuple[cuuint32_t] | List[cuuint32_t]], interleave not None : CUtensorMapInterleave, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): +def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[tuple[cuuint64_t] | list[cuuint64_t]], globalStrides : Optional[tuple[cuuint64_t] | list[cuuint64_t]], boxDim : Optional[tuple[cuuint32_t] | list[cuuint32_t]], elementStrides : Optional[tuple[cuuint32_t] | list[cuuint32_t]], interleave not None : CUtensorMapInterleave, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): """ Create a tensor map descriptor object representing tiled memory region. Creates a descriptor for Tensor Memory Access (TMA) object specified by @@ -49375,17 +49378,17 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor Dimensionality of tensor globalAddress : Any Starting address of memory region described by tensor - globalDim : List[:py:obj:`~.cuuint64_t`] + globalDim : list[:py:obj:`~.cuuint64_t`] Array containing tensor size (number of elements) along each of the `tensorRank` dimensions - globalStrides : List[:py:obj:`~.cuuint64_t`] + globalStrides : list[:py:obj:`~.cuuint64_t`] Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions - boxDim : List[:py:obj:`~.cuuint32_t`] + boxDim : list[:py:obj:`~.cuuint32_t`] Array containing traversal box size (number of elments) along each of the `tensorRank` dimensions. Specifies how many elements to be traversed along each tensor dimension. - elementStrides : List[:py:obj:`~.cuuint32_t`] + elementStrides : list[:py:obj:`~.cuuint32_t`] Array containing traversal stride in each of the `tensorRank` dimensions interleave : :py:obj:`~.CUtensorMapInterleave` @@ -49411,16 +49414,16 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor """ elementStrides = [] if elementStrides is None else elementStrides if not all(isinstance(_x, (cuuint32_t,)) for _x in elementStrides): - raise TypeError("Argument 'elementStrides' is not instance of type (expected Tuple[cydriver.cuuint32_t,] or List[cydriver.cuuint32_t,]") + raise TypeError("Argument 'elementStrides' is not instance of type (expected tuple[cydriver.cuuint32_t,] or list[cydriver.cuuint32_t,]") boxDim = [] if boxDim is None else boxDim if not all(isinstance(_x, (cuuint32_t,)) for _x in boxDim): - raise TypeError("Argument 'boxDim' is not instance of type (expected Tuple[cydriver.cuuint32_t,] or List[cydriver.cuuint32_t,]") + raise TypeError("Argument 'boxDim' is not instance of type (expected tuple[cydriver.cuuint32_t,] or list[cydriver.cuuint32_t,]") globalStrides = [] if globalStrides is None else globalStrides if not all(isinstance(_x, (cuuint64_t,)) for _x in globalStrides): - raise TypeError("Argument 'globalStrides' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalStrides' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") globalDim = [] if globalDim is None else globalDim if not all(isinstance(_x, (cuuint64_t,)) for _x in globalDim): - raise TypeError("Argument 'globalDim' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalDim' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") cdef cydriver.cuuint32_t cytensorRank if tensorRank is None: ptensorRank = 0 @@ -49431,7 +49434,7 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor cytensorRank = ptensorRank cdef CUtensorMap tensorMap = CUtensorMap() cdef cydriver.CUtensorMapDataType cytensorDataType = tensorDataType.value - cyglobalAddress = utils.HelperInputVoidPtr(globalAddress) + cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr cdef cydriver.cuuint64_t* cyglobalDim = NULL if len(globalDim) > 1: @@ -49495,7 +49498,7 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor {{if 'cuTensorMapEncodeIm2col' in found_functions}} @cython.embedsignature(True) -def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], globalStrides : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], pixelBoxLowerCorner : Optional[Tuple[int] | List[int]], pixelBoxUpperCorner : Optional[Tuple[int] | List[int]], channelsPerPixel, pixelsPerColumn, elementStrides : Optional[Tuple[cuuint32_t] | List[cuuint32_t]], interleave not None : CUtensorMapInterleave, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): +def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[tuple[cuuint64_t] | list[cuuint64_t]], globalStrides : Optional[tuple[cuuint64_t] | list[cuuint64_t]], pixelBoxLowerCorner : Optional[tuple[int] | list[int]], pixelBoxUpperCorner : Optional[tuple[int] | list[int]], channelsPerPixel, pixelsPerColumn, elementStrides : Optional[tuple[cuuint32_t] | list[cuuint32_t]], interleave not None : CUtensorMapInterleave, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): """ Create a tensor map descriptor object representing im2col memory region. Creates a descriptor for Tensor Memory Access (TMA) object specified by @@ -49709,21 +49712,21 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso Dimensionality of tensor; must be at least 3 globalAddress : Any Starting address of memory region described by tensor - globalDim : List[:py:obj:`~.cuuint64_t`] + globalDim : list[:py:obj:`~.cuuint64_t`] Array containing tensor size (number of elements) along each of the `tensorRank` dimensions - globalStrides : List[:py:obj:`~.cuuint64_t`] + globalStrides : list[:py:obj:`~.cuuint64_t`] Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions - pixelBoxLowerCorner : List[int] + pixelBoxLowerCorner : list[int] Array containing DHW dimensions of lower box corner - pixelBoxUpperCorner : List[int] + pixelBoxUpperCorner : list[int] Array containing DHW dimensions of upper box corner channelsPerPixel : Any Number of channels per pixel pixelsPerColumn : Any Number of pixels per column - elementStrides : List[:py:obj:`~.cuuint32_t`] + elementStrides : list[:py:obj:`~.cuuint32_t`] Array containing traversal stride in each of the `tensorRank` dimensions interleave : :py:obj:`~.CUtensorMapInterleave` @@ -49749,7 +49752,7 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso """ elementStrides = [] if elementStrides is None else elementStrides if not all(isinstance(_x, (cuuint32_t,)) for _x in elementStrides): - raise TypeError("Argument 'elementStrides' is not instance of type (expected Tuple[cydriver.cuuint32_t,] or List[cydriver.cuuint32_t,]") + raise TypeError("Argument 'elementStrides' is not instance of type (expected tuple[cydriver.cuuint32_t,] or list[cydriver.cuuint32_t,]") cdef cydriver.cuuint32_t cypixelsPerColumn if pixelsPerColumn is None: ppixelsPerColumn = 0 @@ -49768,16 +49771,16 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso cychannelsPerPixel = pchannelsPerPixel pixelBoxUpperCorner = [] if pixelBoxUpperCorner is None else pixelBoxUpperCorner if not all(isinstance(_x, (int)) for _x in pixelBoxUpperCorner): - raise TypeError("Argument 'pixelBoxUpperCorner' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'pixelBoxUpperCorner' is not instance of type (expected tuple[int] or list[int]") pixelBoxLowerCorner = [] if pixelBoxLowerCorner is None else pixelBoxLowerCorner if not all(isinstance(_x, (int)) for _x in pixelBoxLowerCorner): - raise TypeError("Argument 'pixelBoxLowerCorner' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'pixelBoxLowerCorner' is not instance of type (expected tuple[int] or list[int]") globalStrides = [] if globalStrides is None else globalStrides if not all(isinstance(_x, (cuuint64_t,)) for _x in globalStrides): - raise TypeError("Argument 'globalStrides' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalStrides' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") globalDim = [] if globalDim is None else globalDim if not all(isinstance(_x, (cuuint64_t,)) for _x in globalDim): - raise TypeError("Argument 'globalDim' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalDim' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") cdef cydriver.cuuint32_t cytensorRank if tensorRank is None: ptensorRank = 0 @@ -49788,7 +49791,7 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso cytensorRank = ptensorRank cdef CUtensorMap tensorMap = CUtensorMap() cdef cydriver.CUtensorMapDataType cytensorDataType = tensorDataType.value - cyglobalAddress = utils.HelperInputVoidPtr(globalAddress) + cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr cdef cydriver.cuuint64_t* cyglobalDim = NULL if len(globalDim) > 1: @@ -49842,7 +49845,7 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso {{if 'cuTensorMapEncodeIm2colWide' in found_functions}} @cython.embedsignature(True) -def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], globalStrides : Optional[Tuple[cuuint64_t] | List[cuuint64_t]], int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides : Optional[Tuple[cuuint32_t] | List[cuuint32_t]], interleave not None : CUtensorMapInterleave, mode not None : CUtensorMapIm2ColWideMode, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): +def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[tuple[cuuint64_t] | list[cuuint64_t]], globalStrides : Optional[tuple[cuuint64_t] | list[cuuint64_t]], int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides : Optional[tuple[cuuint32_t] | list[cuuint32_t]], interleave not None : CUtensorMapInterleave, mode not None : CUtensorMapIm2ColWideMode, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): """ Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along the W dimension. Creates a descriptor for Tensor Memory Access (TMA) object specified by @@ -50041,10 +50044,10 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t Dimensionality of tensor; must be at least 3 globalAddress : Any Starting address of memory region described by tensor - globalDim : List[:py:obj:`~.cuuint64_t`] + globalDim : list[:py:obj:`~.cuuint64_t`] Array containing tensor size (number of elements) along each of the `tensorRank` dimensions - globalStrides : List[:py:obj:`~.cuuint64_t`] + globalStrides : list[:py:obj:`~.cuuint64_t`] Array containing stride size (in bytes) along each of the `tensorRank` - 1 dimensions pixelBoxLowerCornerWidth : int @@ -50055,7 +50058,7 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t Number of channels per pixel pixelsPerColumn : Any Number of pixels per column - elementStrides : List[:py:obj:`~.cuuint32_t`] + elementStrides : list[:py:obj:`~.cuuint32_t`] Array containing traversal stride in each of the `tensorRank` dimensions interleave : :py:obj:`~.CUtensorMapInterleave` @@ -50083,7 +50086,7 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t """ elementStrides = [] if elementStrides is None else elementStrides if not all(isinstance(_x, (cuuint32_t,)) for _x in elementStrides): - raise TypeError("Argument 'elementStrides' is not instance of type (expected Tuple[cydriver.cuuint32_t,] or List[cydriver.cuuint32_t,]") + raise TypeError("Argument 'elementStrides' is not instance of type (expected tuple[cydriver.cuuint32_t,] or list[cydriver.cuuint32_t,]") cdef cydriver.cuuint32_t cypixelsPerColumn if pixelsPerColumn is None: ppixelsPerColumn = 0 @@ -50102,10 +50105,10 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t cychannelsPerPixel = pchannelsPerPixel globalStrides = [] if globalStrides is None else globalStrides if not all(isinstance(_x, (cuuint64_t,)) for _x in globalStrides): - raise TypeError("Argument 'globalStrides' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalStrides' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") globalDim = [] if globalDim is None else globalDim if not all(isinstance(_x, (cuuint64_t,)) for _x in globalDim): - raise TypeError("Argument 'globalDim' is not instance of type (expected Tuple[cydriver.cuuint64_t,] or List[cydriver.cuuint64_t,]") + raise TypeError("Argument 'globalDim' is not instance of type (expected tuple[cydriver.cuuint64_t,] or list[cydriver.cuuint64_t,]") cdef cydriver.cuuint32_t cytensorRank if tensorRank is None: ptensorRank = 0 @@ -50116,7 +50119,7 @@ def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, t cytensorRank = ptensorRank cdef CUtensorMap tensorMap = CUtensorMap() cdef cydriver.CUtensorMapDataType cytensorDataType = tensorDataType.value - cyglobalAddress = utils.HelperInputVoidPtr(globalAddress) + cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr cdef cydriver.cuuint64_t* cyglobalDim = NULL if len(globalDim) > 1: @@ -50196,8 +50199,8 @@ def cuTensorMapReplaceAddress(tensorMap : Optional[CUtensorMap], globalAddress): -------- :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapEncodeIm2colWide` """ - cdef cydriver.CUtensorMap* cytensorMap_ptr = tensorMap._pvt_ptr if tensorMap != None else NULL - cyglobalAddress = utils.HelperInputVoidPtr(globalAddress) + cdef cydriver.CUtensorMap* cytensorMap_ptr = tensorMap._pvt_ptr if tensorMap is not None else NULL + cyglobalAddress = _HelperInputVoidPtr(globalAddress) cdef void* cyglobalAddress_ptr = cyglobalAddress.cptr with nogil: err = cydriver.cuTensorMapReplaceAddress(cytensorMap_ptr, cyglobalAddress_ptr) @@ -51032,7 +51035,7 @@ def cuCoredumpGetAttribute(attrib not None : CUcoredumpSettings): :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` """ cdef cydriver.CUcoredumpSettings cyattrib = attrib.value - cdef utils.HelperCUcoredumpSettings cyvalue = utils.HelperCUcoredumpSettings(attrib, 0, is_getter=True) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr cdef size_t size = cyvalue.size() with nogil: @@ -51148,7 +51151,7 @@ def cuCoredumpGetAttributeGlobal(attrib not None : CUcoredumpSettings): :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpSetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` """ cdef cydriver.CUcoredumpSettings cyattrib = attrib.value - cdef utils.HelperCUcoredumpSettings cyvalue = utils.HelperCUcoredumpSettings(attrib, 0, is_getter=True) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr cdef size_t size = cyvalue.size() with nogil: @@ -51271,7 +51274,7 @@ def cuCoredumpSetAttribute(attrib not None : CUcoredumpSettings, value): :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpSetAttributeGlobal` """ cdef cydriver.CUcoredumpSettings cyattrib = attrib.value - cdef utils.HelperCUcoredumpSettings cyvalue = utils.HelperCUcoredumpSettings(attrib, value, is_getter=False) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr cdef size_t size = cyvalue.size() with nogil: @@ -51397,7 +51400,7 @@ def cuCoredumpSetAttributeGlobal(attrib not None : CUcoredumpSettings, value): :py:obj:`~.cuCoredumpGetAttribute`, :py:obj:`~.cuCoredumpGetAttributeGlobal`, :py:obj:`~.cuCoredumpSetAttribute` """ cdef cydriver.CUcoredumpSettings cyattrib = attrib.value - cdef utils.HelperCUcoredumpSettings cyvalue = utils.HelperCUcoredumpSettings(attrib, value, is_getter=False) + cdef _HelperCUcoredumpSettings cyvalue = _HelperCUcoredumpSettings(attrib, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr cdef size_t size = cyvalue.size() with nogil: @@ -51424,7 +51427,7 @@ def cuGetExportTable(pExportTableId : Optional[CUuuid]): None """ cdef void_ptr ppExportTable = 0 - cdef cydriver.CUuuid* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId != None else NULL + cdef cydriver.CUuuid* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId is not None else NULL with nogil: err = cydriver.cuGetExportTable(&ppExportTable, cypExportTableId_ptr) if err != cydriver.CUDA_SUCCESS: @@ -51812,7 +51815,7 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_RESOURCE_TYPE`, :py:obj:`~.CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION` - result : List[:py:obj:`~.CUdevResource`] + result : list[:py:obj:`~.CUdevResource`] Output array of `None` resources. Can be NULL to query the number of groups. nbGroups : unsigned int @@ -51834,7 +51837,7 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe if cyresult is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(nbGroups) + 'x' + str(sizeof(cydriver.CUdevResource))) cdef unsigned int cynbGroups = nbGroups - cdef cydriver.CUdevResource* cyinput__ptr = input_._pvt_ptr if input_ != None else NULL + cdef cydriver.CUdevResource* cyinput__ptr = input_._pvt_ptr if input_ is not None else NULL cdef CUdevResource remaining = CUdevResource() with nogil: err = cydriver.cuDevSmResourceSplitByCount(cyresult, &cynbGroups, cyinput__ptr, remaining._pvt_ptr, useFlags, minCount) @@ -51851,7 +51854,7 @@ def cuDevSmResourceSplitByCount(unsigned int nbGroups, input_ : Optional[CUdevRe {{if 'cuDevResourceGenerateDesc' in found_functions}} @cython.embedsignature(True) -def cuDevResourceGenerateDesc(resources : Optional[Tuple[CUdevResource] | List[CUdevResource]], unsigned int nbResources): +def cuDevResourceGenerateDesc(resources : Optional[tuple[CUdevResource] | list[CUdevResource]], unsigned int nbResources): """ Generate a resource descriptor. Generates a single resource descriptor with the set of resources @@ -51876,7 +51879,7 @@ def cuDevResourceGenerateDesc(resources : Optional[Tuple[CUdevResource] | List[C Parameters ---------- - resources : List[:py:obj:`~.CUdevResource`] + resources : list[:py:obj:`~.CUdevResource`] Array of resources to be included in the descriptor nbResources : unsigned int Number of resources passed in `resources` @@ -51894,7 +51897,7 @@ def cuDevResourceGenerateDesc(resources : Optional[Tuple[CUdevResource] | List[C """ resources = [] if resources is None else resources if not all(isinstance(_x, (CUdevResource,)) for _x in resources): - raise TypeError("Argument 'resources' is not instance of type (expected Tuple[cydriver.CUdevResource,] or List[cydriver.CUdevResource,]") + raise TypeError("Argument 'resources' is not instance of type (expected tuple[cydriver.CUdevResource,] or list[cydriver.CUdevResource,]") cdef CUdevResourceDesc phDesc = CUdevResourceDesc() cdef cydriver.CUdevResource* cyresources = NULL if len(resources) > 1: @@ -52202,7 +52205,7 @@ def cuLogsRegisterCallback(callbackFunc, userData): else: pcallbackFunc = int(CUlogsCallback(callbackFunc)) cycallbackFunc = pcallbackFunc - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cuLogsCallbackData *cbData = NULL @@ -52468,7 +52471,7 @@ def cuCheckpointProcessLock(int pid, args : Optional[CUcheckpointLockArgs]): CUresult :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` :py:obj:`~.CUDA_ERROR_NOT_READY` """ - cdef cydriver.CUcheckpointLockArgs* cyargs_ptr = args._pvt_ptr if args != None else NULL + cdef cydriver.CUcheckpointLockArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessLock(pid, cyargs_ptr) return (_dict_CUresult[err],) @@ -52499,7 +52502,7 @@ def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpoin CUresult :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` """ - cdef cydriver.CUcheckpointCheckpointArgs* cyargs_ptr = args._pvt_ptr if args != None else NULL + cdef cydriver.CUcheckpointCheckpointArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessCheckpoint(pid, cyargs_ptr) return (_dict_CUresult[err],) @@ -52535,7 +52538,7 @@ def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs] -------- :py:obj:`~.cuInit` """ - cdef cydriver.CUcheckpointRestoreArgs* cyargs_ptr = args._pvt_ptr if args != None else NULL + cdef cydriver.CUcheckpointRestoreArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessRestore(pid, cyargs_ptr) return (_dict_CUresult[err],) @@ -52564,7 +52567,7 @@ def cuCheckpointProcessUnlock(int pid, args : Optional[CUcheckpointUnlockArgs]): CUresult :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` """ - cdef cydriver.CUcheckpointUnlockArgs* cyargs_ptr = args._pvt_ptr if args != None else NULL + cdef cydriver.CUcheckpointUnlockArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: err = cydriver.cuCheckpointProcessUnlock(pid, cyargs_ptr) return (_dict_CUresult[err],) @@ -53183,7 +53186,7 @@ def cuEGLStreamProducerReturnFrame(conn, eglframe : Optional[CUeglFrame], pStrea cyconn = conn else: raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) - cdef cydriver.CUeglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe != None else NULL + cdef cydriver.CUeglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe is not None else NULL with nogil: err = cydriver.cuEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) return (_dict_CUresult[err],) @@ -53492,7 +53495,7 @@ def cuGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : CUGLDevic CUDA_ERROR_INVALID_GRAPHICS_CONTEXT pCudaDeviceCount : unsigned int Returned number of CUDA devices. - pCudaDevices : List[CUdevice] + pCudaDevices : list[CUdevice] Returned CUDA devices. See Also @@ -54601,3 +54604,125 @@ def sizeof(objType): if objType == VdpOutputSurface: return sizeof(cydriver.VdpOutputSurface){{endif}} raise TypeError("Unknown type: " + str(objType)) + +cdef int _add_native_handle_getters() except?-1: + from cuda.bindings.utils import _add_cuda_native_handle_getter + {{if 'CUcontext' in found_types}} + def CUcontext_getter(CUcontext x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUcontext, CUcontext_getter) + {{endif}} + {{if 'CUmodule' in found_types}} + def CUmodule_getter(CUmodule x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmodule, CUmodule_getter) + {{endif}} + {{if 'CUfunction' in found_types}} + def CUfunction_getter(CUfunction x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUfunction, CUfunction_getter) + {{endif}} + {{if 'CUlibrary' in found_types}} + def CUlibrary_getter(CUlibrary x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlibrary, CUlibrary_getter) + {{endif}} + {{if 'CUkernel' in found_types}} + def CUkernel_getter(CUkernel x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUkernel, CUkernel_getter) + {{endif}} + {{if 'CUarray' in found_types}} + def CUarray_getter(CUarray x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUarray, CUarray_getter) + {{endif}} + {{if 'CUmipmappedArray' in found_types}} + def CUmipmappedArray_getter(CUmipmappedArray x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmipmappedArray, CUmipmappedArray_getter) + {{endif}} + {{if 'CUtexref' in found_types}} + def CUtexref_getter(CUtexref x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUtexref, CUtexref_getter) + {{endif}} + {{if 'CUsurfref' in found_types}} + def CUsurfref_getter(CUsurfref x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUsurfref, CUsurfref_getter) + {{endif}} + {{if 'CUevent' in found_types}} + def CUevent_getter(CUevent x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUevent, CUevent_getter) + {{endif}} + {{if 'CUstream' in found_types}} + def CUstream_getter(CUstream x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUstream, CUstream_getter) + {{endif}} + {{if 'CUgraphicsResource' in found_types}} + def CUgraphicsResource_getter(CUgraphicsResource x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphicsResource, CUgraphicsResource_getter) + {{endif}} + {{if 'CUexternalMemory' in found_types}} + def CUexternalMemory_getter(CUexternalMemory x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUexternalMemory, CUexternalMemory_getter) + {{endif}} + {{if 'CUexternalSemaphore' in found_types}} + def CUexternalSemaphore_getter(CUexternalSemaphore x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUexternalSemaphore, CUexternalSemaphore_getter) + {{endif}} + {{if 'CUgraph' in found_types}} + def CUgraph_getter(CUgraph x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraph, CUgraph_getter) + {{endif}} + {{if 'CUgraphNode' in found_types}} + def CUgraphNode_getter(CUgraphNode x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphNode, CUgraphNode_getter) + {{endif}} + {{if 'CUgraphExec' in found_types}} + def CUgraphExec_getter(CUgraphExec x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphExec, CUgraphExec_getter) + {{endif}} + {{if 'CUmemoryPool' in found_types}} + def CUmemoryPool_getter(CUmemoryPool x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUmemoryPool, CUmemoryPool_getter) + {{endif}} + {{if 'CUuserObject' in found_types}} + def CUuserObject_getter(CUuserObject x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUuserObject, CUuserObject_getter) + {{endif}} + {{if 'CUgraphDeviceNode' in found_types}} + def CUgraphDeviceNode_getter(CUgraphDeviceNode x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgraphDeviceNode, CUgraphDeviceNode_getter) + {{endif}} + {{if 'CUasyncCallbackHandle' in found_types}} + def CUasyncCallbackHandle_getter(CUasyncCallbackHandle x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUasyncCallbackHandle, CUasyncCallbackHandle_getter) + {{endif}} + {{if 'CUgreenCtx' in found_types}} + def CUgreenCtx_getter(CUgreenCtx x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUgreenCtx, CUgreenCtx_getter) + {{endif}} + {{if 'CUlinkState' in found_types}} + def CUlinkState_getter(CUlinkState x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlinkState, CUlinkState_getter) + {{endif}} + {{if 'CUdevResourceDesc' in found_types}} + def CUdevResourceDesc_getter(CUdevResourceDesc x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUdevResourceDesc, CUdevResourceDesc_getter) + {{endif}} + {{if 'CUlogsCallbackHandle' in found_types}} + def CUlogsCallbackHandle_getter(CUlogsCallbackHandle x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUlogsCallbackHandle, CUlogsCallbackHandle_getter) + {{endif}} + {{if True}} + def CUeglStreamConnection_getter(CUeglStreamConnection x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUeglStreamConnection, CUeglStreamConnection_getter) + {{endif}} + {{if True}} + def EGLImageKHR_getter(EGLImageKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLImageKHR, EGLImageKHR_getter) + {{endif}} + {{if True}} + def EGLStreamKHR_getter(EGLStreamKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLStreamKHR, EGLStreamKHR_getter) + {{endif}} + {{if True}} + def EGLSyncKHR_getter(EGLSyncKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLSyncKHR, EGLSyncKHR_getter) + {{endif}} + return 0 +_add_native_handle_getters() + diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/cuda/bindings/nvjitlink.pxd index 6941f2328c..1279de9b48 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/nvjitlink.pxd @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t, uint32_t diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index a0a4d9a987..6dd8770d7a 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -1,8 +1,8 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. cimport cython # NOQA @@ -29,6 +29,15 @@ class Result(_IntEnum): ERROR_THREADPOOL = NVJITLINK_ERROR_THREADPOOL ERROR_UNRECOGNIZED_INPUT = NVJITLINK_ERROR_UNRECOGNIZED_INPUT ERROR_FINALIZE = NVJITLINK_ERROR_FINALIZE + ERROR_NULL_INPUT = NVJITLINK_ERROR_NULL_INPUT + ERROR_INCOMPATIBLE_OPTIONS = NVJITLINK_ERROR_INCOMPATIBLE_OPTIONS + ERROR_INCORRECT_INPUT_TYPE = NVJITLINK_ERROR_INCORRECT_INPUT_TYPE + ERROR_ARCH_MISMATCH = NVJITLINK_ERROR_ARCH_MISMATCH + ERROR_OUTDATED_LIBRARY = NVJITLINK_ERROR_OUTDATED_LIBRARY + ERROR_MISSING_FATBIN = NVJITLINK_ERROR_MISSING_FATBIN + ERROR_UNRECOGNIZED_ARCH = NVJITLINK_ERROR_UNRECOGNIZED_ARCH + ERROR_UNSUPPORTED_ARCH = NVJITLINK_ERROR_UNSUPPORTED_ARCH + ERROR_LTO_NOT_ENABLED = NVJITLINK_ERROR_LTO_NOT_ENABLED class InputType(_IntEnum): """See `nvJitLinkInputType`.""" diff --git a/cuda_bindings/cuda/bindings/nvrtc.pxd.in b/cuda_bindings/cuda/bindings/nvrtc.pxd.in index a839b1c566..d1af058144 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pxd.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pxd.in @@ -3,7 +3,8 @@ # This code was automatically generated with version 12.9.0. Do not modify it directly. cimport cuda.bindings.cynvrtc as cynvrtc -cimport cuda.bindings._lib.utils as utils + +include "_lib/utils.pxd" {{if 'nvrtcProgram' in found_types}} diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx.in b/cuda_bindings/cuda/bindings/nvrtc.pyx.in index d274acc996..9e565f9752 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx.in +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx.in @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # This code was automatically generated with version 12.9.0. Do not modify it directly. -from typing import List, Tuple, Any, Optional +from typing import Any, Optional from enum import IntEnum import cython import ctypes @@ -15,6 +15,10 @@ from libcpp.vector cimport vector from cpython.buffer cimport PyObject_CheckBuffer, PyObject_GetBuffer, PyBuffer_Release, PyBUF_SIMPLE, PyBUF_ANY_CONTIGUOUS from cpython.bytes cimport PyBytes_FromStringAndSize +import cuda.bindings.driver as _driver +_driver = _driver.__dict__ +include "_lib/utils.pxi" + ctypedef unsigned long long signed_char_ptr ctypedef unsigned long long unsigned_char_ptr ctypedef unsigned long long char_ptr @@ -207,7 +211,7 @@ def nvrtcGetSupportedArchs(): nvrtcResult - :py:obj:`~.NVRTC_SUCCESS` - :py:obj:`~.NVRTC_ERROR_INVALID_INPUT` - supportedArchs : List[int] + supportedArchs : list[int] sorted array of supported architectures. """ cdef vector[int] supportedArchs @@ -224,7 +228,7 @@ def nvrtcGetSupportedArchs(): {{if 'nvrtcCreateProgram' in found_functions}} @cython.embedsignature(True) -def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional[Tuple[bytes] | List[bytes]], includeNames : Optional[Tuple[bytes] | List[bytes]]): +def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional[tuple[bytes] | list[bytes]], includeNames : Optional[tuple[bytes] | list[bytes]]): """ nvrtcCreateProgram creates an instance of nvrtcProgram with the given input parameters, and sets the output parameter `prog` with it. Parameters @@ -237,10 +241,10 @@ def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional numHeaders : int Number of headers used. `numHeaders` must be greater than or equal to 0. - headers : List[bytes] + headers : list[bytes] Sources of the headers. `headers` can be `NULL` when `numHeaders` is 0. - includeNames : List[bytes] + includeNames : list[bytes] Name of each header by which they can be included in the CUDA program source. `includeNames` can be `NULL` when `numHeaders` is 0. These headers must be included with the exact names specified @@ -263,10 +267,10 @@ def nvrtcCreateProgram(char* src, char* name, int numHeaders, headers : Optional """ includeNames = [] if includeNames is None else includeNames if not all(isinstance(_x, (bytes)) for _x in includeNames): - raise TypeError("Argument 'includeNames' is not instance of type (expected Tuple[bytes] or List[bytes]") + raise TypeError("Argument 'includeNames' is not instance of type (expected tuple[bytes] or list[bytes]") headers = [] if headers is None else headers if not all(isinstance(_x, (bytes)) for _x in headers): - raise TypeError("Argument 'headers' is not instance of type (expected Tuple[bytes] or List[bytes]") + raise TypeError("Argument 'headers' is not instance of type (expected tuple[bytes] or list[bytes]") cdef nvrtcProgram prog = nvrtcProgram() if numHeaders > len(headers): raise RuntimeError("List is too small: " + str(len(headers)) + " < " + str(numHeaders)) if numHeaders > len(includeNames): raise RuntimeError("List is too small: " + str(len(includeNames)) + " < " + str(numHeaders)) @@ -318,7 +322,7 @@ def nvrtcDestroyProgram(prog): {{if 'nvrtcCompileProgram' in found_functions}} @cython.embedsignature(True) -def nvrtcCompileProgram(prog, int numOptions, options : Optional[Tuple[bytes] | List[bytes]]): +def nvrtcCompileProgram(prog, int numOptions, options : Optional[tuple[bytes] | list[bytes]]): """ nvrtcCompileProgram compiles the given program. It supports compile options listed in :py:obj:`~.Supported Compile @@ -330,7 +334,7 @@ def nvrtcCompileProgram(prog, int numOptions, options : Optional[Tuple[bytes] | CUDA Runtime Compilation program. numOptions : int Number of compiler options passed. - options : List[bytes] + options : list[bytes] Compiler options in the form of C string array. `options` can be `NULL` when `numOptions` is 0. @@ -349,7 +353,7 @@ def nvrtcCompileProgram(prog, int numOptions, options : Optional[Tuple[bytes] | """ options = [] if options is None else options if not all(isinstance(_x, (bytes)) for _x in options): - raise TypeError("Argument 'options' is not instance of type (expected Tuple[bytes] or List[bytes]") + raise TypeError("Argument 'options' is not instance of type (expected tuple[bytes] or list[bytes]") cdef cynvrtc.nvrtcProgram cyprog if prog is None: pprog = 0 @@ -1089,9 +1093,9 @@ def nvrtcSetFlowCallback(prog, callback, payload): else: pprog = int(nvrtcProgram(prog)) cyprog = pprog - cycallback = utils.HelperInputVoidPtr(callback) + cycallback = _HelperInputVoidPtr(callback) cdef void* cycallback_ptr = cycallback.cptr - cypayload = utils.HelperInputVoidPtr(payload) + cypayload = _HelperInputVoidPtr(payload) cdef void* cypayload_ptr = cypayload.cptr with nogil: err = cynvrtc.nvrtcSetFlowCallback(cyprog, cycallback_ptr, cypayload_ptr) diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/cuda/bindings/nvvm.pxd index a5a5e1ca7b..1b3bb6fdf6 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/nvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index 24729aa775..5c03f2a698 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 11.0.3 to 12.9.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. cimport cython # NOQA diff --git a/cuda_bindings/cuda/bindings/path_finder.py b/cuda_bindings/cuda/bindings/path_finder.py deleted file mode 100644 index fc6cade25f..0000000000 --- a/cuda_bindings/cuda/bindings/path_finder.py +++ /dev/null @@ -1,15 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This file is for TEMPORARY BACKWARD COMPATIBILITY only. -# cuda.bindings.path_finder is deprecated and slated to be removed in the next cuda-bindings major version release. - -from cuda.bindings._path_finder.temporary_backward_compatibility import ( - load_nvidia_dynamic_library as _load_nvidia_dynamic_library, -) -from cuda.pathfinder import SUPPORTED_NVIDIA_LIBNAMES as _SUPPORTED_LIBNAMES - -__all__ = [ - "_load_nvidia_dynamic_library", - "_SUPPORTED_LIBNAMES", -] diff --git a/cuda_bindings/cuda/bindings/runtime.pxd.in b/cuda_bindings/cuda/bindings/runtime.pxd.in index 6ff973d617..c42ad62458 100644 --- a/cuda_bindings/cuda/bindings/runtime.pxd.in +++ b/cuda_bindings/cuda/bindings/runtime.pxd.in @@ -3,7 +3,8 @@ # This code was automatically generated with version 12.9.0. Do not modify it directly. cimport cuda.bindings.cyruntime as cyruntime -cimport cuda.bindings._lib.utils as utils + +include "_lib/utils.pxd" cimport cuda.bindings.driver as driver {{if 'cudaArray_t' in found_types}} @@ -398,7 +399,7 @@ cdef class cudaArraySparseProperties: Flags will either be zero or cudaArraySparsePropertiesSingleMipTail {{endif}} {{if 'cudaArraySparseProperties.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -430,7 +431,7 @@ cdef class cudaArrayMemoryRequirements: Alignment necessary for mapping the array. {{endif}} {{if 'cudaArrayMemoryRequirements.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -617,7 +618,7 @@ cdef class cudaMemcpyNodeParams: Must be zero {{endif}} {{if 'cudaMemcpyNodeParams.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Must be zero {{endif}} {{if 'cudaMemcpyNodeParams.copyParams' in found_struct}} @@ -1277,7 +1278,7 @@ cdef class cudaFuncAttributes: cudaFuncSetAttribute {{endif}} {{if 'cudaFuncAttributes.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Reserved for future use. {{endif}} @@ -1842,11 +1843,11 @@ cdef class cudaDeviceProp: Maximum number of threads per block {{endif}} {{if 'cudaDeviceProp.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'cudaDeviceProp.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'cudaDeviceProp.clockRate' in found_struct}} @@ -1914,29 +1915,29 @@ cdef class cudaDeviceProp: or cuDeviceGetTexture1DLinearMaxWidth() instead. {{endif}} {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} - maxTexture2D : List[int] + maxTexture2D : list[int] Maximum 2D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DMipmap' in found_struct}} - maxTexture2DMipmap : List[int] + maxTexture2DMipmap : list[int] Maximum 2D mipmapped texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DLinear' in found_struct}} - maxTexture2DLinear : List[int] + maxTexture2DLinear : list[int] Maximum dimensions (width, height, pitch) for 2D textures bound to pitched memory {{endif}} {{if 'cudaDeviceProp.maxTexture2DGather' in found_struct}} - maxTexture2DGather : List[int] + maxTexture2DGather : list[int] Maximum 2D texture dimensions if texture gather operations have to be performed {{endif}} {{if 'cudaDeviceProp.maxTexture3D' in found_struct}} - maxTexture3D : List[int] + maxTexture3D : list[int] Maximum 3D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture3DAlt' in found_struct}} - maxTexture3DAlt : List[int] + maxTexture3DAlt : list[int] Maximum alternate 3D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTextureCubemap' in found_struct}} @@ -1944,15 +1945,15 @@ cdef class cudaDeviceProp: Maximum Cubemap texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture1DLayered' in found_struct}} - maxTexture1DLayered : List[int] + maxTexture1DLayered : list[int] Maximum 1D layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DLayered' in found_struct}} - maxTexture2DLayered : List[int] + maxTexture2DLayered : list[int] Maximum 2D layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTextureCubemapLayered' in found_struct}} - maxTextureCubemapLayered : List[int] + maxTextureCubemapLayered : list[int] Maximum Cubemap layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface1D' in found_struct}} @@ -1960,19 +1961,19 @@ cdef class cudaDeviceProp: Maximum 1D surface size {{endif}} {{if 'cudaDeviceProp.maxSurface2D' in found_struct}} - maxSurface2D : List[int] + maxSurface2D : list[int] Maximum 2D surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface3D' in found_struct}} - maxSurface3D : List[int] + maxSurface3D : list[int] Maximum 3D surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface1DLayered' in found_struct}} - maxSurface1DLayered : List[int] + maxSurface1DLayered : list[int] Maximum 1D layered surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface2DLayered' in found_struct}} - maxSurface2DLayered : List[int] + maxSurface2DLayered : list[int] Maximum 2D layered surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurfaceCubemap' in found_struct}} @@ -1980,7 +1981,7 @@ cdef class cudaDeviceProp: Maximum Cubemap surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurfaceCubemapLayered' in found_struct}} - maxSurfaceCubemapLayered : List[int] + maxSurfaceCubemapLayered : list[int] Maximum Cubemap layered surface dimensions {{endif}} {{if 'cudaDeviceProp.surfaceAlignment' in found_struct}} @@ -2194,7 +2195,7 @@ cdef class cudaDeviceProp: Indicates device supports unified pointers {{endif}} {{if 'cudaDeviceProp.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Reserved for future use {{endif}} @@ -2591,7 +2592,7 @@ cdef class anon_struct17: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2635,7 +2636,7 @@ cdef class cudaExternalSemaphoreSignalParams: all other types of cudaExternalSemaphore_t, flags must be zero. {{endif}} {{if 'cudaExternalSemaphoreSignalParams.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2731,7 +2732,7 @@ cdef class anon_struct20: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2775,7 +2776,7 @@ cdef class cudaExternalSemaphoreWaitParams: all other types of cudaExternalSemaphore_t, flags must be zero. {{endif}} {{if 'cudaExternalSemaphoreWaitParams.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -2868,7 +2869,7 @@ cdef class cudaKernelNodeParams: cdef dim3 _blockDim {{endif}} {{if 'cudaKernelNodeParams.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{endif}} {{if 'cudaKernelNodeParamsV2' in found_struct}} @@ -2918,7 +2919,7 @@ cdef class cudaKernelNodeParamsV2: cdef dim3 _blockDim {{endif}} {{if 'cudaKernelNodeParamsV2.kernelParams' in found_struct}} - cdef utils.HelperKernelParams _cykernelParams + cdef _HelperKernelParams _cykernelParams {{endif}} {{endif}} {{if 'cudaExternalSemaphoreSignalNodeParams' in found_struct}} @@ -3224,11 +3225,11 @@ cdef class cudaGraphNodeParams: Type of the node {{endif}} {{if 'cudaGraphNodeParams.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'cudaGraphNodeParams.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'cudaGraphNodeParams.kernel' in found_struct}} @@ -3958,7 +3959,7 @@ cdef class cudaTextureDesc: Attributes ---------- {{if 'cudaTextureDesc.addressMode' in found_struct}} - addressMode : List[cudaTextureAddressMode] + addressMode : list[cudaTextureAddressMode] Texture address mode for up to 3 dimensions {{endif}} {{if 'cudaTextureDesc.filterMode' in found_struct}} @@ -3974,7 +3975,7 @@ cdef class cudaTextureDesc: Perform sRGB->linear conversion during texture read {{endif}} {{if 'cudaTextureDesc.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Texture Border Color {{endif}} {{if 'cudaTextureDesc.normalizedCoords' in found_struct}} @@ -4052,7 +4053,7 @@ cdef class cudaEglPlaneDesc_st: Channel Format Descriptor {{endif}} {{if True}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use {{endif}} @@ -4074,11 +4075,11 @@ cdef class anon_union11: Attributes ---------- {{if True}} - pArray : List[cudaArray_t] + pArray : list[cudaArray_t] {{endif}} {{if True}} - pPitch : List[cudaPitchedPtr] + pPitch : list[cudaPitchedPtr] {{endif}} @@ -4109,7 +4110,7 @@ cdef class cudaEglFrame_st: {{endif}} {{if True}} - planeDesc : List[cudaEglPlaneDesc] + planeDesc : list[cudaEglPlaneDesc] CUDA EGL Plane Descriptor cudaEglPlaneDesc {{endif}} {{if True}} @@ -4691,7 +4692,7 @@ cdef class cudaEglPlaneDesc(cudaEglPlaneDesc_st): Channel Format Descriptor {{endif}} {{if True}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use {{endif}} @@ -4722,7 +4723,7 @@ cdef class cudaEglFrame(cudaEglFrame_st): {{endif}} {{if True}} - planeDesc : List[cudaEglPlaneDesc] + planeDesc : list[cudaEglPlaneDesc] CUDA EGL Plane Descriptor cudaEglPlaneDesc {{endif}} {{if True}} diff --git a/cuda_bindings/cuda/bindings/runtime.pyx.in b/cuda_bindings/cuda/bindings/runtime.pyx.in index 1f1fc72727..0e9449f632 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx.in +++ b/cuda_bindings/cuda/bindings/runtime.pyx.in @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # This code was automatically generated with version 12.9.0. Do not modify it directly. -from typing import List, Tuple, Any, Optional +from typing import Any, Optional from enum import IntEnum import cython import ctypes @@ -17,6 +17,10 @@ from cpython.bytes cimport PyBytes_FromStringAndSize import cuda.bindings.driver from libcpp.map cimport map +import cuda.bindings.driver as _driver +_driver = _driver.__dict__ +include "_lib/utils.pxi" + ctypedef unsigned long long signed_char_ptr ctypedef unsigned long long unsigned_char_ptr ctypedef unsigned long long char_ptr @@ -6091,7 +6095,7 @@ cdef class cudaArraySparseProperties: Flags will either be zero or cudaArraySparsePropertiesSingleMipTail {{endif}} {{if 'cudaArraySparseProperties.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -6208,7 +6212,7 @@ cdef class cudaArrayMemoryRequirements: Alignment necessary for mapping the array. {{endif}} {{if 'cudaArrayMemoryRequirements.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -6354,7 +6358,7 @@ cdef class cudaPitchedPtr: return self._pvt_ptr[0].ptr @ptr.setter def ptr(self, ptr): - _cptr = utils.HelperInputVoidPtr(ptr) + _cptr = _HelperInputVoidPtr(ptr) self._pvt_ptr[0].ptr = _cptr.cptr {{endif}} {{if 'cudaPitchedPtr.pitch' in found_struct}} @@ -6785,7 +6789,7 @@ cdef class cudaMemcpyNodeParams: Must be zero {{endif}} {{if 'cudaMemcpyNodeParams.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Must be zero {{endif}} {{if 'cudaMemcpyNodeParams.copyParams' in found_struct}} @@ -7191,7 +7195,7 @@ cdef class cudaMemsetParams: return self._pvt_ptr[0].dst @dst.setter def dst(self, dst): - _cdst = utils.HelperInputVoidPtr(dst) + _cdst = _HelperInputVoidPtr(dst) self._pvt_ptr[0].dst = _cdst.cptr {{endif}} {{if 'cudaMemsetParams.pitch' in found_struct}} @@ -7332,7 +7336,7 @@ cdef class cudaMemsetParamsV2: return self._pvt_ptr[0].dst @dst.setter def dst(self, dst): - _cdst = utils.HelperInputVoidPtr(dst) + _cdst = _HelperInputVoidPtr(dst) self._pvt_ptr[0].dst = _cdst.cptr {{endif}} {{if 'cudaMemsetParamsV2.pitch' in found_struct}} @@ -7474,7 +7478,7 @@ cdef class cudaAccessPolicyWindow: return self._pvt_ptr[0].base_ptr @base_ptr.setter def base_ptr(self, base_ptr): - _cbase_ptr = utils.HelperInputVoidPtr(base_ptr) + _cbase_ptr = _HelperInputVoidPtr(base_ptr) self._pvt_ptr[0].base_ptr = _cbase_ptr.cptr {{endif}} {{if 'cudaAccessPolicyWindow.num_bytes' in found_struct}} @@ -7591,7 +7595,7 @@ cdef class cudaHostNodeParams: return self._pvt_ptr[0].userData @userData.setter def userData(self, userData): - _cuserData = utils.HelperInputVoidPtr(userData) + _cuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = _cuserData.cptr {{endif}} {{endif}} @@ -7672,7 +7676,7 @@ cdef class cudaHostNodeParamsV2: return self._pvt_ptr[0].userData @userData.setter def userData(self, userData): - _cuserData = utils.HelperInputVoidPtr(userData) + _cuserData = _HelperInputVoidPtr(userData) self._pvt_ptr[0].userData = _cuserData.cptr {{endif}} {{endif}} @@ -7858,7 +7862,7 @@ cdef class anon_struct3: return self._pvt_ptr[0].res.linear.devPtr @devPtr.setter def devPtr(self, devPtr): - _cdevPtr = utils.HelperInputVoidPtr(devPtr) + _cdevPtr = _HelperInputVoidPtr(devPtr) self._pvt_ptr[0].res.linear.devPtr = _cdevPtr.cptr {{endif}} {{if 'cudaResourceDesc.res.linear.desc' in found_struct}} @@ -7964,7 +7968,7 @@ cdef class anon_struct4: return self._pvt_ptr[0].res.pitch2D.devPtr @devPtr.setter def devPtr(self, devPtr): - _cdevPtr = utils.HelperInputVoidPtr(devPtr) + _cdevPtr = _HelperInputVoidPtr(devPtr) self._pvt_ptr[0].res.pitch2D.devPtr = _cdevPtr.cptr {{endif}} {{if 'cudaResourceDesc.res.pitch2D.desc' in found_struct}} @@ -8471,7 +8475,7 @@ cdef class cudaPointerAttributes: return self._pvt_ptr[0].devicePointer @devicePointer.setter def devicePointer(self, devicePointer): - _cdevicePointer = utils.HelperInputVoidPtr(devicePointer) + _cdevicePointer = _HelperInputVoidPtr(devicePointer) self._pvt_ptr[0].devicePointer = _cdevicePointer.cptr {{endif}} {{if 'cudaPointerAttributes.hostPointer' in found_struct}} @@ -8480,7 +8484,7 @@ cdef class cudaPointerAttributes: return self._pvt_ptr[0].hostPointer @hostPointer.setter def hostPointer(self, hostPointer): - _chostPointer = utils.HelperInputVoidPtr(hostPointer) + _chostPointer = _HelperInputVoidPtr(hostPointer) self._pvt_ptr[0].hostPointer = _chostPointer.cptr {{endif}} {{endif}} @@ -8594,7 +8598,7 @@ cdef class cudaFuncAttributes: cudaFuncSetAttribute {{endif}} {{if 'cudaFuncAttributes.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Reserved for future use. {{endif}} @@ -9149,7 +9153,7 @@ cdef class cudaMemPoolProps: return self._pvt_ptr[0].win32SecurityAttributes @win32SecurityAttributes.setter def win32SecurityAttributes(self, win32SecurityAttributes): - _cwin32SecurityAttributes = utils.HelperInputVoidPtr(win32SecurityAttributes) + _cwin32SecurityAttributes = _HelperInputVoidPtr(win32SecurityAttributes) self._pvt_ptr[0].win32SecurityAttributes = _cwin32SecurityAttributes.cptr {{endif}} {{if 'cudaMemPoolProps.maxSize' in found_struct}} @@ -9378,7 +9382,7 @@ cdef class cudaMemAllocNodeParams: return self._pvt_ptr[0].dptr @dptr.setter def dptr(self, dptr): - _cdptr = utils.HelperInputVoidPtr(dptr) + _cdptr = _HelperInputVoidPtr(dptr) self._pvt_ptr[0].dptr = _cdptr.cptr {{endif}} {{endif}} @@ -9527,7 +9531,7 @@ cdef class cudaMemAllocNodeParamsV2: return self._pvt_ptr[0].dptr @dptr.setter def dptr(self, dptr): - _cdptr = utils.HelperInputVoidPtr(dptr) + _cdptr = _HelperInputVoidPtr(dptr) self._pvt_ptr[0].dptr = _cdptr.cptr {{endif}} {{endif}} @@ -9578,7 +9582,7 @@ cdef class cudaMemFreeNodeParams: return self._pvt_ptr[0].dptr @dptr.setter def dptr(self, dptr): - _cdptr = utils.HelperInputVoidPtr(dptr) + _cdptr = _HelperInputVoidPtr(dptr) self._pvt_ptr[0].dptr = _cdptr.cptr {{endif}} {{endif}} @@ -9861,7 +9865,7 @@ cdef class anon_struct5: return self._pvt_ptr[0].op.ptr.ptr @ptr.setter def ptr(self, ptr): - _cptr = utils.HelperInputVoidPtr(ptr) + _cptr = _HelperInputVoidPtr(ptr) self._pvt_ptr[0].op.ptr.ptr = _cptr.cptr {{endif}} {{if 'cudaMemcpy3DOperand.op.ptr.rowLength' in found_struct}} @@ -10341,11 +10345,11 @@ cdef class cudaDeviceProp: Maximum number of threads per block {{endif}} {{if 'cudaDeviceProp.maxThreadsDim' in found_struct}} - maxThreadsDim : List[int] + maxThreadsDim : list[int] Maximum size of each dimension of a block {{endif}} {{if 'cudaDeviceProp.maxGridSize' in found_struct}} - maxGridSize : List[int] + maxGridSize : list[int] Maximum size of each dimension of a grid {{endif}} {{if 'cudaDeviceProp.clockRate' in found_struct}} @@ -10413,29 +10417,29 @@ cdef class cudaDeviceProp: or cuDeviceGetTexture1DLinearMaxWidth() instead. {{endif}} {{if 'cudaDeviceProp.maxTexture2D' in found_struct}} - maxTexture2D : List[int] + maxTexture2D : list[int] Maximum 2D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DMipmap' in found_struct}} - maxTexture2DMipmap : List[int] + maxTexture2DMipmap : list[int] Maximum 2D mipmapped texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DLinear' in found_struct}} - maxTexture2DLinear : List[int] + maxTexture2DLinear : list[int] Maximum dimensions (width, height, pitch) for 2D textures bound to pitched memory {{endif}} {{if 'cudaDeviceProp.maxTexture2DGather' in found_struct}} - maxTexture2DGather : List[int] + maxTexture2DGather : list[int] Maximum 2D texture dimensions if texture gather operations have to be performed {{endif}} {{if 'cudaDeviceProp.maxTexture3D' in found_struct}} - maxTexture3D : List[int] + maxTexture3D : list[int] Maximum 3D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture3DAlt' in found_struct}} - maxTexture3DAlt : List[int] + maxTexture3DAlt : list[int] Maximum alternate 3D texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTextureCubemap' in found_struct}} @@ -10443,15 +10447,15 @@ cdef class cudaDeviceProp: Maximum Cubemap texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture1DLayered' in found_struct}} - maxTexture1DLayered : List[int] + maxTexture1DLayered : list[int] Maximum 1D layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTexture2DLayered' in found_struct}} - maxTexture2DLayered : List[int] + maxTexture2DLayered : list[int] Maximum 2D layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxTextureCubemapLayered' in found_struct}} - maxTextureCubemapLayered : List[int] + maxTextureCubemapLayered : list[int] Maximum Cubemap layered texture dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface1D' in found_struct}} @@ -10459,19 +10463,19 @@ cdef class cudaDeviceProp: Maximum 1D surface size {{endif}} {{if 'cudaDeviceProp.maxSurface2D' in found_struct}} - maxSurface2D : List[int] + maxSurface2D : list[int] Maximum 2D surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface3D' in found_struct}} - maxSurface3D : List[int] + maxSurface3D : list[int] Maximum 3D surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface1DLayered' in found_struct}} - maxSurface1DLayered : List[int] + maxSurface1DLayered : list[int] Maximum 1D layered surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurface2DLayered' in found_struct}} - maxSurface2DLayered : List[int] + maxSurface2DLayered : list[int] Maximum 2D layered surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurfaceCubemap' in found_struct}} @@ -10479,7 +10483,7 @@ cdef class cudaDeviceProp: Maximum Cubemap surface dimensions {{endif}} {{if 'cudaDeviceProp.maxSurfaceCubemapLayered' in found_struct}} - maxSurfaceCubemapLayered : List[int] + maxSurfaceCubemapLayered : list[int] Maximum Cubemap layered surface dimensions {{endif}} {{if 'cudaDeviceProp.surfaceAlignment' in found_struct}} @@ -10693,7 +10697,7 @@ cdef class cudaDeviceProp: Indicates device supports unified pointers {{endif}} {{if 'cudaDeviceProp.reserved' in found_struct}} - reserved : List[int] + reserved : list[int] Reserved for future use {{endif}} @@ -12285,7 +12289,7 @@ cdef class anon_struct7: return self._pvt_ptr[0].handle.win32.handle @handle.setter def handle(self, handle): - _chandle = utils.HelperInputVoidPtr(handle) + _chandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = _chandle.cptr {{endif}} {{if 'cudaExternalMemoryHandleDesc.handle.win32.name' in found_struct}} @@ -12294,7 +12298,7 @@ cdef class anon_struct7: return self._pvt_ptr[0].handle.win32.name @name.setter def name(self, name): - _cname = utils.HelperInputVoidPtr(name) + _cname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = _cname.cptr {{endif}} {{endif}} @@ -12380,7 +12384,7 @@ cdef class anon_union2: return self._pvt_ptr[0].handle.nvSciBufObject @nvSciBufObject.setter def nvSciBufObject(self, nvSciBufObject): - _cnvSciBufObject = utils.HelperInputVoidPtr(nvSciBufObject) + _cnvSciBufObject = _HelperInputVoidPtr(nvSciBufObject) self._pvt_ptr[0].handle.nvSciBufObject = _cnvSciBufObject.cptr {{endif}} {{endif}} @@ -12764,7 +12768,7 @@ cdef class anon_struct8: return self._pvt_ptr[0].handle.win32.handle @handle.setter def handle(self, handle): - _chandle = utils.HelperInputVoidPtr(handle) + _chandle = _HelperInputVoidPtr(handle) self._pvt_ptr[0].handle.win32.handle = _chandle.cptr {{endif}} {{if 'cudaExternalSemaphoreHandleDesc.handle.win32.name' in found_struct}} @@ -12773,7 +12777,7 @@ cdef class anon_struct8: return self._pvt_ptr[0].handle.win32.name @name.setter def name(self, name): - _cname = utils.HelperInputVoidPtr(name) + _cname = _HelperInputVoidPtr(name) self._pvt_ptr[0].handle.win32.name = _cname.cptr {{endif}} {{endif}} @@ -12859,7 +12863,7 @@ cdef class anon_union3: return self._pvt_ptr[0].handle.nvSciSyncObj @nvSciSyncObj.setter def nvSciSyncObj(self, nvSciSyncObj): - _cnvSciSyncObj = utils.HelperInputVoidPtr(nvSciSyncObj) + _cnvSciSyncObj = _HelperInputVoidPtr(nvSciSyncObj) self._pvt_ptr[0].handle.nvSciSyncObj = _cnvSciSyncObj.cptr {{endif}} {{endif}} @@ -13055,7 +13059,7 @@ cdef class anon_union6: return self._pvt_ptr[0].params.nvSciSync.fence @fence.setter def fence(self, fence): - _cfence = utils.HelperInputVoidPtr(fence) + _cfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = _cfence.cptr {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.nvSciSync.reserved' in found_struct}} @@ -13132,7 +13136,7 @@ cdef class anon_struct17: {{endif}} {{if 'cudaExternalSemaphoreSignalParams.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -13246,7 +13250,7 @@ cdef class cudaExternalSemaphoreSignalParams: all other types of cudaExternalSemaphore_t, flags must be zero. {{endif}} {{if 'cudaExternalSemaphoreSignalParams.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -13417,7 +13421,7 @@ cdef class anon_union7: return self._pvt_ptr[0].params.nvSciSync.fence @fence.setter def fence(self, fence): - _cfence = utils.HelperInputVoidPtr(fence) + _cfence = _HelperInputVoidPtr(fence) self._pvt_ptr[0].params.nvSciSync.fence = _cfence.cptr {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.nvSciSync.reserved' in found_struct}} @@ -13512,7 +13516,7 @@ cdef class anon_struct20: {{endif}} {{if 'cudaExternalSemaphoreWaitParams.params.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -13626,7 +13630,7 @@ cdef class cudaExternalSemaphoreWaitParams: all other types of cudaExternalSemaphore_t, flags must be zero. {{endif}} {{if 'cudaExternalSemaphoreWaitParams.reserved' in found_struct}} - reserved : List[unsigned int] + reserved : list[unsigned int] {{endif}} @@ -13773,7 +13777,7 @@ cdef class cudalibraryHostUniversalFunctionAndDataTable: return self._pvt_ptr[0].functionTable @functionTable.setter def functionTable(self, functionTable): - _cfunctionTable = utils.HelperInputVoidPtr(functionTable) + _cfunctionTable = _HelperInputVoidPtr(functionTable) self._pvt_ptr[0].functionTable = _cfunctionTable.cptr {{endif}} {{if 'cudalibraryHostUniversalFunctionAndDataTable.functionWindowSize' in found_struct}} @@ -13790,7 +13794,7 @@ cdef class cudalibraryHostUniversalFunctionAndDataTable: return self._pvt_ptr[0].dataTable @dataTable.setter def dataTable(self, dataTable): - _cdataTable = utils.HelperInputVoidPtr(dataTable) + _cdataTable = _HelperInputVoidPtr(dataTable) self._pvt_ptr[0].dataTable = _cdataTable.cptr {{endif}} {{if 'cudalibraryHostUniversalFunctionAndDataTable.dataWindowSize' in found_struct}} @@ -13905,7 +13909,7 @@ cdef class cudaKernelNodeParams: return self._pvt_ptr[0].func @func.setter def func(self, func): - _cfunc = utils.HelperInputVoidPtr(func) + _cfunc = _HelperInputVoidPtr(func) self._pvt_ptr[0].func = _cfunc.cptr {{endif}} {{if 'cudaKernelNodeParams.gridDim' in found_struct}} @@ -13938,7 +13942,7 @@ cdef class cudaKernelNodeParams: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'cudaKernelNodeParams.extra' in found_struct}} @@ -14053,7 +14057,7 @@ cdef class cudaKernelNodeParamsV2: return self._pvt_ptr[0].func @func.setter def func(self, func): - _cfunc = utils.HelperInputVoidPtr(func) + _cfunc = _HelperInputVoidPtr(func) self._pvt_ptr[0].func = _cfunc.cptr {{endif}} {{if 'cudaKernelNodeParamsV2.gridDim' in found_struct}} @@ -14086,7 +14090,7 @@ cdef class cudaKernelNodeParamsV2: return self._pvt_ptr[0].kernelParams @kernelParams.setter def kernelParams(self, kernelParams): - self._cykernelParams = utils.HelperKernelParams(kernelParams) + self._cykernelParams = _HelperKernelParams(kernelParams) self._pvt_ptr[0].kernelParams = self._cykernelParams.ckernelParams {{endif}} {{if 'cudaKernelNodeParamsV2.extra' in found_struct}} @@ -14956,11 +14960,11 @@ cdef class cudaGraphNodeParams: Type of the node {{endif}} {{if 'cudaGraphNodeParams.reserved0' in found_struct}} - reserved0 : List[int] + reserved0 : list[int] Reserved. Must be zero. {{endif}} {{if 'cudaGraphNodeParams.reserved1' in found_struct}} - reserved1 : List[long long] + reserved1 : list[long long] Padding. Unused bytes must be zero. {{endif}} {{if 'cudaGraphNodeParams.kernel' in found_struct}} @@ -15737,7 +15741,7 @@ cdef class anon_struct21: return self._pvt_ptr[0].updateData.param.pValue @pValue.setter def pValue(self, pValue): - _cpValue = utils.HelperInputVoidPtr(pValue) + _cpValue = _HelperInputVoidPtr(pValue) self._pvt_ptr[0].updateData.param.pValue = _cpValue.cptr {{endif}} {{if 'cudaGraphKernelNodeUpdate.updateData.param.offset' in found_struct}} @@ -17070,7 +17074,7 @@ cdef class cudaTextureDesc: Attributes ---------- {{if 'cudaTextureDesc.addressMode' in found_struct}} - addressMode : List[cudaTextureAddressMode] + addressMode : list[cudaTextureAddressMode] Texture address mode for up to 3 dimensions {{endif}} {{if 'cudaTextureDesc.filterMode' in found_struct}} @@ -17086,7 +17090,7 @@ cdef class cudaTextureDesc: Perform sRGB->linear conversion during texture read {{endif}} {{if 'cudaTextureDesc.borderColor' in found_struct}} - borderColor : List[float] + borderColor : list[float] Texture Border Color {{endif}} {{if 'cudaTextureDesc.normalizedCoords' in found_struct}} @@ -17367,7 +17371,7 @@ cdef class cudaEglPlaneDesc_st: Channel Format Descriptor {{endif}} {{if True}} - reserved : List[unsigned int] + reserved : list[unsigned int] Reserved for future use {{endif}} @@ -17502,11 +17506,11 @@ cdef class anon_union11: Attributes ---------- {{if True}} - pArray : List[cudaArray_t] + pArray : list[cudaArray_t] {{endif}} {{if True}} - pPitch : List[cudaPitchedPtr] + pPitch : list[cudaPitchedPtr] {{endif}} @@ -17547,7 +17551,7 @@ cdef class anon_union11: def pArray(self): return [cudaArray_t(init_value=_pArray) for _pArray in self._pvt_ptr[0].frame.pArray] @pArray.setter - def pArray(self, pArray : List[cudaArray_t]): + def pArray(self, pArray : list[cudaArray_t]): if len(pArray) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pArray)) pArray = [int(_pArray) for _pArray in pArray] @@ -17563,7 +17567,7 @@ cdef class anon_union11: string.memcpy(out_pPitch[_idx].getPtr(), &self._pvt_ptr[0].frame.pPitch[_idx], sizeof(cyruntime.cudaPitchedPtr)) return out_pPitch @pPitch.setter - def pPitch(self, pPitch : List[cudaPitchedPtr]): + def pPitch(self, pPitch : list[cudaPitchedPtr]): if len(pPitch) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(pPitch)) for _idx in range(len(pPitch)): @@ -17591,7 +17595,7 @@ cdef class cudaEglFrame_st: {{endif}} {{if True}} - planeDesc : List[cudaEglPlaneDesc] + planeDesc : list[cudaEglPlaneDesc] CUDA EGL Plane Descriptor cudaEglPlaneDesc {{endif}} {{if True}} @@ -17680,7 +17684,7 @@ cdef class cudaEglFrame_st: string.memcpy(out_planeDesc[_idx].getPtr(), &self._pvt_ptr[0].planeDesc[_idx], sizeof(cyruntime.cudaEglPlaneDesc)) return out_planeDesc @planeDesc.setter - def planeDesc(self, planeDesc : List[cudaEglPlaneDesc]): + def planeDesc(self, planeDesc : list[cudaEglPlaneDesc]): if len(planeDesc) != 3: raise IndexError('not enough values found during array assignment, expected 3, got', len(planeDesc)) for _idx in range(len(planeDesc)): @@ -18269,7 +18273,7 @@ def cudaDeviceGetTexture1DLinearMaxWidth(fmtDesc : Optional[cudaChannelFormatDes :py:obj:`~.cuDeviceGetTexture1DLinearMaxWidth` """ cdef size_t maxWidthInElements = 0 - cdef cyruntime.cudaChannelFormatDesc* cyfmtDesc_ptr = fmtDesc._pvt_ptr if fmtDesc != None else NULL + cdef cyruntime.cudaChannelFormatDesc* cyfmtDesc_ptr = fmtDesc._pvt_ptr if fmtDesc is not None else NULL with nogil: err = cyruntime.cudaDeviceGetTexture1DLinearMaxWidth(&maxWidthInElements, cyfmtDesc_ptr, device) if err != cyruntime.cudaSuccess: @@ -18657,7 +18661,7 @@ def cudaIpcGetMemHandle(devPtr): :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaIpcGetEventHandle`, :py:obj:`~.cudaIpcOpenEventHandle`, :py:obj:`~.cudaIpcOpenMemHandle`, :py:obj:`~.cudaIpcCloseMemHandle`, :py:obj:`~.cuIpcGetMemHandle` """ cdef cudaIpcMemHandle_t handle = cudaIpcMemHandle_t() - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaIpcGetMemHandle(handle._pvt_ptr, cydevPtr_ptr) @@ -18775,7 +18779,7 @@ def cudaIpcCloseMemHandle(devPtr): -------- :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaIpcGetEventHandle`, :py:obj:`~.cudaIpcOpenEventHandle`, :py:obj:`~.cudaIpcGetMemHandle`, :py:obj:`~.cudaIpcOpenMemHandle`, :py:obj:`~.cuIpcCloseMemHandle` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaIpcCloseMemHandle(cydevPtr_ptr) @@ -18890,7 +18894,7 @@ def cudaDeviceRegisterAsyncNotification(int device, callbackFunc, userData): else: pcallbackFunc = int(cudaAsyncCallback(callbackFunc)) cycallbackFunc = pcallbackFunc - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cudaAsyncCallbackData *cbData = NULL @@ -20106,7 +20110,7 @@ def cudaDeviceGetNvSciSyncAttributes(nvSciSyncAttrList, int device, int flags): -------- :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` """ - cynvSciSyncAttrList = utils.HelperInputVoidPtr(nvSciSyncAttrList) + cynvSciSyncAttrList = _HelperInputVoidPtr(nvSciSyncAttrList) cdef void* cynvSciSyncAttrList_ptr = cynvSciSyncAttrList.cptr with nogil: err = cyruntime.cudaDeviceGetNvSciSyncAttributes(cynvSciSyncAttrList_ptr, device, flags) @@ -20199,7 +20203,7 @@ def cudaChooseDevice(prop : Optional[cudaDeviceProp]): :py:obj:`~.cudaGetDeviceCount`, :py:obj:`~.cudaGetDevice`, :py:obj:`~.cudaSetDevice`, :py:obj:`~.cudaGetDeviceProperties`, :py:obj:`~.cudaInitDevice` """ cdef int device = 0 - cdef cyruntime.cudaDeviceProp* cyprop_ptr = prop._pvt_ptr if prop != None else NULL + cdef cyruntime.cudaDeviceProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL with nogil: err = cyruntime.cudaChooseDevice(&device, cyprop_ptr) if err != cyruntime.cudaSuccess: @@ -20940,7 +20944,7 @@ def cudaStreamSetAttribute(hStream, attr not None : cudaStreamAttrID, value : Op phStream = int(cudaStream_t(hStream)) cyhStream = phStream cdef cyruntime.cudaStreamAttrID cyattr = attr.value - cdef cyruntime.cudaStreamAttrValue* cyvalue_ptr = value._pvt_ptr if value != None else NULL + cdef cyruntime.cudaStreamAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cyruntime.cudaStreamSetAttribute(cyhStream, cyattr, cyvalue_ptr) return (_dict_cudaError_t[err],) @@ -21144,7 +21148,7 @@ def cudaStreamAddCallback(stream, callback, userData, unsigned int flags): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cudaStreamCallbackData *cbData = NULL @@ -21343,7 +21347,7 @@ def cudaStreamAttachMemAsync(stream, devPtr, size_t length, unsigned int flags): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaStreamAttachMemAsync(cystream, cydevPtr_ptr, length, flags) @@ -21410,7 +21414,7 @@ def cudaStreamBeginCapture(stream, mode not None : cudaStreamCaptureMode): {{if 'cudaStreamBeginCaptureToGraph' in found_functions}} @cython.embedsignature(True) -def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, mode not None : cudaStreamCaptureMode): +def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, mode not None : cudaStreamCaptureMode): """ Begins graph capture on a stream to an existing graph. Begin graph capture on `stream`. When a stream is in capture mode, all @@ -21435,10 +21439,10 @@ def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[Tuple[c Stream in which to initiate capture. graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to capture into. - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the first node captured in the stream. Can be NULL if numDependencies is 0. - dependencyData : List[:py:obj:`~.cudaGraphEdgeData`] + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array of data associated with each dependency. numDependencies : size_t Number of dependencies. @@ -21462,10 +21466,10 @@ def cudaStreamBeginCaptureToGraph(stream, graph, dependencies : Optional[Tuple[c """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -21740,7 +21744,7 @@ def cudaStreamGetCaptureInfo(stream): are or become unreachable from the original stream at :py:obj:`~.cudaStreamEndCapture` due to direct actions on the graph do not trigger :py:obj:`~.cudaErrorStreamCaptureUnjoined`. - dependencies_out : List[:py:obj:`~.cudaGraphNode_t`] + dependencies_out : list[:py:obj:`~.cudaGraphNode_t`] Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this set of nodes, absent operations such as event wait which modify this set. The @@ -21829,7 +21833,7 @@ def cudaStreamGetCaptureInfo_v3(stream): are or become unreachable from the original stream at :py:obj:`~.cudaStreamEndCapture` due to direct actions on the graph do not trigger :py:obj:`~.cudaErrorStreamCaptureUnjoined`. - dependencies_out : List[:py:obj:`~.cudaGraphNode_t`] + dependencies_out : list[:py:obj:`~.cudaGraphNode_t`] Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this set of nodes, absent operations such as event wait which modify this set. The @@ -21838,7 +21842,7 @@ def cudaStreamGetCaptureInfo_v3(stream): be copied out and are valid until they or the graph is destroyed. The driver-owned array may also be passed directly to APIs that operate on the graph (not the stream) without copying. - edgeData_out : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData_out : list[:py:obj:`~.cudaGraphEdgeData`] Optional location to store a pointer to an array of graph edge data. This array parallels `dependencies_out`; the next node to be added has an edge to `dependencies_out`[i] with annotation @@ -21883,7 +21887,7 @@ def cudaStreamGetCaptureInfo_v3(stream): {{if 'cudaStreamUpdateCaptureDependencies' in found_functions}} @cython.embedsignature(True) -def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, unsigned int flags): +def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, unsigned int flags): """ Update the set of dependencies in a capturing stream (11.3+) Modifies the dependency set of a capturing stream. The dependency set @@ -21911,7 +21915,7 @@ def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cu ---------- stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to update - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] The set of dependencies to add numDependencies : size_t The size of the dependencies array @@ -21929,7 +21933,7 @@ def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cu """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaStream_t cystream if stream is None: pstream = 0 @@ -21959,7 +21963,7 @@ def cudaStreamUpdateCaptureDependencies(stream, dependencies : Optional[Tuple[cu {{if 'cudaStreamUpdateCaptureDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cudaStreamUpdateCaptureDependencies_v2(stream, dependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, unsigned int flags): +def cudaStreamUpdateCaptureDependencies_v2(stream, dependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, unsigned int flags): """ Update the set of dependencies in a capturing stream (12.3+) Modifies the dependency set of a capturing stream. The dependency set @@ -21983,9 +21987,9 @@ def cudaStreamUpdateCaptureDependencies_v2(stream, dependencies : Optional[Tuple ---------- stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to update - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] The set of dependencies to add - dependencyData : List[:py:obj:`~.cudaGraphEdgeData`] + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array of data associated with each dependency. numDependencies : size_t The size of the dependencies array @@ -22003,10 +22007,10 @@ def cudaStreamUpdateCaptureDependencies_v2(stream, dependencies : Optional[Tuple """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in dependencies): - raise TypeError("Argument 'dependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaStream_t cystream if stream is None: pstream = 0 @@ -22668,7 +22672,7 @@ def cudaImportExternalMemory(memHandleDesc : Optional[cudaExternalMemoryHandleDe and Cache Control" chapter from Vulkan specification. """ cdef cudaExternalMemory_t extMem_out = cudaExternalMemory_t() - cdef cyruntime.cudaExternalMemoryHandleDesc* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc != None else NULL + cdef cyruntime.cudaExternalMemoryHandleDesc* cymemHandleDesc_ptr = memHandleDesc._pvt_ptr if memHandleDesc is not None else NULL with nogil: err = cyruntime.cudaImportExternalMemory(extMem_out._pvt_ptr, cymemHandleDesc_ptr) if err != cyruntime.cudaSuccess: @@ -22736,7 +22740,7 @@ def cudaExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[cudaExternal pextMem = int(cudaExternalMemory_t(extMem)) cyextMem = pextMem cdef void_ptr devPtr = 0 - cdef cyruntime.cudaExternalMemoryBufferDesc* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc != None else NULL + cdef cyruntime.cudaExternalMemoryBufferDesc* cybufferDesc_ptr = bufferDesc._pvt_ptr if bufferDesc is not None else NULL with nogil: err = cyruntime.cudaExternalMemoryGetMappedBuffer(&devPtr, cyextMem, cybufferDesc_ptr) if err != cyruntime.cudaSuccess: @@ -22808,7 +22812,7 @@ def cudaExternalMemoryGetMappedMipmappedArray(extMem, mipmapDesc : Optional[cuda pextMem = int(cudaExternalMemory_t(extMem)) cyextMem = pextMem cdef cudaMipmappedArray_t mipmap = cudaMipmappedArray_t() - cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc != None else NULL + cdef cyruntime.cudaExternalMemoryMipmappedArrayDesc* cymipmapDesc_ptr = mipmapDesc._pvt_ptr if mipmapDesc is not None else NULL with nogil: err = cyruntime.cudaExternalMemoryGetMappedMipmappedArray(mipmap._pvt_ptr, cyextMem, cymipmapDesc_ptr) if err != cyruntime.cudaSuccess: @@ -22995,7 +22999,7 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa :py:obj:`~.cudaDestroyExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` """ cdef cudaExternalSemaphore_t extSem_out = cudaExternalSemaphore_t() - cdef cyruntime.cudaExternalSemaphoreHandleDesc* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc != None else NULL + cdef cyruntime.cudaExternalSemaphoreHandleDesc* cysemHandleDesc_ptr = semHandleDesc._pvt_ptr if semHandleDesc is not None else NULL with nogil: err = cyruntime.cudaImportExternalSemaphore(extSem_out._pvt_ptr, cysemHandleDesc_ptr) if err != cyruntime.cudaSuccess: @@ -23006,7 +23010,7 @@ def cudaImportExternalSemaphore(semHandleDesc : Optional[cudaExternalSemaphoreHa {{if 'cudaSignalExternalSemaphoresAsync_v2' in found_functions}} @cython.embedsignature(True) -def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSemaphore_t] | List[cudaExternalSemaphore_t]], paramsArray : Optional[Tuple[cudaExternalSemaphoreSignalParams] | List[cudaExternalSemaphoreSignalParams]], unsigned int numExtSems, stream): +def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSemaphore_t] | list[cudaExternalSemaphore_t]], paramsArray : Optional[tuple[cudaExternalSemaphoreSignalParams] | list[cudaExternalSemaphoreSignalParams]], unsigned int numExtSems, stream): """ Signals a set of external semaphore objects. Enqueues a signal operation on a set of externally allocated semaphore @@ -23081,9 +23085,9 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalS Parameters ---------- - extSemArray : List[:py:obj:`~.cudaExternalSemaphore_t`] + extSemArray : list[:py:obj:`~.cudaExternalSemaphore_t`] Set of external semaphores to be signaled - paramsArray : List[:py:obj:`~.cudaExternalSemaphoreSignalParams`] + paramsArray : list[:py:obj:`~.cudaExternalSemaphoreSignalParams`] Array of semaphore parameters numExtSems : unsigned int Number of semaphores to signal @@ -23109,10 +23113,10 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalS cystream = pstream paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (cudaExternalSemaphoreSignalParams,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cyruntime.cudaExternalSemaphoreSignalParams,] or List[cyruntime.cudaExternalSemaphoreSignalParams,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphoreSignalParams,] or list[cyruntime.cudaExternalSemaphoreSignalParams,]") extSemArray = [] if extSemArray is None else extSemArray if not all(isinstance(_x, (cudaExternalSemaphore_t,)) for _x in extSemArray): - raise TypeError("Argument 'extSemArray' is not instance of type (expected Tuple[cyruntime.cudaExternalSemaphore_t,] or List[cyruntime.cudaExternalSemaphore_t,]") + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphore_t,] or list[cyruntime.cudaExternalSemaphore_t,]") cdef cyruntime.cudaExternalSemaphore_t* cyextSemArray = NULL if len(extSemArray) > 1: cyextSemArray = calloc(len(extSemArray), sizeof(cyruntime.cudaExternalSemaphore_t)) @@ -23146,7 +23150,7 @@ def cudaSignalExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalS {{if 'cudaWaitExternalSemaphoresAsync_v2' in found_functions}} @cython.embedsignature(True) -def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSemaphore_t] | List[cudaExternalSemaphore_t]], paramsArray : Optional[Tuple[cudaExternalSemaphoreWaitParams] | List[cudaExternalSemaphoreWaitParams]], unsigned int numExtSems, stream): +def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[tuple[cudaExternalSemaphore_t] | list[cudaExternalSemaphore_t]], paramsArray : Optional[tuple[cudaExternalSemaphoreWaitParams] | list[cudaExternalSemaphoreWaitParams]], unsigned int numExtSems, stream): """ Waits on a set of external semaphore objects. Enqueues a wait operation on a set of externally allocated semaphore @@ -23210,9 +23214,9 @@ def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSem Parameters ---------- - extSemArray : List[:py:obj:`~.cudaExternalSemaphore_t`] + extSemArray : list[:py:obj:`~.cudaExternalSemaphore_t`] External semaphores to be waited on - paramsArray : List[:py:obj:`~.cudaExternalSemaphoreWaitParams`] + paramsArray : list[:py:obj:`~.cudaExternalSemaphoreWaitParams`] Array of semaphore parameters numExtSems : unsigned int Number of semaphores to wait on @@ -23238,10 +23242,10 @@ def cudaWaitExternalSemaphoresAsync(extSemArray : Optional[Tuple[cudaExternalSem cystream = pstream paramsArray = [] if paramsArray is None else paramsArray if not all(isinstance(_x, (cudaExternalSemaphoreWaitParams,)) for _x in paramsArray): - raise TypeError("Argument 'paramsArray' is not instance of type (expected Tuple[cyruntime.cudaExternalSemaphoreWaitParams,] or List[cyruntime.cudaExternalSemaphoreWaitParams,]") + raise TypeError("Argument 'paramsArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphoreWaitParams,] or list[cyruntime.cudaExternalSemaphoreWaitParams,]") extSemArray = [] if extSemArray is None else extSemArray if not all(isinstance(_x, (cudaExternalSemaphore_t,)) for _x in extSemArray): - raise TypeError("Argument 'extSemArray' is not instance of type (expected Tuple[cyruntime.cudaExternalSemaphore_t,] or List[cyruntime.cudaExternalSemaphore_t,]") + raise TypeError("Argument 'extSemArray' is not instance of type (expected tuple[cyruntime.cudaExternalSemaphore_t,] or list[cyruntime.cudaExternalSemaphore_t,]") cdef cyruntime.cudaExternalSemaphore_t* cyextSemArray = NULL if len(extSemArray) > 1: cyextSemArray = calloc(len(extSemArray), sizeof(cyruntime.cudaExternalSemaphore_t)) @@ -23368,7 +23372,7 @@ def cudaFuncSetCacheConfig(func, cacheConfig not None : cudaFuncCache): ----- This API does not accept a :py:obj:`~.cudaKernel_t` casted as void*. If cache config modification is required for a :py:obj:`~.cudaKernel_t` (or a global function), it can be replaced with a call to :py:obj:`~.cudaFuncSetAttributes` with the attribute :py:obj:`~.cudaFuncAttributePreferredSharedMemoryCarveout` to specify a more granular L1 cache and shared memory split configuration. """ - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr cdef cyruntime.cudaFuncCache cycacheConfig = cacheConfig.value with nogil: @@ -23411,7 +23415,7 @@ def cudaFuncGetAttributes(func): :py:obj:`~.cudaFuncSetCacheConfig (C API)`, cudaFuncGetAttributes (C++ API), :py:obj:`~.cudaLaunchKernel (C API)`, :py:obj:`~.cuFuncGetAttribute` """ cdef cudaFuncAttributes attr = cudaFuncAttributes() - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr with nogil: err = cyruntime.cudaFuncGetAttributes(attr._pvt_ptr, cyfunc_ptr) @@ -23498,7 +23502,7 @@ def cudaFuncSetAttribute(func, attr not None : cudaFuncAttribute, int value): cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidDeviceFunction`, :py:obj:`~.cudaErrorInvalidValue` """ - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr cdef cyruntime.cudaFuncAttribute cyattr = attr.value with nogil: @@ -23599,7 +23603,7 @@ def cudaLaunchHostFunc(stream, fn, userData): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cyuserData = utils.HelperInputVoidPtr(userData) + cyuserData = _HelperInputVoidPtr(userData) cdef void* cyuserData_ptr = cyuserData.cptr cdef cudaStreamHostCallbackData *cbData = NULL @@ -23676,7 +23680,7 @@ def cudaFuncSetSharedMemConfig(func, config not None : cudaSharedMemConfig): -------- :py:obj:`~.cudaDeviceSetSharedMemConfig`, :py:obj:`~.cudaDeviceGetSharedMemConfig`, :py:obj:`~.cudaDeviceSetCacheConfig`, :py:obj:`~.cudaDeviceGetCacheConfig`, :py:obj:`~.cudaFuncSetCacheConfig`, :py:obj:`~.cuFuncSetSharedMemConfig` """ - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr cdef cyruntime.cudaSharedMemConfig cyconfig = config.value with nogil: @@ -23714,7 +23718,7 @@ def cudaOccupancyMaxActiveBlocksPerMultiprocessor(func, int blockSize, size_t dy :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessor` """ cdef int numBlocks = 0 - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr with nogil: err = cyruntime.cudaOccupancyMaxActiveBlocksPerMultiprocessor(&numBlocks, cyfunc_ptr, blockSize, dynamicSMemSize) @@ -23753,7 +23757,7 @@ def cudaOccupancyAvailableDynamicSMemPerBlock(func, int numBlocks, int blockSize :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), :py:obj:`~.cudaOccupancyAvailableDynamicSMemPerBlock` """ cdef size_t dynamicSmemSize = 0 - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr with nogil: err = cyruntime.cudaOccupancyAvailableDynamicSMemPerBlock(&dynamicSmemSize, cyfunc_ptr, numBlocks, blockSize) @@ -23809,7 +23813,7 @@ def cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(func, int blockSize, :py:obj:`~.cudaOccupancyMaxActiveBlocksPerMultiprocessor`, cudaOccupancyMaxPotentialBlockSize (C++ API), cudaOccupancyMaxPotentialBlockSizeWithFlags (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMem (C++ API), cudaOccupancyMaxPotentialBlockSizeVariableSMemWithFlags (C++ API), cudaOccupancyAvailableDynamicSMemPerBlock (C++ API), :py:obj:`~.cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags` """ cdef int numBlocks = 0 - cyfunc = utils.HelperInputVoidPtr(func) + cyfunc = _HelperInputVoidPtr(func) cdef void* cyfunc_ptr = cyfunc.cptr with nogil: err = cyruntime.cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(&numBlocks, cyfunc_ptr, blockSize, dynamicSMemSize, flags) @@ -24164,7 +24168,7 @@ def cudaMallocArray(desc : Optional[cudaChannelFormatDesc], size_t width, size_t :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuArrayCreate` """ cdef cudaArray_t array = cudaArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc != None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMallocArray(array._pvt_ptr, cydesc_ptr, width, height, flags) if err != cyruntime.cudaSuccess: @@ -24215,7 +24219,7 @@ def cudaFree(devPtr): -------- :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaMallocManaged`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaMallocFromPoolAsync` :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaFreeAsync` :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemFree` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaFree(cydevPtr_ptr) @@ -24246,7 +24250,7 @@ def cudaFreeHost(ptr): -------- :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaMallocArray`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemFreeHost` """ - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaFreeHost(cyptr_ptr) @@ -24522,7 +24526,7 @@ def cudaHostRegister(ptr, size_t size, unsigned int flags): -------- :py:obj:`~.cudaHostUnregister`, :py:obj:`~.cudaHostGetFlags`, :py:obj:`~.cudaHostGetDevicePointer`, :py:obj:`~.cuMemHostRegister` """ - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaHostRegister(cyptr_ptr, size, flags) @@ -24555,7 +24559,7 @@ def cudaHostUnregister(ptr): -------- :py:obj:`~.cudaHostUnregister`, :py:obj:`~.cuMemHostUnregister` """ - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaHostUnregister(cyptr_ptr) @@ -24615,7 +24619,7 @@ def cudaHostGetDevicePointer(pHost, unsigned int flags): :py:obj:`~.cudaSetDeviceFlags`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemHostGetDevicePointer` """ cdef void_ptr pDevice = 0 - cypHost = utils.HelperInputVoidPtr(pHost) + cypHost = _HelperInputVoidPtr(pHost) cdef void* cypHost_ptr = cypHost.cptr with nogil: err = cyruntime.cudaHostGetDevicePointer(&pDevice, cypHost_ptr, flags) @@ -24650,7 +24654,7 @@ def cudaHostGetFlags(pHost): :py:obj:`~.cudaHostAlloc`, :py:obj:`~.cuMemHostGetFlags` """ cdef unsigned int pFlags = 0 - cypHost = utils.HelperInputVoidPtr(pHost) + cypHost = _HelperInputVoidPtr(pHost) cdef void* cypHost_ptr = cypHost.cptr with nogil: err = cyruntime.cudaHostGetFlags(&pFlags, cypHost_ptr) @@ -24823,7 +24827,7 @@ def cudaMalloc3DArray(desc : Optional[cudaChannelFormatDesc], extent not None : :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.cuArray3DCreate` """ cdef cudaArray_t array = cudaArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc != None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMalloc3DArray(array._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], flags) if err != cyruntime.cudaSuccess: @@ -24949,7 +24953,7 @@ def cudaMallocMipmappedArray(desc : Optional[cudaChannelFormatDesc], extent not :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc`, :py:obj:`~.cudaMallocPitch`, :py:obj:`~.cudaFree`, :py:obj:`~.cudaFreeArray`, :py:obj:`~.cudaMallocHost (C API)`, :py:obj:`~.cudaFreeHost`, :py:obj:`~.cudaHostAlloc`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.cuMipmappedArrayCreate` """ cdef cudaMipmappedArray_t mipmappedArray = cudaMipmappedArray_t() - cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc != None else NULL + cdef cyruntime.cudaChannelFormatDesc* cydesc_ptr = desc._pvt_ptr if desc is not None else NULL with nogil: err = cyruntime.cudaMallocMipmappedArray(mipmappedArray._pvt_ptr, cydesc_ptr, extent._pvt_ptr[0], numLevels, flags) if err != cyruntime.cudaSuccess: @@ -25084,7 +25088,7 @@ def cudaMemcpy3D(p : Optional[cudaMemcpy3DParms]): -------- :py:obj:`~.cudaMalloc3D`, :py:obj:`~.cudaMalloc3DArray`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemcpy3DAsync`, :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.make_cudaExtent`, :py:obj:`~.make_cudaPos`, :py:obj:`~.cuMemcpy3D` """ - cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3D(cyp_ptr) return (_dict_cudaError_t[err],) @@ -25121,7 +25125,7 @@ def cudaMemcpy3DPeer(p : Optional[cudaMemcpy3DPeerParms]): -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyPeerAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cuMemcpy3DPeer` """ - cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p != None else NULL + cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DPeer(cyp_ptr) return (_dict_cudaError_t[err],) @@ -25226,7 +25230,7 @@ def cudaMemcpy3DAsync(p : Optional[cudaMemcpy3DParms], stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DAsync(cyp_ptr, cystream) return (_dict_cudaError_t[err],) @@ -25266,7 +25270,7 @@ def cudaMemcpy3DPeerAsync(p : Optional[cudaMemcpy3DPeerParms], stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p != None else NULL + cdef cyruntime.cudaMemcpy3DPeerParms* cyp_ptr = p._pvt_ptr if p is not None else NULL with nogil: err = cyruntime.cudaMemcpy3DPeerAsync(cyp_ptr, cystream) return (_dict_cudaError_t[err],) @@ -25674,9 +25678,9 @@ def cudaMemcpy(dst, src, size_t count, kind not None : cudaMemcpyKind): -------- :py:obj:`~.cudaMemcpy2D`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpyDtoH`, :py:obj:`~.cuMemcpyHtoD`, :py:obj:`~.cuMemcpyDtoD`, :py:obj:`~.cuMemcpy` """ - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -25723,9 +25727,9 @@ def cudaMemcpyPeer(dst, int dstDevice, src, int srcDevice, size_t count): -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpyPeerAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cuMemcpyPeer` """ - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr with nogil: err = cyruntime.cudaMemcpyPeer(cydst_ptr, dstDevice, cysrc_ptr, srcDevice, count) @@ -25782,9 +25786,9 @@ def cudaMemcpy2D(dst, size_t dpitch, src, size_t spitch, size_t width, size_t he -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpy2DToArray`, :py:obj:`~.cudaMemcpy2DFromArray`, :py:obj:`~.cudaMemcpy2DArrayToArray`, :py:obj:`~.cudaMemcpyToSymbol`, :py:obj:`~.cudaMemcpyFromSymbol`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy2DAsync`, :py:obj:`~.cudaMemcpy2DToArrayAsync`, :py:obj:`~.cudaMemcpy2DFromArrayAsync`, :py:obj:`~.cudaMemcpyToSymbolAsync`, :py:obj:`~.cudaMemcpyFromSymbolAsync`, :py:obj:`~.cuMemcpy2D`, :py:obj:`~.cuMemcpy2DUnaligned` """ - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -25851,7 +25855,7 @@ def cudaMemcpy2DToArray(dst, size_t wOffset, size_t hOffset, src, size_t spitch, else: pdst = int(cudaArray_t(dst)) cydst = pdst - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -25918,7 +25922,7 @@ def cudaMemcpy2DFromArray(dst, size_t dpitch, src, size_t wOffset, size_t hOffse else: psrc = int(cudaArray_const_t(src)) cysrc = psrc - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -26059,9 +26063,9 @@ def cudaMemcpyAsync(dst, src, size_t count, kind not None : cudaMemcpyKind, stre else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -26116,9 +26120,9 @@ def cudaMemcpyPeerAsync(dst, int dstDevice, src, int srcDevice, size_t count, st else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr with nogil: err = cyruntime.cudaMemcpyPeerAsync(cydst_ptr, dstDevice, cysrc_ptr, srcDevice, count, cystream) @@ -26128,7 +26132,7 @@ def cudaMemcpyPeerAsync(dst, int dstDevice, src, int srcDevice, size_t count, st {{if 'cudaMemcpyBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optional[Tuple[Any] | List[Any]], sizes : Tuple[int] | List[int], size_t count, attrs : Optional[Tuple[cudaMemcpyAttributes] | List[cudaMemcpyAttributes]], attrsIdxs : Tuple[int] | List[int], size_t numAttrs, stream): +def cudaMemcpyBatchAsync(dsts : Optional[tuple[Any] | list[Any]], srcs : Optional[tuple[Any] | list[Any]], sizes : tuple[int] | list[int], size_t count, attrs : Optional[tuple[cudaMemcpyAttributes] | list[cudaMemcpyAttributes]], attrsIdxs : tuple[int] | list[int], size_t numAttrs, stream): """ Performs a batch of memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in @@ -26206,17 +26210,17 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona Parameters ---------- - dsts : List[Any] + dsts : list[Any] Array of destination pointers. - srcs : List[Any] + srcs : list[Any] Array of memcpy source pointers. - sizes : List[int] + sizes : list[int] Array of sizes for memcpy operations. count : size_t Size of `dsts`, `srcs` and `sizes` arrays - attrs : List[:py:obj:`~.cudaMemcpyAttributes`] + attrs : list[:py:obj:`~.cudaMemcpyAttributes`] Array of memcpy attributes. - attrsIdxs : List[int] + attrsIdxs : list[int] Array of indices to specify which copies each entry in the `attrs` array applies to. The attributes specified in attrs[k] will be applied to copies starting from attrsIdxs[k] through attrsIdxs[k+1] @@ -26246,19 +26250,19 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona pstream = int(cudaStream_t(stream)) cystream = pstream if not all(isinstance(_x, (int)) for _x in attrsIdxs): - raise TypeError("Argument 'attrsIdxs' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'attrsIdxs' is not instance of type (expected tuple[int] or list[int]") attrs = [] if attrs is None else attrs if not all(isinstance(_x, (cudaMemcpyAttributes,)) for _x in attrs): - raise TypeError("Argument 'attrs' is not instance of type (expected Tuple[cyruntime.cudaMemcpyAttributes,] or List[cyruntime.cudaMemcpyAttributes,]") + raise TypeError("Argument 'attrs' is not instance of type (expected tuple[cyruntime.cudaMemcpyAttributes,] or list[cyruntime.cudaMemcpyAttributes,]") if not all(isinstance(_x, (int)) for _x in sizes): - raise TypeError("Argument 'sizes' is not instance of type (expected Tuple[int] or List[int]") + raise TypeError("Argument 'sizes' is not instance of type (expected tuple[int] or list[int]") srcs = [] if srcs is None else srcs dsts = [] if dsts is None else dsts - pylist = [utils.HelperInputVoidPtr(pydsts) for pydsts in dsts] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdsts = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(pydsts) for pydsts in dsts] + cdef _InputVoidPtrPtrHelper voidStarHelperdsts = _InputVoidPtrPtrHelper(pylist) cdef void** cydsts_ptr = voidStarHelperdsts.cptr - pylist = [utils.HelperInputVoidPtr(pysrcs) for pysrcs in srcs] - cdef utils.InputVoidPtrPtrHelper voidStarHelpersrcs = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperInputVoidPtr(pysrcs) for pysrcs in srcs] + cdef _InputVoidPtrPtrHelper voidStarHelpersrcs = _InputVoidPtrPtrHelper(pylist) cdef void** cysrcs_ptr = voidStarHelpersrcs.cptr cdef vector[size_t] cysizes = sizes if count > len(dsts): raise RuntimeError("List is too small: " + str(len(dsts)) + " < " + str(count)) @@ -26289,7 +26293,7 @@ def cudaMemcpyBatchAsync(dsts : Optional[Tuple[Any] | List[Any]], srcs : Optiona {{if 'cudaMemcpy3DBatchAsync' in found_functions}} @cython.embedsignature(True) -def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBatchOp] | List[cudaMemcpy3DBatchOp]], unsigned long long flags, stream): +def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[cudaMemcpy3DBatchOp] | list[cudaMemcpy3DBatchOp]], unsigned long long flags, stream): """ Performs a batch of 3D memory copies asynchronously. Performs a batch of memory copies. The batch as a whole executes in @@ -26379,7 +26383,7 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBa ---------- numOps : size_t Total number of memcpy operations. - opList : List[:py:obj:`~.cudaMemcpy3DBatchOp`] + opList : list[:py:obj:`~.cudaMemcpy3DBatchOp`] Array of size `numOps` containing the actual memcpy operations. flags : unsigned long long Flags for future use, must be zero now. @@ -26406,7 +26410,7 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[Tuple[cudaMemcpy3DBa cystream = pstream opList = [] if opList is None else opList if not all(isinstance(_x, (cudaMemcpy3DBatchOp,)) for _x in opList): - raise TypeError("Argument 'opList' is not instance of type (expected Tuple[cyruntime.cudaMemcpy3DBatchOp,] or List[cyruntime.cudaMemcpy3DBatchOp,]") + raise TypeError("Argument 'opList' is not instance of type (expected tuple[cyruntime.cudaMemcpy3DBatchOp,] or list[cyruntime.cudaMemcpy3DBatchOp,]") if numOps > len(opList): raise RuntimeError("List is too small: " + str(len(opList)) + " < " + str(numOps)) cdef cyruntime.cudaMemcpy3DBatchOp* cyopList = NULL if len(opList) > 1: @@ -26498,9 +26502,9 @@ def cudaMemcpy2DAsync(dst, size_t dpitch, src, size_t spitch, size_t width, size else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -26588,7 +26592,7 @@ def cudaMemcpy2DToArrayAsync(dst, size_t wOffset, size_t hOffset, src, size_t sp else: pdst = int(cudaArray_t(dst)) cydst = pdst - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -26675,7 +26679,7 @@ def cudaMemcpy2DFromArrayAsync(dst, size_t dpitch, src, size_t wOffset, size_t h else: psrc = int(cudaArray_const_t(src)) cysrc = psrc - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -26713,7 +26717,7 @@ def cudaMemset(devPtr, int value, size_t count): -------- :py:obj:`~.cuMemsetD8`, :py:obj:`~.cuMemsetD16`, :py:obj:`~.cuMemsetD32` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset(cydevPtr_ptr, value, count) @@ -26757,7 +26761,7 @@ def cudaMemset2D(devPtr, size_t pitch, int value, size_t width, size_t height): -------- :py:obj:`~.cudaMemset`, :py:obj:`~.cudaMemset3D`, :py:obj:`~.cudaMemsetAsync`, :py:obj:`~.cudaMemset2DAsync`, :py:obj:`~.cudaMemset3DAsync`, :py:obj:`~.cuMemsetD2D8`, :py:obj:`~.cuMemsetD2D16`, :py:obj:`~.cuMemsetD2D32` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset2D(cydevPtr_ptr, pitch, value, width, height) @@ -26864,7 +26868,7 @@ def cudaMemsetAsync(devPtr, int value, size_t count, stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemsetAsync(cydevPtr_ptr, value, count, cystream) @@ -26924,7 +26928,7 @@ def cudaMemset2DAsync(devPtr, size_t pitch, int value, size_t width, size_t heig else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemset2DAsync(cydevPtr_ptr, pitch, value, width, height, cystream) @@ -27093,7 +27097,7 @@ def cudaMemPrefetchAsync(devPtr, size_t count, int dstDevice, stream): else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemPrefetchAsync(cydevPtr_ptr, count, dstDevice, cystream) @@ -27210,7 +27214,7 @@ def cudaMemPrefetchAsync_v2(devPtr, size_t count, location not None : cudaMemLoc else: pstream = int(cudaStream_t(stream)) cystream = pstream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemPrefetchAsync_v2(cydevPtr_ptr, count, location._pvt_ptr[0], flags, cystream) @@ -27375,7 +27379,7 @@ def cudaMemAdvise(devPtr, size_t count, advice not None : cudaMemoryAdvise, int -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemAdvise` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr cdef cyruntime.cudaMemoryAdvise cyadvice = advice.value with nogil: @@ -27572,7 +27576,7 @@ def cudaMemAdvise_v2(devPtr, size_t count, advice not None : cudaMemoryAdvise, l -------- :py:obj:`~.cudaMemcpy`, :py:obj:`~.cudaMemcpyPeer`, :py:obj:`~.cudaMemcpyAsync`, :py:obj:`~.cudaMemcpy3DPeerAsync`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cuMemAdvise`, :py:obj:`~.cuMemAdvise_v2` """ - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr cdef cyruntime.cudaMemoryAdvise cyadvice = advice.value with nogil: @@ -27718,10 +27722,10 @@ def cudaMemRangeGetAttribute(size_t dataSize, attribute not None : cudaMemRangeA -------- :py:obj:`~.cudaMemRangeGetAttributes`, :py:obj:`~.cudaMemPrefetchAsync`, :py:obj:`~.cudaMemAdvise`, :py:obj:`~.cuMemRangeGetAttribute` """ - cdef utils.HelperCUmem_range_attribute cydata = utils.HelperCUmem_range_attribute(attribute, dataSize) + cdef _HelperCUmem_range_attribute cydata = _HelperCUmem_range_attribute(attribute, dataSize) cdef void* cydata_ptr = cydata.cptr cdef cyruntime.cudaMemRangeAttribute cyattribute = attribute.value - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemRangeGetAttribute(cydata_ptr, dataSize, cyattribute, cydevPtr_ptr, count) @@ -27733,7 +27737,7 @@ def cudaMemRangeGetAttribute(size_t dataSize, attribute not None : cudaMemRangeA {{if 'cudaMemRangeGetAttributes' in found_functions}} @cython.embedsignature(True) -def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : Optional[Tuple[cudaMemRangeAttribute] | List[cudaMemRangeAttribute]], size_t numAttributes, devPtr, size_t count): +def cudaMemRangeGetAttributes(dataSizes : tuple[int] | list[int], attributes : Optional[tuple[cudaMemRangeAttribute] | list[cudaMemRangeAttribute]], size_t numAttributes, devPtr, size_t count): """ Query attributes of a given memory range. Query attributes of the memory range starting at `devPtr` with a size @@ -27766,9 +27770,9 @@ def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : O Parameters ---------- - dataSizes : List[int] + dataSizes : list[int] Array containing the sizes of each result - attributes : List[:py:obj:`~.cudaMemRangeAttribute`] + attributes : list[:py:obj:`~.cudaMemRangeAttribute`] An array of attributes to query (numAttributes and the number of attributes in this array should match) numAttributes : size_t @@ -27782,7 +27786,7 @@ def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : O ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - data : List[Any] + data : list[Any] A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written to. @@ -27792,17 +27796,17 @@ def cudaMemRangeGetAttributes(dataSizes : Tuple[int] | List[int], attributes : O """ attributes = [] if attributes is None else attributes if not all(isinstance(_x, (cudaMemRangeAttribute)) for _x in attributes): - raise TypeError("Argument 'attributes' is not instance of type (expected Tuple[cyruntime.cudaMemRangeAttribute] or List[cyruntime.cudaMemRangeAttribute]") + raise TypeError("Argument 'attributes' is not instance of type (expected tuple[cyruntime.cudaMemRangeAttribute] or list[cyruntime.cudaMemRangeAttribute]") if not all(isinstance(_x, (int)) for _x in dataSizes): - raise TypeError("Argument 'dataSizes' is not instance of type (expected Tuple[int] or List[int]") - pylist = [utils.HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperdata = utils.InputVoidPtrPtrHelper(pylist) + raise TypeError("Argument 'dataSizes' is not instance of type (expected tuple[int] or list[int]") + pylist = [_HelperCUmem_range_attribute(pyattributes, pydataSizes) for (pyattributes, pydataSizes) in zip(attributes, dataSizes)] + cdef _InputVoidPtrPtrHelper voidStarHelperdata = _InputVoidPtrPtrHelper(pylist) cdef void** cyvoidStarHelper_ptr = voidStarHelperdata.cptr cdef vector[size_t] cydataSizes = dataSizes cdef vector[cyruntime.cudaMemRangeAttribute] cyattributes = [pyattributes.value for pyattributes in (attributes)] if numAttributes > len(dataSizes): raise RuntimeError("List is too small: " + str(len(dataSizes)) + " < " + str(numAttributes)) if numAttributes > len(attributes): raise RuntimeError("List is too small: " + str(len(attributes)) + " < " + str(numAttributes)) - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaMemRangeGetAttributes(cyvoidStarHelper_ptr, cydataSizes.data(), cyattributes.data(), numAttributes, cydevPtr_ptr, count) @@ -27862,7 +27866,7 @@ def cudaMemcpyToArray(dst, size_t wOffset, size_t hOffset, src, size_t count, ki else: pdst = int(cudaArray_t(dst)) cydst = pdst - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -27921,7 +27925,7 @@ def cudaMemcpyFromArray(dst, src, size_t wOffset, size_t hOffset, size_t count, else: psrc = int(cudaArray_const_t(src)) cysrc = psrc - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -28067,7 +28071,7 @@ def cudaMemcpyToArrayAsync(dst, size_t wOffset, size_t hOffset, src, size_t coun else: pdst = int(cudaArray_t(dst)) cydst = pdst - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -28143,7 +28147,7 @@ def cudaMemcpyFromArrayAsync(dst, src, size_t wOffset, size_t hOffset, size_t co else: psrc = int(cudaArray_const_t(src)) cysrc = psrc - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -28245,7 +28249,7 @@ def cudaFreeAsync(devPtr, hStream): else: phStream = int(cudaStream_t(hStream)) cyhStream = phStream - cydevPtr = utils.HelperInputVoidPtr(devPtr) + cydevPtr = _HelperInputVoidPtr(devPtr) cdef void* cydevPtr_ptr = cydevPtr.cptr with nogil: err = cyruntime.cudaFreeAsync(cydevPtr_ptr, cyhStream) @@ -28371,7 +28375,7 @@ def cudaMemPoolSetAttribute(memPool, attr not None : cudaMemPoolAttr, value): pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef cyruntime.cudaMemPoolAttr cyattr = attr.value - cdef utils.HelperCUmemPool_attribute cyvalue = utils.HelperCUmemPool_attribute(attr, value, is_getter=False) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaMemPoolSetAttribute(cymemPool, cyattr, cyvalue_ptr) @@ -28453,7 +28457,7 @@ def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef cyruntime.cudaMemPoolAttr cyattr = attr.value - cdef utils.HelperCUmemPool_attribute cyvalue = utils.HelperCUmemPool_attribute(attr, 0, is_getter=True) + cdef _HelperCUmemPool_attribute cyvalue = _HelperCUmemPool_attribute(attr, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaMemPoolGetAttribute(cymemPool, cyattr, cyvalue_ptr) @@ -28465,14 +28469,14 @@ def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): {{if 'cudaMemPoolSetAccess' in found_functions}} @cython.embedsignature(True) -def cudaMemPoolSetAccess(memPool, descList : Optional[Tuple[cudaMemAccessDesc] | List[cudaMemAccessDesc]], size_t count): +def cudaMemPoolSetAccess(memPool, descList : Optional[tuple[cudaMemAccessDesc] | list[cudaMemAccessDesc]], size_t count): """ Controls visibility of pools between devices. Parameters ---------- pool : :py:obj:`~.CUmemoryPool` or :py:obj:`~.cudaMemPool_t` The pool being modified - map : List[:py:obj:`~.cudaMemAccessDesc`] + map : list[:py:obj:`~.cudaMemAccessDesc`] Array of access descriptors. Each descriptor instructs the access to enable for a single gpu count : size_t @@ -28489,7 +28493,7 @@ def cudaMemPoolSetAccess(memPool, descList : Optional[Tuple[cudaMemAccessDesc] | """ descList = [] if descList is None else descList if not all(isinstance(_x, (cudaMemAccessDesc,)) for _x in descList): - raise TypeError("Argument 'descList' is not instance of type (expected Tuple[cyruntime.cudaMemAccessDesc,] or List[cyruntime.cudaMemAccessDesc,]") + raise TypeError("Argument 'descList' is not instance of type (expected tuple[cyruntime.cudaMemAccessDesc,] or list[cyruntime.cudaMemAccessDesc,]") cdef cyruntime.cudaMemPool_t cymemPool if memPool is None: pmemPool = 0 @@ -28551,7 +28555,7 @@ def cudaMemPoolGetAccess(memPool, location : Optional[cudaMemLocation]): pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef cyruntime.cudaMemAccessFlags flags - cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location != None else NULL + cdef cyruntime.cudaMemLocation* cylocation_ptr = location._pvt_ptr if location is not None else NULL with nogil: err = cyruntime.cudaMemPoolGetAccess(&flags, cymemPool, cylocation_ptr) if err != cyruntime.cudaSuccess: @@ -28627,7 +28631,7 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): Specifying cudaMemHandleTypeNone creates a memory pool that will not support IPC. """ cdef cudaMemPool_t memPool = cudaMemPool_t() - cdef cyruntime.cudaMemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps != None else NULL + cdef cyruntime.cudaMemPoolProps* cypoolProps_ptr = poolProps._pvt_ptr if poolProps is not None else NULL with nogil: err = cyruntime.cudaMemPoolCreate(memPool._pvt_ptr, cypoolProps_ptr) if err != cyruntime.cudaSuccess: @@ -28787,7 +28791,7 @@ def cudaMemPoolExportToShareableHandle(memPool, handleType not None : cudaMemAll else: pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool - cdef utils.HelperCUmemAllocationHandleType cyshareableHandle = utils.HelperCUmemAllocationHandleType(handleType) + cdef _HelperCUmemAllocationHandleType cyshareableHandle = _HelperCUmemAllocationHandleType(handleType) cdef void* cyshareableHandle_ptr = cyshareableHandle.cptr cdef cyruntime.cudaMemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -28831,7 +28835,7 @@ def cudaMemPoolImportFromShareableHandle(shareableHandle, handleType not None : Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in :py:obj:`~.cudaDeviceSetMemPool` or :py:obj:`~.cudaMallocFromPoolAsync` calls. """ cdef cudaMemPool_t memPool = cudaMemPool_t() - cyshareableHandle = utils.HelperInputVoidPtr(shareableHandle) + cyshareableHandle = _HelperInputVoidPtr(shareableHandle) cdef void* cyshareableHandle_ptr = cyshareableHandle.cptr cdef cyruntime.cudaMemAllocationHandleType cyhandleType = handleType.value with nogil: @@ -28869,7 +28873,7 @@ def cudaMemPoolExportPointer(ptr): :py:obj:`~.cuMemPoolExportPointer`, :py:obj:`~.cudaMemPoolExportToShareableHandle`, :py:obj:`~.cudaMemPoolImportFromShareableHandle`, :py:obj:`~.cudaMemPoolImportPointer` """ cdef cudaMemPoolPtrExportData exportData = cudaMemPoolPtrExportData() - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaMemPoolExportPointer(exportData._pvt_ptr, cyptr_ptr) @@ -28923,7 +28927,7 @@ def cudaMemPoolImportPointer(memPool, exportData : Optional[cudaMemPoolPtrExport pmemPool = int(cudaMemPool_t(memPool)) cymemPool = pmemPool cdef void_ptr ptr = 0 - cdef cyruntime.cudaMemPoolPtrExportData* cyexportData_ptr = exportData._pvt_ptr if exportData != None else NULL + cdef cyruntime.cudaMemPoolPtrExportData* cyexportData_ptr = exportData._pvt_ptr if exportData is not None else NULL with nogil: err = cyruntime.cudaMemPoolImportPointer(&ptr, cymemPool, cyexportData_ptr) if err != cyruntime.cudaSuccess: @@ -28994,7 +28998,7 @@ def cudaPointerGetAttributes(ptr): In CUDA 11.0 forward passing host pointer will return :py:obj:`~.cudaMemoryTypeUnregistered` in :py:obj:`~.cudaPointerAttributes.type` and call will return :py:obj:`~.cudaSuccess`. """ cdef cudaPointerAttributes attributes = cudaPointerAttributes() - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaPointerGetAttributes(attributes._pvt_ptr, cyptr_ptr) @@ -29814,9 +29818,9 @@ def cudaCreateTextureObject(pResDesc : Optional[cudaResourceDesc], pTexDesc : Op :py:obj:`~.cudaDestroyTextureObject`, :py:obj:`~.cuTexObjectCreate` """ cdef cudaTextureObject_t pTexObject = cudaTextureObject_t() - cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc != None else NULL - cdef cyruntime.cudaTextureDesc* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc != None else NULL - cdef cyruntime.cudaResourceViewDesc* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc != None else NULL + cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL + cdef cyruntime.cudaTextureDesc* cypTexDesc_ptr = pTexDesc._pvt_ptr if pTexDesc is not None else NULL + cdef cyruntime.cudaResourceViewDesc* cypResViewDesc_ptr = pResViewDesc._pvt_ptr if pResViewDesc is not None else NULL with nogil: err = cyruntime.cudaCreateTextureObject(pTexObject._pvt_ptr, cypResDesc_ptr, cypTexDesc_ptr, cypResViewDesc_ptr) if err != cyruntime.cudaSuccess: @@ -30017,7 +30021,7 @@ def cudaCreateSurfaceObject(pResDesc : Optional[cudaResourceDesc]): :py:obj:`~.cudaDestroySurfaceObject`, :py:obj:`~.cuSurfObjectCreate` """ cdef cudaSurfaceObject_t pSurfObject = cudaSurfaceObject_t() - cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc != None else NULL + cdef cyruntime.cudaResourceDesc* cypResDesc_ptr = pResDesc._pvt_ptr if pResDesc is not None else NULL with nogil: err = cyruntime.cudaCreateSurfaceObject(pSurfObject._pvt_ptr, cypResDesc_ptr) if err != cyruntime.cudaSuccess: @@ -30202,7 +30206,7 @@ def cudaGraphCreate(unsigned int flags): {{if 'cudaGraphAddKernelNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddKernelNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaKernelNodeParams]): +def cudaGraphAddKernelNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaKernelNodeParams]): """ Creates a kernel execution node and adds it to a graph. Creates a new kernel execution node and adds it to `graph` with @@ -30266,7 +30270,7 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -30290,7 +30294,7 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -30311,7 +30315,7 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddKernelNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypNodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -30402,7 +30406,7 @@ def cudaGraphKernelNodeSetParams(node, pNodeParams : Optional[cudaKernelNodePara else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphKernelNodeSetParams(cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -30535,7 +30539,7 @@ def cudaGraphKernelNodeSetAttribute(hNode, attr not None : cudaKernelNodeAttrID, phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode cdef cyruntime.cudaKernelNodeAttrID cyattr = attr.value - cdef cyruntime.cudaKernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value != None else NULL + cdef cyruntime.cudaKernelNodeAttrValue* cyvalue_ptr = value._pvt_ptr if value is not None else NULL with nogil: err = cyruntime.cudaGraphKernelNodeSetAttribute(cyhNode, cyattr, cyvalue_ptr) return (_dict_cudaError_t[err],) @@ -30544,7 +30548,7 @@ def cudaGraphKernelNodeSetAttribute(hNode, attr not None : cudaKernelNodeAttrID, {{if 'cudaGraphAddMemcpyNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, pCopyParams : Optional[cudaMemcpy3DParms]): +def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pCopyParams : Optional[cudaMemcpy3DParms]): """ Creates a memcpy node and adds it to a graph. Creates a new memcpy node and adds it to `graph` with `numDependencies` @@ -30566,7 +30570,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -30586,7 +30590,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -30607,7 +30611,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemcpy3DParms* cypCopyParams_ptr = pCopyParams._pvt_ptr if pCopyParams != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypCopyParams_ptr = pCopyParams._pvt_ptr if pCopyParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemcpyNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypCopyParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -30620,7 +30624,7 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t {{if 'cudaGraphAddMemcpyNode1D' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, dst, src, size_t count, kind not None : cudaMemcpyKind): +def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, dst, src, size_t count, kind not None : cudaMemcpyKind): """ Creates a 1D memcpy node and adds it to a graph. Creates a new 1D memcpy node and adds it to `graph` with @@ -30652,7 +30656,7 @@ def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[Tuple[cudaGraphNode ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -30678,7 +30682,7 @@ def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[Tuple[cudaGraphNode """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -30698,9 +30702,9 @@ def cudaGraphAddMemcpyNode1D(graph, pDependencies : Optional[Tuple[cudaGraphNode cypDependencies[idx] = (pDependencies[idx])._pvt_ptr[0] elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -30784,7 +30788,7 @@ def cudaGraphMemcpyNodeSetParams(node, pNodeParams : Optional[cudaMemcpy3DParms] else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphMemcpyNodeSetParams(cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -30842,9 +30846,9 @@ def cudaGraphMemcpyNodeSetParams1D(node, dst, src, size_t count, kind not None : else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -30855,7 +30859,7 @@ def cudaGraphMemcpyNodeSetParams1D(node, dst, src, size_t count, kind not None : {{if 'cudaGraphAddMemsetNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemsetNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, pMemsetParams : Optional[cudaMemsetParams]): +def cudaGraphAddMemsetNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pMemsetParams : Optional[cudaMemsetParams]): """ Creates a memset node and adds it to a graph. Creates a new memset node and adds it to `graph` with `numDependencies` @@ -30871,7 +30875,7 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -30891,7 +30895,7 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -30912,7 +30916,7 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemsetParams* cypMemsetParams_ptr = pMemsetParams._pvt_ptr if pMemsetParams != None else NULL + cdef cyruntime.cudaMemsetParams* cypMemsetParams_ptr = pMemsetParams._pvt_ptr if pMemsetParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemsetNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypMemsetParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -30994,7 +30998,7 @@ def cudaGraphMemsetNodeSetParams(node, pNodeParams : Optional[cudaMemsetParams]) else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphMemsetNodeSetParams(cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -31003,7 +31007,7 @@ def cudaGraphMemsetNodeSetParams(node, pNodeParams : Optional[cudaMemsetParams]) {{if 'cudaGraphAddHostNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddHostNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaHostNodeParams]): +def cudaGraphAddHostNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, pNodeParams : Optional[cudaHostNodeParams]): """ Creates a host execution node and adds it to a graph. Creates a new CPU execution node and adds it to `graph` with @@ -31020,7 +31024,7 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31040,7 +31044,7 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31061,7 +31065,7 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddHostNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cypNodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -31143,7 +31147,7 @@ def cudaGraphHostNodeSetParams(node, pNodeParams : Optional[cudaHostNodeParams]) else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphHostNodeSetParams(cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -31152,7 +31156,7 @@ def cudaGraphHostNodeSetParams(node, pNodeParams : Optional[cudaHostNodeParams]) {{if 'cudaGraphAddChildGraphNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, childGraph): +def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, childGraph): """ Creates a child graph node and adds it to a graph. Creates a new node which executes an embedded graph, and adds it to @@ -31172,7 +31176,7 @@ def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[Tuple[cudaGraphNo ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31200,7 +31204,7 @@ def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[Tuple[cudaGraphNo cychildGraph = pchildGraph pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31278,7 +31282,7 @@ def cudaGraphChildGraphNodeGetGraph(node): {{if 'cudaGraphAddEmptyNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddEmptyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies): +def cudaGraphAddEmptyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies): """ Creates an empty node and adds it to a graph. Creates a new node which performs no operation, and adds it to `graph` @@ -31298,7 +31302,7 @@ def cudaGraphAddEmptyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31316,7 +31320,7 @@ def cudaGraphAddEmptyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31349,7 +31353,7 @@ def cudaGraphAddEmptyNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] {{if 'cudaGraphAddEventRecordNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, event): +def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, event): """ Creates an event record node and adds it to a graph. Creates a new event record node and adds it to `hGraph` with @@ -31368,7 +31372,7 @@ def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[Tuple[cudaGraphN ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31396,7 +31400,7 @@ def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[Tuple[cudaGraphN cyevent = pevent pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31514,7 +31518,7 @@ def cudaGraphEventRecordNodeSetEvent(node, event): {{if 'cudaGraphAddEventWaitNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, event): +def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, event): """ Creates an event wait node and adds it to a graph. Creates a new event wait node and adds it to `hGraph` with @@ -31536,7 +31540,7 @@ def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[Tuple[cudaGraphNod ---------- hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - dependencies : List[:py:obj:`~.cudaGraphNode_t`] + dependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31564,7 +31568,7 @@ def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[Tuple[cudaGraphNod cyevent = pevent pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31682,7 +31686,7 @@ def cudaGraphEventWaitNodeSetEvent(node, event): {{if 'cudaGraphAddExternalSemaphoresSignalNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreSignalNodeParams]): +def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreSignalNodeParams]): """ Creates an external semaphore signal node and adds it to a graph. Creates a new external semaphore signal node and adds it to `graph` @@ -31700,7 +31704,7 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[Tup ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31720,7 +31724,7 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[Tup """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31741,7 +31745,7 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[Tup elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddExternalSemaphoresSignalNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -31830,7 +31834,7 @@ def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[ else: phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExternalSemaphoresSignalNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -31839,7 +31843,7 @@ def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[ {{if 'cudaGraphAddExternalSemaphoresWaitNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreWaitNodeParams]): +def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaExternalSemaphoreWaitNodeParams]): """ Creates an external semaphore wait node and adds it to a graph. Creates a new external semaphore wait node and adds it to `graph` with @@ -31857,7 +31861,7 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[Tuple ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -31877,7 +31881,7 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[Tuple """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -31898,7 +31902,7 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[Tuple elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddExternalSemaphoresWaitNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -31987,7 +31991,7 @@ def cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[cu else: phNode = int(cudaGraphNode_t(hNode)) cyhNode = phNode - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExternalSemaphoresWaitNodeSetParams(cyhNode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -31996,7 +32000,7 @@ def cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[cu {{if 'cudaGraphAddMemAllocNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaMemAllocNodeParams]): +def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaMemAllocNodeParams]): """ Creates an allocation node and adds it to a graph. Creates a new allocation node and adds it to `graph` with @@ -32053,7 +32057,7 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[Tuple[cudaGraphNode ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -32073,7 +32077,7 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[Tuple[cudaGraphNode """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -32094,7 +32098,7 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[Tuple[cudaGraphNode elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaMemAllocNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaMemAllocNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddMemAllocNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -32150,7 +32154,7 @@ def cudaGraphMemAllocNodeGetParams(node): {{if 'cudaGraphAddMemFreeNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, dptr): +def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, dptr): """ Creates a memory free node and adds it to a graph. Creates a new memory free node and adds it to `graph` with @@ -32185,7 +32189,7 @@ def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_ ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -32205,7 +32209,7 @@ def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_ """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -32226,7 +32230,7 @@ def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_ elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cydptr = utils.HelperInputVoidPtr(dptr) + cydptr = _HelperInputVoidPtr(dptr) cdef void* cydptr_ptr = cydptr.cptr with nogil: err = cyruntime.cudaGraphAddMemFreeNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cydptr_ptr) @@ -32349,7 +32353,7 @@ def cudaDeviceGetGraphMemAttribute(int device, attr not None : cudaGraphMemAttri :py:obj:`~.cudaDeviceSetGraphMemAttribute`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync` """ cdef cyruntime.cudaGraphMemAttributeType cyattr = attr.value - cdef utils.HelperCUgraphMem_attribute cyvalue = utils.HelperCUgraphMem_attribute(attr, 0, is_getter=True) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, 0, is_getter=True) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaDeviceGetGraphMemAttribute(device, cyattr, cyvalue_ptr) @@ -32393,7 +32397,7 @@ def cudaDeviceSetGraphMemAttribute(int device, attr not None : cudaGraphMemAttri :py:obj:`~.cudaDeviceGetGraphMemAttribute`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync` """ cdef cyruntime.cudaGraphMemAttributeType cyattr = attr.value - cdef utils.HelperCUgraphMem_attribute cyvalue = utils.HelperCUgraphMem_attribute(attr, value, is_getter=False) + cdef _HelperCUgraphMem_attribute cyvalue = _HelperCUgraphMem_attribute(attr, value, is_getter=False) cdef void* cyvalue_ptr = cyvalue.cptr with nogil: err = cyruntime.cudaDeviceSetGraphMemAttribute(device, cyattr, cyvalue_ptr) @@ -32571,7 +32575,7 @@ def cudaGraphGetNodes(graph, size_t numNodes = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - nodes : List[:py:obj:`~.cudaGraphNode_t`] + nodes : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the nodes numNodes : int See description @@ -32630,7 +32634,7 @@ def cudaGraphGetRootNodes(graph, size_t pNumRootNodes = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - pRootNodes : List[:py:obj:`~.cudaGraphNode_t`] + pRootNodes : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the root nodes pNumRootNodes : int See description @@ -32691,9 +32695,9 @@ def cudaGraphGetEdges(graph, size_t numEdges = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Location to return edge endpoints - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Location to return edge endpoints numEdges : int See description @@ -32769,11 +32773,11 @@ def cudaGraphGetEdges_v2(graph, size_t numEdges = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Location to return edge endpoints - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Location to return edge endpoints - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional location to return edge data numEdges : int See description @@ -32853,7 +32857,7 @@ def cudaGraphNodeGetDependencies(node, size_t pNumDependencies = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the dependencies pNumDependencies : int See description @@ -32918,9 +32922,9 @@ def cudaGraphNodeGetDependencies_v2(node, size_t pNumDependencies = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the dependencies - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array to return edge data for each dependency pNumDependencies : int See description @@ -32990,7 +32994,7 @@ def cudaGraphNodeGetDependentNodes(node, size_t pNumDependentNodes = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` - pDependentNodes : List[:py:obj:`~.cudaGraphNode_t`] + pDependentNodes : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the dependent nodes pNumDependentNodes : int See description @@ -33055,9 +33059,9 @@ def cudaGraphNodeGetDependentNodes_v2(node, size_t pNumDependentNodes = 0): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorLossyQuery`, :py:obj:`~.cudaErrorInvalidValue` - pDependentNodes : List[:py:obj:`~.cudaGraphNode_t`] + pDependentNodes : list[:py:obj:`~.cudaGraphNode_t`] Pointer to return the dependent nodes - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional pointer to return edge data for dependent nodes pNumDependentNodes : int See description @@ -33105,7 +33109,7 @@ def cudaGraphNodeGetDependentNodes_v2(node, size_t pNumDependentNodes = 0): {{if 'cudaGraphAddDependencies' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies): +def cudaGraphAddDependencies(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies): """ Adds dependency edges to a graph. The number of dependencies to be added is defined by `numDependencies` @@ -33119,9 +33123,9 @@ def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | Li ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which dependencies are added - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Array of dependent nodes numDependencies : size_t Number of dependencies to be added @@ -33137,10 +33141,10 @@ def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | Li """ to = [] if to is None else to if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -33183,7 +33187,7 @@ def cudaGraphAddDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | Li {{if 'cudaGraphAddDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], edgeData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies): +def cudaGraphAddDependencies_v2(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], edgeData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies): """ Adds dependency edges to a graph. (12.3+) The number of dependencies to be added is defined by `numDependencies` @@ -33197,11 +33201,11 @@ def cudaGraphAddDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which dependencies are added - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Array of dependent nodes - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array of edge data. If NULL, default (zeroed) edge data is assumed. numDependencies : size_t @@ -33218,13 +33222,13 @@ def cudaGraphAddDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | """ edgeData = [] if edgeData is None else edgeData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in edgeData): - raise TypeError("Argument 'edgeData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") to = [] if to is None else to if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -33276,7 +33280,7 @@ def cudaGraphAddDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | {{if 'cudaGraphRemoveDependencies' in found_functions}} @cython.embedsignature(True) -def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies): +def cudaGraphRemoveDependencies(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies): """ Removes dependency edges from a graph. The number of `pDependencies` to be removed is defined by @@ -33291,9 +33295,9 @@ def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph from which to remove dependencies - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Array of dependent nodes numDependencies : size_t Number of dependencies to be removed @@ -33309,10 +33313,10 @@ def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | """ to = [] if to is None else to if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -33355,7 +33359,7 @@ def cudaGraphRemoveDependencies(graph, from_ : Optional[Tuple[cudaGraphNode_t] | {{if 'cudaGraphRemoveDependencies_v2' in found_functions}} @cython.embedsignature(True) -def cudaGraphRemoveDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], to : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], edgeData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies): +def cudaGraphRemoveDependencies_v2(graph, from_ : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], to : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], edgeData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies): """ Removes dependency edges from a graph. (12.3+) The number of `pDependencies` to be removed is defined by @@ -33372,11 +33376,11 @@ def cudaGraphRemoveDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph from which to remove dependencies - from : List[:py:obj:`~.cudaGraphNode_t`] + from : list[:py:obj:`~.cudaGraphNode_t`] Array of nodes that provide the dependencies - to : List[:py:obj:`~.cudaGraphNode_t`] + to : list[:py:obj:`~.cudaGraphNode_t`] Array of dependent nodes - edgeData : List[:py:obj:`~.cudaGraphEdgeData`] + edgeData : list[:py:obj:`~.cudaGraphEdgeData`] Optional array of edge data. If NULL, edge data is assumed to be default (zeroed). numDependencies : size_t @@ -33393,13 +33397,13 @@ def cudaGraphRemoveDependencies_v2(graph, from_ : Optional[Tuple[cudaGraphNode_t """ edgeData = [] if edgeData is None else edgeData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in edgeData): - raise TypeError("Argument 'edgeData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'edgeData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") to = [] if to is None else to if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in to): - raise TypeError("Argument 'to' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'to' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") from_ = [] if from_ is None else from_ if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in from_): - raise TypeError("Argument 'from_' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'from_' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -33836,7 +33840,7 @@ def cudaGraphInstantiateWithParams(graph, instantiateParams : Optional[cudaGraph pgraph = int(cudaGraph_t(graph)) cygraph = pgraph cdef cudaGraphExec_t pGraphExec = cudaGraphExec_t() - cdef cyruntime.cudaGraphInstantiateParams* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams != None else NULL + cdef cyruntime.cudaGraphInstantiateParams* cyinstantiateParams_ptr = instantiateParams._pvt_ptr if instantiateParams is not None else NULL with nogil: err = cyruntime.cudaGraphInstantiateWithParams(pGraphExec._pvt_ptr, cygraph, cyinstantiateParams_ptr) if err != cyruntime.cudaSuccess: @@ -33963,7 +33967,7 @@ def cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaKernelNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecKernelNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -34028,7 +34032,7 @@ def cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaMemcpy3DParms* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecMemcpyNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -34097,9 +34101,9 @@ def cudaGraphExecMemcpyNodeSetParams1D(hGraphExec, node, dst, src, size_t count, else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cydst = utils.HelperInputVoidPtr(dst) + cydst = _HelperInputVoidPtr(dst) cdef void* cydst_ptr = cydst.cptr - cysrc = utils.HelperInputVoidPtr(src) + cysrc = _HelperInputVoidPtr(src) cdef void* cysrc_ptr = cysrc.cptr cdef cyruntime.cudaMemcpyKind cykind = kind.value with nogil: @@ -34171,7 +34175,7 @@ def cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaMemsetParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecMemsetNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -34226,7 +34230,7 @@ def cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams : Optional[cuda else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams != None else NULL + cdef cyruntime.cudaHostNodeParams* cypNodeParams_ptr = pNodeParams._pvt_ptr if pNodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecHostNodeSetParams(cyhGraphExec, cynode, cypNodeParams_ptr) return (_dict_cudaError_t[err],) @@ -34482,7 +34486,7 @@ def cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePa else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreSignalNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecExternalSemaphoresSignalNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -34542,7 +34546,7 @@ def cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodePara else: phGraphExec = int(cudaGraphExec_t(hGraphExec)) cyhGraphExec = phGraphExec - cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaExternalSemaphoreWaitNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecExternalSemaphoresWaitNodeSetParams(cyhGraphExec, cyhNode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -35112,7 +35116,7 @@ def cudaUserObjectCreate(ptr, destroy, unsigned int initialRefcount, unsigned in pdestroy = int(cudaHostFn_t(destroy)) cydestroy = pdestroy cdef cudaUserObject_t object_out = cudaUserObject_t() - cyptr = utils.HelperInputVoidPtr(ptr) + cyptr = _HelperInputVoidPtr(ptr) cdef void* cyptr_ptr = cyptr.cptr with nogil: err = cyruntime.cudaUserObjectCreate(object_out._pvt_ptr, cyptr_ptr, cydestroy, initialRefcount, flags) @@ -35318,7 +35322,7 @@ def cudaGraphReleaseUserObject(graph, object, unsigned int count): {{if 'cudaGraphAddNode' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): +def cudaGraphAddNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): """ Adds a node of arbitrary type to a graph. Creates a new node in `graph` described by `nodeParams` with @@ -35344,7 +35348,7 @@ def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | Li ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node numDependencies : size_t Number of dependencies @@ -35364,7 +35368,7 @@ def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | Li """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -35385,7 +35389,7 @@ def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | Li elif len(pDependencies) == 1: cypDependencies = (pDependencies[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddNode(pGraphNode._pvt_ptr, cygraph, cypDependencies, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -35398,7 +35402,7 @@ def cudaGraphAddNode(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | Li {{if 'cudaGraphAddNode_v2' in found_functions}} @cython.embedsignature(True) -def cudaGraphAddNode_v2(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | List[cudaGraphNode_t]], dependencyData : Optional[Tuple[cudaGraphEdgeData] | List[cudaGraphEdgeData]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): +def cudaGraphAddNode_v2(graph, pDependencies : Optional[tuple[cudaGraphNode_t] | list[cudaGraphNode_t]], dependencyData : Optional[tuple[cudaGraphEdgeData] | list[cudaGraphEdgeData]], size_t numDependencies, nodeParams : Optional[cudaGraphNodeParams]): """ Adds a node of arbitrary type to a graph (12.3+) Creates a new node in `graph` described by `nodeParams` with @@ -35424,9 +35428,9 @@ def cudaGraphAddNode_v2(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | ---------- graph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` Graph to which to add the node - pDependencies : List[:py:obj:`~.cudaGraphNode_t`] + pDependencies : list[:py:obj:`~.cudaGraphNode_t`] Dependencies of the node - dependencyData : List[:py:obj:`~.cudaGraphEdgeData`] + dependencyData : list[:py:obj:`~.cudaGraphEdgeData`] Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies. numDependencies : size_t @@ -35447,10 +35451,10 @@ def cudaGraphAddNode_v2(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | """ dependencyData = [] if dependencyData is None else dependencyData if not all(isinstance(_x, (cudaGraphEdgeData,)) for _x in dependencyData): - raise TypeError("Argument 'dependencyData' is not instance of type (expected Tuple[cyruntime.cudaGraphEdgeData,] or List[cyruntime.cudaGraphEdgeData,]") + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cyruntime.cudaGraphEdgeData,] or list[cyruntime.cudaGraphEdgeData,]") pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): - raise TypeError("Argument 'pDependencies' is not instance of type (expected Tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or List[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") + raise TypeError("Argument 'pDependencies' is not instance of type (expected tuple[cyruntime.cudaGraphNode_t,driver.CUgraphNode] or list[cyruntime.cudaGraphNode_t,driver.CUgraphNode]") cdef cyruntime.cudaGraph_t cygraph if graph is None: pgraph = 0 @@ -35481,7 +35485,7 @@ def cudaGraphAddNode_v2(graph, pDependencies : Optional[Tuple[cudaGraphNode_t] | cydependencyData = (dependencyData[0])._pvt_ptr if numDependencies > len(pDependencies): raise RuntimeError("List is too small: " + str(len(pDependencies)) + " < " + str(numDependencies)) if numDependencies > len(dependencyData): raise RuntimeError("List is too small: " + str(len(dependencyData)) + " < " + str(numDependencies)) - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphAddNode_v2(pGraphNode._pvt_ptr, cygraph, cypDependencies, cydependencyData, numDependencies, cynodeParams_ptr) if len(pDependencies) > 1 and cypDependencies is not NULL: @@ -35531,7 +35535,7 @@ def cudaGraphNodeSetParams(node, nodeParams : Optional[cudaGraphNodeParams]): else: pnode = int(cudaGraphNode_t(node)) cynode = pnode - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphNodeSetParams(cynode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -35591,7 +35595,7 @@ def cudaGraphExecNodeSetParams(graphExec, node, nodeParams : Optional[cudaGraphN else: pgraphExec = int(cudaGraphExec_t(graphExec)) cygraphExec = pgraphExec - cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams != None else NULL + cdef cyruntime.cudaGraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL with nogil: err = cyruntime.cudaGraphExecNodeSetParams(cygraphExec, cynode, cynodeParams_ptr) return (_dict_cudaError_t[err],) @@ -35856,7 +35860,7 @@ def cudaGetDriverEntryPointByVersion(char* symbol, unsigned int cudaVersion, uns {{if 'cudaLibraryLoadData' in found_functions}} @cython.embedsignature(True) -def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[cudaJitOption]], jitOptionsValues : Optional[Tuple[Any] | List[Any]], unsigned int numJitOptions, libraryOptions : Optional[Tuple[cudaLibraryOption] | List[cudaLibraryOption]], libraryOptionValues : Optional[Tuple[Any] | List[Any]], unsigned int numLibraryOptions): +def cudaLibraryLoadData(code, jitOptions : Optional[tuple[cudaJitOption] | list[cudaJitOption]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[cudaLibraryOption] | list[cudaLibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): """ Load a library with specified code and options. Takes a pointer `code` and loads the corresponding library `library` @@ -35898,15 +35902,15 @@ def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[ ---------- code : Any Code to load - jitOptions : List[:py:obj:`~.cudaJitOption`] + jitOptions : list[:py:obj:`~.cudaJitOption`] Options for JIT - jitOptionsValues : List[Any] + jitOptionsValues : list[Any] Option values for JIT numJitOptions : unsigned int Number of options - libraryOptions : List[:py:obj:`~.cudaLibraryOption`] + libraryOptions : list[:py:obj:`~.cudaLibraryOption`] Options for loading - libraryOptionValues : List[Any] + libraryOptionValues : list[Any] Option values for loading numLibraryOptions : unsigned int Number of options for loading @@ -35925,23 +35929,23 @@ def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[ libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues libraryOptions = [] if libraryOptions is None else libraryOptions if not all(isinstance(_x, (cudaLibraryOption)) for _x in libraryOptions): - raise TypeError("Argument 'libraryOptions' is not instance of type (expected Tuple[cyruntime.cudaLibraryOption] or List[cyruntime.cudaLibraryOption]") + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cyruntime.cudaLibraryOption] or list[cyruntime.cudaLibraryOption]") jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues jitOptions = [] if jitOptions is None else jitOptions if not all(isinstance(_x, (cudaJitOption)) for _x in jitOptions): - raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cyruntime.cudaJitOption] or List[cyruntime.cudaJitOption]") + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cyruntime.cudaJitOption] or list[cyruntime.cudaJitOption]") cdef cudaLibrary_t library = cudaLibrary_t() - cycode = utils.HelperInputVoidPtr(code) + cycode = _HelperInputVoidPtr(code) cdef void* cycode_ptr = cycode.cptr cdef vector[cyruntime.cudaJitOption] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] - pylist = [utils.HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) cdef vector[cyruntime.cudaLibraryOption] cylibraryOptions = [pylibraryOptions.value for pylibraryOptions in (libraryOptions)] - pylist = [utils.HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) @@ -35955,7 +35959,7 @@ def cudaLibraryLoadData(code, jitOptions : Optional[Tuple[cudaJitOption] | List[ {{if 'cudaLibraryLoadFromFile' in found_functions}} @cython.embedsignature(True) -def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[cudaJitOption] | List[cudaJitOption]], jitOptionsValues : Optional[Tuple[Any] | List[Any]], unsigned int numJitOptions, libraryOptions : Optional[Tuple[cudaLibraryOption] | List[cudaLibraryOption]], libraryOptionValues : Optional[Tuple[Any] | List[Any]], unsigned int numLibraryOptions): +def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[tuple[cudaJitOption] | list[cudaJitOption]], jitOptionsValues : Optional[tuple[Any] | list[Any]], unsigned int numJitOptions, libraryOptions : Optional[tuple[cudaLibraryOption] | list[cudaLibraryOption]], libraryOptionValues : Optional[tuple[Any] | list[Any]], unsigned int numLibraryOptions): """ Load a library with specified file and options. Takes a pointer `code` and loads the corresponding library `library` @@ -35997,15 +36001,15 @@ def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[cudaJitO ---------- fileName : bytes File to load from - jitOptions : List[:py:obj:`~.cudaJitOption`] + jitOptions : list[:py:obj:`~.cudaJitOption`] Options for JIT - jitOptionsValues : List[Any] + jitOptionsValues : list[Any] Option values for JIT numJitOptions : unsigned int Number of options - libraryOptions : List[:py:obj:`~.cudaLibraryOption`] + libraryOptions : list[:py:obj:`~.cudaLibraryOption`] Options for loading - libraryOptionValues : List[Any] + libraryOptionValues : list[Any] Option values for loading numLibraryOptions : unsigned int Number of options for loading @@ -36024,21 +36028,21 @@ def cudaLibraryLoadFromFile(char* fileName, jitOptions : Optional[Tuple[cudaJitO libraryOptionValues = [] if libraryOptionValues is None else libraryOptionValues libraryOptions = [] if libraryOptions is None else libraryOptions if not all(isinstance(_x, (cudaLibraryOption)) for _x in libraryOptions): - raise TypeError("Argument 'libraryOptions' is not instance of type (expected Tuple[cyruntime.cudaLibraryOption] or List[cyruntime.cudaLibraryOption]") + raise TypeError("Argument 'libraryOptions' is not instance of type (expected tuple[cyruntime.cudaLibraryOption] or list[cyruntime.cudaLibraryOption]") jitOptionsValues = [] if jitOptionsValues is None else jitOptionsValues jitOptions = [] if jitOptions is None else jitOptions if not all(isinstance(_x, (cudaJitOption)) for _x in jitOptions): - raise TypeError("Argument 'jitOptions' is not instance of type (expected Tuple[cyruntime.cudaJitOption] or List[cyruntime.cudaJitOption]") + raise TypeError("Argument 'jitOptions' is not instance of type (expected tuple[cyruntime.cudaJitOption] or list[cyruntime.cudaJitOption]") cdef cudaLibrary_t library = cudaLibrary_t() cdef vector[cyruntime.cudaJitOption] cyjitOptions = [pyjitOptions.value for pyjitOptions in (jitOptions)] - pylist = [utils.HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCudaJitOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(jitOptions, jitOptionsValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperjitOptionsValues = _InputVoidPtrPtrHelper(pylist) cdef void** cyjitOptionsValues_ptr = voidStarHelperjitOptionsValues.cptr if numJitOptions > len(jitOptions): raise RuntimeError("List is too small: " + str(len(jitOptions)) + " < " + str(numJitOptions)) if numJitOptions > len(jitOptionsValues): raise RuntimeError("List is too small: " + str(len(jitOptionsValues)) + " < " + str(numJitOptions)) cdef vector[cyruntime.cudaLibraryOption] cylibraryOptions = [pylibraryOptions.value for pylibraryOptions in (libraryOptions)] - pylist = [utils.HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] - cdef utils.InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = utils.InputVoidPtrPtrHelper(pylist) + pylist = [_HelperCudaLibraryOption(pyoptions, pyoptionValues) for pyoptions, pyoptionValues in zip(libraryOptions, libraryOptionValues)] + cdef _InputVoidPtrPtrHelper voidStarHelperlibraryOptionValues = _InputVoidPtrPtrHelper(pylist) cdef void** cylibraryOptionValues_ptr = voidStarHelperlibraryOptionValues.cptr if numLibraryOptions > len(libraryOptions): raise RuntimeError("List is too small: " + str(len(libraryOptions)) + " < " + str(numLibraryOptions)) if numLibraryOptions > len(libraryOptionValues): raise RuntimeError("List is too small: " + str(len(libraryOptionValues)) + " < " + str(numLibraryOptions)) @@ -36341,7 +36345,7 @@ def cudaLibraryEnumerateKernels(unsigned int numKernels, lib): ------- cudaError_t :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorCudartUnloading`, :py:obj:`~.cudaErrorInitializationError`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` - kernels : List[:py:obj:`~.cudaKernel_t`] + kernels : list[:py:obj:`~.cudaKernel_t`] Buffer where the kernel handles are returned to See Also @@ -36485,7 +36489,7 @@ def cudaKernelSetAttributeForDevice(kernel, attr not None : cudaFuncAttribute, i def cudaGetExportTable(pExportTableId : Optional[cudaUUID_t]): """""" cdef void_ptr ppExportTable = 0 - cdef cyruntime.cudaUUID_t* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId != None else NULL + cdef cyruntime.cudaUUID_t* cypExportTableId_ptr = pExportTableId._pvt_ptr if pExportTableId is not None else NULL with nogil: err = cyruntime.cudaGetExportTable(&ppExportTable, cypExportTableId_ptr) if err != cyruntime.cudaSuccess: @@ -36528,7 +36532,7 @@ def cudaGetKernel(entryFuncAddr): cudaGetKernel (C++ API) """ cdef cudaKernel_t kernelPtr = cudaKernel_t() - cyentryFuncAddr = utils.HelperInputVoidPtr(entryFuncAddr) + cyentryFuncAddr = _HelperInputVoidPtr(entryFuncAddr) cdef void* cyentryFuncAddr_ptr = cyentryFuncAddr.cptr with nogil: err = cyruntime.cudaGetKernel(kernelPtr._pvt_ptr, cyentryFuncAddr_ptr) @@ -36568,7 +36572,7 @@ def make_cudaPitchedPtr(d, size_t p, size_t xsz, size_t ysz): -------- make_cudaExtent, make_cudaPos """ - cyd = utils.HelperInputVoidPtr(d) + cyd = _HelperInputVoidPtr(d) cdef void* cyd_ptr = cyd.cptr with nogil: err = cyruntime.make_cudaPitchedPtr(cyd_ptr, p, xsz, ysz) @@ -37188,7 +37192,7 @@ def cudaEGLStreamProducerReturnFrame(conn, eglframe : Optional[cudaEglFrame], pS cyconn = conn else: raise TypeError("Argument 'conn' is not instance of type (expected , found " + str(type(conn))) - cdef cyruntime.cudaEglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe != None else NULL + cdef cyruntime.cudaEglFrame* cyeglframe_ptr = eglframe._pvt_ptr if eglframe is not None else NULL with nogil: err = cyruntime.cudaEGLStreamProducerReturnFrame(cyconn, cyeglframe_ptr, cypStream) return (_dict_cudaError_t[err],) @@ -37393,7 +37397,7 @@ def cudaGLGetDevices(unsigned int cudaDeviceCount, deviceList not None : cudaGLD pCudaDeviceCount : unsigned int Returned number of CUDA devices corresponding to the current OpenGL context - pCudaDevices : List[int] + pCudaDevices : list[int] Returned CUDA devices corresponding to the current OpenGL context See Also @@ -38214,3 +38218,101 @@ def sizeof(objType): if objType == cudaEglStreamConnection: return sizeof(cyruntime.cudaEglStreamConnection){{endif}} raise TypeError("Unknown type: " + str(objType)) + +cdef int _add_native_handle_getters() except?-1: + from cuda.bindings.utils import _add_cuda_native_handle_getter + {{if 'cudaArray_t' in found_types}} + def cudaArray_t_getter(cudaArray_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaArray_t, cudaArray_t_getter) + {{endif}} + {{if 'cudaArray_const_t' in found_types}} + def cudaArray_const_t_getter(cudaArray_const_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaArray_const_t, cudaArray_const_t_getter) + {{endif}} + {{if 'cudaMipmappedArray_t' in found_types}} + def cudaMipmappedArray_t_getter(cudaMipmappedArray_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMipmappedArray_t, cudaMipmappedArray_t_getter) + {{endif}} + {{if 'cudaMipmappedArray_const_t' in found_types}} + def cudaMipmappedArray_const_t_getter(cudaMipmappedArray_const_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMipmappedArray_const_t, cudaMipmappedArray_const_t_getter) + {{endif}} + {{if 'cudaStream_t' in found_types}} + def cudaStream_t_getter(cudaStream_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaStream_t, cudaStream_t_getter) + {{endif}} + {{if 'cudaEvent_t' in found_types}} + def cudaEvent_t_getter(cudaEvent_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaEvent_t, cudaEvent_t_getter) + {{endif}} + {{if 'cudaGraphicsResource_t' in found_types}} + def cudaGraphicsResource_t_getter(cudaGraphicsResource_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphicsResource_t, cudaGraphicsResource_t_getter) + {{endif}} + {{if 'cudaExternalMemory_t' in found_types}} + def cudaExternalMemory_t_getter(cudaExternalMemory_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaExternalMemory_t, cudaExternalMemory_t_getter) + {{endif}} + {{if 'cudaExternalSemaphore_t' in found_types}} + def cudaExternalSemaphore_t_getter(cudaExternalSemaphore_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaExternalSemaphore_t, cudaExternalSemaphore_t_getter) + {{endif}} + {{if 'cudaGraph_t' in found_types}} + def cudaGraph_t_getter(cudaGraph_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraph_t, cudaGraph_t_getter) + {{endif}} + {{if 'cudaGraphNode_t' in found_types}} + def cudaGraphNode_t_getter(cudaGraphNode_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphNode_t, cudaGraphNode_t_getter) + {{endif}} + {{if 'cudaUserObject_t' in found_types}} + def cudaUserObject_t_getter(cudaUserObject_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaUserObject_t, cudaUserObject_t_getter) + {{endif}} + {{if 'cudaFunction_t' in found_types}} + def cudaFunction_t_getter(cudaFunction_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaFunction_t, cudaFunction_t_getter) + {{endif}} + {{if 'cudaKernel_t' in found_types}} + def cudaKernel_t_getter(cudaKernel_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaKernel_t, cudaKernel_t_getter) + {{endif}} + {{if 'cudaLibrary_t' in found_types}} + def cudaLibrary_t_getter(cudaLibrary_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaLibrary_t, cudaLibrary_t_getter) + {{endif}} + {{if 'cudaMemPool_t' in found_types}} + def cudaMemPool_t_getter(cudaMemPool_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaMemPool_t, cudaMemPool_t_getter) + {{endif}} + {{if 'cudaGraphExec_t' in found_types}} + def cudaGraphExec_t_getter(cudaGraphExec_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphExec_t, cudaGraphExec_t_getter) + {{endif}} + {{if 'cudaGraphDeviceNode_t' in found_types}} + def cudaGraphDeviceNode_t_getter(cudaGraphDeviceNode_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaGraphDeviceNode_t, cudaGraphDeviceNode_t_getter) + {{endif}} + {{if 'cudaAsyncCallbackHandle_t' in found_types}} + def cudaAsyncCallbackHandle_t_getter(cudaAsyncCallbackHandle_t x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaAsyncCallbackHandle_t, cudaAsyncCallbackHandle_t_getter) + {{endif}} + {{if True}} + def EGLImageKHR_getter(EGLImageKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLImageKHR, EGLImageKHR_getter) + {{endif}} + {{if True}} + def EGLStreamKHR_getter(EGLStreamKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLStreamKHR, EGLStreamKHR_getter) + {{endif}} + {{if True}} + def EGLSyncKHR_getter(EGLSyncKHR x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(EGLSyncKHR, EGLSyncKHR_getter) + {{endif}} + {{if True}} + def cudaEglStreamConnection_getter(cudaEglStreamConnection x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(cudaEglStreamConnection, cudaEglStreamConnection_getter) + {{endif}} + return 0 +_add_native_handle_getters() + diff --git a/cuda_bindings/cuda/bindings/utils/__init__.pxd b/cuda_bindings/cuda/bindings/utils/__init__.pxd deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/cuda_bindings/cuda/bindings/utils/__init__.py b/cuda_bindings/cuda/bindings/utils/__init__.py index ab13d004c4..5f9288b81e 100644 --- a/cuda_bindings/cuda/bindings/utils/__init__.py +++ b/cuda_bindings/cuda/bindings/utils/__init__.py @@ -1,5 +1,31 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE -from ._get_handle import get_cuda_native_handle +from typing import Any, Callable + from ._ptx_utils import get_minimal_required_cuda_ver_from_ptx_ver, get_ptx_ver + +_handle_getters: dict[type, Callable[[Any], int]] = {} + + +def _add_cuda_native_handle_getter(t: type, getter: Callable[[Any], int]) -> None: + _handle_getters[t] = getter + + +def get_cuda_native_handle(obj: Any) -> int: + """Returns the address of the provided CUDA Python object as a Python int. + + Parameters + ---------- + obj : Any + CUDA Python object + + Returns + ------- + int : The object address. + """ + obj_type = type(obj) + try: + return _handle_getters[obj_type](obj) + except KeyError: + raise TypeError("Unknown type: " + str(obj_type)) from None diff --git a/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in b/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in deleted file mode 100644 index 2d40133dba..0000000000 --- a/cuda_bindings/cuda/bindings/utils/_get_handle.pyx.in +++ /dev/null @@ -1,230 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE - -# This code was automatically generated with version 12.9.0. Do not modify it directly. - -from libc.stdint cimport uintptr_t -cimport cython - -from cuda.bindings cimport driver, runtime, cydriver, cyruntime - - -cdef dict _handle_getters = None - -@cython.embedsignature(True) -def get_cuda_native_handle(obj) -> int: - """ Returns the address of the provided CUDA Python object as Python int. - - Parameters - ---------- - obj : Any - CUDA Python object - - Returns - ------- - int : The object address. - """ - global _handle_getters - obj_type = type(obj) - if _handle_getters is None: - _handle_getters = dict() - {{if 'CUcontext' in found_types}} - def CUcontext_getter(driver.CUcontext x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUcontext] = CUcontext_getter - {{endif}} - {{if 'CUmodule' in found_types}} - def CUmodule_getter(driver.CUmodule x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUmodule] = CUmodule_getter - {{endif}} - {{if 'CUfunction' in found_types}} - def CUfunction_getter(driver.CUfunction x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUfunction] = CUfunction_getter - {{endif}} - {{if 'CUlibrary' in found_types}} - def CUlibrary_getter(driver.CUlibrary x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUlibrary] = CUlibrary_getter - {{endif}} - {{if 'CUkernel' in found_types}} - def CUkernel_getter(driver.CUkernel x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUkernel] = CUkernel_getter - {{endif}} - {{if 'CUarray' in found_types}} - def CUarray_getter(driver.CUarray x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUarray] = CUarray_getter - {{endif}} - {{if 'CUmipmappedArray' in found_types}} - def CUmipmappedArray_getter(driver.CUmipmappedArray x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUmipmappedArray] = CUmipmappedArray_getter - {{endif}} - {{if 'CUtexref' in found_types}} - def CUtexref_getter(driver.CUtexref x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUtexref] = CUtexref_getter - {{endif}} - {{if 'CUsurfref' in found_types}} - def CUsurfref_getter(driver.CUsurfref x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUsurfref] = CUsurfref_getter - {{endif}} - {{if 'CUevent' in found_types}} - def CUevent_getter(driver.CUevent x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUevent] = CUevent_getter - {{endif}} - {{if 'CUstream' in found_types}} - def CUstream_getter(driver.CUstream x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUstream] = CUstream_getter - {{endif}} - {{if 'CUgraphicsResource' in found_types}} - def CUgraphicsResource_getter(driver.CUgraphicsResource x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraphicsResource] = CUgraphicsResource_getter - {{endif}} - {{if 'CUexternalMemory' in found_types}} - def CUexternalMemory_getter(driver.CUexternalMemory x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUexternalMemory] = CUexternalMemory_getter - {{endif}} - {{if 'CUexternalSemaphore' in found_types}} - def CUexternalSemaphore_getter(driver.CUexternalSemaphore x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUexternalSemaphore] = CUexternalSemaphore_getter - {{endif}} - {{if 'CUgraph' in found_types}} - def CUgraph_getter(driver.CUgraph x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraph] = CUgraph_getter - {{endif}} - {{if 'CUgraphNode' in found_types}} - def CUgraphNode_getter(driver.CUgraphNode x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraphNode] = CUgraphNode_getter - {{endif}} - {{if 'CUgraphExec' in found_types}} - def CUgraphExec_getter(driver.CUgraphExec x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraphExec] = CUgraphExec_getter - {{endif}} - {{if 'CUmemoryPool' in found_types}} - def CUmemoryPool_getter(driver.CUmemoryPool x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUmemoryPool] = CUmemoryPool_getter - {{endif}} - {{if 'CUuserObject' in found_types}} - def CUuserObject_getter(driver.CUuserObject x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUuserObject] = CUuserObject_getter - {{endif}} - {{if 'CUgraphDeviceNode' in found_types}} - def CUgraphDeviceNode_getter(driver.CUgraphDeviceNode x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgraphDeviceNode] = CUgraphDeviceNode_getter - {{endif}} - {{if 'CUasyncCallbackHandle' in found_types}} - def CUasyncCallbackHandle_getter(driver.CUasyncCallbackHandle x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUasyncCallbackHandle] = CUasyncCallbackHandle_getter - {{endif}} - {{if 'CUgreenCtx' in found_types}} - def CUgreenCtx_getter(driver.CUgreenCtx x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUgreenCtx] = CUgreenCtx_getter - {{endif}} - {{if 'CUlinkState' in found_types}} - def CUlinkState_getter(driver.CUlinkState x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUlinkState] = CUlinkState_getter - {{endif}} - {{if 'CUdevResourceDesc' in found_types}} - def CUdevResourceDesc_getter(driver.CUdevResourceDesc x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUdevResourceDesc] = CUdevResourceDesc_getter - {{endif}} - {{if 'CUlogsCallbackHandle' in found_types}} - def CUlogsCallbackHandle_getter(driver.CUlogsCallbackHandle x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUlogsCallbackHandle] = CUlogsCallbackHandle_getter - {{endif}} - {{if True}} - def CUeglStreamConnection_getter(driver.CUeglStreamConnection x): return (x._pvt_ptr[0]) - _handle_getters[driver.CUeglStreamConnection] = CUeglStreamConnection_getter - {{endif}} - {{if True}} - def EGLImageKHR_getter(runtime.EGLImageKHR x): return (x._pvt_ptr[0]) - _handle_getters[runtime.EGLImageKHR] = EGLImageKHR_getter - {{endif}} - {{if True}} - def EGLStreamKHR_getter(runtime.EGLStreamKHR x): return (x._pvt_ptr[0]) - _handle_getters[runtime.EGLStreamKHR] = EGLStreamKHR_getter - {{endif}} - {{if True}} - def EGLSyncKHR_getter(runtime.EGLSyncKHR x): return (x._pvt_ptr[0]) - _handle_getters[runtime.EGLSyncKHR] = EGLSyncKHR_getter - {{endif}} - {{if 'cudaArray_t' in found_types}} - def cudaArray_t_getter(runtime.cudaArray_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaArray_t] = cudaArray_t_getter - {{endif}} - {{if 'cudaArray_const_t' in found_types}} - def cudaArray_const_t_getter(runtime.cudaArray_const_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaArray_const_t] = cudaArray_const_t_getter - {{endif}} - {{if 'cudaMipmappedArray_t' in found_types}} - def cudaMipmappedArray_t_getter(runtime.cudaMipmappedArray_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaMipmappedArray_t] = cudaMipmappedArray_t_getter - {{endif}} - {{if 'cudaMipmappedArray_const_t' in found_types}} - def cudaMipmappedArray_const_t_getter(runtime.cudaMipmappedArray_const_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaMipmappedArray_const_t] = cudaMipmappedArray_const_t_getter - {{endif}} - {{if 'cudaStream_t' in found_types}} - def cudaStream_t_getter(runtime.cudaStream_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaStream_t] = cudaStream_t_getter - {{endif}} - {{if 'cudaEvent_t' in found_types}} - def cudaEvent_t_getter(runtime.cudaEvent_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaEvent_t] = cudaEvent_t_getter - {{endif}} - {{if 'cudaGraphicsResource_t' in found_types}} - def cudaGraphicsResource_t_getter(runtime.cudaGraphicsResource_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraphicsResource_t] = cudaGraphicsResource_t_getter - {{endif}} - {{if 'cudaExternalMemory_t' in found_types}} - def cudaExternalMemory_t_getter(runtime.cudaExternalMemory_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaExternalMemory_t] = cudaExternalMemory_t_getter - {{endif}} - {{if 'cudaExternalSemaphore_t' in found_types}} - def cudaExternalSemaphore_t_getter(runtime.cudaExternalSemaphore_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaExternalSemaphore_t] = cudaExternalSemaphore_t_getter - {{endif}} - {{if 'cudaGraph_t' in found_types}} - def cudaGraph_t_getter(runtime.cudaGraph_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraph_t] = cudaGraph_t_getter - {{endif}} - {{if 'cudaGraphNode_t' in found_types}} - def cudaGraphNode_t_getter(runtime.cudaGraphNode_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraphNode_t] = cudaGraphNode_t_getter - {{endif}} - {{if 'cudaUserObject_t' in found_types}} - def cudaUserObject_t_getter(runtime.cudaUserObject_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaUserObject_t] = cudaUserObject_t_getter - {{endif}} - {{if 'cudaFunction_t' in found_types}} - def cudaFunction_t_getter(runtime.cudaFunction_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaFunction_t] = cudaFunction_t_getter - {{endif}} - {{if 'cudaKernel_t' in found_types}} - def cudaKernel_t_getter(runtime.cudaKernel_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaKernel_t] = cudaKernel_t_getter - {{endif}} - {{if 'cudaLibrary_t' in found_types}} - def cudaLibrary_t_getter(runtime.cudaLibrary_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaLibrary_t] = cudaLibrary_t_getter - {{endif}} - {{if 'cudaMemPool_t' in found_types}} - def cudaMemPool_t_getter(runtime.cudaMemPool_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaMemPool_t] = cudaMemPool_t_getter - {{endif}} - {{if 'cudaGraphExec_t' in found_types}} - def cudaGraphExec_t_getter(runtime.cudaGraphExec_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraphExec_t] = cudaGraphExec_t_getter - {{endif}} - {{if 'cudaGraphDeviceNode_t' in found_types}} - def cudaGraphDeviceNode_t_getter(runtime.cudaGraphDeviceNode_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaGraphDeviceNode_t] = cudaGraphDeviceNode_t_getter - {{endif}} - {{if 'cudaAsyncCallbackHandle_t' in found_types}} - def cudaAsyncCallbackHandle_t_getter(runtime.cudaAsyncCallbackHandle_t x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaAsyncCallbackHandle_t] = cudaAsyncCallbackHandle_t_getter - {{endif}} - {{if True}} - def cudaEglStreamConnection_getter(runtime.cudaEglStreamConnection x): return (x._pvt_ptr[0]) - _handle_getters[runtime.cudaEglStreamConnection] = cudaEglStreamConnection_getter - {{endif}} - try: - return _handle_getters[obj_type](obj) - except KeyError: - raise TypeError("Unknown type: " + str(obj_type)) from None \ No newline at end of file diff --git a/cuda_bindings/docs/source/install.md b/cuda_bindings/docs/source/install.md index 175e304e61..7fac151762 100644 --- a/cuda_bindings/docs/source/install.md +++ b/cuda_bindings/docs/source/install.md @@ -56,7 +56,6 @@ Source builds require that the provided CUDA headers are of the same major.minor ```console $ export CUDA_HOME=/usr/local/cuda -$ export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH ``` See [Environment Variables](environment_variables.md) for a description of other build-time environment variables. diff --git a/cuda_bindings/docs/source/release/12.X.Y-notes.rst b/cuda_bindings/docs/source/release/12.X.Y-notes.rst index 80cd405308..411d07b544 100644 --- a/cuda_bindings/docs/source/release/12.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/12.X.Y-notes.rst @@ -27,6 +27,8 @@ Highlights * Python bindings in every module, including ``driver``, ``runtime``, and ``nvrtc``, now have the GIL released before calling the underlying C APIs. +* The Python overhead of calling functions in CUDA bindings in ``driver``, + ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. Bug fixes --------- diff --git a/cuda_bindings/pyproject.toml b/cuda_bindings/pyproject.toml index f1546e2999..839843f253 100644 --- a/cuda_bindings/pyproject.toml +++ b/cuda_bindings/pyproject.toml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE [build-system] -requires = ["setuptools>=77.0.0", "cython>=3.0,<3.1.0", "pyclibrary>=0.1.7"] +requires = ["setuptools>=77.0.0", "cython>=3.1,<3.2", "pyclibrary>=0.1.7"] build-backend = "setuptools.build_meta" [project] @@ -27,8 +27,7 @@ dynamic = [ "readme", ] dependencies = [ - "cuda-pathfinder ~= 1.0", - "pywin32; sys_platform == 'win32'", + "cuda-pathfinder ~=1.1", ] [project.optional-dependencies] @@ -40,12 +39,11 @@ all = [ ] test = [ - "cython>=3.0,<3.1.0", + "cython>=3.1,<3.2", "setuptools>=77.0.0", "numpy>=1.21.1", "pytest>=6.2.4", "pytest-benchmark>=3.4.1", - "llvmlite" ] [project.urls] @@ -86,7 +84,6 @@ select = [ ] ignore = [ - "UP006", "UP007", "E741", # ambiguous variable name such as I "B007", # rename unsued loop variable to _name diff --git a/cuda_bindings/setup.py b/cuda_bindings/setup.py index 128220371a..f810452a78 100644 --- a/cuda_bindings/setup.py +++ b/cuda_bindings/setup.py @@ -31,6 +31,7 @@ raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set") CUDA_HOME = CUDA_HOME.split(os.pathsep) + if os.environ.get("PARALLEL_LEVEL") is not None: warn( "Environment variable PARALLEL_LEVEL is deprecated. Use CUDA_PYTHON_PARALLEL_LEVEL instead", @@ -219,7 +220,6 @@ def generate_output(infile, local): os.path.join("cuda", "bindings"), os.path.join("cuda", "bindings", "_bindings"), os.path.join("cuda", "bindings", "_lib"), - os.path.join("cuda", "bindings", "_lib", "cyruntime"), os.path.join("cuda", "bindings", "_internal"), os.path.join("cuda", "bindings", "utils"), ] @@ -238,6 +238,8 @@ def generate_output(infile, local): os.path.dirname(sysconfig.get_path("include")), ] + include_path_list library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")] +cudalib_subdirs = [r"lib\x64"] if sys.platform == "win32" else ["lib64", "lib"] +library_dirs.extend(os.path.join(prefix, subdir) for prefix in CUDA_HOME for subdir in cudalib_subdirs) extra_compile_args = [] extra_cythonize_kwargs = {} @@ -246,12 +248,13 @@ def generate_output(infile, local): "-std=c++14", "-fpermissive", "-Wno-deprecated-declarations", - "-D _GLIBCXX_ASSERTIONS", "-fno-var-tracking-assignments", ] if "--debug" in sys.argv: extra_cythonize_kwargs["gdb_debug"] = True extra_compile_args += ["-g", "-O0"] + extra_compile_args += ["-D _GLIBCXX_ASSERTIONS"] # libstdc++ + # extra_compile_args += ["-D _LIBCPP_ENABLE_ASSERTIONS"] # Consider: if clang, use libc++ preprocessor macros. else: extra_compile_args += ["-O3"] @@ -323,7 +326,7 @@ def do_cythonize(extensions): return cythonize( extensions, nthreads=nthreads, - compiler_directives=dict(language_level=3, embedsignature=True, binding=True), + compiler_directives=dict(language_level=3, embedsignature=True, binding=True, freethreading_compatible=True), **extra_cythonize_kwargs, ) @@ -340,9 +343,6 @@ def do_cythonize(extensions): (["cuda/bindings/_bindings/cyruntime.pyx"], static_runtime_libraries), (["cuda/bindings/_bindings/cyruntime_ptds.pyx"], static_runtime_libraries), # utils - (["cuda/bindings/_lib/utils.pyx", "cuda/bindings/_lib/param_packer.cpp"], None), - (["cuda/bindings/_lib/cyruntime/cyruntime.pyx"], None), - (["cuda/bindings/_lib/cyruntime/utils.pyx"], None), (["cuda/bindings/utils/*.pyx"], None), # public *(([f], None) for f in cuda_bindings_files), diff --git a/cuda_bindings/tests/cython/build_tests.bat b/cuda_bindings/tests/cython/build_tests.bat index c56efac47f..fda860506e 100644 --- a/cuda_bindings/tests/cython/build_tests.bat +++ b/cuda_bindings/tests/cython/build_tests.bat @@ -5,5 +5,5 @@ REM SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE setlocal set CL=%CL% /I"%CUDA_HOME%\include" - cythonize -3 -i %~dp0test_*.pyx + cythonize -3 -i -Xfreethreading_compatible=True %~dp0test_*.pyx endlocal diff --git a/cuda_bindings/tests/cython/build_tests.sh b/cuda_bindings/tests/cython/build_tests.sh index 50a16b6930..1e08f35955 100755 --- a/cuda_bindings/tests/cython/build_tests.sh +++ b/cuda_bindings/tests/cython/build_tests.sh @@ -14,4 +14,4 @@ else exit 1 fi -cythonize -3 -i ${SCRIPTPATH}/test_*.pyx +cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx diff --git a/cuda_bindings/tests/test_cufile.py b/cuda_bindings/tests/test_cufile.py index 1a51348680..32b07a802f 100644 --- a/cuda_bindings/tests/test_cufile.py +++ b/cuda_bindings/tests/test_cufile.py @@ -172,7 +172,7 @@ def test_handle_register(): file_path = "test_handle_register.bin" # Create file with POSIX operations - fd = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o600) # Write test data using POSIX write test_data = b"Test data for cuFile - POSIX write" @@ -502,7 +502,7 @@ def test_cufile_read_write(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register buffers with cuFile write_buf_int = int(write_buf) @@ -601,7 +601,7 @@ def test_cufile_read_write_host_memory(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register host buffers with cuFile write_buf_int = int(write_buf) @@ -702,7 +702,7 @@ def test_cufile_read_write_large(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register buffers with cuFile write_buf_int = int(write_buf) @@ -793,7 +793,7 @@ def test_cufile_write_async(cufile_env_json): # Create test file file_path = "test_cufile_write_async.bin" - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: # Register file handle @@ -888,7 +888,7 @@ def test_cufile_read_async(cufile_env_json): file_path = "test_cufile_read_async.bin" # First create and write test data without O_DIRECT - fd_temp = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o644) + fd_temp = os.open(file_path, os.O_CREAT | os.O_RDWR, 0o600) # Create test data that's aligned to 4096 bytes test_string = b"Async read test data for cuFile!" test_string_len = len(test_string) @@ -992,7 +992,7 @@ def test_cufile_async_read_write(cufile_env_json): # Create test file file_path = "test_cufile_async_rw.bin" - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) try: # Register file handle @@ -1139,7 +1139,7 @@ def test_batch_io_basic(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register buffers with cuFile for buf in buffers: @@ -1353,7 +1353,7 @@ def test_batch_io_cancel(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register buffers with cuFile for buf in buffers: @@ -1463,7 +1463,7 @@ def test_batch_io_large_operations(): try: # Create file with O_DIRECT - fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o644) + fd = os.open(file_path, os.O_CREAT | os.O_RDWR | os.O_DIRECT, 0o600) # Register all buffers with cuFile all_buffers = write_buffers + read_buffers diff --git a/cuda_bindings/tests/test_nvvm.py b/cuda_bindings/tests/test_nvvm.py index 974547eb3d..e96120ec9e 100644 --- a/cuda_bindings/tests/test_nvvm.py +++ b/cuda_bindings/tests/test_nvvm.py @@ -4,22 +4,13 @@ import binascii import re -import textwrap from contextlib import contextmanager import pytest from cuda.bindings import nvvm -MINIMAL_NVVMIR_FIXTURE_PARAMS = ["txt", "bitcode_static"] -try: - import llvmlite.binding as llvmlite_binding # Optional test dependency. -except ImportError: - llvmlite_binding = None -else: - MINIMAL_NVVMIR_FIXTURE_PARAMS.append("bitcode_dynamic") - -MINIMAL_NVVMIR_TXT = b"""\ +MINIMAL_NVVMIR_TXT_TEMPLATE = b"""\ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-i128:128:128-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64" target triple = "nvptx64-nvidia-cuda" @@ -131,43 +122,24 @@ "6e673e0000000000", } -MINIMAL_NVVMIR_CACHE = {} - -@pytest.fixture(params=MINIMAL_NVVMIR_FIXTURE_PARAMS) +@pytest.fixture(params=("txt", "bitcode_static")) def minimal_nvvmir(request): - for pass_counter in range(2): - nvvmir = MINIMAL_NVVMIR_CACHE.get(request.param, -1) - if nvvmir != -1: - if nvvmir is None: - pytest.skip(f"UNAVAILABLE: {request.param}") - return nvvmir - if pass_counter: - raise AssertionError("This code path is meant to be unreachable.") - # Build cache entries, then try again (above). - major, minor, debug_major, debug_minor = nvvm.ir_version() - txt = MINIMAL_NVVMIR_TXT % (major, debug_major) - if llvmlite_binding is None: - bitcode_dynamic = None - else: - bitcode_dynamic = llvmlite_binding.parse_assembly(txt.decode()).as_bitcode() - bitcode_static = MINIMAL_NVVMIR_BITCODE_STATIC.get((major, debug_major)) - if bitcode_static is not None: - bitcode_static = binascii.unhexlify(bitcode_static) - MINIMAL_NVVMIR_CACHE["txt"] = txt - MINIMAL_NVVMIR_CACHE["bitcode_dynamic"] = bitcode_dynamic - MINIMAL_NVVMIR_CACHE["bitcode_static"] = bitcode_static - if bitcode_static is None: - if bitcode_dynamic is None: - raise RuntimeError("Please `pip install llvmlite` to generate `bitcode_static` (see PR #443)") - bitcode_hex = binascii.hexlify(bitcode_dynamic).decode("ascii") - print("\n\nMINIMAL_NVVMIR_BITCODE_STATIC = { # PLEASE ADD TO test_nvvm.py") - print(f" ({major}, {debug_major}): # (major, debug_major)") - lines = textwrap.wrap(bitcode_hex, width=80) - for line in lines[:-1]: - print(f' "{line}"') - print(f' "{lines[-1]}",') - print("}\n", flush=True) + major, minor, debug_major, debug_minor = nvvm.ir_version() + + if request.param == "txt": + return MINIMAL_NVVMIR_TXT_TEMPLATE % (major, debug_major) + + bitcode_static_binascii = MINIMAL_NVVMIR_BITCODE_STATIC.get((major, debug_major)) + if bitcode_static_binascii: + return binascii.unhexlify(bitcode_static_binascii) + raise RuntimeError( + "Static bitcode for NVVM IR version " + f"{major}.{debug_major} is not available in this test.\n" + "Maintainers: Please run the helper script to generate it and add the " + "output to the MINIMAL_NVVMIR_BITCODE_STATIC dict:\n" + " ../../toolshed/build_static_bitcode_input.py" + ) @pytest.fixture(params=[nvvm.compile_program, nvvm.verify_program]) diff --git a/cuda_bindings/tests/test_utils.py b/cuda_bindings/tests/test_utils.py index 3da7272ed9..7ed4fd7531 100644 --- a/cuda_bindings/tests/test_utils.py +++ b/cuda_bindings/tests/test_utils.py @@ -2,6 +2,9 @@ # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE import random +import subprocess # nosec B404 +import sys +from pathlib import Path import pytest @@ -87,3 +90,28 @@ def test_get_handle(target): def test_get_handle_error(target): with pytest.raises(TypeError) as e: handle = get_cuda_native_handle(target) + + +@pytest.mark.parametrize( + "module", + [ + # Top-level modules for external Python use + # TODO: Import cycle detected: (('numeric',), ''), stack: [((), + # 'cuda.bindings.cufile'), ((), 'cuda.bindings.cycufile'), + # (('show_config',), 'numpy.__config__'), (('__cpu_features__', + # '__cpu_baseline__', '__cpu_dispatch__'), + # 'numpy._core._multiarray_umath'), (('numeric',), ''), + # (('shape_base',), '')] + # "cufile", + "driver", + "nvjitlink", + "nvrtc", + "nvvm", + # TODO: cuda.bindings.cyruntime -> cuda.bindings._lib.cyruntime.cyruntime cycle + # "runtime", + ], +) +def test_cyclical_imports(module): + subprocess.check_call( # nosec B603 + [sys.executable, Path(__file__).parent / "utils" / "check_cyclical_import.py", f"cuda.bindings.{module}"], + ) diff --git a/cuda_bindings/tests/utils/check_cyclical_import.py b/cuda_bindings/tests/utils/check_cyclical_import.py new file mode 100644 index 0000000000..e40f800110 --- /dev/null +++ b/cuda_bindings/tests/utils/check_cyclical_import.py @@ -0,0 +1,42 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +""" +Tests whether importing a specific module leads to cyclical imports. + +See https://github.com/NVIDIA/cuda-python/issues/789 for more info. +""" + +import argparse + +orig_import = __builtins__.__import__ + +import_stack = [] + + +def import_hook(name, globals=None, locals=None, fromlist=(), *args, **kwargs): + """Approximate a custom import system that does not allow import cycles.""" + + stack_entry = (tuple(fromlist) if fromlist is not None else None, name) + if stack_entry in import_stack and name.startswith("cuda.bindings."): + raise ImportError(f"Import cycle detected: {stack_entry}, stack: {import_stack}") + import_stack.append(stack_entry) + try: + res = orig_import(name, globals, locals, fromlist, *args, **kwargs) + finally: + import_stack.pop() + return res + + +__builtins__.__import__ = import_hook + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument( + "module", + type=str, + ) + args = parser.parse_args() + + __import__(args.module) diff --git a/cuda_core/cuda/core/experimental/_linker.py b/cuda_core/cuda/core/experimental/_linker.py index c3528a14e2..436a5aa7bb 100644 --- a/cuda_core/cuda/core/experimental/_linker.py +++ b/cuda_core/cuda/core/experimental/_linker.py @@ -8,7 +8,7 @@ import weakref from contextlib import contextmanager from dataclasses import dataclass -from typing import TYPE_CHECKING, List, Tuple, Union +from typing import TYPE_CHECKING, Union from warnings import warn if TYPE_CHECKING: @@ -140,14 +140,14 @@ class LinkerOptions: fma : bool, optional Use fast multiply-add. Default: True. - kernels_used : [Union[str, Tuple[str], List[str]]], optional + kernels_used : [Union[str, tuple[str], list[str]]], optional Pass a kernel or sequence of kernels that are used; any not in the list can be removed. - variables_used : [Union[str, Tuple[str], List[str]]], optional + variables_used : [Union[str, tuple[str], list[str]]], optional Pass a variable or sequence of variables that are used; any not in the list can be removed. optimize_unused_variables : bool, optional Assume that if a variable is not referenced in device code, it can be removed. Default: False. - ptxas_options : [Union[str, Tuple[str], List[str]]], optional + ptxas_options : [Union[str, tuple[str], list[str]]], optional Pass options to PTXAS. split_compile : int, optional Split compilation maximum thread count. Use 0 to use all available processors. Value of 1 disables split @@ -177,10 +177,10 @@ class LinkerOptions: prec_div: bool | None = None prec_sqrt: bool | None = None fma: bool | None = None - kernels_used: Union[str, Tuple[str], List[str]] | None = None - variables_used: Union[str, Tuple[str], List[str]] | None = None + kernels_used: Union[str, tuple[str], list[str]] | None = None + variables_used: Union[str, tuple[str], list[str]] | None = None optimize_unused_variables: bool | None = None - ptxas_options: Union[str, Tuple[str], List[str]] | None = None + ptxas_options: Union[str, tuple[str], list[str]] | None = None split_compile: int | None = None split_compile_extended: int | None = None no_cache: bool | None = None diff --git a/cuda_core/cuda/core/experimental/_memory.py b/cuda_core/cuda/core/experimental/_memory.py index 190ba3e04a..206d600965 100644 --- a/cuda_core/cuda/core/experimental/_memory.py +++ b/cuda_core/cuda/core/experimental/_memory.py @@ -6,7 +6,7 @@ import abc import weakref -from typing import Tuple, TypeVar, Union +from typing import TypeVar, Union from cuda.core.experimental._dlpack import DLDeviceType, make_py_capsule from cuda.core.experimental._stream import Stream, default_stream @@ -169,8 +169,8 @@ def __dlpack__( self, *, stream: int | None = None, - max_version: Tuple[int, int] | None = None, - dl_device: Tuple[int, int] | None = None, + max_version: tuple[int, int] | None = None, + dl_device: tuple[int, int] | None = None, copy: bool | None = None, ) -> PyCapsule: # Note: we ignore the stream argument entirely (as if it is -1). @@ -183,12 +183,12 @@ def __dlpack__( versioned = False else: if not isinstance(max_version, tuple) or len(max_version) != 2: - raise BufferError(f"Expected max_version Tuple[int, int], got {max_version}") + raise BufferError(f"Expected max_version tuple[int, int], got {max_version}") versioned = max_version >= (1, 0) capsule = make_py_capsule(self, versioned) return capsule - def __dlpack_device__(self) -> Tuple[int, int]: + def __dlpack_device__(self) -> tuple[int, int]: d_h = (bool(self.is_device_accessible), bool(self.is_host_accessible)) if d_h == (True, False): return (DLDeviceType.kDLCUDA, self.device_id) diff --git a/cuda_core/cuda/core/experimental/_program.py b/cuda_core/cuda/core/experimental/_program.py index 3df8894d50..0dfc528288 100644 --- a/cuda_core/cuda/core/experimental/_program.py +++ b/cuda_core/cuda/core/experimental/_program.py @@ -6,7 +6,7 @@ import weakref from dataclasses import dataclass -from typing import TYPE_CHECKING, List, Tuple, Union +from typing import TYPE_CHECKING, Union from warnings import warn if TYPE_CHECKING: @@ -33,14 +33,14 @@ def _process_define_macro_inner(formatted_options, macro): return True if isinstance(macro, tuple): if len(macro) != 2 or any(not isinstance(val, str) for val in macro): - raise RuntimeError(f"Expected define_macro Tuple[str, str], got {macro}") + raise RuntimeError(f"Expected define_macro tuple[str, str], got {macro}") formatted_options.append(f"--define-macro={macro[0]}={macro[1]}") return True return False def _process_define_macro(formatted_options, macro): - union_type = "Union[str, Tuple[str, str]]" + union_type = "Union[str, tuple[str, str]]" if _process_define_macro_inner(formatted_options, macro): return if is_nested_sequence(macro): @@ -48,7 +48,7 @@ def _process_define_macro(formatted_options, macro): if not _process_define_macro_inner(formatted_options, seq_macro): raise RuntimeError(f"Expected define_macro {union_type}, got {seq_macro}") return - raise RuntimeError(f"Expected define_macro {union_type}, List[{union_type}], got {macro}") + raise RuntimeError(f"Expected define_macro {union_type}, list[{union_type}], got {macro}") @dataclass @@ -79,7 +79,7 @@ class ProgramOptions: Enable device code optimization. When specified along with ā€˜-G’, enables limited debug information generation for optimized device code. Default: None - ptxas_options : Union[str, List[str]], optional + ptxas_options : Union[str, list[str]], optional Specify one or more options directly to ptxas, the PTX optimizing assembler. Options should be strings. For example ["-v", "-O2"]. Default: None @@ -113,17 +113,17 @@ class ProgramOptions: gen_opt_lto : bool, optional Run the optimizer passes before generating the LTO IR. Default: False - define_macro : Union[str, Tuple[str, str], List[Union[str, Tuple[str, str]]]], optional + define_macro : Union[str, tuple[str, str], list[Union[str, tuple[str, str]]]], optional Predefine a macro. Can be either a string, in which case that macro will be set to 1, a 2 element tuple of strings, in which case the first element is defined as the second, or a list of strings or tuples. Default: None - undefine_macro : Union[str, List[str]], optional + undefine_macro : Union[str, list[str]], optional Cancel any previous definition of a macro, or list of macros. Default: None - include_path : Union[str, List[str]], optional + include_path : Union[str, list[str]], optional Add the directory or directories to the list of directories to be searched for headers. Default: None - pre_include : Union[str, List[str]], optional + pre_include : Union[str, list[str]], optional Preinclude one or more headers during preprocessing. Can be either a string or a list of strings. Default: None no_source_include : bool, optional @@ -156,13 +156,13 @@ class ProgramOptions: no_display_error_number : bool, optional Disable the display of a diagnostic number for warning messages. Default: False - diag_error : Union[int, List[int]], optional + diag_error : Union[int, list[int]], optional Emit error for a specified diagnostic message number or comma separated list of numbers. Default: None - diag_suppress : Union[int, List[int]], optional + diag_suppress : Union[int, list[int]], optional Suppress a specified diagnostic message number or comma separated list of numbers. Default: None - diag_warn : Union[int, List[int]], optional + diag_warn : Union[int, list[int]], optional Emit warning for a specified diagnostic message number or comma separated lis of numbers. Default: None brief_diagnostics : bool, optional @@ -189,7 +189,7 @@ class ProgramOptions: debug: bool | None = None lineinfo: bool | None = None device_code_optimize: bool | None = None - ptxas_options: Union[str, List[str], Tuple[str]] | None = None + ptxas_options: Union[str, list[str], tuple[str]] | None = None max_register_count: int | None = None ftz: bool | None = None prec_sqrt: bool | None = None @@ -200,11 +200,11 @@ class ProgramOptions: link_time_optimization: bool | None = None gen_opt_lto: bool | None = None define_macro: ( - Union[str, Tuple[str, str], List[Union[str, Tuple[str, str]]], Tuple[Union[str, Tuple[str, str]]]] | None + Union[str, tuple[str, str], list[Union[str, tuple[str, str]]], tuple[Union[str, tuple[str, str]]]] | None ) = None - undefine_macro: Union[str, List[str], Tuple[str]] | None = None - include_path: Union[str, List[str], Tuple[str]] | None = None - pre_include: Union[str, List[str], Tuple[str]] | None = None + undefine_macro: Union[str, list[str], tuple[str]] | None = None + include_path: Union[str, list[str], tuple[str]] | None = None + pre_include: Union[str, list[str], tuple[str]] | None = None no_source_include: bool | None = None std: str | None = None builtin_move_forward: bool | None = None @@ -215,9 +215,9 @@ class ProgramOptions: device_int128: bool | None = None optimization_info: str | None = None no_display_error_number: bool | None = None - diag_error: Union[int, List[int], Tuple[int]] | None = None - diag_suppress: Union[int, List[int], Tuple[int]] | None = None - diag_warn: Union[int, List[int], Tuple[int]] | None = None + diag_error: Union[int, list[int], tuple[int]] | None = None + diag_suppress: Union[int, list[int], tuple[int]] | None = None + diag_warn: Union[int, list[int], tuple[int]] | None = None brief_diagnostics: bool | None = None time: str | None = None split_compile: int | None = None @@ -453,7 +453,7 @@ def compile(self, target_type, name_expressions=(), logs=None): target_type : Any String of the targeted compilation type. Supported options are "ptx", "cubin" and "ltoir". - name_expressions : Union[List, Tuple], optional + name_expressions : Union[list, tuple], optional List of explicit name expressions to become accessible. (Default to no expressions) logs : Any, optional diff --git a/cuda_core/cuda/core/experimental/_stream.pyx b/cuda_core/cuda/core/experimental/_stream.pyx index d73156523b..64ae09529f 100644 --- a/cuda_core/cuda/core/experimental/_stream.pyx +++ b/cuda_core/cuda/core/experimental/_stream.pyx @@ -12,7 +12,7 @@ from cuda.core.experimental._utils.cuda_utils cimport ( import os import warnings from dataclasses import dataclass -from typing import TYPE_CHECKING, Optional, Protocol, Tuple, Union +from typing import TYPE_CHECKING, Optional, Protocol, Union if TYPE_CHECKING: import cuda.bindings @@ -47,7 +47,7 @@ cdef class StreamOptions: class IsStreamT(Protocol): - def __cuda_stream__(self) -> Tuple[int, int]: + def __cuda_stream__(self) -> tuple[int, int]: """ For any Python object that is meant to be interpreted as a CUDA stream, the intent can be communicated by implementing this protocol that returns a 2-tuple: The protocol @@ -201,7 +201,7 @@ cdef class Stream: self._owner = None self._handle = None - def __cuda_stream__(self) -> Tuple[int, int]: + def __cuda_stream__(self) -> tuple[int, int]: """Return an instance of a __cuda_stream__ protocol.""" return (0, int(self.handle)) diff --git a/cuda_core/cuda/core/experimental/_system.py b/cuda_core/cuda/core/experimental/_system.py index a4e54d1ba1..cbbc1a83cb 100644 --- a/cuda_core/cuda/core/experimental/_system.py +++ b/cuda_core/cuda/core/experimental/_system.py @@ -2,8 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 -from typing import Tuple - from cuda.core.experimental._device import Device from cuda.core.experimental._utils.cuda_utils import driver, handle_return, runtime @@ -26,7 +24,7 @@ def __init__(self): self._initialized = True @property - def driver_version(self) -> Tuple[int, int]: + def driver_version(self) -> tuple[int, int]: """ Query the CUDA driver version. diff --git a/cuda_core/cuda/core/experimental/_utils/driver_cu_result_explanations.py b/cuda_core/cuda/core/experimental/_utils/driver_cu_result_explanations.py index b77e1d2cf2..3f6d67a369 100644 --- a/cuda_core/cuda/core/experimental/_utils/driver_cu_result_explanations.py +++ b/cuda_core/cuda/core/experimental/_utils/driver_cu_result_explanations.py @@ -19,7 +19,7 @@ # Also update the CUDA Toolkit version number below. # Done. -# CUDA Toolkit v12.9.0 +# CUDA Toolkit v12.9.1 DRIVER_CU_RESULT_EXPLANATIONS = { 0: ( "The API call returned with no errors. In the case of query calls, this also means that the operation" diff --git a/cuda_core/cuda/core/experimental/_utils/runtime_cuda_error_explanations.py b/cuda_core/cuda/core/experimental/_utils/runtime_cuda_error_explanations.py index afebacefbb..a6d2e7a785 100644 --- a/cuda_core/cuda/core/experimental/_utils/runtime_cuda_error_explanations.py +++ b/cuda_core/cuda/core/experimental/_utils/runtime_cuda_error_explanations.py @@ -21,7 +21,7 @@ # Also update the CUDA Toolkit version number below. # Done. -# CUDA Toolkit v12.9.0 +# CUDA Toolkit v12.9.1 RUNTIME_CUDA_ERROR_EXPLANATIONS = { 0: ( "The API call returned with no errors. In the case of query calls, this also means that the operation" diff --git a/cuda_core/pyproject.toml b/cuda_core/pyproject.toml index adfa6c568b..6b1f959ebb 100644 --- a/cuda_core/pyproject.toml +++ b/cuda_core/pyproject.toml @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 [build-system] -requires = ["setuptools>=77.0.0", "Cython>=3.0"] +requires = ["setuptools>=77.0.0", "Cython>=3.1"] build-backend = "setuptools.build_meta" @@ -48,7 +48,7 @@ dependencies = [ [project.optional-dependencies] cu11 = ["cuda-bindings[all]==11.8.*"] cu12 = ["cuda-bindings[all]==12.*"] -test = ["cython>=3.0", "setuptools", "pytest>=6.2.4"] +test = ["cython>=3.1", "setuptools", "pytest>=6.2.4"] test-cu11 = ["cuda-core[test]", "cupy-cuda11x", "nvidia-cuda-runtime-cu11"] # runtime headers needed by CuPy test-cu12 = ["cuda-core[test]", "cupy-cuda12x", "nvidia-cuda-runtime-cu12"] # runtime headers needed by CuPy @@ -95,7 +95,6 @@ select = [ ] ignore = [ - "UP006", "UP007", "E741", # ambiguous variable name such as I "B007", # rename unsued loop variable to _name diff --git a/cuda_core/setup.py b/cuda_core/setup.py index d93eec45d0..bf654b21b2 100644 --- a/cuda_core/setup.py +++ b/cuda_core/setup.py @@ -41,7 +41,12 @@ def build_extensions(self): setup( - ext_modules=cythonize(ext_modules, verbose=True, language_level=3, compiler_directives={"embedsignature": True}), + ext_modules=cythonize( + ext_modules, + verbose=True, + language_level=3, + compiler_directives={"embedsignature": True, "freethreading_compatible": True}, + ), cmdclass={ "build_ext": build_ext, }, diff --git a/cuda_core/tests/cython/build_tests.sh b/cuda_core/tests/cython/build_tests.sh index 1c36259c08..eb3303840d 100755 --- a/cuda_core/tests/cython/build_tests.sh +++ b/cuda_core/tests/cython/build_tests.sh @@ -15,4 +15,4 @@ else exit 1 fi -cythonize -3 -i ${SCRIPTPATH}/test_*.pyx +cythonize -3 -i -Xfreethreading_compatible=True ${SCRIPTPATH}/test_*.pyx diff --git a/cuda_core/tests/test_memory.py b/cuda_core/tests/test_memory.py index 2454046465..a2a59b176d 100644 --- a/cuda_core/tests/test_memory.py +++ b/cuda_core/tests/test_memory.py @@ -229,9 +229,9 @@ def test_buffer_dunder_dlpack(): buffer.__dlpack__(dl_device=[]) with pytest.raises(BufferError, match=r"^Sorry, not supported: copy=True$"): buffer.__dlpack__(copy=True) - with pytest.raises(BufferError, match=r"^Expected max_version Tuple\[int, int\], got \[\]$"): + with pytest.raises(BufferError, match=r"^Expected max_version tuple\[int, int\], got \[\]$"): buffer.__dlpack__(max_version=[]) - with pytest.raises(BufferError, match=r"^Expected max_version Tuple\[int, int\], got \(9, 8, 7\)$"): + with pytest.raises(BufferError, match=r"^Expected max_version tuple\[int, int\], got \(9, 8, 7\)$"): buffer.__dlpack__(max_version=(9, 8, 7)) diff --git a/cuda_core/tests/test_utils.py b/cuda_core/tests/test_utils.py index e35f2c7b03..af34145a30 100644 --- a/cuda_core/tests/test_utils.py +++ b/cuda_core/tests/test_utils.py @@ -2,6 +2,11 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE +import platform +import subprocess # nosec B404 +import sys +from pathlib import Path + try: import cupy as cp except ImportError: @@ -164,3 +169,21 @@ def _check_view(self, view, in_arr, dev): assert view.is_device_accessible is True assert view.exporting_obj is in_arr # can't test view.readonly with CuPy or Numba... + + +@pytest.mark.parametrize( + "module", + # Top-level modules for external Python use + [ + "driver", + "nvjitlink", + "nvrtc", + "nvvm", + "runtime", + *(["cufile"] if platform.system() != "Windows" else []), + ], +) +def test_cyclical_imports(module): + subprocess.check_call( # nosec B603 + [sys.executable, Path(__file__).parent / "utils" / "check_cyclical_import.py", f"cuda.bindings.{module}"], + ) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py index 388c75845d..bb6c32b63a 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/find_nvidia_dynamic_lib.py @@ -12,7 +12,7 @@ IS_WINDOWS, is_suppressed_dll_file, ) -from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs_all_sitepackages +from cuda.pathfinder._utils.find_sub_dirs import find_sub_dirs, find_sub_dirs_all_sitepackages def _no_such_file_in_sub_dirs( @@ -28,18 +28,21 @@ def _no_such_file_in_sub_dirs( def _find_so_using_nvidia_lib_dirs( libname: str, so_basename: str, error_messages: list[str], attachments: list[str] ) -> Optional[str]: - nvidia_sub_dirs = ("nvidia", "*", "nvvm", "lib64") if libname == "nvvm" else ("nvidia", "*", "lib") file_wild = so_basename + "*" - for lib_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): - # First look for an exact match - so_name = os.path.join(lib_dir, so_basename) - if os.path.isfile(so_name): - return so_name - # Look for a versioned library - # Using sort here mainly to make the result deterministic. - for so_name in sorted(glob.glob(os.path.join(lib_dir, file_wild))): + nvidia_sub_dirs_list: list[tuple[str, ...]] = [("nvidia", "*", "lib")] # works also for CTK 13 nvvm + if libname == "nvvm": + nvidia_sub_dirs_list.append(("nvidia", "*", "nvvm", "lib64")) # CTK 12 + for nvidia_sub_dirs in nvidia_sub_dirs_list: + for lib_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): + # First look for an exact match + so_name = os.path.join(lib_dir, so_basename) if os.path.isfile(so_name): return so_name + # Look for a versioned library + # Using sort here mainly to make the result deterministic. + for so_name in sorted(glob.glob(os.path.join(lib_dir, file_wild))): + if os.path.isfile(so_name): + return so_name _no_such_file_in_sub_dirs(nvidia_sub_dirs, file_wild, error_messages, attachments) return None @@ -56,11 +59,17 @@ def _find_dll_under_dir(dirpath: str, file_wild: str) -> Optional[str]: def _find_dll_using_nvidia_bin_dirs( libname: str, lib_searched_for: str, error_messages: list[str], attachments: list[str] ) -> Optional[str]: - nvidia_sub_dirs = ("nvidia", "*", "nvvm", "bin") if libname == "nvvm" else ("nvidia", "*", "bin") - for bin_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): - dll_name = _find_dll_under_dir(bin_dir, lib_searched_for) - if dll_name is not None: - return dll_name + nvidia_sub_dirs_list: list[tuple[str, ...]] = [ + ("nvidia", "*", "bin"), # CTK 12 + ("nvidia", "*", "bin", "*"), # CTK 13, e.g. site-packages\nvidia\cu13\bin\x86_64\ + ] + if libname == "nvvm": + nvidia_sub_dirs_list.append(("nvidia", "*", "nvvm", "bin")) # Only for CTK 12 + for nvidia_sub_dirs in nvidia_sub_dirs_list: + for bin_dir in find_sub_dirs_all_sitepackages(nvidia_sub_dirs): + dll_name = _find_dll_under_dir(bin_dir, lib_searched_for) + if dll_name is not None: + return dll_name _no_such_file_in_sub_dirs(nvidia_sub_dirs, lib_searched_for, error_messages, attachments) return None @@ -76,21 +85,29 @@ def _find_lib_dir_using_cuda_home(libname: str) -> Optional[str]: cuda_home = _get_cuda_home() if cuda_home is None: return None - subdirs: tuple[str, ...] + subdirs_list: tuple[tuple[str, ...], ...] if IS_WINDOWS: - subdirs = (os.path.join("nvvm", "bin"),) if libname == "nvvm" else ("bin",) + if libname == "nvvm": # noqa: SIM108 + subdirs_list = ( + ("nvvm", "bin", "*"), # CTK 13 + ("nvvm", "bin"), # CTK 12 + ) + else: + subdirs_list = ( + ("bin", "x64"), # CTK 13 + ("bin",), # CTK 12 + ) else: - subdirs = ( - (os.path.join("nvvm", "lib64"),) - if libname == "nvvm" - else ( - "lib64", # CTK - "lib", # Conda + if libname == "nvvm": # noqa: SIM108 + subdirs_list = (("nvvm", "lib64"),) + else: + subdirs_list = ( + ("lib64",), # CTK + ("lib",), # Conda ) - ) - for subdir in subdirs: - dirname = os.path.join(cuda_home, subdir) - if os.path.isdir(dirname): + for sub_dirs in subdirs_list: + dirname: str # work around bug in mypy + for dirname in find_sub_dirs((cuda_home,), sub_dirs): return dirname return None diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py index 251e0593a2..29192ec4c3 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_dl_linux.py @@ -1,6 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 +import contextlib import ctypes import ctypes.util import os @@ -109,7 +110,26 @@ def load_with_system_search(libname: str) -> Optional[LoadedDL]: return None -def load_with_abs_path(_libname: str, found_path: str) -> LoadedDL: +def _work_around_known_bugs(libname: str, found_path: str) -> None: + if libname == "nvrtc": + # Work around bug/oversight in + # nvidia_cuda_nvrtc-13.0.48-py3-none-manylinux2010_x86_64.manylinux_2_12_x86_64.whl + # Issue: libnvrtc.so.13 RUNPATH is not set. + # This workaround is highly specific + # - for simplicity. + # - to not mask bugs in future nvidia-cuda-nvrtc releases. + # - because a more general workaround is complicated. + dirname, basename = os.path.split(found_path) + if basename == "libnvrtc.so.13": + dep_basename = "libnvrtc-builtins.so.13.0" + dep_path = os.path.join(dirname, dep_basename) + if os.path.isfile(dep_path): + # In case of failure, defer to primary load, which is almost certain to fail, too. + with contextlib.suppress(OSError): + ctypes.CDLL(dep_path, CDLL_MODE) + + +def load_with_abs_path(libname: str, found_path: str) -> LoadedDL: """Load a dynamic library from the given path. Args: @@ -122,6 +142,7 @@ def load_with_abs_path(_libname: str, found_path: str) -> LoadedDL: Raises: RuntimeError: If the library cannot be loaded """ + _work_around_known_bugs(libname, found_path) try: handle = ctypes.CDLL(found_path, CDLL_MODE) except OSError as e: diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py index 19d73b23e0..14901c3e1f 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py @@ -101,29 +101,35 @@ # cuda_12.4.1_550.54.15_linux.run # cuda_12.5.1_555.42.06_linux.run # cuda_12.6.2_560.35.03_linux.run -# cuda_12.8.0_570.86.10_linux.run -# cuda_12.9.0_575.51.03_linux.run +# cuda_12.8.1_570.124.06_linux.run +# cuda_12.9.1_575.57.08_linux.run +# cuda_13.0.0_580.65.06_linux.run # Generated with toolshed/build_pathfinder_sonames.py SUPPORTED_LINUX_SONAMES = { "cublas": ( "libcublas.so.11", "libcublas.so.12", + "libcublas.so.13", ), "cublasLt": ( "libcublasLt.so.11", "libcublasLt.so.12", + "libcublasLt.so.13", ), "cudart": ( "libcudart.so.11.0", "libcudart.so.12", + "libcudart.so.13", ), "cufft": ( "libcufft.so.10", "libcufft.so.11", + "libcufft.so.12", ), "cufftw": ( "libcufftw.so.10", "libcufftw.so.11", + "libcufftw.so.12", ), "cufile": ("libcufile.so.0",), # "cufile_rdma": ("libcufile_rdma.so.1",), @@ -131,10 +137,12 @@ "cusolver": ( "libcusolver.so.10", "libcusolver.so.11", + "libcusolver.so.12", ), "cusolverMg": ( "libcusolverMg.so.10", "libcusolverMg.so.11", + "libcusolverMg.so.12", ), "cusparse": ( "libcusparse.so.11", @@ -143,62 +151,82 @@ "nppc": ( "libnppc.so.11", "libnppc.so.12", + "libnppc.so.13", ), "nppial": ( "libnppial.so.11", "libnppial.so.12", + "libnppial.so.13", ), "nppicc": ( "libnppicc.so.11", "libnppicc.so.12", + "libnppicc.so.13", ), "nppidei": ( "libnppidei.so.11", "libnppidei.so.12", + "libnppidei.so.13", ), "nppif": ( "libnppif.so.11", "libnppif.so.12", + "libnppif.so.13", ), "nppig": ( "libnppig.so.11", "libnppig.so.12", + "libnppig.so.13", ), "nppim": ( "libnppim.so.11", "libnppim.so.12", + "libnppim.so.13", ), "nppist": ( "libnppist.so.11", "libnppist.so.12", + "libnppist.so.13", ), "nppisu": ( "libnppisu.so.11", "libnppisu.so.12", + "libnppisu.so.13", ), "nppitc": ( "libnppitc.so.11", "libnppitc.so.12", + "libnppitc.so.13", ), "npps": ( "libnpps.so.11", "libnpps.so.12", + "libnpps.so.13", + ), + "nvJitLink": ( + "libnvJitLink.so.12", + "libnvJitLink.so.13", ), - "nvJitLink": ("libnvJitLink.so.12",), "nvblas": ( "libnvblas.so.11", "libnvblas.so.12", + "libnvblas.so.13", + ), + "nvfatbin": ( + "libnvfatbin.so.12", + "libnvfatbin.so.13", ), - "nvfatbin": ("libnvfatbin.so.12",), "nvjpeg": ( "libnvjpeg.so.11", "libnvjpeg.so.12", + "libnvjpeg.so.13", ), "nvrtc": ( "libnvrtc.so.11.0", "libnvrtc.so.11.1", "libnvrtc.so.11.2", "libnvrtc.so.12", + "libnvrtc.so.13", ), "nvvm": ( "libnvvm.so.3", @@ -224,39 +252,47 @@ # cuda_12.5.1_555.85_windows.exe # cuda_12.6.2_560.94_windows.exe # cuda_12.8.1_572.61_windows.exe -# cuda_12.9.0_576.02_windows.txt -# Generated with toolshed/build_pathfinder_dlls.py (WITH MANUAL EDITS) +# cuda_12.9.1_576.57_windows.exe +# cuda_13.0.0_windows.exe +# Generated with toolshed/build_pathfinder_dlls.py SUPPORTED_WINDOWS_DLLS = { "cublas": ( "cublas64_11.dll", "cublas64_12.dll", + "cublas64_13.dll", ), "cublasLt": ( "cublasLt64_11.dll", "cublasLt64_12.dll", + "cublasLt64_13.dll", ), "cudart": ( "cudart64_101.dll", "cudart64_110.dll", "cudart64_12.dll", + "cudart64_13.dll", "cudart64_65.dll", ), "cufft": ( "cufft64_10.dll", "cufft64_11.dll", + "cufft64_12.dll", ), "cufftw": ( "cufftw64_10.dll", "cufftw64_11.dll", + "cufftw64_12.dll", ), "curand": ("curand64_10.dll",), "cusolver": ( "cusolver64_10.dll", "cusolver64_11.dll", + "cusolver64_12.dll", ), "cusolverMg": ( "cusolverMg64_10.dll", "cusolverMg64_11.dll", + "cusolverMg64_12.dll", ), "cusparse": ( "cusparse64_11.dll", @@ -265,62 +301,82 @@ "nppc": ( "nppc64_11.dll", "nppc64_12.dll", + "nppc64_13.dll", ), "nppial": ( "nppial64_11.dll", "nppial64_12.dll", + "nppial64_13.dll", ), "nppicc": ( "nppicc64_11.dll", "nppicc64_12.dll", + "nppicc64_13.dll", ), "nppidei": ( "nppidei64_11.dll", "nppidei64_12.dll", + "nppidei64_13.dll", ), "nppif": ( "nppif64_11.dll", "nppif64_12.dll", + "nppif64_13.dll", ), "nppig": ( "nppig64_11.dll", "nppig64_12.dll", + "nppig64_13.dll", ), "nppim": ( "nppim64_11.dll", "nppim64_12.dll", + "nppim64_13.dll", ), "nppist": ( "nppist64_11.dll", "nppist64_12.dll", + "nppist64_13.dll", ), "nppisu": ( "nppisu64_11.dll", "nppisu64_12.dll", + "nppisu64_13.dll", ), "nppitc": ( "nppitc64_11.dll", "nppitc64_12.dll", + "nppitc64_13.dll", ), "npps": ( "npps64_11.dll", "npps64_12.dll", + "npps64_13.dll", + ), + "nvJitLink": ( + "nvJitLink_120_0.dll", + "nvJitLink_130_0.dll", ), - "nvJitLink": ("nvJitLink_120_0.dll",), "nvblas": ( "nvblas64_11.dll", "nvblas64_12.dll", + "nvblas64_13.dll", + ), + "nvfatbin": ( + "nvfatbin_120_0.dll", + "nvfatbin_130_0.dll", ), - "nvfatbin": ("nvfatbin_120_0.dll",), "nvjpeg": ( "nvjpeg64_11.dll", "nvjpeg64_12.dll", + "nvjpeg64_13.dll", ), "nvrtc": ( "nvrtc64_110_0.dll", "nvrtc64_111_0.dll", "nvrtc64_112_0.dll", "nvrtc64_120_0.dll", + "nvrtc64_130_0.dll", ), "nvvm": ( "nvvm64.dll", @@ -347,10 +403,10 @@ def is_suppressed_dll_file(path_basename: str) -> bool: return path_basename.startswith(("cudart32_", "nvvm32")) -# Based on nm output for Linux x86_64 /usr/local/cuda (12.8.1) +# Based on `nm -D --defined-only` output for Linux x86_64 distributions. EXPECTED_LIB_SYMBOLS = { "nvJitLink": ( - "__nvJitLinkCreate_12_0", # 12.0 through 12.8 (at least) + "__nvJitLinkCreate_12_0", # 12.0 through 12.9 "nvJitLinkVersion", # 12.3 and up ), "nvrtc": ("nvrtcVersion",), @@ -366,16 +422,16 @@ def is_suppressed_dll_file(path_basename: str) -> bool: "cusolverMg": ("cusolverMgCreate",), "cusparse": ("cusparseGetVersion",), "nppc": ("nppGetLibVersion",), - "nppial": ("nppiAdd_32f_C1R",), - "nppicc": ("nppiColorToGray_8u_C3C1R",), - "nppidei": ("nppiCopy_8u_C1R",), - "nppif": ("nppiFilterSobelHorizBorder_8u_C1R",), - "nppig": ("nppiResize_8u_C1R",), - "nppim": ("nppiErode_8u_C1R",), - "nppist": ("nppiMean_8u_C1R",), + "nppial": ("nppiAdd_32f_C1R_Ctx",), + "nppicc": ("nppiColorToGray_8u_C3C1R_Ctx",), + "nppidei": ("nppiCopy_8u_C1R_Ctx",), + "nppif": ("nppiFilterSobelHorizBorder_8u_C1R_Ctx",), + "nppig": ("nppiResize_8u_C1R_Ctx",), + "nppim": ("nppiErode_8u_C1R_Ctx",), + "nppist": ("nppiMean_8u_C1R_Ctx",), "nppisu": ("nppiFree",), - "nppitc": ("nppiThreshold_8u_C1R",), - "npps": ("nppsAdd_32f",), + "nppitc": ("nppiThreshold_8u_C1R_Ctx",), + "npps": ("nppsAdd_32f_Ctx",), "nvblas": ("dgemm",), "cufile": ("cuFileGetVersion",), # "cufile_rdma": ("rdma_buffer_reg",), diff --git a/cuda_pathfinder/cuda/pathfinder/_version.py b/cuda_pathfinder/cuda/pathfinder/_version.py index 23e58fddbb..a41dd93edd 100644 --- a/cuda_pathfinder/cuda/pathfinder/_version.py +++ b/cuda_pathfinder/cuda/pathfinder/_version.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "1.0.0" +__version__ = "1.1.0" diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index 161dd66971..ac6724277e 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -29,6 +29,22 @@ nvidia_wheels_cu12 = [ "nvidia-nvjitlink-cu12", "nvidia-nvjpeg-cu12", ] +nvidia_wheels_cu13 = [ + "nvidia-cublas", + "nvidia-cuda-nvcc", + "nvidia-cuda-nvrtc", + "nvidia-cuda-runtime", + "nvidia-cufft", + "nvidia-cufile; sys_platform != 'win32'", + "nvidia-curand", + "nvidia-cusolver", + "nvidia-cusparse", + "nvidia-npp", + "nvidia-nvfatbin", + "nvidia-nvjitlink", + "nvidia-nvjpeg", + "nvidia-nvvm", +] [project.urls] Repository = "https://github.com/NVIDIA/cuda-python" diff --git a/toolshed/build_static_bitcode_input.py b/toolshed/build_static_bitcode_input.py new file mode 100755 index 0000000000..95c3a610f6 --- /dev/null +++ b/toolshed/build_static_bitcode_input.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. +# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE + +""" +Helper to produce static bitcode input for test_nvvm.py. + +Usage: + python toolshed/build_static_bitcode_input.py + +It will print a ready-to-paste MINIMAL_NVVMIR_BITCODE_STATIC entry for the +current NVVM IR version detected at runtime. +""" + +import binascii +import os +import sys +import textwrap + +import llvmlite.binding # HINT: pip install llvmlite +from cuda.bindings import nvvm + + +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)) + import test_nvvm + + return test_nvvm.MINIMAL_NVVMIR_TXT_TEMPLATE + + +def main(): + major, _minor, debug_major, _debug_minor = nvvm.ir_version() + txt = get_minimal_nvvmir_txt_template() % (major, debug_major) + bitcode_dynamic = llvmlite.binding.parse_assembly(txt.decode()).as_bitcode() + bitcode_hex = binascii.hexlify(bitcode_dynamic).decode("ascii") + print("\n\nMINIMAL_NVVMIR_BITCODE_STATIC = { # PLEASE ADD TO test_nvvm.py") + print(f" ({major}, {debug_major}): # (major, debug_major)") + lines = textwrap.wrap(bitcode_hex, width=80) + for line in lines[:-1]: + print(f' "{line}"') + print(f' "{lines[-1]}",') + print("}\n", flush=True) + print() + + +if __name__ == "__main__": + assert len(sys.argv) == 1, "This helper script does not take any arguments." + main()