Add ObjectCode.get_module() for legacy driver API integration#2339
Open
lijinf2 wants to merge 2 commits into
Open
Add ObjectCode.get_module() for legacy driver API integration#2339lijinf2 wants to merge 2 commits into
lijinf2 wants to merge 2 commits into
Conversation
Contributor
Contributor
Author
|
/ok to test 600176e |
|
leofang
reviewed
Jul 14, 2026
| cdef cydriver.CUmodule mod | ||
| with nogil: | ||
| HANDLE_RETURN(cydriver.cuLibraryGetModule(&mod, as_cu(self._h_library))) | ||
| return driver.CUmodule(<intptr_t>mod) |
Member
There was a problem hiding this comment.
Q: Shouldn't we use as_py() to do the return value conversion?
Q: How do we teach the difference between .get_module() and .handle?
Contributor
Author
There was a problem hiding this comment.
Sorry for not getting back sooner. I shifted focus to issue #2179, for which I need to set up cuda bindings development environment for the first time.
It looks as_py() does not provide support for CUmodule type yet. I am not sure if we should add the support there per CUmodule is deemed as legacy API. But let me know if you find the support favorable. Happy to add that.
For .handle vs .get_module(): I'll clarify in the docstring.
Document that .handle returns the native context-independent CUlibrary for cuda.core/newer APIs, while get_module() is a legacy-interop bridge returning a context-dependent CUmodule via cuLibraryGetModule.
Contributor
Author
|
/ok to test b56e37e |
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.
Description
closes #489
Add
ObjectCode.get_module()to expose theCUmodulefor the current context viacuLibraryGetModule, so code using legacy driver APIs can interoperate withcuda.core's context-independentCUlibraryloading.Checklist