Skip to content

Commit 4deb398

Browse files
abhilash1910pre-commit-ci[bot]brandon-b-millerrwgkcursoragent
authored
[NVVM] Support - Followup enhancements (#1218)
* add ltoir test support * add options for multi-modules * add tests * add bitcode test * [pre-commit.ci] auto code formatting * fix format * [pre-commit.ci] auto code formatting * refresh * apply bitcode file from cupy_test helpers * use 2 tuples * refresh * format * [pre-commit.ci] auto code formatting * fix from upstream * refresh from upstream * fix tests * take path_finder from PR 447 * add builder files * use python lists/tuples * libdevice integration * refresh * refresh * refresh * use cuda_pathfinder module for libdevice * rebase * rebase * tests * Address reviews * put libdevice stuff under _static_libs * refresh reviews * change program to cython per PR 1565 * fix import * fix tests * fix ruff check * ruff fix find_libdevice * [pre-commit.ci] auto code formatting * add spdx and copyright * rm redundant include and fix test * [pre-commit.ci] auto code formatting * refresh tests * add correct libdevice for CTK> 13 * [pre-commit.ci] auto code formatting * revamp design of pathfinder as LocatedHeaderDir * refresh * [pre-commit.ci] auto code formatting * fix mypy errirs * fix base var declaration * format changes * format changes * rename to bitcodelib * refresh * refresh * revert * refresh test_nvvm to use cupy test helpers * refresh test_nvvm * [pre-commit.ci] auto code formatting * refresh with actual test * rm try_common_paths * refresh 1 * [pre-commit.ci] auto code formatting * refresh * refresh * [pre-commit.ci] auto code formatting * refresh * [pre-commit.ci] auto code formatting * refresh pathfinder test after rebae * Uniform handling of cuda_python_test_helpers dependency in cuda_bindings, cuda_core * pre-commit cleanup * Prefer installed cuda-python-test-helpers in test bootstrap. Avoid silently overriding site-packages with checkout paths during test setup by only injecting the repo helper path when the helper distribution is not installed, and fail fast with a clear error when neither source is available. Co-authored-by: Cursor <cursoragent@cursor.com> * Remove cuda_core Pixi PYTHONPATH override for test helpers. Keep helper resolution consistent with test bootstrap logic so Pixi runs do not silently force checkout helpers ahead of installed packages. Co-authored-by: Cursor <cursoragent@cursor.com> * Remove helper package install from coverage workflow. Coverage jobs now use the same conftest bootstrap path as other test flows, reducing redundant setup and keeping helper resolution behavior consistent across CI. Co-authored-by: Cursor <cursoragent@cursor.com> * Use per-module pytest plugin registration for NVVM helper fixtures. Keep fixture registration next to the tests that consume it and drop direct fixture imports that required lint suppressions. Co-authored-by: Cursor <cursoragent@cursor.com> * Remove "Renamed" comments * Make bitcode locate/find consistently raise not-found errors. Raise BitcodeLibNotFoundError from locate_bitcode_lib instead of returning None, simplify find_bitcode_lib to rely on that behavior, and update bitcode tests to handle expected not-found cases outside all_must_work mode. Co-authored-by: Cursor <cursoragent@cursor.com> * Refocus bitcode-lib tests on real coverage and narrow mocks. Keep the environment-backed locate/find smoke test as the primary happy-path check, and replace broad mock scenarios with targeted branch tests for search order and not-found diagnostics. Co-authored-by: Cursor <cursoragent@cursor.com> * Undo accidental change in cuda_pathfinder/tests/test_find_nvidia_binaries.py * Use direct platform_aware.IS_WINDOWS import (rather than the detour through supported_nvidia_libs) * Add found_via metadata for bitcode library discovery. Record whether locate_bitcode_lib resolved via site-packages, conda, or CUDA_HOME to mirror pathfinder discovery APIs, and update focused tests to validate the reported source. Co-authored-by: Cursor <cursoragent@cursor.com> * Export SUPPORTED_BITCODE_LIBS in cuda.pathfinder public API. Expose supported bitcode names through __init__ using the existing Sphinx indirection pattern so users can discover the API surface consistently with other supported-* constants. Co-authored-by: Cursor <cursoragent@cursor.com> * refresh * [pre-commit.ci] auto code formatting * refresh * [pre-commit.ci] auto code formatting * Serialize NVVM compile/libdevice mutation per Program instance. Add a per-instance threading lock around the NVVM verify/libdevice-add/compile path to prevent concurrent compile races from double-adding libdevice. The lock is taken under the GIL and held across nogil sections, and we verified this ordering avoids introducing a lock/GIL deadlock cycle. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: brandon-b-miller <brmiller@nvidia.com> Co-authored-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5985ee1 commit 4deb398

File tree

16 files changed

+823
-184
lines changed

16 files changed

+823
-184
lines changed

.github/workflows/coverage.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ jobs:
9898
run: |
9999
.venv/bin/pip install -v ./cuda_pathfinder
100100
101-
- name: Build cuda-python-test-helpers
102-
run: |
103-
.venv/bin/pip install -v ./cuda_python_test_helpers
104-
105101
- name: Build cuda-bindings
106102
run: |
107103
cd cuda_bindings

.github/workflows/test-wheel-linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ jobs:
251251
env:
252252
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works
253253
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works
254+
CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: see_what_works
254255
run: run-tests pathfinder
255256

256257
- name: Run cuda.bindings tests
@@ -296,4 +297,5 @@ jobs:
296297
env:
297298
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work
298299
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work
300+
CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: all_must_work
299301
run: run-tests pathfinder

.github/workflows/test-wheel-windows.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ jobs:
224224
env:
225225
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: see_what_works
226226
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: see_what_works
227+
CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: see_what_works
227228
shell: bash --noprofile --norc -xeuo pipefail {0}
228229
run: run-tests pathfinder
229230

@@ -273,5 +274,6 @@ jobs:
273274
env:
274275
CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS: all_must_work
275276
CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS: all_must_work
277+
CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS: all_must_work
276278
shell: bash --noprofile --norc -xeuo pipefail {0}
277279
run: run-tests pathfinder

ci/tools/run-tests

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ popd
3030
if [[ "${test_module}" == "pathfinder" ]]; then
3131
pushd ./cuda_pathfinder
3232
echo "Running pathfinder tests with " \
33-
"LD:${CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS} " \
34-
"FH:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS}"
33+
"LD:${CUDA_PATHFINDER_TEST_LOAD_NVIDIA_DYNAMIC_LIB_STRICTNESS} " \
34+
"FH:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_HEADERS_STRICTNESS} " \
35+
"BC:${CUDA_PATHFINDER_TEST_FIND_NVIDIA_BITCODE_LIB_STRICTNESS}"
3536
pytest -ra -s -v --durations=0 tests/ |& tee /tmp/pathfinder_test_log.txt
3637
# Report the number of "INFO test_" lines (including zero)
3738
# to support quick validations based on GHA log archives.

cuda_bindings/tests/conftest.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33

4+
import pathlib
5+
import sys
6+
from importlib.metadata import PackageNotFoundError, distribution
7+
48
import cuda.bindings.driver as cuda
59
import pytest
610

11+
# Import shared test helpers for tests across subprojects.
12+
# PLEASE KEEP IN SYNC with copies in other conftest.py in this repo.
13+
_test_helpers_root = pathlib.Path(__file__).resolve().parents[2] / "cuda_python_test_helpers"
14+
try:
15+
distribution("cuda-python-test-helpers")
16+
except PackageNotFoundError as exc:
17+
if not _test_helpers_root.is_dir():
18+
raise RuntimeError(
19+
f"cuda-python-test-helpers not installed; expected checkout path {_test_helpers_root}"
20+
) from exc
21+
22+
test_helpers_root = str(_test_helpers_root)
23+
if test_helpers_root not in sys.path:
24+
sys.path.insert(0, test_helpers_root)
25+
726

827
@pytest.fixture(scope="module")
928
def cuda_driver():

cuda_bindings/tests/test_nvvm.py

Lines changed: 4 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -2,143 +2,13 @@
22
#
33
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
44

5-
import binascii
65
import re
76
from contextlib import contextmanager
87

98
import pytest
109
from cuda.bindings import nvvm
1110

12-
MINIMAL_NVVMIR_TXT_TEMPLATE = b"""\
13-
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"
14-
15-
target triple = "nvptx64-nvidia-cuda"
16-
17-
define void @kernel() {
18-
entry:
19-
ret void
20-
}
21-
22-
!nvvm.annotations = !{!0}
23-
!0 = !{void ()* @kernel, !"kernel", i32 1}
24-
25-
!nvvmir.version = !{!1}
26-
!1 = !{i32 %d, i32 0, i32 %d, i32 0}
27-
""" # noqa: E501
28-
29-
MINIMAL_NVVMIR_BITCODE_STATIC = {
30-
(1, 3): # (major, debug_major)
31-
"4243c0de3514000005000000620c30244a59be669dfbb4bf0b51804c01000000210c00007f010000"
32-
"0b02210002000000160000000781239141c80449061032399201840c250508191e048b62800c4502"
33-
"42920b42641032143808184b0a3232884870c421234412878c1041920264c808b1142043468820c9"
34-
"01323284182a282a90317cb05c9120c3c8000000892000000b0000003222c80820624600212b2498"
35-
"0c212524980c19270c85a4906032645c20246382a01801300128030173046000132677b00778a007"
36-
"7cb0033a680377b0877420877408873618877a208770d8e012e5d006f0a0077640077a600774a007"
37-
"7640076d900e71a00778a00778d006e980077a80077a80076d900e7160077a100776a0077160076d"
38-
"900e7320077a300772a0077320076d900e7640077a600774a0077640076d900e71200778a0077120"
39-
"0778a00771200778d006e6300772a0077320077a300772d006e6600774a0077640077a600774d006"
40-
"f6100776a0077160077a100776d006f6300772a0077320077a300772d006f6600774a0077640077a"
41-
"600774d006f610077280077a10077280077a10077280076de00e7160077a300772a0077640071a21"
42-
"4c0e11de9c2e4fbbcfbe211560040000000000000000000000000620b141a0e86000004016080000"
43-
"06000000321e980c19114c908c092647c6044362098c009401000000b1180000ac0000003308801c"
44-
"c4e11c6614013d88433884c38c4280077978077398710ce6000fed100ef4800e330c421ec2c11dce"
45-
"a11c6630053d88433884831bcc033dc8433d8c033dcc788c7470077b08077948877070077a700376"
46-
"788770208719cc110eec900ee1300f6e300fe3f00ef0500e3310c41dde211cd8211dc2611e663089"
47-
"3bbc833bd04339b4033cbc833c84033bccf0147660077b6807376887726807378087709087706007"
48-
"76280776f8057678877780875f08877118877298877998812ceef00eeee00ef5c00eec300362c8a1"
49-
"1ce4a11ccca11ce4a11cdc611cca211cc4811dca6106d6904339c84339984339c84339b8c3389443"
50-
"3888033b94c32fbc833cfc823bd4033bb0c30cc7698770588772708374680778608774188774a087"
51-
"19ce530fee000ff2500ee4900ee3400fe1200eec500e3320281ddcc11ec2411ed2211cdc811edce0"
52-
"1ce4e11dea011e66185138b0433a9c833bcc50247660077b68073760877778077898514cf4900ff0"
53-
"500e331e6a1eca611ce8211ddec11d7e011ee4a11ccc211df0610654858338ccc33bb0433dd04339"
54-
"fcc23ce4433b88c33bb0c38cc50a877998877718877408077a28077298815ce3100eecc00ee5500e"
55-
"f33023c1d2411ee4e117d8e11dde011e6648193bb0833db4831b84c3388c4339ccc33cb8c139c8c3"
56-
"3bd4033ccc48b471080776600771088771588719dbc60eec600fede006f0200fe5300fe5200ff650"
57-
"0e6e100ee3300ee5300ff3e006e9e00ee4500ef83023e2ec611cc2811dd8e117ec211de6211dc421"
58-
"1dd8211de8211f66209d3bbc433db80339948339cc58bc7070077778077a08077a488777708719cb"
59-
"e70eef300fe1e00ee9400fe9a00fe530c3010373a8077718875f988770708774a08774d087729881"
60-
"844139e0c338b0433d904339cc40c4a01dcaa11de0411edec11c662463300ee1c00eec300fe9400f"
61-
"e5000000792000001d000000721e482043880c19097232482023818c9191d144a01028643c313242"
62-
"8e9021a318100a00060000006b65726e656c0000230802308240042308843082400c330c4230cc40"
63-
"0c4441c84860821272b3b36b730973737ba30ba34b7b739b1b2528d271b3b36b4b9373b12b939b4b"
64-
"7b731b2530000000a9180000250000000b0a7228877780077a587098433db8c338b04339d0c382e6"
65-
"1cc6a10de8411ec2c11de6211de8211ddec11d1634e3600ee7500fe1200fe4400fe1200fe7500ef4"
66-
"b08081077928877060077678877108077a28077258709cc338b4013ba4833d94c3026b1cd8211cdc"
67-
"e11cdc201ce4611cdc201ce8811ec2611cd0a11cc8611cc2811dd861c1010ff4200fe1500ff4800e"
68-
"00000000d11000000600000007cc3ca4833b9c033b94033da0833c94433890c30100000061200000"
69-
"06000000130481860301000002000000075010cd14610000000000007120000003000000320e1022"
70-
"8400fb020000000000000000650c00001f000000120394f000000000030000000600000006000000"
71-
"4c000000010000005800000000000000580000000100000070000000000000000c00000013000000"
72-
"1f000000080000000600000000000000700000000000000000000000010000000000000000000000"
73-
"060000000000000006000000ffffffff00240000000000005d0c00000d0000001203946700000000"
74-
"6b65726e656c31352e302e376e7670747836342d6e76696469612d637564613c737472696e673e00"
75-
"00000000",
76-
(2, 3): # (major, debug_major)
77-
"4243c0de3514000005000000620c30244a59be669dfbb4bf0b51804c01000000210c000080010000"
78-
"0b02210002000000160000000781239141c80449061032399201840c250508191e048b62800c4502"
79-
"42920b42641032143808184b0a3232884870c421234412878c1041920264c808b1142043468820c9"
80-
"01323284182a282a90317cb05c9120c3c8000000892000000b0000003222c80820624600212b2498"
81-
"0c212524980c19270c85a4906032645c20246382a01801300128030173046000132677b00778a007"
82-
"7cb0033a680377b0877420877408873618877a208770d8e012e5d006f0a0077640077a600774a007"
83-
"7640076d900e71a00778a00778d006e980077a80077a80076d900e7160077a100776a0077160076d"
84-
"900e7320077a300772a0077320076d900e7640077a600774a0077640076d900e71200778a0077120"
85-
"0778a00771200778d006e6300772a0077320077a300772d006e6600774a0077640077a600774d006"
86-
"f6100776a0077160077a100776d006f6300772a0077320077a300772d006f6600774a0077640077a"
87-
"600774d006f610077280077a10077280077a10077280076de00e7160077a300772a0077640071a21"
88-
"4c0e11de9c2e4fbbcfbe211560040000000000000000000000000620b141a0286100004016080000"
89-
"06000000321e980c19114c908c092647c60443620914c10840190000b1180000ac0000003308801c"
90-
"c4e11c6614013d88433884c38c4280077978077398710ce6000fed100ef4800e330c421ec2c11dce"
91-
"a11c6630053d88433884831bcc033dc8433d8c033dcc788c7470077b08077948877070077a700376"
92-
"788770208719cc110eec900ee1300f6e300fe3f00ef0500e3310c41dde211cd8211dc2611e663089"
93-
"3bbc833bd04339b4033cbc833c84033bccf0147660077b6807376887726807378087709087706007"
94-
"76280776f8057678877780875f08877118877298877998812ceef00eeee00ef5c00eec300362c8a1"
95-
"1ce4a11ccca11ce4a11cdc611cca211cc4811dca6106d6904339c84339984339c84339b8c3389443"
96-
"3888033b94c32fbc833cfc823bd4033bb0c30cc7698770588772708374680778608774188774a087"
97-
"19ce530fee000ff2500ee4900ee3400fe1200eec500e3320281ddcc11ec2411ed2211cdc811edce0"
98-
"1ce4e11dea011e66185138b0433a9c833bcc50247660077b68073760877778077898514cf4900ff0"
99-
"500e331e6a1eca611ce8211ddec11d7e011ee4a11ccc211df0610654858338ccc33bb0433dd04339"
100-
"fcc23ce4433b88c33bb0c38cc50a877998877718877408077a28077298815ce3100eecc00ee5500e"
101-
"f33023c1d2411ee4e117d8e11dde011e6648193bb0833db4831b84c3388c4339ccc33cb8c139c8c3"
102-
"3bd4033ccc48b471080776600771088771588719dbc60eec600fede006f0200fe5300fe5200ff650"
103-
"0e6e100ee3300ee5300ff3e006e9e00ee4500ef83023e2ec611cc2811dd8e117ec211de6211dc421"
104-
"1dd8211de8211f66209d3bbc433db80339948339cc58bc7070077778077a08077a488777708719cb"
105-
"e70eef300fe1e00ee9400fe9a00fe530c3010373a8077718875f988770708774a08774d087729881"
106-
"844139e0c338b0433d904339cc40c4a01dcaa11de0411edec11c662463300ee1c00eec300fe9400f"
107-
"e5000000792000001e000000721e482043880c19097232482023818c9191d144a01028643c313242"
108-
"8e9021a318100a00060000006b65726e656c0000230802308240042308843082400c23080431c320"
109-
"04c30c045118858c04262821373bbb36973037b737ba30bab437b7b95102231d373bbbb6343917bb"
110-
"32b9b9b437b7518203000000a9180000250000000b0a7228877780077a587098433db8c338b04339"
111-
"d0c382e61cc6a10de8411ec2c11de6211de8211ddec11d1634e3600ee7500fe1200fe4400fe1200f"
112-
"e7500ef4b08081077928877060077678877108077a28077258709cc338b4013ba4833d94c3026b1c"
113-
"d8211cdce11cdc201ce4611cdc201ce8811ec2611cd0a11cc8611cc2811dd861c1010ff4200fe150"
114-
"0ff4800e00000000d11000000600000007cc3ca4833b9c033b94033da0833c94433890c301000000"
115-
"6120000006000000130481860301000002000000075010cd14610000000000007120000003000000"
116-
"320e10228400fc020000000000000000650c00001f000000120394f0000000000300000006000000"
117-
"060000004c000000010000005800000000000000580000000100000070000000000000000c000000"
118-
"130000001f0000000800000006000000000000007000000000000000000000000100000000000000"
119-
"00000000060000000000000006000000ffffffff00240000000000005d0c00000d00000012039467"
120-
"000000006b65726e656c31352e302e376e7670747836342d6e76696469612d637564613c73747269"
121-
"6e673e0000000000",
122-
}
123-
124-
125-
@pytest.fixture(params=("txt", "bitcode_static"))
126-
def minimal_nvvmir(request):
127-
major, minor, debug_major, debug_minor = nvvm.ir_version()
128-
129-
if request.param == "txt":
130-
return MINIMAL_NVVMIR_TXT_TEMPLATE % (major, debug_major)
131-
132-
bitcode_static_binascii = MINIMAL_NVVMIR_BITCODE_STATIC.get((major, debug_major))
133-
if bitcode_static_binascii:
134-
return binascii.unhexlify(bitcode_static_binascii)
135-
raise RuntimeError(
136-
"Static bitcode for NVVM IR version "
137-
f"{major}.{debug_major} is not available in this test.\n"
138-
"Maintainers: Please run the helper script to generate it and add the "
139-
"output to the MINIMAL_NVVMIR_BITCODE_STATIC dict:\n"
140-
" ../../toolshed/build_static_bitcode_input.py"
141-
)
11+
pytest_plugins = ("cuda_python_test_helpers.nvvm_bitcode",)
14212

14313

14414
@pytest.fixture(params=[nvvm.compile_program, nvvm.verify_program])
@@ -221,7 +91,7 @@ def test_c_or_v_program_fail_invalid_ir(compile_or_verify):
22191
assert get_program_log(prog) == "FileNameHere.ll (1, 0): parse expected top-level entity\x00"
22292

22393

224-
def test_c_or_v_program_fail_bad_option(minimal_nvvmir, compile_or_verify):
94+
def test_c_or_v_program_fail_bad_option(minimal_nvvmir, compile_or_verify): # noqa: F401, F811
22595
with nvvm_program() as prog:
22696
nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll")
22797
with pytest.raises(nvvm.nvvmError, match=match_exact("ERROR_INVALID_OPTION (7)")):
@@ -246,7 +116,7 @@ def test_get_buffer_empty(get_size, get_buffer):
246116

247117

248118
@pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]])
249-
def test_compile_program_with_minimal_nvvm_ir(minimal_nvvmir, options):
119+
def test_compile_program_with_minimal_nvvm_ir(minimal_nvvmir, options): # noqa: F401, F811
250120
with nvvm_program() as prog:
251121
nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll")
252122
try:
@@ -266,7 +136,7 @@ def test_compile_program_with_minimal_nvvm_ir(minimal_nvvmir, options):
266136

267137

268138
@pytest.mark.parametrize("options", [[], ["-opt=0"], ["-opt=3", "-g"]])
269-
def test_verify_program_with_minimal_nvvm_ir(minimal_nvvmir, options):
139+
def test_verify_program_with_minimal_nvvm_ir(minimal_nvvmir, options): # noqa: F401, F811
270140
with nvvm_program() as prog:
271141
nvvm.add_module_to_program(prog, minimal_nvvmir, len(minimal_nvvmir), "FileNameHere.ll")
272142
nvvm.verify_program(prog, len(options), options)

cuda_core/cuda/core/_program.pxd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ cdef class Program:
1313
object _linker # Linker
1414
object _options # ProgramOptions
1515
object __weakref__
16+
object _compile_lock # Per-instance lock for compile-time mutation
17+
bint _use_libdevice # Flag for libdevice loading
18+
bint _libdevice_added

0 commit comments

Comments
 (0)