22#
33# SPDX-License-Identifier: Apache-2.0
44#
5- # This code was automatically generated across versions from 12.4.1 to 13.4.1 . Do not modify it directly.
6- # CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6b42b70b945f3898a53f87261fcdb5a688cb9ab93476427781e1838a3ffffaf9
5+ # This code was automatically generated across versions from 12.4.1 to 13.5.0 . Do not modify it directly.
6+ # CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8934b7f337c877db73540d82524de10847b1beb8d17b4bd86a2cd07329fc1882
77
88
99# <<<< PREAMBLE CONTENT >>>>
1010
11+ from libc.stdint cimport intptr_t
12+
1113cdef extern from * nogil:
1214 """
1315 #if defined(_MSC_VER) && !defined(__clang__)
@@ -44,8 +46,6 @@ cdef extern from "<dlfcn.h>":
4446 void * _cyb_dlsym " dlsym" (void * , const char * ) nogil
4547 const void * _cyb_RTLD_DEFAULT " RTLD_DEFAULT"
4648
47- from libc.stdint cimport intptr_t
48-
4949import threading as _cyb_threading
5050
5151cdef int _cyb___py_nvfatbin_init = 0
@@ -77,95 +77,35 @@ cdef void* __nvFatbinAddIndex = NULL
7777cdef void * __nvFatbinAddReloc = NULL
7878cdef void * __nvFatbinAddTileIR = NULL
7979
80+ cdef enum : _cyb_nvfatbin_n_functions = 12
81+ cdef void ** _cyb_nvfatbin_slots[_cyb_nvfatbin_n_functions]
82+ cdef const char * _cyb_nvfatbin_names[_cyb_nvfatbin_n_functions]
83+ _cyb_nvfatbin_slots[0 ] = & __nvFatbinGetErrorString; _cyb_nvfatbin_names[0 ] = b' nvFatbinGetErrorString'
84+ _cyb_nvfatbin_slots[1 ] = & __nvFatbinCreate; _cyb_nvfatbin_names[1 ] = b' nvFatbinCreate'
85+ _cyb_nvfatbin_slots[2 ] = & __nvFatbinDestroy; _cyb_nvfatbin_names[2 ] = b' nvFatbinDestroy'
86+ _cyb_nvfatbin_slots[3 ] = & __nvFatbinAddPTX; _cyb_nvfatbin_names[3 ] = b' nvFatbinAddPTX'
87+ _cyb_nvfatbin_slots[4 ] = & __nvFatbinAddCubin; _cyb_nvfatbin_names[4 ] = b' nvFatbinAddCubin'
88+ _cyb_nvfatbin_slots[5 ] = & __nvFatbinAddLTOIR; _cyb_nvfatbin_names[5 ] = b' nvFatbinAddLTOIR'
89+ _cyb_nvfatbin_slots[6 ] = & __nvFatbinSize; _cyb_nvfatbin_names[6 ] = b' nvFatbinSize'
90+ _cyb_nvfatbin_slots[7 ] = & __nvFatbinGet; _cyb_nvfatbin_names[7 ] = b' nvFatbinGet'
91+ _cyb_nvfatbin_slots[8 ] = & __nvFatbinVersion; _cyb_nvfatbin_names[8 ] = b' nvFatbinVersion'
92+ _cyb_nvfatbin_slots[9 ] = & __nvFatbinAddIndex; _cyb_nvfatbin_names[9 ] = b' nvFatbinAddIndex'
93+ _cyb_nvfatbin_slots[10 ] = & __nvFatbinAddReloc; _cyb_nvfatbin_names[10 ] = b' nvFatbinAddReloc'
94+ _cyb_nvfatbin_slots[11 ] = & __nvFatbinAddTileIR; _cyb_nvfatbin_names[11 ] = b' nvFatbinAddTileIR'
95+
8096cdef int _init_nvfatbin() except - 1 nogil:
8197 global _cyb___py_nvfatbin_init
8298 cdef void * handle = NULL
99+ cdef Py_ssize_t i
83100 with gil, _cyb_symbol_lock:
84101 if _cyb___py_nvfatbin_init: return 0
85102
86- global __nvFatbinGetErrorString
87- __nvFatbinGetErrorString = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinGetErrorString' )
88- if __nvFatbinGetErrorString == NULL :
89- if handle == NULL :
90- handle = load_library()
91- __nvFatbinGetErrorString = _cyb_dlsym(handle, ' nvFatbinGetErrorString' )
92-
93- global __nvFatbinCreate
94- __nvFatbinCreate = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinCreate' )
95- if __nvFatbinCreate == NULL :
96- if handle == NULL :
97- handle = load_library()
98- __nvFatbinCreate = _cyb_dlsym(handle, ' nvFatbinCreate' )
99-
100- global __nvFatbinDestroy
101- __nvFatbinDestroy = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinDestroy' )
102- if __nvFatbinDestroy == NULL :
103- if handle == NULL :
104- handle = load_library()
105- __nvFatbinDestroy = _cyb_dlsym(handle, ' nvFatbinDestroy' )
106-
107- global __nvFatbinAddPTX
108- __nvFatbinAddPTX = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinAddPTX' )
109- if __nvFatbinAddPTX == NULL :
110- if handle == NULL :
111- handle = load_library()
112- __nvFatbinAddPTX = _cyb_dlsym(handle, ' nvFatbinAddPTX' )
113-
114- global __nvFatbinAddCubin
115- __nvFatbinAddCubin = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinAddCubin' )
116- if __nvFatbinAddCubin == NULL :
117- if handle == NULL :
118- handle = load_library()
119- __nvFatbinAddCubin = _cyb_dlsym(handle, ' nvFatbinAddCubin' )
120-
121- global __nvFatbinAddLTOIR
122- __nvFatbinAddLTOIR = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinAddLTOIR' )
123- if __nvFatbinAddLTOIR == NULL :
124- if handle == NULL :
125- handle = load_library()
126- __nvFatbinAddLTOIR = _cyb_dlsym(handle, ' nvFatbinAddLTOIR' )
127-
128- global __nvFatbinSize
129- __nvFatbinSize = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinSize' )
130- if __nvFatbinSize == NULL :
131- if handle == NULL :
132- handle = load_library()
133- __nvFatbinSize = _cyb_dlsym(handle, ' nvFatbinSize' )
134-
135- global __nvFatbinGet
136- __nvFatbinGet = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinGet' )
137- if __nvFatbinGet == NULL :
138- if handle == NULL :
139- handle = load_library()
140- __nvFatbinGet = _cyb_dlsym(handle, ' nvFatbinGet' )
141-
142- global __nvFatbinVersion
143- __nvFatbinVersion = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinVersion' )
144- if __nvFatbinVersion == NULL :
145- if handle == NULL :
146- handle = load_library()
147- __nvFatbinVersion = _cyb_dlsym(handle, ' nvFatbinVersion' )
148-
149- global __nvFatbinAddIndex
150- __nvFatbinAddIndex = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinAddIndex' )
151- if __nvFatbinAddIndex == NULL :
152- if handle == NULL :
153- handle = load_library()
154- __nvFatbinAddIndex = _cyb_dlsym(handle, ' nvFatbinAddIndex' )
155-
156- global __nvFatbinAddReloc
157- __nvFatbinAddReloc = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinAddReloc' )
158- if __nvFatbinAddReloc == NULL :
159- if handle == NULL :
160- handle = load_library()
161- __nvFatbinAddReloc = _cyb_dlsym(handle, ' nvFatbinAddReloc' )
162-
163- global __nvFatbinAddTileIR
164- __nvFatbinAddTileIR = _cyb_dlsym(_cyb_RTLD_DEFAULT, ' nvFatbinAddTileIR' )
165- if __nvFatbinAddTileIR == NULL :
166- if handle == NULL :
167- handle = load_library()
168- __nvFatbinAddTileIR = _cyb_dlsym(handle, ' nvFatbinAddTileIR' )
103+ for i in range (_cyb_nvfatbin_n_functions):
104+ _cyb_nvfatbin_slots[i][0 ] = _cyb_dlsym(_cyb_RTLD_DEFAULT, _cyb_nvfatbin_names[i])
105+ if _cyb_nvfatbin_slots[i][0 ] == NULL :
106+ if handle == NULL :
107+ handle = load_library()
108+ _cyb_nvfatbin_slots[i][0 ] = _cyb_dlsym(handle, _cyb_nvfatbin_names[i])
169109
170110 _cyb_atomic_int_store(< int * > & _cyb___py_nvfatbin_init, 1 )
171111 return 0
@@ -184,41 +124,9 @@ cpdef dict _inspect_function_pointers():
184124
185125 _check_or_init_nvfatbin()
186126 cdef dict data = {}
187- global __nvFatbinGetErrorString
188- data[" __nvFatbinGetErrorString" ] = < intptr_t> __nvFatbinGetErrorString
189-
190- global __nvFatbinCreate
191- data[" __nvFatbinCreate" ] = < intptr_t> __nvFatbinCreate
192-
193- global __nvFatbinDestroy
194- data[" __nvFatbinDestroy" ] = < intptr_t> __nvFatbinDestroy
195-
196- global __nvFatbinAddPTX
197- data[" __nvFatbinAddPTX" ] = < intptr_t> __nvFatbinAddPTX
198-
199- global __nvFatbinAddCubin
200- data[" __nvFatbinAddCubin" ] = < intptr_t> __nvFatbinAddCubin
201-
202- global __nvFatbinAddLTOIR
203- data[" __nvFatbinAddLTOIR" ] = < intptr_t> __nvFatbinAddLTOIR
204-
205- global __nvFatbinSize
206- data[" __nvFatbinSize" ] = < intptr_t> __nvFatbinSize
207-
208- global __nvFatbinGet
209- data[" __nvFatbinGet" ] = < intptr_t> __nvFatbinGet
210-
211- global __nvFatbinVersion
212- data[" __nvFatbinVersion" ] = < intptr_t> __nvFatbinVersion
213-
214- global __nvFatbinAddIndex
215- data[" __nvFatbinAddIndex" ] = < intptr_t> __nvFatbinAddIndex
216-
217- global __nvFatbinAddReloc
218- data[" __nvFatbinAddReloc" ] = < intptr_t> __nvFatbinAddReloc
219-
220- global __nvFatbinAddTileIR
221- data[" __nvFatbinAddTileIR" ] = < intptr_t> __nvFatbinAddTileIR
127+ cdef Py_ssize_t i
128+ for i in range (_cyb_nvfatbin_n_functions):
129+ data[' __' + _cyb_nvfatbin_names[i].decode()] = < intptr_t> _cyb_nvfatbin_slots[i][0 ]
222130 _cyb_func_ptrs = data
223131 return data
224132
0 commit comments