Skip to content

Comments

Add Ruff Linter run to generated bindings#108

Closed
isVoid wants to merge 3 commits intoNVIDIA:mainfrom
isVoid:fea-add-ruff-linter
Closed

Add Ruff Linter run to generated bindings#108
isVoid wants to merge 3 commits intoNVIDIA:mainfrom
isVoid:fea-add-ruff-linter

Conversation

@isVoid
Copy link
Collaborator

@isVoid isVoid commented Mar 20, 2025

No description provided.

@isVoid isVoid mentioned this pull request Apr 14, 2025
isVoid added a commit that referenced this pull request May 5, 2025
- The linkable code object that contains the shim functions are added to
`active_linking_library` in python.
- Streamed Shim Function Writes. The shim functions are written to a
string stream at lowering time using a special class named
`KeyedStringIO` that prevents double write of the same shim function.
- Ruff formatting generated code (with import sort):
#108
- Generation metadata added to binding: #116 
- Allow user to specify entry point and retain file list in config file
using relative path
d1e7aa2
- Allow user to add additional imports via `Additional Import` config
item
8f7bd22
- Allow user to override the include line in shim function via `Shim
Include Override` config item
8f7bd22
- Allow user to specify whether to include check in the binding to
assert existence of pynvjitlink
[bad0c69](bad0c69)
- Allow user to specify a custom macro, which dictates both how
clangTooling parses the header file, as well as how the shim function is
compiled with NVRTC.
[0f0ee9c](0f0ee9c)

[ORIGINAL]
This PR supercedes #102, which hand picked the parts where only lowering
modifications are involved. In essence, this PR uses a new attribute in
Numba-cuda target context named `_external_linkage`. By inserting the
correct external linkables in the context, this PR hides the shim
function usage to user, therefore eliminating the need for
`c_ext_shim_func` variable.

Additionally, since each shim function is isolated into the sub scope
inside each function lowering, the monolithic shim function block no
longer exists. This should presumably speedup compilation due to reduced
IO burden on the size of the shim function being parsed by the RTC.

~~depends on NVIDIA/numba-cuda#165

Jointly in work with NVIDIA/numba-cuda#166

Includes changes from #116, #108

---------

Co-authored-by: isVoid <isVoid@users.noreply.github.com>
Co-authored-by: Yevhenii Havrylko <yhavrylko@nvidia.com>
@isVoid
Copy link
Collaborator Author

isVoid commented May 5, 2025

Handled by #106

@isVoid isVoid closed this May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant