Commit ab29f67
Replace nvrtc Tempita templates with pre-generated Cython files (#1900)
* [DRAFT] Replace nvrtc Tempita templates with pre-generated Cython files
Replace .pyx.in / .pxd.in Tempita templates with plain .pyx / .pxd files
generated by the refactored cython-gen (cybind leof/cybind\!369).
Changes:
- Remove 6 Tempita template files (.pyx.in / .pxd.in) for nvrtc
- Add 7 pre-generated Cython files with zero Tempita
- Move internal layer from _bindings/ to _internal/ following cybind convention
- Split platform-specific code into nvrtc_linux.pyx / nvrtc_windows.pyx
- Internal layer now uses cybind-style loading (RTLD_DEFAULT + fallback,
FunctionNotFoundError, _init_nvrtc/_check_or_init_nvrtc naming)
This is a companion PR to cybind leof/cybind\!369. Build system changes
(build_hooks.py, pyproject.toml) to remove pyclibrary are not yet
included — this PR shows the generated output for review.
Part of https://gitlab-master.nvidia.com/leof/cybind/-/issues/173
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Regenerate nvrtc files with template-based generation
Update generated artifacts to use cybind-style templates:
- Fix excessive blank lines from Tempita stripping
- Internal layer files now generated from template files under
cybind/assets/templates/ via string.Template.substitute()
- Proper license headers from templates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update cynvrtc.pyx to use _internal cimport (cybind convention)
- cynvrtc.pyx now uses "from ._internal cimport nvrtc as _nvrtc"
instead of the legacy "cimport _bindings.cynvrtc as cynvrtc"
- Function wrappers reference _nvrtc._funcName() matching cybind style
- cynvrtc.pxd gets proper template header
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update build system: skip pyclibrary for nvrtc, fix cynvrtc source path
- Remove nvrtc from _REQUIRED_HEADERS (no pyclibrary parsing needed;
nvrtc .pyx/.pxd files are now pre-generated by cybind)
- Update sources_list: cynvrtc.pyx moved from _bindings/ to bindings/
- _rename_architecture_specific_files already handles
_internal/nvrtc_linux.pyx -> _internal/nvrtc.pyx
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Restore generator version in headers, remove duplicate cynvrtc source entry
- Regenerate files with generator version in header comments
- Remove explicit cynvrtc.pyx from sources_list (already covered by
cuda_bindings_files glob)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix pre-commit: strip trailing whitespace and ensure final newline
Regenerated from latest cybind which now cleans up trailing whitespace
and ensures files end with exactly one newline.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 6ec277e commit ab29f67
File tree
9 files changed
+1194
-1192
lines changed- cuda_bindings
- cuda/bindings
- _bindings
- _internal
9 files changed
+1194
-1192
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 97 | + | |
100 | 98 | | |
101 | 99 | | |
102 | 100 | | |
| |||
423 | 421 | | |
424 | 422 | | |
425 | 423 | | |
426 | | - | |
| 424 | + | |
| 425 | + | |
427 | 426 | | |
428 | 427 | | |
429 | 428 | | |
| |||
This file was deleted.
Lines changed: 7 additions & 80 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | | - | |
5 | | - | |
| 7 | + | |
6 | 8 | | |
7 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 18 | | |
24 | 19 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 20 | | |
29 | 21 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 22 | | |
34 | 23 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 24 | | |
39 | 25 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 26 | | |
44 | 27 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 28 | | |
49 | 29 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 30 | | |
54 | 31 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 32 | | |
59 | 33 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 34 | | |
64 | 35 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 36 | | |
69 | 37 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 38 | | |
74 | 39 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 40 | | |
79 | 41 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 42 | | |
84 | 43 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 44 | | |
89 | 45 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | 46 | | |
94 | 47 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | 48 | | |
99 | 49 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 50 | | |
104 | 51 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | 52 | | |
109 | 53 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | 54 | | |
114 | 55 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | 56 | | |
119 | 57 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | 58 | | |
124 | 59 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | 60 | | |
129 | 61 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | 62 | | |
134 | 63 | | |
135 | | - | |
136 | | - | |
0 commit comments