|
4 | 4 | # This code was automatically generated with version 13.0.0. Do not modify it directly. |
5 | 5 | {{if 'Windows' == platform.system()}} |
6 | 6 | import os |
7 | | -import win32api |
| 7 | +cimport cuda.bindings._lib.windll as windll |
8 | 8 | {{else}} |
9 | 9 | cimport cuda.bindings._lib.dlfcn as dlfcn |
10 | | -from libc.stdint cimport uintptr_t |
11 | 10 | {{endif}} |
12 | 11 | from cuda.pathfinder import load_nvidia_dynamic_lib |
13 | | -from libc.stdint cimport intptr_t |
| 12 | +from libc.stdint cimport intptr_t, uintptr_t |
14 | 13 | import threading |
15 | 14 |
|
16 | 15 | cdef object __symbol_lock = threading.Lock() |
@@ -50,172 +49,100 @@ cdef int _cuPythonInit() except -1 nogil: |
50 | 49 |
|
51 | 50 | # Load function |
52 | 51 | {{if 'nvrtcGetErrorString' in found_functions}} |
53 | | - try: |
54 | | - global __nvrtcGetErrorString |
55 | | - __nvrtcGetErrorString = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetErrorString') |
56 | | - except: |
57 | | - pass |
| 52 | + global __nvrtcGetErrorString |
| 53 | + __nvrtcGetErrorString = windll.GetProcAddress(handle, 'nvrtcGetErrorString') |
58 | 54 | {{endif}} |
59 | 55 | {{if 'nvrtcVersion' in found_functions}} |
60 | | - try: |
61 | | - global __nvrtcVersion |
62 | | - __nvrtcVersion = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcVersion') |
63 | | - except: |
64 | | - pass |
| 56 | + global __nvrtcVersion |
| 57 | + __nvrtcVersion = windll.GetProcAddress(handle, 'nvrtcVersion') |
65 | 58 | {{endif}} |
66 | 59 | {{if 'nvrtcGetNumSupportedArchs' in found_functions}} |
67 | | - try: |
68 | | - global __nvrtcGetNumSupportedArchs |
69 | | - __nvrtcGetNumSupportedArchs = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') |
70 | | - except: |
71 | | - pass |
| 60 | + global __nvrtcGetNumSupportedArchs |
| 61 | + __nvrtcGetNumSupportedArchs = windll.GetProcAddress(handle, 'nvrtcGetNumSupportedArchs') |
72 | 62 | {{endif}} |
73 | 63 | {{if 'nvrtcGetSupportedArchs' in found_functions}} |
74 | | - try: |
75 | | - global __nvrtcGetSupportedArchs |
76 | | - __nvrtcGetSupportedArchs = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetSupportedArchs') |
77 | | - except: |
78 | | - pass |
| 64 | + global __nvrtcGetSupportedArchs |
| 65 | + __nvrtcGetSupportedArchs = windll.GetProcAddress(handle, 'nvrtcGetSupportedArchs') |
79 | 66 | {{endif}} |
80 | 67 | {{if 'nvrtcCreateProgram' in found_functions}} |
81 | | - try: |
82 | | - global __nvrtcCreateProgram |
83 | | - __nvrtcCreateProgram = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcCreateProgram') |
84 | | - except: |
85 | | - pass |
| 68 | + global __nvrtcCreateProgram |
| 69 | + __nvrtcCreateProgram = windll.GetProcAddress(handle, 'nvrtcCreateProgram') |
86 | 70 | {{endif}} |
87 | 71 | {{if 'nvrtcDestroyProgram' in found_functions}} |
88 | | - try: |
89 | | - global __nvrtcDestroyProgram |
90 | | - __nvrtcDestroyProgram = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcDestroyProgram') |
91 | | - except: |
92 | | - pass |
| 72 | + global __nvrtcDestroyProgram |
| 73 | + __nvrtcDestroyProgram = windll.GetProcAddress(handle, 'nvrtcDestroyProgram') |
93 | 74 | {{endif}} |
94 | 75 | {{if 'nvrtcCompileProgram' in found_functions}} |
95 | | - try: |
96 | | - global __nvrtcCompileProgram |
97 | | - __nvrtcCompileProgram = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcCompileProgram') |
98 | | - except: |
99 | | - pass |
| 76 | + global __nvrtcCompileProgram |
| 77 | + __nvrtcCompileProgram = windll.GetProcAddress(handle, 'nvrtcCompileProgram') |
100 | 78 | {{endif}} |
101 | 79 | {{if 'nvrtcGetPTXSize' in found_functions}} |
102 | | - try: |
103 | | - global __nvrtcGetPTXSize |
104 | | - __nvrtcGetPTXSize = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetPTXSize') |
105 | | - except: |
106 | | - pass |
| 80 | + global __nvrtcGetPTXSize |
| 81 | + __nvrtcGetPTXSize = windll.GetProcAddress(handle, 'nvrtcGetPTXSize') |
107 | 82 | {{endif}} |
108 | 83 | {{if 'nvrtcGetPTX' in found_functions}} |
109 | | - try: |
110 | | - global __nvrtcGetPTX |
111 | | - __nvrtcGetPTX = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetPTX') |
112 | | - except: |
113 | | - pass |
| 84 | + global __nvrtcGetPTX |
| 85 | + __nvrtcGetPTX = windll.GetProcAddress(handle, 'nvrtcGetPTX') |
114 | 86 | {{endif}} |
115 | 87 | {{if 'nvrtcGetCUBINSize' in found_functions}} |
116 | | - try: |
117 | | - global __nvrtcGetCUBINSize |
118 | | - __nvrtcGetCUBINSize = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetCUBINSize') |
119 | | - except: |
120 | | - pass |
| 88 | + global __nvrtcGetCUBINSize |
| 89 | + __nvrtcGetCUBINSize = windll.GetProcAddress(handle, 'nvrtcGetCUBINSize') |
121 | 90 | {{endif}} |
122 | 91 | {{if 'nvrtcGetCUBIN' in found_functions}} |
123 | | - try: |
124 | | - global __nvrtcGetCUBIN |
125 | | - __nvrtcGetCUBIN = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetCUBIN') |
126 | | - except: |
127 | | - pass |
| 92 | + global __nvrtcGetCUBIN |
| 93 | + __nvrtcGetCUBIN = windll.GetProcAddress(handle, 'nvrtcGetCUBIN') |
128 | 94 | {{endif}} |
129 | 95 | {{if 'nvrtcGetLTOIRSize' in found_functions}} |
130 | | - try: |
131 | | - global __nvrtcGetLTOIRSize |
132 | | - __nvrtcGetLTOIRSize = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetLTOIRSize') |
133 | | - except: |
134 | | - pass |
| 96 | + global __nvrtcGetLTOIRSize |
| 97 | + __nvrtcGetLTOIRSize = windll.GetProcAddress(handle, 'nvrtcGetLTOIRSize') |
135 | 98 | {{endif}} |
136 | 99 | {{if 'nvrtcGetLTOIR' in found_functions}} |
137 | | - try: |
138 | | - global __nvrtcGetLTOIR |
139 | | - __nvrtcGetLTOIR = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetLTOIR') |
140 | | - except: |
141 | | - pass |
| 100 | + global __nvrtcGetLTOIR |
| 101 | + __nvrtcGetLTOIR = windll.GetProcAddress(handle, 'nvrtcGetLTOIR') |
142 | 102 | {{endif}} |
143 | 103 | {{if 'nvrtcGetOptiXIRSize' in found_functions}} |
144 | | - try: |
145 | | - global __nvrtcGetOptiXIRSize |
146 | | - __nvrtcGetOptiXIRSize = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetOptiXIRSize') |
147 | | - except: |
148 | | - pass |
| 104 | + global __nvrtcGetOptiXIRSize |
| 105 | + __nvrtcGetOptiXIRSize = windll.GetProcAddress(handle, 'nvrtcGetOptiXIRSize') |
149 | 106 | {{endif}} |
150 | 107 | {{if 'nvrtcGetOptiXIR' in found_functions}} |
151 | | - try: |
152 | | - global __nvrtcGetOptiXIR |
153 | | - __nvrtcGetOptiXIR = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetOptiXIR') |
154 | | - except: |
155 | | - pass |
| 108 | + global __nvrtcGetOptiXIR |
| 109 | + __nvrtcGetOptiXIR = windll.GetProcAddress(handle, 'nvrtcGetOptiXIR') |
156 | 110 | {{endif}} |
157 | 111 | {{if 'nvrtcGetProgramLogSize' in found_functions}} |
158 | | - try: |
159 | | - global __nvrtcGetProgramLogSize |
160 | | - __nvrtcGetProgramLogSize = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetProgramLogSize') |
161 | | - except: |
162 | | - pass |
| 112 | + global __nvrtcGetProgramLogSize |
| 113 | + __nvrtcGetProgramLogSize = windll.GetProcAddress(handle, 'nvrtcGetProgramLogSize') |
163 | 114 | {{endif}} |
164 | 115 | {{if 'nvrtcGetProgramLog' in found_functions}} |
165 | | - try: |
166 | | - global __nvrtcGetProgramLog |
167 | | - __nvrtcGetProgramLog = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetProgramLog') |
168 | | - except: |
169 | | - pass |
| 116 | + global __nvrtcGetProgramLog |
| 117 | + __nvrtcGetProgramLog = windll.GetProcAddress(handle, 'nvrtcGetProgramLog') |
170 | 118 | {{endif}} |
171 | 119 | {{if 'nvrtcAddNameExpression' in found_functions}} |
172 | | - try: |
173 | | - global __nvrtcAddNameExpression |
174 | | - __nvrtcAddNameExpression = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcAddNameExpression') |
175 | | - except: |
176 | | - pass |
| 120 | + global __nvrtcAddNameExpression |
| 121 | + __nvrtcAddNameExpression = windll.GetProcAddress(handle, 'nvrtcAddNameExpression') |
177 | 122 | {{endif}} |
178 | 123 | {{if 'nvrtcGetLoweredName' in found_functions}} |
179 | | - try: |
180 | | - global __nvrtcGetLoweredName |
181 | | - __nvrtcGetLoweredName = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetLoweredName') |
182 | | - except: |
183 | | - pass |
| 124 | + global __nvrtcGetLoweredName |
| 125 | + __nvrtcGetLoweredName = windll.GetProcAddress(handle, 'nvrtcGetLoweredName') |
184 | 126 | {{endif}} |
185 | 127 | {{if 'nvrtcGetPCHHeapSize' in found_functions}} |
186 | | - try: |
187 | | - global __nvrtcGetPCHHeapSize |
188 | | - __nvrtcGetPCHHeapSize = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetPCHHeapSize') |
189 | | - except: |
190 | | - pass |
| 128 | + global __nvrtcGetPCHHeapSize |
| 129 | + __nvrtcGetPCHHeapSize = windll.GetProcAddress(handle, 'nvrtcGetPCHHeapSize') |
191 | 130 | {{endif}} |
192 | 131 | {{if 'nvrtcSetPCHHeapSize' in found_functions}} |
193 | | - try: |
194 | | - global __nvrtcSetPCHHeapSize |
195 | | - __nvrtcSetPCHHeapSize = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcSetPCHHeapSize') |
196 | | - except: |
197 | | - pass |
| 132 | + global __nvrtcSetPCHHeapSize |
| 133 | + __nvrtcSetPCHHeapSize = windll.GetProcAddress(handle, 'nvrtcSetPCHHeapSize') |
198 | 134 | {{endif}} |
199 | 135 | {{if 'nvrtcGetPCHCreateStatus' in found_functions}} |
200 | | - try: |
201 | | - global __nvrtcGetPCHCreateStatus |
202 | | - __nvrtcGetPCHCreateStatus = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') |
203 | | - except: |
204 | | - pass |
| 136 | + global __nvrtcGetPCHCreateStatus |
| 137 | + __nvrtcGetPCHCreateStatus = windll.GetProcAddress(handle, 'nvrtcGetPCHCreateStatus') |
205 | 138 | {{endif}} |
206 | 139 | {{if 'nvrtcGetPCHHeapSizeRequired' in found_functions}} |
207 | | - try: |
208 | | - global __nvrtcGetPCHHeapSizeRequired |
209 | | - __nvrtcGetPCHHeapSizeRequired = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') |
210 | | - except: |
211 | | - pass |
| 140 | + global __nvrtcGetPCHHeapSizeRequired |
| 141 | + __nvrtcGetPCHHeapSizeRequired = windll.GetProcAddress(handle, 'nvrtcGetPCHHeapSizeRequired') |
212 | 142 | {{endif}} |
213 | 143 | {{if 'nvrtcSetFlowCallback' in found_functions}} |
214 | | - try: |
215 | | - global __nvrtcSetFlowCallback |
216 | | - __nvrtcSetFlowCallback = <void*><unsigned long long>win32api.GetProcAddress(handle, 'nvrtcSetFlowCallback') |
217 | | - except: |
218 | | - pass |
| 144 | + global __nvrtcSetFlowCallback |
| 145 | + __nvrtcSetFlowCallback = windll.GetProcAddress(handle, 'nvrtcSetFlowCallback') |
219 | 146 | {{endif}} |
220 | 147 |
|
221 | 148 | {{else}} |
|
0 commit comments