ENH: Add support instantiating ObjectCode with path-like instances#2123
Open
acosmicflamingo wants to merge 9 commits into
Open
ENH: Add support instantiating ObjectCode with path-like instances#2123acosmicflamingo wants to merge 9 commits into
acosmicflamingo wants to merge 9 commits into
Conversation
Contributor
Author
|
This could also be the updated documentation for the change: diff --git a/cuda_core/cuda/core/_module.pyx b/cuda_core/cuda/core/_module.pyx
index ea334aae07..b5b0b441aa 100644
--- a/cuda_core/cuda/core/_module.pyx
+++ b/cuda_core/cuda/core/_module.pyx
@@ -628,9 +628,10 @@ cdef class ObjectCode:
Parameters
----------
- module : Union[bytes, str]
- Either a bytes object containing the in-memory cubin to load, or
- a file path string pointing to the on-disk cubin to load.
+ module : Union[bytes, str, os.PathLike]
+ Either a bytes object containing the in-memory cubin to load,
+ the file path pointing to the on-disk cubin to load,
+ or the string representation of the file path
name : Optional[str]
A human-readable identifier representing this code object.
symbol_mapping : Optional[dict] |
kkraus14
reviewed
May 21, 2026
kkraus14
reviewed
May 21, 2026
kkraus14
reviewed
May 22, 2026
kkraus14
approved these changes
May 22, 2026
Collaborator
|
/ok to test 837e70c |
Author
|
Whoops, I expect tests to fail because |
Author
|
/ok to test 6ed4a7f |
Collaborator
|
/ok to test 6ed4a7f |
Collaborator
|
We require maintainers to trigger CI 😄 |
|
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.
Resolves #755
Before looking into addressing #663, I noticed @kkraus14 had pointed out missing pathlib-like support and figured I could give it a try it a go.
One improvement I could make to
_lazy_load_moduleis the ask-for-forgiveness approach to avoid checking module type twice. It would only require declaringpath_bytesbefore the try block: