Open
Conversation
|
Make `Linker.backend` callable without instantiation, allowing downstream libraries (e.g., numba-cuda) to query which linking backend will be used before constructing a Linker. The classmethod calls `_decide_nvjitlink_or_driver()` and maps its return value to "nvJitLink" or "driver". Existing call sites updated to use parens (`linker.backend()` instead of `linker.backend`). Breaking change: attribute-style access `linker.backend` now returns a bound method, not a string. Only two in-repo call sites affected; both updated. Refs NVIDIA#714 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests monkeypatch module-level flags in cuda.core._linker to verify the classmethod without requiring a GPU. Covers nvJitLink path, driver path, probe invocation when not memoised, classmethod descriptor check, and idempotency. Refs NVIDIA#714 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Explicit guard that the intentional property-to-classmethod break is preserved. Documents the breaking change in the test itself. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document the breaking change from property to classmethod. Also remove unused pytest import from test_linker_backend.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ecc449b to
dbe6176
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Linker.backendfrom an instance property to a classmethod so callers can query the linking backend without constructing aLinker_decide_nvjitlink_or_driver()(existing memoised probe) and maps the return value to"nvJitLink"or"driver"_program.pyxand existing test assertion to use parensDevice()/cuInitrequired)0.8.0-notes.rstdocumenting the breaking changeBreaking change:
linker.backend(attribute access) now returns a bound method, not a string. All call sites must useLinker.backend(). Only 2 in-repo call sites affected; numba-cuda (the requester) will adoptLinker.backend()from day one.Test plan
test_linker_initpasses with updated paren callCloses #714
🤖 Generated with Claude Code