Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle CTK version specific options in the linker test #371

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
eba7d22
add exception manager to handle options which aren't covered in all c…
ksimpson-work Jan 10, 2025
4b9b81a
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 10, 2025
d473c24
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 14, 2025
6e5114e
Update cuda_core/tests/test_linker.py
ksimpson-work Jan 15, 2025
66b03fc
address comments
ksimpson-work Jan 15, 2025
36a7eab
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 15, 2025
1e9a8e8
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 15, 2025
3a25e41
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 16, 2025
0e34720
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 16, 2025
0466528
Merge remote-tracking branch 'upstream/main' into handle-version-spec…
ksimpson-work Jan 17, 2025
45eeb33
Merge remote-tracking branch 'origin/handle-version-specific-options'…
ksimpson-work Jan 17, 2025
df897e8
switch to hardcode
ksimpson-work Jan 17, 2025
02b52d5
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 20, 2025
4c7ae33
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 21, 2025
1986452
Merge remote-tracking branch 'upstream/main' into handle-version-spec…
ksimpson-work Jan 21, 2025
94af829
construct the options class within if else logic
ksimpson-work Jan 21, 2025
3c932d6
Merge remote-tracking branch 'origin/handle-version-specific-options'…
ksimpson-work Jan 21, 2025
5586587
fix mistake
ksimpson-work Jan 23, 2025
b3e254d
fix mistake
ksimpson-work Jan 23, 2025
fc682d9
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 27, 2025
38801fe
minor tweak
ksimpson-work Jan 28, 2025
252e5f0
Merge branch 'main' into handle-version-specific-options
ksimpson-work Jan 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions cuda_core/tests/test_linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,16 @@ def compile_ltoir_functions(init_cuda):
return object_code_a_ltoir, object_code_b_ltoir, object_code_c_ltoir


culink_options = [
options = [
LinkerOptions(),
LinkerOptions(arch=ARCH, verbose=True),
LinkerOptions(arch=ARCH, max_register_count=32),
LinkerOptions(arch=ARCH, optimization_level=3),
LinkerOptions(arch=ARCH, debug=True),
LinkerOptions(arch=ARCH, lineinfo=True),
LinkerOptions(arch=ARCH, no_cache=True), # TODO: consider adding cuda 12.4 to test matrix in which case this
# will fail. Tracked in issue #337
]


@pytest.mark.parametrize(
"options",
culink_options
if culink_backend
else culink_options
+ [
if not culink_backend:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested for line 22 above:

if culink_backend:
    nvjitlink = None
else:
    from cuda.bindings import nvjitlink

Then here:

if nvjitlink is not None:

That way the import appears only once, and near the top, where it is more expected.

options += [
LinkerOptions(arch=ARCH, time=True),
LinkerOptions(arch=ARCH, ftz=True),
LinkerOptions(arch=ARCH, prec_div=True),
Expand All @@ -77,8 +69,13 @@ def compile_ltoir_functions(init_cuda):
LinkerOptions(arch=ARCH, xptxas=["-v"]),
LinkerOptions(arch=ARCH, split_compile=0),
LinkerOptions(arch=ARCH, split_compile_extended=1),
],
)
]
version = nvjitlink.version()
if version >= (12, 5):
options += [LinkerOptions(arch=ARCH, no_cache=True)]


@pytest.mark.parametrize("options", options)
def test_linker_init(compile_ptx_functions, options):
linker = Linker(*compile_ptx_functions, options=options)
object_code = linker.link("cubin")
Expand Down
Loading