singe_cuda_sys/nvrtc_sys_13040.rs
1/* automatically generated by rust-bindgen 0.72.1 */
2
3/// Skip installation if version marker exists and version matches. This is the default behavior when flags=0.
4pub const NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS: u32 = 0;
5/// Clear existing directory contents before installation. Guarantees consistency by removing any existing files first.
6pub const NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE: u32 = 1;
7/// Return NVRTC_ERROR_BUSY immediately if installation is in progress by another process, instead of waiting for the lock. Can be combined with FORCE_OVERWRITE using bitwise OR.
8pub const NVRTC_INSTALL_HEADERS_NO_WAIT: u32 = 2;
9/// Unsigned C `size_t`, used for byte counts and object sizes in the native ABI.
10pub type size_t = ::core::ffi::c_ulong;
11impl nvrtcResult {
12 /// The operation completed successfully.
13 pub const NVRTC_SUCCESS: nvrtcResult = nvrtcResult(0);
14 /// NVRTC could not allocate the required memory.
15 pub const NVRTC_ERROR_OUT_OF_MEMORY: nvrtcResult = nvrtcResult(1);
16 /// NVRTC could not create the program.
17 pub const NVRTC_ERROR_PROGRAM_CREATION_FAILURE: nvrtcResult = nvrtcResult(2);
18 /// An input argument is invalid.
19 pub const NVRTC_ERROR_INVALID_INPUT: nvrtcResult = nvrtcResult(3);
20 /// The program handle is invalid.
21 pub const NVRTC_ERROR_INVALID_PROGRAM: nvrtcResult = nvrtcResult(4);
22 /// A compilation option is invalid.
23 pub const NVRTC_ERROR_INVALID_OPTION: nvrtcResult = nvrtcResult(5);
24 /// CUDA source compilation failed; the program log contains diagnostics.
25 pub const NVRTC_ERROR_COMPILATION: nvrtcResult = nvrtcResult(6);
26 /// An NVRTC built-in operation failed.
27 pub const NVRTC_ERROR_BUILTIN_OPERATION_FAILURE: nvrtcResult = nvrtcResult(7);
28 /// A name expression cannot be added after compilation.
29 pub const NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION: nvrtcResult = nvrtcResult(
30 8,
31 );
32 /// A lowered name was requested before compiling the program.
33 pub const NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION: nvrtcResult = nvrtcResult(
34 9,
35 );
36 /// The name expression is invalid.
37 pub const NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID: nvrtcResult = nvrtcResult(10);
38 /// An internal NVRTC error occurred.
39 pub const NVRTC_ERROR_INTERNAL_ERROR: nvrtcResult = nvrtcResult(11);
40 /// NVRTC could not write its compilation timing file.
41 pub const NVRTC_ERROR_TIME_FILE_WRITE_FAILED: nvrtcResult = nvrtcResult(12);
42 /// No precompiled-header creation was attempted. PCH processing may not have been requested, or automatic PCH processing chose not to create a file.
43 pub const NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED: nvrtcResult = nvrtcResult(13);
44 /// The precompiled-header heap was exhausted. Query the required size and enlarge the heap before retrying compilation with a new program.
45 pub const NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED: nvrtcResult = nvrtcResult(14);
46 /// An error prevented the precompiled-header file from being created.
47 pub const NVRTC_ERROR_PCH_CREATE: nvrtcResult = nvrtcResult(15);
48 /// The operation was cancelled.
49 pub const NVRTC_ERROR_CANCELLED: nvrtcResult = nvrtcResult(16);
50 /// NVRTC could not write its compilation time-trace file.
51 pub const NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED: nvrtcResult = nvrtcResult(17);
52 /// Bundled-header installation could not acquire the installation lock and a nonblocking installation was requested.
53 pub const NVRTC_ERROR_BUSY: nvrtcResult = nvrtcResult(18);
54}
55/// The enumerated type nvrtcResult defines API call result codes.
56///
57/// NVRTC API functions return nvrtcResult to indicate the call result.
58#[repr(transparent)]
59#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
60pub struct nvrtcResult(pub ::core::ffi::c_uint);
61singe_loader::functions! { crate::NVRTC;
62 /// nvrtcGetErrorString is a helper function that returns a string describing the given nvrtcResult code, e.g., [`nvrtcResult::NVRTC_SUCCESS`] to `"NVRTC_SUCCESS"`.
63 ///
64 /// For unrecognized enumeration values, it returns `"NVRTC_ERROR unknown"`.
65 ///
66 /// # Parameters
67 ///
68 /// - `result`: CUDA Runtime Compilation API result code.
69 pub fn nvrtcGetErrorString(result: nvrtcResult) -> *const ::core::ffi::c_char;
70}
71singe_loader::functions! { crate::NVRTC;
72 /// nvrtcVersion sets the output parameters `major` and `minor` with the CUDA Runtime Compilation version number.
73 ///
74 /// # Parameters
75 ///
76 /// - `major`: CUDA Runtime Compilation major version number.
77 /// - `minor`: CUDA Runtime Compilation minor version number.
78 pub fn nvrtcVersion(
79 major: *mut ::core::ffi::c_int,
80 minor: *mut ::core::ffi::c_int,
81 ) -> nvrtcResult;
82}
83singe_loader::functions! { crate::NVRTC;
84 /// nvrtcGetNumSupportedArchs sets the output parameter `numArchs` with the number of architectures supported by NVRTC.
85 ///
86 /// This can then be used to pass an array to [`nvrtcGetSupportedArchs`] to get the supported architectures.
87 ///
88 /// see [`nvrtcGetSupportedArchs`].
89 ///
90 /// # Parameters
91 ///
92 /// - `numArchs`: number of supported architectures.
93 pub fn nvrtcGetNumSupportedArchs(numArchs: *mut ::core::ffi::c_int) -> nvrtcResult;
94}
95singe_loader::functions! { crate::NVRTC;
96 /// nvrtcGetSupportedArchs populates the array passed via the output parameter `supportedArchs` with the architectures supported by NVRTC.
97 ///
98 /// The array is sorted in the ascending order. The size of the array to be passed can be determined using [`nvrtcGetNumSupportedArchs`].
99 ///
100 /// see [`nvrtcGetNumSupportedArchs`].
101 ///
102 /// # Parameters
103 ///
104 /// - `supportedArchs`: sorted array of supported architectures.
105 pub fn nvrtcGetSupportedArchs(
106 supportedArchs: *mut ::core::ffi::c_int,
107 ) -> nvrtcResult;
108}
109/// Incomplete native type used by [`nvrtcProgram`] handles. The native API owns its layout.
110#[repr(C)]
111#[derive(Debug, Copy, Clone)]
112pub struct _nvrtcProgram {
113 _unused: [u8; 0],
114}
115/// nvrtcProgram is the unit of compilation, and an opaque handle for a program.
116///
117/// To compile a CUDA program string, an instance of nvrtcProgram must be created first with [`nvrtcCreateProgram`], then compiled with [`nvrtcCompileProgram`].
118pub type nvrtcProgram = *mut _nvrtcProgram;
119singe_loader::functions! { crate::NVRTC;
120 /// nvrtcCreateProgram creates an instance of nvrtcProgram with the given input parameters, and sets the output parameter `prog` with it.
121 ///
122 /// # Parameters
123 ///
124 /// - `prog`: CUDA Runtime Compilation program.
125 /// - `src`: CUDA program source.
126 /// - `name`: CUDA program name. name can be NULL ; "default_program" is used when name is NULL or “”.
127 /// - `numHeaders`: Number of headers used. numHeaders must be greater than or equal to 0.
128 /// - `headers`: Sources of the headers. headers can be NULL when numHeaders is 0.
129 /// - `includeNames`: Name of each header by which they can be included in the CUDA program source. includeNames can be NULL when numHeaders is 0. These headers must be included with the exact names specified here.
130 pub fn nvrtcCreateProgram(
131 prog: *mut nvrtcProgram,
132 src: *const ::core::ffi::c_char,
133 name: *const ::core::ffi::c_char,
134 numHeaders: ::core::ffi::c_int,
135 headers: *const *const ::core::ffi::c_char,
136 includeNames: *const *const ::core::ffi::c_char,
137 ) -> nvrtcResult;
138}
139singe_loader::functions! { crate::NVRTC;
140 /// nvrtcDestroyProgram destroys the given program.
141 ///
142 /// # Parameters
143 ///
144 /// - `prog`: CUDA Runtime Compilation program.
145 pub fn nvrtcDestroyProgram(prog: *mut nvrtcProgram) -> nvrtcResult;
146}
147singe_loader::functions! { crate::NVRTC;
148 /// nvrtcCompileProgram compiles the given program.
149 ///
150 /// It supports compile options listed in [Supported Compile Options](https://docs.nvidia.com/cuda/archive/13.4.2/nvrtc/index.html#group__options).
151 ///
152 /// # Parameters
153 ///
154 /// - `prog`: CUDA Runtime Compilation program.
155 /// - `numOptions`: Number of compiler options passed.
156 /// - `options`: Compiler options in the form of C string array. options can be NULL when numOptions is 0.
157 pub fn nvrtcCompileProgram(
158 prog: nvrtcProgram,
159 numOptions: ::core::ffi::c_int,
160 options: *const *const ::core::ffi::c_char,
161 ) -> nvrtcResult;
162}
163singe_loader::functions! { crate::NVRTC;
164 /// nvrtcGetPTXSize sets the value of `ptxSizeRet` with the size of the PTX generated by the previous compilation of `prog` (including the trailing `NULL`).
165 ///
166 /// # Parameters
167 ///
168 /// - `prog`: CUDA Runtime Compilation program.
169 /// - `ptxSizeRet`: Size of the generated PTX (including the trailing NULL ).
170 pub fn nvrtcGetPTXSize(prog: nvrtcProgram, ptxSizeRet: *mut size_t) -> nvrtcResult;
171}
172singe_loader::functions! { crate::NVRTC;
173 /// nvrtcGetPTX stores the PTX generated by the previous compilation of `prog` in the memory pointed by `ptx`.
174 ///
175 /// # Parameters
176 ///
177 /// - `prog`: CUDA Runtime Compilation program.
178 /// - `ptx`: Compiled result.
179 pub fn nvrtcGetPTX(prog: nvrtcProgram, ptx: *mut ::core::ffi::c_char) -> nvrtcResult;
180}
181singe_loader::functions! { crate::NVRTC;
182 /// nvrtcGetCUBINSize sets the value of `cubinSizeRet` with the size of the cubin generated by the previous compilation of `prog`.
183 ///
184 /// The value of cubinSizeRet is set to 0 if the value specified to `-arch` is a virtual architecture instead of an actual architecture.
185 ///
186 /// # Parameters
187 ///
188 /// - `prog`: CUDA Runtime Compilation program.
189 /// - `cubinSizeRet`: Size of the generated cubin.
190 pub fn nvrtcGetCUBINSize(
191 prog: nvrtcProgram,
192 cubinSizeRet: *mut size_t,
193 ) -> nvrtcResult;
194}
195singe_loader::functions! { crate::NVRTC;
196 /// nvrtcGetCUBIN stores the cubin generated by the previous compilation of `prog` in the memory pointed by `cubin`.
197 ///
198 /// No cubin is available if the value specified to `-arch` is a virtual architecture instead of an actual architecture. The cubin does not contain code for the Tile functions (`__tile__` / `__tile_global__`) or variables (`__tile__`); use [`nvrtcGetTileIR`] to extract the cuda_tile IR generated for Tile code.
199 ///
200 /// # Parameters
201 ///
202 /// - `prog`: CUDA Runtime Compilation program.
203 /// - `cubin`: Compiled and assembled result.
204 pub fn nvrtcGetCUBIN(
205 prog: nvrtcProgram,
206 cubin: *mut ::core::ffi::c_char,
207 ) -> nvrtcResult;
208}
209singe_loader::functions! { crate::NVRTC;
210 /// nvrtcGetLTOIRSize sets the value of `LTOIRSizeRet` with the size of the LTO IR generated by the previous compilation of `prog`.
211 ///
212 /// The value of LTOIRSizeRet is set to 0 if the program was not compiled with `-dlto`.
213 ///
214 /// # Parameters
215 ///
216 /// - `prog`: CUDA Runtime Compilation program.
217 /// - `LTOIRSizeRet`: Size of the generated LTO IR.
218 pub fn nvrtcGetLTOIRSize(
219 prog: nvrtcProgram,
220 LTOIRSizeRet: *mut size_t,
221 ) -> nvrtcResult;
222}
223singe_loader::functions! { crate::NVRTC;
224 /// nvrtcGetLTOIR stores the LTO IR generated by the previous compilation of `prog` in the memory pointed by `LTOIR`.
225 ///
226 /// No LTO IR is available if the program was compiled without `-dlto`.
227 ///
228 /// # Parameters
229 ///
230 /// - `prog`: CUDA Runtime Compilation program.
231 /// - `LTOIR`: Compiled result.
232 pub fn nvrtcGetLTOIR(
233 prog: nvrtcProgram,
234 LTOIR: *mut ::core::ffi::c_char,
235 ) -> nvrtcResult;
236}
237singe_loader::functions! { crate::NVRTC;
238 /// nvrtcGetOptiXIRSize sets the value of `optixirSizeRet` with the size of the OptiX IR generated by the previous compilation of `prog`.
239 ///
240 /// The value of nvrtcGetOptiXIRSize is set to 0 if the program was compiled with options incompatible with OptiX IR generation.
241 ///
242 /// # Parameters
243 ///
244 /// - `prog`: CUDA Runtime Compilation program.
245 /// - `optixirSizeRet`: Size of the generated LTO IR.
246 pub fn nvrtcGetOptiXIRSize(
247 prog: nvrtcProgram,
248 optixirSizeRet: *mut size_t,
249 ) -> nvrtcResult;
250}
251singe_loader::functions! { crate::NVRTC;
252 /// nvrtcGetOptiXIR stores the OptiX IR generated by the previous compilation of `prog` in the memory pointed by `optixir`.
253 ///
254 /// No OptiX IR is available if the program was compiled with options incompatible with OptiX IR generation.
255 ///
256 /// # Parameters
257 ///
258 /// - `prog`: CUDA Runtime Compilation program.
259 /// - `optixir`: Optix IR Compiled result.
260 pub fn nvrtcGetOptiXIR(
261 prog: nvrtcProgram,
262 optixir: *mut ::core::ffi::c_char,
263 ) -> nvrtcResult;
264}
265singe_loader::functions! { crate::NVRTC;
266 /// nvrtcGetProgramLogSize sets `logSizeRet` with the size of the log generated by the previous compilation of `prog` (including the trailing `NULL`).
267 ///
268 /// Note that compilation log may be generated with warnings and informative messages, even when the compilation of `prog` succeeds.
269 ///
270 /// # Parameters
271 ///
272 /// - `prog`: CUDA Runtime Compilation program.
273 /// - `logSizeRet`: Size of the compilation log (including the trailing NULL ).
274 pub fn nvrtcGetProgramLogSize(
275 prog: nvrtcProgram,
276 logSizeRet: *mut size_t,
277 ) -> nvrtcResult;
278}
279singe_loader::functions! { crate::NVRTC;
280 /// nvrtcGetProgramLog stores the log generated by the previous compilation of `prog` in the memory pointed by `log`.
281 ///
282 /// # Parameters
283 ///
284 /// - `prog`: CUDA Runtime Compilation program.
285 /// - `log`: Compilation log.
286 pub fn nvrtcGetProgramLog(
287 prog: nvrtcProgram,
288 log: *mut ::core::ffi::c_char,
289 ) -> nvrtcResult;
290}
291singe_loader::functions! { crate::NVRTC;
292 /// nvrtcAddNameExpression notes the given name expression denoting the address of a **global** function or **device**/__constant__ variable.
293 ///
294 /// The identical name expression string must be provided on a subsequent call to nvrtcGetLoweredName to extract the lowered name.
295 ///
296 /// # Parameters
297 ///
298 /// - `prog`: CUDA Runtime Compilation program.
299 /// - `name_expression`: constant expression denoting the address of a global function or device /__constant__ variable.
300 pub fn nvrtcAddNameExpression(
301 prog: nvrtcProgram,
302 name_expression: *const ::core::ffi::c_char,
303 ) -> nvrtcResult;
304}
305singe_loader::functions! { crate::NVRTC;
306 /// nvrtcGetLoweredName extracts the lowered (mangled) name for a **global** function or **device**/__constant__ variable, and updates \*lowered_name to point to it.
307 ///
308 /// The memory containing the name is released when the NVRTC program is destroyed by nvrtcDestroyProgram. The identical name expression must have been previously provided to nvrtcAddNameExpression.
309 ///
310 /// # Parameters
311 ///
312 /// - `prog`: CUDA Runtime Compilation program.
313 /// - `name_expression`: constant expression denoting the address of a global function or device /__constant__ variable.
314 /// - `lowered_name`: initialized by the function to point to a C string containing the lowered (mangled) name corresponding to the provided name expression.
315 pub fn nvrtcGetLoweredName(
316 prog: nvrtcProgram,
317 name_expression: *const ::core::ffi::c_char,
318 lowered_name: *mut *const ::core::ffi::c_char,
319 ) -> nvrtcResult;
320}
321singe_loader::functions! { crate::NVRTC;
322 /// retrieve the current size of the PCH Heap.
323 ///
324 /// # Parameters
325 ///
326 /// - `ret`: pointer to location where the size of the PCH Heap will be stored.
327 pub fn nvrtcGetPCHHeapSize(ret: *mut size_t) -> nvrtcResult;
328}
329singe_loader::functions! { crate::NVRTC;
330 /// set the size of the PCH Heap.
331 ///
332 /// The requested size may be rounded up to a platform dependent alignment (e.g. page size). If the PCH Heap has already been allocated, the heap memory will be freed and a new PCH Heap will be allocated.
333 ///
334 /// # Parameters
335 ///
336 /// - `size`: requested size of the PCH Heap, in bytes.
337 pub fn nvrtcSetPCHHeapSize(size: size_t) -> nvrtcResult;
338}
339singe_loader::functions! { crate::NVRTC;
340 /// Returns the PCH creation status.
341 ///
342 /// [`nvrtcResult::NVRTC_SUCCESS`] indicates that the PCH was successfully created. [`nvrtcResult::NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED`] indicates that no PCH creation was attempted, either because PCH functionality was not requested during the preceding nvrtcCompileProgram call, or automatic PCH processing was requested, and compiler chose not to create a PCH file. [`nvrtcResult::NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED`] indicates that a PCH file could potentially have been created, but the compiler ran out space in the PCH heap. In this scenario, the [`nvrtcGetPCHHeapSizeRequired`] can be used to query the required heap size, the heap can be reallocated for this size with [`nvrtcSetPCHHeapSize`] and PCH creation may be reattempted again invoking [`nvrtcCompileProgram`] with a new NVRTC program instance. [`nvrtcResult::NVRTC_ERROR_PCH_CREATE`] indicates that an error condition prevented the PCH file from being created.
343 ///
344 /// # Parameters
345 ///
346 /// - `prog`: CUDA Runtime Compilation program.
347 pub fn nvrtcGetPCHCreateStatus(prog: nvrtcProgram) -> nvrtcResult;
348}
349singe_loader::functions! { crate::NVRTC;
350 /// retrieve the required size of the PCH heap required to compile the given program.
351 ///
352 /// # Parameters
353 ///
354 /// - `prog`: CUDA Runtime Compilation program.
355 /// - `size`: pointer to location where the required size of the PCH Heap will be stored.
356 ///
357 /// # Return value
358 ///
359 /// - [`nvrtcResult::NVRTC_ERROR_INVALID_INPUT`]: The size retrieved using this function is only valid if nvrtcGetPCHCreateStatus() returned [`nvrtcResult::NVRTC_SUCCESS`] or [`nvrtcResult::NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED`].
360 pub fn nvrtcGetPCHHeapSizeRequired(
361 prog: nvrtcProgram,
362 size: *mut size_t,
363 ) -> nvrtcResult;
364}
365singe_loader::functions! { crate::NVRTC;
366 /// nvrtcSetFlowCallback registers a callback function that the compiler will invoke at different points during a call to nvrtcCompileProgram, and the callback function can decide whether to cancel compilation by returning specific values.
367 ///
368 /// The callback function must satisfy the following constraints:
369 ///
370 /// (1) Its signature should be:
371 ///
372 /// (2) It must return 1 to cancel compilation or 0 to continue. Other return values are reserved for future use.
373 ///
374 /// (3) It must return consistent values. Once it returns 1 at one point, it must return 1 in all following invocations during the current nvrtcCompileProgram call in progress.
375 ///
376 /// (4) It must be thread-safe.
377 ///
378 /// (5) It must not invoke any nvrtc/libnvvm/ptx APIs.
379 ///
380 /// # Parameters
381 ///
382 /// - `prog`: CUDA Runtime Compilation program.
383 /// - `callback`: the callback that issues cancellation signal.
384 /// - `payload`: to be passed as a parameter when invoking the callback.
385 pub fn nvrtcSetFlowCallback(
386 prog: nvrtcProgram,
387 callback: ::core::option::Option<
388 unsafe extern "C" fn(
389 arg1: *mut ::core::ffi::c_void,
390 arg2: *mut ::core::ffi::c_void,
391 ) -> ::core::ffi::c_int,
392 >,
393 payload: *mut ::core::ffi::c_void,
394 ) -> nvrtcResult;
395}
396singe_loader::functions! { crate::NVRTC;
397 /// nvrtcGetTileIRSize sets the value of `TileIRSizeRet` with the size of the cuda_tile IR generated by the previous compilation of `prog`.
398 ///
399 /// # Parameters
400 ///
401 /// - `prog`: CUDA Runtime Compilation program.
402 /// - `TileIRSizeRet`: Size of the generated cuda_tile IR.
403 pub fn nvrtcGetTileIRSize(
404 prog: nvrtcProgram,
405 TileIRSizeRet: *mut size_t,
406 ) -> nvrtcResult;
407}
408singe_loader::functions! { crate::NVRTC;
409 /// nvrtcGetTileIR stores the cuda_tile IR generated by the previous compilation of `prog` in the memory pointed by `TileIR`.
410 ///
411 /// # Parameters
412 ///
413 /// - `prog`: CUDA Runtime Compilation program.
414 /// - `TileIR`: Generated cuda_tile IR.
415 pub fn nvrtcGetTileIR(
416 prog: nvrtcProgram,
417 TileIR: *mut ::core::ffi::c_char,
418 ) -> nvrtcResult;
419}
420singe_loader::functions! { crate::NVRTC;
421 /// nvrtcInstallBundledHeaders extracts CUDA headers bundled with NVRTC to a specified directory for use during compilation.
422 ///
423 /// NVRTC bundles a set of CUDA Toolkit headers and CUDA C++ Core Libraries (CCCL) within libnvrtc-builtins. This function extracts these headers to the specified directory, allowing NVRTC programs to compile without requiring a separate CUDA Toolkit installation. The bundled headers match those available in the CUDA Toolkit plus CCCL libraries.
424 ///
425 /// After extraction, users can compile kernels by passing appropriate include paths (such as “-I<installPath>” and “-I<installPath>/cccl”) to nvrtcCompileProgram.
426 ///
427 /// A version marker file (.nvrtc_headers_version) is created in the installation directory to track the installed version.
428 ///
429 /// This function is thread-safe and process-safe. Concurrent calls from multiple threads or processes will be serialized using file locking. By default, the function waits for the lock; use NVRTC_INSTALL_HEADERS_NO_WAIT to return immediately with [`nvrtcResult::NVRTC_ERROR_BUSY`] if another process holds the lock.
430 ///
431 /// # Parameters
432 ///
433 /// - `installPath`: Path where headers should be extracted (UTF-8 encoded). The directory will be created if it doesn’t exist.
434 /// - `flags`: NVRTC_INSTALL_HEADERS_* flags: 0 (SKIP_IF_EXISTS): Skip if version marker exists and version matches. This is the default. NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE: Clear directory first, then install. Guarantees consistency. NVRTC_INSTALL_HEADERS_NO_WAIT: Return [`nvrtcResult::NVRTC_ERROR_BUSY`] immediately if lock cannot be acquired. NO_WAIT can be combined with FORCE_OVERWRITE.
435 /// - `errorLog`: Optional pointer to receive detailed error message on failure. If non-NULL, *errorLog will be set to point to a string describing the error cause. Note: subsequent API calls from the same thread may overwrite this message. May be NULL if error details are not needed.
436 ///
437 /// # Return value
438 ///
439 /// - [`nvrtcResult::NVRTC_ERROR_BUILTIN_OPERATION_FAILURE`]: (extraction failed or version mismatch).
440 /// - [`nvrtcResult::NVRTC_ERROR_BUSY`]: (lock held by another process and NVRTC_INSTALL_HEADERS_NO_WAIT was specified).
441 /// - [`nvrtcResult::NVRTC_ERROR_INVALID_INPUT`]: (invalid path or conflicting flags like SKIP_IF_EXISTS | FORCE_OVERWRITE).
442 pub fn nvrtcInstallBundledHeaders(
443 installPath: *const ::core::ffi::c_char,
444 flags: ::core::ffi::c_uint,
445 errorLog: *mut *const ::core::ffi::c_char,
446 ) -> nvrtcResult;
447}
448/// Structure containing information about bundled headers.
449#[repr(C)]
450#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
451pub struct nvrtcBundledHeadersInfo {
452 /// Non-zero if bundled headers are available
453 pub available: ::core::ffi::c_int,
454 /// Size of compressed archive in bytes
455 pub compressedSize: size_t,
456 /// Estimated size when extracted in bytes
457 pub uncompressedSize: size_t,
458 /// CUDA major version of bundled headers
459 pub cudaVersionMajor: ::core::ffi::c_int,
460 /// CUDA minor version of bundled headers
461 pub cudaVersionMinor: ::core::ffi::c_int,
462 /// Number of header files in the bundle
463 pub numFiles: ::core::ffi::c_uint,
464}
465singe_loader::functions! { crate::NVRTC;
466 /// nvrtcGetBundledHeadersInfo queries information about the bundled headers without extracting them.
467 ///
468 /// This function allows users to determine if bundled headers are available and get size estimates before calling nvrtcInstallBundledHeaders.
469 ///
470 /// # Parameters
471 ///
472 /// - `info`: Pointer to structure to receive header information.
473 /// - `errorLog`: Optional pointer to receive detailed error message on failure. If non-NULL, *errorLog will be set to point to a string describing the error cause. Note: subsequent API calls from the same thread may overwrite this message. May be NULL if error details are not needed.
474 ///
475 /// # Return value
476 ///
477 /// - [`nvrtcResult::NVRTC_ERROR_BUILTIN_OPERATION_FAILURE`]: (failed to query bundled headers).
478 /// - [`nvrtcResult::NVRTC_ERROR_INVALID_INPUT`]: (info is NULL).
479 pub fn nvrtcGetBundledHeadersInfo(
480 info: *mut nvrtcBundledHeadersInfo,
481 errorLog: *mut *const ::core::ffi::c_char,
482 ) -> nvrtcResult;
483}
484singe_loader::functions! { crate::NVRTC;
485 /// nvrtcRemoveBundledHeaders removes previously installed bundled headers.
486 ///
487 /// This function removes the headers installed by nvrtcInstallBundledHeaders, helping users manage disk space. It recursively removes all files and subdirectories within the installation directory.
488 ///
489 /// # Parameters
490 ///
491 /// - `installPath`: Path where headers were previously installed. Must be the same path used with nvrtcInstallBundledHeaders.
492 /// - `errorLog`: Optional pointer to receive detailed error message on failure. If non-NULL, *errorLog will be set to point to a string describing the error cause. Note: subsequent API calls from the same thread may overwrite this message. May be NULL if error details are not needed.
493 ///
494 /// # Return value
495 ///
496 /// - [`nvrtcResult::NVRTC_ERROR_BUILTIN_OPERATION_FAILURE`]: (removal failed).
497 /// - [`nvrtcResult::NVRTC_ERROR_INVALID_INPUT`]: (invalid path).
498 pub fn nvrtcRemoveBundledHeaders(
499 installPath: *const ::core::ffi::c_char,
500 errorLog: *mut *const ::core::ffi::c_char,
501 ) -> nvrtcResult;
502}