singe-cuda-sys 0.1.0-alpha.8

Low-level FFI bindings for CUDA driver, runtime, NVRTC, NVVM, NVTX, and related NVIDIA APIs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
/* automatically generated by rust-bindgen 0.72.1 */

pub const NVRTC_INSTALL_HEADERS_SKIP_IF_EXISTS: u32 = 0;
pub const NVRTC_INSTALL_HEADERS_FORCE_OVERWRITE: u32 = 1;
pub const NVRTC_INSTALL_HEADERS_NO_WAIT: u32 = 2;
pub type size_t = ::core::ffi::c_ulong;
/// The enumerated type nvrtcResult defines API call result codes.
///
/// NVRTC API functions return nvrtcResult to indicate the call result.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum nvrtcResult {
    NVRTC_SUCCESS = 0,
    NVRTC_ERROR_OUT_OF_MEMORY = 1,
    NVRTC_ERROR_PROGRAM_CREATION_FAILURE = 2,
    NVRTC_ERROR_INVALID_INPUT = 3,
    NVRTC_ERROR_INVALID_PROGRAM = 4,
    NVRTC_ERROR_INVALID_OPTION = 5,
    NVRTC_ERROR_COMPILATION = 6,
    NVRTC_ERROR_BUILTIN_OPERATION_FAILURE = 7,
    NVRTC_ERROR_NO_NAME_EXPRESSIONS_AFTER_COMPILATION = 8,
    NVRTC_ERROR_NO_LOWERED_NAMES_BEFORE_COMPILATION = 9,
    NVRTC_ERROR_NAME_EXPRESSION_NOT_VALID = 10,
    NVRTC_ERROR_INTERNAL_ERROR = 11,
    NVRTC_ERROR_TIME_FILE_WRITE_FAILED = 12,
    NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED = 13,
    NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED = 14,
    NVRTC_ERROR_PCH_CREATE = 15,
    NVRTC_ERROR_CANCELLED = 16,
    NVRTC_ERROR_TIME_TRACE_FILE_WRITE_FAILED = 17,
    NVRTC_ERROR_BUSY = 18,
}
unsafe extern "C" {
    /// nvrtcGetErrorString is a helper function that returns a string describing the given nvrtcResult code, e.g., [`nvrtcResult::NVRTC_SUCCESS`] to `"NVRTC_SUCCESS"`.
    ///
    /// For unrecognized enumeration values, it returns `"NVRTC_ERROR unknown"`.
    ///
    /// # Parameters
    ///
    /// - `result`: CUDA Runtime Compilation API result code.
    pub fn nvrtcGetErrorString(result: nvrtcResult) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    /// nvrtcVersion sets the output parameters `major` and `minor` with the CUDA Runtime Compilation version number.
    ///
    /// # Parameters
    ///
    /// - `major`: CUDA Runtime Compilation major version number.
    /// - `minor`: CUDA Runtime Compilation minor version number.
    pub fn nvrtcVersion(
        major: *mut ::core::ffi::c_int,
        minor: *mut ::core::ffi::c_int,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetNumSupportedArchs sets the output parameter `numArchs` with the number of architectures supported by NVRTC.
    ///
    /// This can then be used to pass an array to [`nvrtcGetSupportedArchs`] to get the supported architectures.
    ///
    /// see [`nvrtcGetSupportedArchs`].
    ///
    /// # Parameters
    ///
    /// - `numArchs`: number of supported architectures.
    pub fn nvrtcGetNumSupportedArchs(numArchs: *mut ::core::ffi::c_int) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetSupportedArchs populates the array passed via the output parameter `supportedArchs` with the architectures supported by NVRTC.
    ///
    /// The array is sorted in the ascending order. The size of the array to be passed can be determined using [`nvrtcGetNumSupportedArchs`].
    ///
    /// see [`nvrtcGetNumSupportedArchs`].
    ///
    /// # Parameters
    ///
    /// - `supportedArchs`: sorted array of supported architectures.
    pub fn nvrtcGetSupportedArchs(
        supportedArchs: *mut ::core::ffi::c_int,
    ) -> nvrtcResult;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _nvrtcProgram {
    _unused: [u8; 0],
}
/// nvrtcProgram is the unit of compilation, and an opaque handle for a program.
///
/// To compile a CUDA program string, an instance of nvrtcProgram must be created first with [`nvrtcCreateProgram`], then compiled with [`nvrtcCompileProgram`].
pub type nvrtcProgram = *mut _nvrtcProgram;
unsafe extern "C" {
    /// nvrtcCreateProgram creates an instance of nvrtcProgram with the given input parameters, and sets the output parameter `prog` with it.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `src`: CUDA program source.
    /// - `name`: CUDA program name. name can be NULL ; "default_program" is used when name is NULL or “”.
    /// - `numHeaders`: Number of headers used. numHeaders must be greater than or equal to 0.
    /// - `headers`: Sources of the headers. headers can be NULL when numHeaders is 0.
    /// - `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.
    pub fn nvrtcCreateProgram(
        prog: *mut nvrtcProgram,
        src: *const ::core::ffi::c_char,
        name: *const ::core::ffi::c_char,
        numHeaders: ::core::ffi::c_int,
        headers: *const *const ::core::ffi::c_char,
        includeNames: *const *const ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcDestroyProgram destroys the given program.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    pub fn nvrtcDestroyProgram(prog: *mut nvrtcProgram) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcCompileProgram compiles the given program.
    ///
    /// It supports compile options listed in Supported Compile Options.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `numOptions`: Number of compiler options passed.
    /// - `options`: Compiler options in the form of C string array. options can be NULL when numOptions is 0.
    pub fn nvrtcCompileProgram(
        prog: nvrtcProgram,
        numOptions: ::core::ffi::c_int,
        options: *const *const ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetPTXSize sets the value of `ptxSizeRet` with the size of the PTX generated by the previous compilation of `prog` (including the trailing `NULL`).
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `ptxSizeRet`: Size of the generated PTX (including the trailing NULL ).
    pub fn nvrtcGetPTXSize(prog: nvrtcProgram, ptxSizeRet: *mut size_t) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetPTX stores the PTX generated by the previous compilation of `prog` in the memory pointed by `ptx`.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `ptx`: Compiled result.
    pub fn nvrtcGetPTX(prog: nvrtcProgram, ptx: *mut ::core::ffi::c_char) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetCUBINSize sets the value of `cubinSizeRet` with the size of the cubin generated by the previous compilation of `prog`.
    ///
    /// The value of cubinSizeRet is set to 0 if the value specified to `-arch` is a virtual architecture instead of an actual architecture.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `cubinSizeRet`: Size of the generated cubin.
    pub fn nvrtcGetCUBINSize(
        prog: nvrtcProgram,
        cubinSizeRet: *mut size_t,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetCUBIN stores the cubin generated by the previous compilation of `prog` in the memory pointed by `cubin`.
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `cubin`: Compiled and assembled result.
    pub fn nvrtcGetCUBIN(
        prog: nvrtcProgram,
        cubin: *mut ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetLTOIRSize sets the value of `LTOIRSizeRet` with the size of the LTO IR generated by the previous compilation of `prog`.
    ///
    /// The value of LTOIRSizeRet is set to 0 if the program was not compiled with `-dlto`.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `LTOIRSizeRet`: Size of the generated LTO IR.
    pub fn nvrtcGetLTOIRSize(
        prog: nvrtcProgram,
        LTOIRSizeRet: *mut size_t,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetLTOIR stores the LTO IR generated by the previous compilation of `prog` in the memory pointed by `LTOIR`.
    ///
    /// No LTO IR is available if the program was compiled without `-dlto`.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `LTOIR`: Compiled result.
    pub fn nvrtcGetLTOIR(
        prog: nvrtcProgram,
        LTOIR: *mut ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetOptiXIRSize sets the value of `optixirSizeRet` with the size of the OptiX IR generated by the previous compilation of `prog`.
    ///
    /// The value of nvrtcGetOptiXIRSize is set to 0 if the program was compiled with options incompatible with OptiX IR generation.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `optixirSizeRet`: Size of the generated LTO IR.
    pub fn nvrtcGetOptiXIRSize(
        prog: nvrtcProgram,
        optixirSizeRet: *mut size_t,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetOptiXIR stores the OptiX IR generated by the previous compilation of `prog` in the memory pointed by `optixir`.
    ///
    /// No OptiX IR is available if the program was compiled with options incompatible with OptiX IR generation.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `optixir`: Optix IR Compiled result.
    pub fn nvrtcGetOptiXIR(
        prog: nvrtcProgram,
        optixir: *mut ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetProgramLogSize sets `logSizeRet` with the size of the log generated by the previous compilation of `prog` (including the trailing `NULL`).
    ///
    /// Note that compilation log may be generated with warnings and informative messages, even when the compilation of `prog` succeeds.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `logSizeRet`: Size of the compilation log (including the trailing NULL ).
    pub fn nvrtcGetProgramLogSize(
        prog: nvrtcProgram,
        logSizeRet: *mut size_t,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetProgramLog stores the log generated by the previous compilation of `prog` in the memory pointed by `log`.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `log`: Compilation log.
    pub fn nvrtcGetProgramLog(
        prog: nvrtcProgram,
        log: *mut ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcAddNameExpression notes the given name expression denoting the address of a **global** function or **device**/__constant__ variable.
    ///
    /// The identical name expression string must be provided on a subsequent call to nvrtcGetLoweredName to extract the lowered name.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `name_expression`: constant expression denoting the address of a global function or device /__constant__ variable.
    pub fn nvrtcAddNameExpression(
        prog: nvrtcProgram,
        name_expression: *const ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetLoweredName extracts the lowered (mangled) name for a **global** function or **device**/__constant__ variable, and updates \*lowered_name to point to it.
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `name_expression`: constant expression denoting the address of a global function or device /__constant__ variable.
    /// - `lowered_name`: initialized by the function to point to a C string containing the lowered (mangled) name corresponding to the provided name expression.
    pub fn nvrtcGetLoweredName(
        prog: nvrtcProgram,
        name_expression: *const ::core::ffi::c_char,
        lowered_name: *mut *const ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// retrieve the current size of the PCH Heap.
    ///
    /// # Parameters
    ///
    /// - `ret`: pointer to location where the size of the PCH Heap will be stored.
    pub fn nvrtcGetPCHHeapSize(ret: *mut size_t) -> nvrtcResult;
}
unsafe extern "C" {
    /// set the size of the PCH Heap.
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `size`: requested size of the PCH Heap, in bytes.
    pub fn nvrtcSetPCHHeapSize(size: size_t) -> nvrtcResult;
}
unsafe extern "C" {
    /// Returns the PCH creation status.
    ///
    /// [`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.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    pub fn nvrtcGetPCHCreateStatus(prog: nvrtcProgram) -> nvrtcResult;
}
unsafe extern "C" {
    /// retrieve the required size of the PCH heap required to compile the given program.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `size`: pointer to location where the required size of the PCH Heap will be stored.
    ///
    /// # Return value
    ///
    /// - [`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`].
    pub fn nvrtcGetPCHHeapSizeRequired(
        prog: nvrtcProgram,
        size: *mut size_t,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// 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.
    ///
    /// The callback function must satisfy the following constraints:
    ///
    /// (1) Its signature should be:
    ///
    /// (2) It must return 1 to cancel compilation or 0 to continue. Other return values are reserved for future use.
    ///
    /// (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.
    ///
    /// (4) It must be thread-safe.
    ///
    /// (5) It must not invoke any nvrtc/libnvvm/ptx APIs.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `callback`: the callback that issues cancellation signal.
    /// - `payload`: to be passed as a parameter when invoking the callback.
    pub fn nvrtcSetFlowCallback(
        prog: nvrtcProgram,
        callback: ::core::option::Option<
            unsafe extern "C" fn(
                arg1: *mut ::core::ffi::c_void,
                arg2: *mut ::core::ffi::c_void,
            ) -> ::core::ffi::c_int,
        >,
        payload: *mut ::core::ffi::c_void,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetTileIRSize sets the value of `TileIRSizeRet` with the size of the cuda_tile IR generated by the previous compilation of `prog`.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `TileIRSizeRet`: Size of the generated cuda_tile IR.
    pub fn nvrtcGetTileIRSize(
        prog: nvrtcProgram,
        TileIRSizeRet: *mut size_t,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcGetTileIR stores the cuda_tile IR generated by the previous compilation of `prog` in the memory pointed by `TileIR`.
    ///
    /// # Parameters
    ///
    /// - `prog`: CUDA Runtime Compilation program.
    /// - `TileIR`: Generated cuda_tile IR.
    pub fn nvrtcGetTileIR(
        prog: nvrtcProgram,
        TileIR: *mut ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcInstallBundledHeaders extracts CUDA headers bundled with NVRTC to a specified directory for use during compilation.
    ///
    /// 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.
    ///
    /// After extraction, users can compile kernels by passing appropriate include paths (such as “-I&lt;installPath>” and “-I&lt;installPath>/cccl”) to nvrtcCompileProgram.
    ///
    /// A version marker file (.nvrtc_headers_version) is created in the installation directory to track the installed version.
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `installPath`: Path where headers should be extracted (UTF-8 encoded). The directory will be created if it doesn’t exist.
    /// - `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.
    /// - `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.
    ///
    /// # Return value
    ///
    /// - [`nvrtcResult::NVRTC_ERROR_BUILTIN_OPERATION_FAILURE`]: (extraction failed or version mismatch).
    /// - [`nvrtcResult::NVRTC_ERROR_BUSY`]: (lock held by another process and NVRTC_INSTALL_HEADERS_NO_WAIT was specified).
    /// - [`nvrtcResult::NVRTC_ERROR_INVALID_INPUT`]: (invalid path or conflicting flags like SKIP_IF_EXISTS | FORCE_OVERWRITE).
    pub fn nvrtcInstallBundledHeaders(
        installPath: *const ::core::ffi::c_char,
        flags: ::core::ffi::c_uint,
        errorLog: *mut *const ::core::ffi::c_char,
    ) -> nvrtcResult;
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct nvrtcBundledHeadersInfo {
    pub available: ::core::ffi::c_int,
    pub compressedSize: size_t,
    pub uncompressedSize: size_t,
    pub cudaVersionMajor: ::core::ffi::c_int,
    pub cudaVersionMinor: ::core::ffi::c_int,
    pub numFiles: ::core::ffi::c_uint,
}
unsafe extern "C" {
    /// nvrtcGetBundledHeadersInfo queries information about the bundled headers without extracting them.
    ///
    /// This function allows users to determine if bundled headers are available and get size estimates before calling nvrtcInstallBundledHeaders.
    ///
    /// # Parameters
    ///
    /// - `info`: Pointer to structure to receive header information.
    /// - `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.
    ///
    /// # Return value
    ///
    /// - [`nvrtcResult::NVRTC_ERROR_BUILTIN_OPERATION_FAILURE`]: (failed to query bundled headers).
    /// - [`nvrtcResult::NVRTC_ERROR_INVALID_INPUT`]: (info is NULL).
    pub fn nvrtcGetBundledHeadersInfo(
        info: *mut nvrtcBundledHeadersInfo,
        errorLog: *mut *const ::core::ffi::c_char,
    ) -> nvrtcResult;
}
unsafe extern "C" {
    /// nvrtcRemoveBundledHeaders removes previously installed bundled headers.
    ///
    /// This function removes the headers installed by nvrtcInstallBundledHeaders, helping users manage disk space. It recursively removes all files and subdirectories within the installation directory.
    ///
    /// # Parameters
    ///
    /// - `installPath`: Path where headers were previously installed. Must be the same path used with nvrtcInstallBundledHeaders.
    /// - `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.
    ///
    /// # Return value
    ///
    /// - [`nvrtcResult::NVRTC_ERROR_BUILTIN_OPERATION_FAILURE`]: (removal failed).
    /// - [`nvrtcResult::NVRTC_ERROR_INVALID_INPUT`]: (invalid path).
    pub fn nvrtcRemoveBundledHeaders(
        installPath: *const ::core::ffi::c_char,
        errorLog: *mut *const ::core::ffi::c_char,
    ) -> nvrtcResult;
}