Skip to content

Commit b8183a8

Browse files
leofangclaude
andcommitted
[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>
1 parent 82e6bb8 commit b8183a8

8 files changed

Lines changed: 1440 additions & 1047 deletions

File tree

cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in

Lines changed: 0 additions & 789 deletions
This file was deleted.
Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,136 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33

4-
# This code was automatically generated with version 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly.
4+
# This code was automatically generated with version 13.2.0, generator version 0.3.1.dev1364+ged01d643e. Do not modify it directly.
55
from cuda.bindings.cynvrtc cimport *
66

7-
{{if 'nvrtcGetErrorString' in found_functions}}
7+
88

99
cdef const char* _nvrtcGetErrorString(nvrtcResult result) except ?NULL nogil
10-
{{endif}}
1110

12-
{{if 'nvrtcVersion' in found_functions}}
11+
12+
1313

1414
cdef nvrtcResult _nvrtcVersion(int* major, int* minor) except ?NVRTC_ERROR_INVALID_INPUT nogil
15-
{{endif}}
1615

17-
{{if 'nvrtcGetNumSupportedArchs' in found_functions}}
16+
17+
1818

1919
cdef nvrtcResult _nvrtcGetNumSupportedArchs(int* numArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil
20-
{{endif}}
2120

22-
{{if 'nvrtcGetSupportedArchs' in found_functions}}
21+
22+
2323

2424
cdef nvrtcResult _nvrtcGetSupportedArchs(int* supportedArchs) except ?NVRTC_ERROR_INVALID_INPUT nogil
25-
{{endif}}
2625

27-
{{if 'nvrtcCreateProgram' in found_functions}}
26+
27+
2828

2929
cdef nvrtcResult _nvrtcCreateProgram(nvrtcProgram* prog, const char* src, const char* name, int numHeaders, const char** headers, const char** includeNames) except ?NVRTC_ERROR_INVALID_INPUT nogil
30-
{{endif}}
3130

32-
{{if 'nvrtcDestroyProgram' in found_functions}}
31+
32+
3333

3434
cdef nvrtcResult _nvrtcDestroyProgram(nvrtcProgram* prog) except ?NVRTC_ERROR_INVALID_INPUT nogil
35-
{{endif}}
3635

37-
{{if 'nvrtcCompileProgram' in found_functions}}
36+
37+
3838

3939
cdef nvrtcResult _nvrtcCompileProgram(nvrtcProgram prog, int numOptions, const char** options) except ?NVRTC_ERROR_INVALID_INPUT nogil
40-
{{endif}}
4140

42-
{{if 'nvrtcGetPTXSize' in found_functions}}
41+
42+
4343

4444
cdef nvrtcResult _nvrtcGetPTXSize(nvrtcProgram prog, size_t* ptxSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil
45-
{{endif}}
4645

47-
{{if 'nvrtcGetPTX' in found_functions}}
46+
47+
4848

4949
cdef nvrtcResult _nvrtcGetPTX(nvrtcProgram prog, char* ptx) except ?NVRTC_ERROR_INVALID_INPUT nogil
50-
{{endif}}
5150

52-
{{if 'nvrtcGetCUBINSize' in found_functions}}
51+
52+
5353

5454
cdef nvrtcResult _nvrtcGetCUBINSize(nvrtcProgram prog, size_t* cubinSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil
55-
{{endif}}
5655

57-
{{if 'nvrtcGetCUBIN' in found_functions}}
56+
57+
5858

5959
cdef nvrtcResult _nvrtcGetCUBIN(nvrtcProgram prog, char* cubin) except ?NVRTC_ERROR_INVALID_INPUT nogil
60-
{{endif}}
6160

62-
{{if 'nvrtcGetLTOIRSize' in found_functions}}
61+
62+
6363

6464
cdef nvrtcResult _nvrtcGetLTOIRSize(nvrtcProgram prog, size_t* LTOIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil
65-
{{endif}}
6665

67-
{{if 'nvrtcGetLTOIR' in found_functions}}
66+
67+
6868

6969
cdef nvrtcResult _nvrtcGetLTOIR(nvrtcProgram prog, char* LTOIR) except ?NVRTC_ERROR_INVALID_INPUT nogil
70-
{{endif}}
7170

72-
{{if 'nvrtcGetOptiXIRSize' in found_functions}}
71+
72+
7373

7474
cdef nvrtcResult _nvrtcGetOptiXIRSize(nvrtcProgram prog, size_t* optixirSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil
75-
{{endif}}
7675

77-
{{if 'nvrtcGetOptiXIR' in found_functions}}
76+
77+
7878

7979
cdef nvrtcResult _nvrtcGetOptiXIR(nvrtcProgram prog, char* optixir) except ?NVRTC_ERROR_INVALID_INPUT nogil
80-
{{endif}}
8180

82-
{{if 'nvrtcGetProgramLogSize' in found_functions}}
81+
82+
8383

8484
cdef nvrtcResult _nvrtcGetProgramLogSize(nvrtcProgram prog, size_t* logSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil
85-
{{endif}}
8685

87-
{{if 'nvrtcGetProgramLog' in found_functions}}
86+
87+
8888

8989
cdef nvrtcResult _nvrtcGetProgramLog(nvrtcProgram prog, char* log) except ?NVRTC_ERROR_INVALID_INPUT nogil
90-
{{endif}}
9190

92-
{{if 'nvrtcAddNameExpression' in found_functions}}
91+
92+
9393

9494
cdef nvrtcResult _nvrtcAddNameExpression(nvrtcProgram prog, const char* name_expression) except ?NVRTC_ERROR_INVALID_INPUT nogil
95-
{{endif}}
9695

97-
{{if 'nvrtcGetLoweredName' in found_functions}}
96+
97+
9898

9999
cdef nvrtcResult _nvrtcGetLoweredName(nvrtcProgram prog, const char* name_expression, const char** lowered_name) except ?NVRTC_ERROR_INVALID_INPUT nogil
100-
{{endif}}
101100

102-
{{if 'nvrtcGetPCHHeapSize' in found_functions}}
101+
102+
103103

104104
cdef nvrtcResult _nvrtcGetPCHHeapSize(size_t* ret) except ?NVRTC_ERROR_INVALID_INPUT nogil
105-
{{endif}}
106105

107-
{{if 'nvrtcSetPCHHeapSize' in found_functions}}
106+
107+
108108

109109
cdef nvrtcResult _nvrtcSetPCHHeapSize(size_t size) except ?NVRTC_ERROR_INVALID_INPUT nogil
110-
{{endif}}
111110

112-
{{if 'nvrtcGetPCHCreateStatus' in found_functions}}
111+
112+
113113

114114
cdef nvrtcResult _nvrtcGetPCHCreateStatus(nvrtcProgram prog) except ?NVRTC_ERROR_INVALID_INPUT nogil
115-
{{endif}}
116115

117-
{{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}}
116+
117+
118118

119119
cdef nvrtcResult _nvrtcGetPCHHeapSizeRequired(nvrtcProgram prog, size_t* size) except ?NVRTC_ERROR_INVALID_INPUT nogil
120-
{{endif}}
121120

122-
{{if 'nvrtcSetFlowCallback' in found_functions}}
121+
122+
123123

124124
cdef nvrtcResult _nvrtcSetFlowCallback(nvrtcProgram prog, void* callback, void* payload) except ?NVRTC_ERROR_INVALID_INPUT nogil
125-
{{endif}}
126125

127-
{{if 'nvrtcGetTileIRSize' in found_functions}}
126+
127+
128128

129129
cdef nvrtcResult _nvrtcGetTileIRSize(nvrtcProgram prog, size_t* TileIRSizeRet) except ?NVRTC_ERROR_INVALID_INPUT nogil
130-
{{endif}}
131130

132-
{{if 'nvrtcGetTileIR' in found_functions}}
131+
132+
133133

134134
cdef nvrtcResult _nvrtcGetTileIR(nvrtcProgram prog, char* TileIR) except ?NVRTC_ERROR_INVALID_INPUT nogil
135-
{{endif}}
135+
136136

0 commit comments

Comments
 (0)