Skip to content

Commit b5c5c1c

Browse files
committed
regenerate with docstrings
1 parent 992ddcf commit b5c5c1c

File tree

1 file changed

+126
-0
lines changed

1 file changed

+126
-0
lines changed

cuda_bindings/cuda/bindings/nvjitlink.pyx

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,23 @@ cpdef destroy(intptr_t handle):
8686

8787

8888
cpdef intptr_t create(uint32_t num_options, options) except -1:
89+
"""nvJitLinkCreate creates an instance of nvJitLinkHandle with the given input options, and sets the output parameter ``handle``.
90+
91+
Args:
92+
num_options (uint32_t): Number of options passed.
93+
options (object): Array of size ``num_options`` of option strings. It can be:
94+
95+
- an :class:`int` as the pointer address to the nested sequence, or
96+
- a Python sequence of :class:`int`\s, each of which is a pointer address
97+
to a valid sequence of 'char', or
98+
- a nested Python sequence of ``str``.
99+
100+
101+
Returns:
102+
intptr_t: Address of nvJitLink handle.
103+
104+
.. seealso:: `nvJitLinkCreate`
105+
"""
89106
cdef nested_resource[ char ] _options_
90107
get_nested_resource_ptr[char](_options_, options, <char*>NULL)
91108
cdef Handle handle
@@ -96,6 +113,17 @@ cpdef intptr_t create(uint32_t num_options, options) except -1:
96113

97114

98115
cpdef add_data(intptr_t handle, int input_type, data, size_t size, name):
116+
"""nvJitLinkAddData adds data image to the link.
117+
118+
Args:
119+
handle (intptr_t): nvJitLink handle.
120+
input_type (InputType): kind of input.
121+
data (bytes): pointer to data image in memory.
122+
size (size_t): size of the data.
123+
name (str): name of input object.
124+
125+
.. seealso:: `nvJitLinkAddData`
126+
"""
99127
cdef void* _data_ = get_buffer_pointer(data, size, readonly=True)
100128
if not isinstance(name, str):
101129
raise TypeError("name must be a Python str")
@@ -107,6 +135,15 @@ cpdef add_data(intptr_t handle, int input_type, data, size_t size, name):
107135

108136

109137
cpdef add_file(intptr_t handle, int input_type, file_name):
138+
"""nvJitLinkAddFile reads data from file and links it in.
139+
140+
Args:
141+
handle (intptr_t): nvJitLink handle.
142+
input_type (InputType): kind of input.
143+
file_name (str): name of file.
144+
145+
.. seealso:: `nvJitLinkAddFile`
146+
"""
110147
if not isinstance(file_name, str):
111148
raise TypeError("file_name must be a Python str")
112149
cdef bytes _temp_file_name_ = (<str>file_name).encode()
@@ -117,12 +154,29 @@ cpdef add_file(intptr_t handle, int input_type, file_name):
117154

118155

119156
cpdef complete(intptr_t handle):
157+
"""nvJitLinkComplete does the actual link.
158+
159+
Args:
160+
handle (intptr_t): nvJitLink handle.
161+
162+
.. seealso:: `nvJitLinkComplete`
163+
"""
120164
with nogil:
121165
status = nvJitLinkComplete(<Handle>handle)
122166
check_status(status)
123167

124168

125169
cpdef size_t get_linked_cubin_size(intptr_t handle) except? 0:
170+
"""nvJitLinkGetLinkedCubinSize gets the size of the linked cubin.
171+
172+
Args:
173+
handle (intptr_t): nvJitLink handle.
174+
175+
Returns:
176+
size_t: Size of the linked cubin.
177+
178+
.. seealso:: `nvJitLinkGetLinkedCubinSize`
179+
"""
126180
cdef size_t size
127181
with nogil:
128182
status = nvJitLinkGetLinkedCubinSize(<Handle>handle, &size)
@@ -131,13 +185,31 @@ cpdef size_t get_linked_cubin_size(intptr_t handle) except? 0:
131185

132186

133187
cpdef get_linked_cubin(intptr_t handle, cubin):
188+
"""nvJitLinkGetLinkedCubin gets the linked cubin.
189+
190+
Args:
191+
handle (intptr_t): nvJitLink handle.
192+
cubin (bytes): The linked cubin.
193+
194+
.. seealso:: `nvJitLinkGetLinkedCubin`
195+
"""
134196
cdef void* _cubin_ = get_buffer_pointer(cubin, -1, readonly=False)
135197
with nogil:
136198
status = nvJitLinkGetLinkedCubin(<Handle>handle, <void*>_cubin_)
137199
check_status(status)
138200

139201

140202
cpdef size_t get_linked_ptx_size(intptr_t handle) except? 0:
203+
"""nvJitLinkGetLinkedPtxSize gets the size of the linked ptx.
204+
205+
Args:
206+
handle (intptr_t): nvJitLink handle.
207+
208+
Returns:
209+
size_t: Size of the linked PTX.
210+
211+
.. seealso:: `nvJitLinkGetLinkedPtxSize`
212+
"""
141213
cdef size_t size
142214
with nogil:
143215
status = nvJitLinkGetLinkedPtxSize(<Handle>handle, &size)
@@ -146,13 +218,31 @@ cpdef size_t get_linked_ptx_size(intptr_t handle) except? 0:
146218

147219

148220
cpdef get_linked_ptx(intptr_t handle, ptx):
221+
"""nvJitLinkGetLinkedPtx gets the linked ptx.
222+
223+
Args:
224+
handle (intptr_t): nvJitLink handle.
225+
ptx (bytes): The linked PTX.
226+
227+
.. seealso:: `nvJitLinkGetLinkedPtx`
228+
"""
149229
cdef void* _ptx_ = get_buffer_pointer(ptx, -1, readonly=False)
150230
with nogil:
151231
status = nvJitLinkGetLinkedPtx(<Handle>handle, <char*>_ptx_)
152232
check_status(status)
153233

154234

155235
cpdef size_t get_error_log_size(intptr_t handle) except? 0:
236+
"""nvJitLinkGetErrorLogSize gets the size of the error log.
237+
238+
Args:
239+
handle (intptr_t): nvJitLink handle.
240+
241+
Returns:
242+
size_t: Size of the error log.
243+
244+
.. seealso:: `nvJitLinkGetErrorLogSize`
245+
"""
156246
cdef size_t size
157247
with nogil:
158248
status = nvJitLinkGetErrorLogSize(<Handle>handle, &size)
@@ -161,13 +251,31 @@ cpdef size_t get_error_log_size(intptr_t handle) except? 0:
161251

162252

163253
cpdef get_error_log(intptr_t handle, log):
254+
"""nvJitLinkGetErrorLog puts any error messages in the log.
255+
256+
Args:
257+
handle (intptr_t): nvJitLink handle.
258+
log (bytes): The error log.
259+
260+
.. seealso:: `nvJitLinkGetErrorLog`
261+
"""
164262
cdef void* _log_ = get_buffer_pointer(log, -1, readonly=False)
165263
with nogil:
166264
status = nvJitLinkGetErrorLog(<Handle>handle, <char*>_log_)
167265
check_status(status)
168266

169267

170268
cpdef size_t get_info_log_size(intptr_t handle) except? 0:
269+
"""nvJitLinkGetInfoLogSize gets the size of the info log.
270+
271+
Args:
272+
handle (intptr_t): nvJitLink handle.
273+
274+
Returns:
275+
size_t: Size of the info log.
276+
277+
.. seealso:: `nvJitLinkGetInfoLogSize`
278+
"""
171279
cdef size_t size
172280
with nogil:
173281
status = nvJitLinkGetInfoLogSize(<Handle>handle, &size)
@@ -176,13 +284,31 @@ cpdef size_t get_info_log_size(intptr_t handle) except? 0:
176284

177285

178286
cpdef get_info_log(intptr_t handle, log):
287+
"""nvJitLinkGetInfoLog puts any info messages in the log.
288+
289+
Args:
290+
handle (intptr_t): nvJitLink handle.
291+
log (bytes): The info log.
292+
293+
.. seealso:: `nvJitLinkGetInfoLog`
294+
"""
179295
cdef void* _log_ = get_buffer_pointer(log, -1, readonly=False)
180296
with nogil:
181297
status = nvJitLinkGetInfoLog(<Handle>handle, <char*>_log_)
182298
check_status(status)
183299

184300

185301
cpdef tuple version():
302+
"""nvJitLinkVersion returns the current version of nvJitLink.
303+
304+
Returns:
305+
A 2-tuple containing:
306+
307+
- unsigned int: The major version.
308+
- unsigned int: The minor version.
309+
310+
.. seealso:: `nvJitLinkVersion`
311+
"""
186312
cdef unsigned int major
187313
cdef unsigned int minor
188314
with nogil:

0 commit comments

Comments
 (0)