singe-cuda-sys 0.1.0-alpha.7

Low-level FFI bindings for CUDA driver, runtime, NVRTC, NVVM, NVTX, and related NVIDIA APIs.
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
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
/* automatically generated by rust-bindgen 0.72.1 */

pub const NVTX_VERSION: u32 = 3;
pub const NVTX_SUCCESS: u32 = 0;
pub const NVTX_FAIL: u32 = 1;
pub const NVTX_ERR_INIT_LOAD_PROPERTY: u32 = 2;
pub const NVTX_ERR_INIT_ACCESS_LIBRARY: u32 = 3;
pub const NVTX_ERR_INIT_LOAD_LIBRARY: u32 = 4;
pub const NVTX_ERR_INIT_MISSING_LIBRARY_ENTRY_POINT: u32 = 5;
pub const NVTX_ERR_INIT_FAILED_LIBRARY_ENTRY_POINT: u32 = 6;
pub const NVTX_ERR_NO_INJECTION_LIBRARY_AVAILABLE: u32 = 7;
pub const NVTX_RESOURCE_CLASS_GENERIC: u32 = 1;
pub type wchar_t = ::core::ffi::c_int;
pub type nvtxRangeId_t = u64;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvtxDomainRegistration_st {
    _unused: [u8; 0],
}
pub type nvtxDomainRegistration = nvtxDomainRegistration_st;
pub type nvtxDomainHandle_t = *mut nvtxDomainRegistration;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvtxStringRegistration_st {
    _unused: [u8; 0],
}
pub type nvtxStringRegistration = nvtxStringRegistration_st;
pub type nvtxStringHandle_t = *mut nvtxStringRegistration;
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum nvtxColorType_t {
    /// Color attribute is unused.
    NVTX_COLOR_UNKNOWN = 0,
    /// An ARGB color is provided.
    NVTX_COLOR_ARGB = 1,
}
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum nvtxMessageType_t {
    /// Message attribute is unused.
    NVTX_MESSAGE_UNKNOWN = 0,
    /// A character sequence is used as payload.
    NVTX_MESSAGE_TYPE_ASCII = 1,
    /// A wide character sequence is used as payload.
    NVTX_MESSAGE_TYPE_UNICODE = 2,
    /// A unique string handle that was registered with [`nvtxDomainRegisterStringA`] or nvtxDomainRegisterStringW().
    NVTX_MESSAGE_TYPE_REGISTERED = 3,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union nvtxMessageValue_t {
    pub ascii: *const ::core::ffi::c_char,
    pub unicode: *const wchar_t,
    pub registered: nvtxStringHandle_t,
}
impl Default for nvtxMessageValue_t {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
unsafe extern "C" {
    /// Force initialization (optional).
    ///
    /// Force NVTX library to initialize. The first call to any NVTX API function will automatically initialize the entire API. This can make the first call much slower than subsequent calls. In applications where the first call to NVTX may be in a performance-critical section, calling nvtxInitialize before any performance-critical sections will ensure NVTX initialization occurs at an acceptable time. Since nvtxInitialize takes no parameters and has no expected behavior besides initialization, it is convenient to add a call to nvtxInitialize in NVTX-instrumented applications that need to force earlier initialization without changing any other code. For example, if an app's first NVTX call is nvtxDomainCreate, and it is difficult to move that call earlier because the domain handle must be stored in an object only created at that point, adding a call to nvtxInitialize at the top of main() will ensure the later call to nvtxDomainCreate is as fast as possible.
    ///
    /// # Parameters
    ///
    /// - `reserved`: must be zero or NULL.
    pub fn nvtxInitialize(reserved: *const ::core::ffi::c_void);
}
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum nvtxPayloadType_t {
    /// Payload attribute is unused.
    NVTX_PAYLOAD_UNKNOWN = 0,
    /// A 64 bit unsigned integer value is used as payload.
    NVTX_PAYLOAD_TYPE_UNSIGNED_INT64 = 1,
    /// A 64 bit signed integer value is used as payload.
    NVTX_PAYLOAD_TYPE_INT64 = 2,
    /// A 64 bit floating point value is used as payload.
    NVTX_PAYLOAD_TYPE_DOUBLE = 3,
    /// A 32 bit floating point value is used as payload.
    NVTX_PAYLOAD_TYPE_UNSIGNED_INT32 = 4,
    /// A 32 bit floating point value is used as payload.
    NVTX_PAYLOAD_TYPE_INT32 = 5,
    /// A 32 bit floating point value is used as payload.
    NVTX_PAYLOAD_TYPE_FLOAT = 6,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct nvtxEventAttributes_v2 {
    pub version: u16,
    pub size: u16,
    pub category: u32,
    pub colorType: i32,
    pub color: u32,
    pub payloadType: i32,
    pub reserved0: i32,
    pub payload: nvtxEventAttributes_v2_payload_t,
    pub messageType: i32,
    pub message: nvtxMessageValue_t,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union nvtxEventAttributes_v2_payload_t {
    pub ullValue: u64,
    pub llValue: i64,
    pub dValue: f64,
    pub uiValue: u32,
    pub iValue: i32,
    pub fValue: f32,
}
impl Default for nvtxEventAttributes_v2_payload_t {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl Default for nvtxEventAttributes_v2 {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type nvtxEventAttributes_t = nvtxEventAttributes_v2;
unsafe extern "C" {
    /// Marks an instantaneous event in the application.
    ///
    /// A marker can contain a text message or specify additional information using the event attributes structure. These attributes include a text message, color, category, and a payload. Each of the attributes is optional and can only be sent out using the [`nvtxDomainMarkEx`] function.
    ///
    /// nvtxDomainMarkEx(NULL, event) is equivalent to calling nvtxMarkEx(event).
    ///
    /// # Parameters
    ///
    /// - `domain`: The domain of scoping the category.
    /// - `eventAttrib`: The event attribute structure defining the marker's attribute types and attribute values.
    pub fn nvtxDomainMarkEx(
        domain: nvtxDomainHandle_t,
        eventAttrib: *const nvtxEventAttributes_t,
    );
}
unsafe extern "C" {
    /// Marks an instantaneous event in the application.
    ///
    /// A marker can contain a text message or specify additional information using the event attributes structure. These attributes include a text message, color, category, and a payload. Each of the attributes is optional and can only be sent out using the [`nvtxMarkEx`] function. If [`nvtxMarkA`] or nvtxMarkW are used to specify the marker or if an attribute is unspecified then a default value will be used.
    ///
    /// # Parameters
    ///
    /// - `eventAttrib`: The event attribute structure defining the marker's attribute types and attribute values.
    pub fn nvtxMarkEx(eventAttrib: *const nvtxEventAttributes_t);
}
unsafe extern "C" {
    /// Marks an instantaneous event in the application.
    ///
    /// A marker created using [`nvtxMarkA`] or nvtxMarkW contains only a text message.
    ///
    /// # Parameters
    ///
    /// - `message`: The message associated to this marker event.
    pub fn nvtxMarkA(message: *const ::core::ffi::c_char);
}
unsafe extern "C" {
    pub fn nvtxMarkW(message: *const wchar_t);
}
unsafe extern "C" {
    /// Starts a process range in a domain.
    ///
    /// # Parameters
    ///
    /// - `domain`: The domain of scoping the category.
    /// - `eventAttrib`: The event attribute structure defining the range's attribute types and attribute values.
    pub fn nvtxDomainRangeStartEx(
        domain: nvtxDomainHandle_t,
        eventAttrib: *const nvtxEventAttributes_t,
    ) -> nvtxRangeId_t;
}
unsafe extern "C" {
    /// Starts a process range.
    ///
    /// # Parameters
    ///
    /// - `eventAttrib`: The event attribute structure defining the range's attribute types and attribute values.
    pub fn nvtxRangeStartEx(eventAttrib: *const nvtxEventAttributes_t) -> nvtxRangeId_t;
}
unsafe extern "C" {
    /// Starts a process range.
    ///
    /// # Parameters
    ///
    /// - `message`: The event message associated to this range event.
    pub fn nvtxRangeStartA(message: *const ::core::ffi::c_char) -> nvtxRangeId_t;
}
unsafe extern "C" {
    pub fn nvtxRangeStartW(message: *const wchar_t) -> nvtxRangeId_t;
}
unsafe extern "C" {
    /// Ends a process range.
    ///
    /// # Parameters
    ///
    /// - `domain`: The domain.
    /// - `id`: The correlation ID returned from a nvtxRangeStart call.
    pub fn nvtxDomainRangeEnd(domain: nvtxDomainHandle_t, id: nvtxRangeId_t);
}
unsafe extern "C" {
    /// Ends a process range.
    ///
    /// # Parameters
    ///
    /// - `id`: The correlation ID returned from an nvtxRangeStart call.
    pub fn nvtxRangeEnd(id: nvtxRangeId_t);
}
unsafe extern "C" {
    /// Starts a nested thread range.
    ///
    /// # Parameters
    ///
    /// - `domain`: The domain of scoping.
    /// - `eventAttrib`: The event attribute structure defining the range's attribute types and attribute values.
    pub fn nvtxDomainRangePushEx(
        domain: nvtxDomainHandle_t,
        eventAttrib: *const nvtxEventAttributes_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    /// Starts a nested thread range.
    ///
    /// # Parameters
    ///
    /// - `eventAttrib`: The event attribute structure defining the range's attribute types and attribute values.
    pub fn nvtxRangePushEx(
        eventAttrib: *const nvtxEventAttributes_t,
    ) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    /// Starts a nested thread range.
    ///
    /// # Parameters
    ///
    /// - `message`: The event message associated to this range event.
    pub fn nvtxRangePushA(message: *const ::core::ffi::c_char) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    pub fn nvtxRangePushW(message: *const wchar_t) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    /// Ends a nested thread range.
    pub fn nvtxDomainRangePop(domain: nvtxDomainHandle_t) -> ::core::ffi::c_int;
}
unsafe extern "C" {
    /// Ends a nested thread range.
    pub fn nvtxRangePop() -> ::core::ffi::c_int;
}
/// Generic resource type for when a resource class is not available.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum nvtxResourceGenericType_t {
    NVTX_RESOURCE_TYPE_UNKNOWN = 0,
    /// Generic pointer assumed to have no collisions with other pointers.
    NVTX_RESOURCE_TYPE_GENERIC_POINTER = 65537,
    /// Generic handle assumed to have no collisions with other handles.
    NVTX_RESOURCE_TYPE_GENERIC_HANDLE = 65538,
    /// OS native thread identifier.
    NVTX_RESOURCE_TYPE_GENERIC_THREAD_NATIVE = 65539,
    /// POSIX pthread identifier.
    NVTX_RESOURCE_TYPE_GENERIC_THREAD_POSIX = 65540,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct nvtxResourceAttributes_v0 {
    pub version: u16,
    pub size: u16,
    pub identifierType: i32,
    pub identifier: nvtxResourceAttributes_v0_identifier_t,
    pub messageType: i32,
    pub message: nvtxMessageValue_t,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union nvtxResourceAttributes_v0_identifier_t {
    pub pValue: *const ::core::ffi::c_void,
    pub ullValue: u64,
}
impl Default for nvtxResourceAttributes_v0_identifier_t {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
impl Default for nvtxResourceAttributes_v0 {
    fn default() -> Self {
        let mut s = ::core::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::core::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub type nvtxResourceAttributes_t = nvtxResourceAttributes_v0;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nvtxResourceHandle {
    _unused: [u8; 0],
}
pub type nvtxResourceHandle_t = *mut nvtxResourceHandle;
unsafe extern "C" {
    /// Create a resource object to track and associate data with OS and middleware objects.
    ///
    /// Allows users to associate an API handle or pointer with a user-provided name.
    ///
    /// # Parameters
    ///
    /// - `domain`: Domain to own the resource object.
    /// - `attribs`: Attributes to be associated with the resource.
    pub fn nvtxDomainResourceCreate(
        domain: nvtxDomainHandle_t,
        attribs: *mut nvtxResourceAttributes_t,
    ) -> nvtxResourceHandle_t;
}
unsafe extern "C" {
    /// Destroy a resource object to track and associate data with OS and middleware objects.
    ///
    /// Allows users to associate an API handle or pointer with a user-provided name.
    ///
    /// # Parameters
    ///
    /// - `resource`: Handle to the resource in which to operate.
    pub fn nvtxDomainResourceDestroy(resource: nvtxResourceHandle_t);
}
unsafe extern "C" {
    /// Annotate an NVTX category used within a domain.
    ///
    /// Categories are used to group sets of events. Each category is identified through a unique ID and that ID is passed into any of the marker/range events to assign that event to a specific category. The nvtxDomainNameCategory function calls allow the user to assign a name to a category ID that is specific to the domain.
    ///
    /// nvtxDomainNameCategory(NULL, category, name) is equivalent to calling nvtxNameCategory(category, name).
    ///
    /// # Parameters
    ///
    /// - `domain`: The domain of scoping the category.
    /// - `category`: The category ID to name.
    /// - `name`: The name of the category.
    pub fn nvtxDomainNameCategoryA(
        domain: nvtxDomainHandle_t,
        category: u32,
        name: *const ::core::ffi::c_char,
    );
}
unsafe extern "C" {
    pub fn nvtxDomainNameCategoryW(
        domain: nvtxDomainHandle_t,
        category: u32,
        name: *const wchar_t,
    );
}
unsafe extern "C" {
    /// Annotate an NVTX category.
    ///
    /// Categories are used to group sets of events. Each category is identified through a unique ID and that ID is passed into any of the marker/range events to assign that event to a specific category. The nvtxNameCategory function calls allow the user to assign a name to a category ID.
    ///
    /// # Parameters
    ///
    /// - `category`: The category ID to name.
    /// - `name`: The name of the category.
    pub fn nvtxNameCategoryA(category: u32, name: *const ::core::ffi::c_char);
}
unsafe extern "C" {
    pub fn nvtxNameCategoryW(category: u32, name: *const wchar_t);
}
unsafe extern "C" {
    /// Annotate an OS thread.
    ///
    /// Allows the user to name an active thread of the current process. If an invalid thread ID is provided or a thread ID from a different process is used the behavior of the tool is implementation dependent.
    ///
    /// Tools expect thread ID to be a number that uniquely identifies the thread at the time of the call. Note that a thread's ID can be reused after it is destroyed. Tools may choose how to handle aliasing of thread IDs.
    ///
    /// POSIX pthread_t type returned by pthread_self() may not comply with these expectations. Please use OS-specific thread ID instead of pthread_t.
    ///
    /// The thread name is associated to the default domain. To support domains use resource objects via [`nvtxDomainResourceCreate`].
    ///
    /// Windows:
    ///
    /// #include &lt;windows.h>
    ///
    /// nvtxNameOsThread(GetCurrentThreadId(), "Current thread");
    ///
    /// nvtxNameOsThread(GetThreadId(SomeThreadHandle), "Other thread");
    ///
    /// Android:
    ///
    /// #include &lt;unistd.h>
    ///
    /// `nvtxNameOsThreadA`(gettid(), "Current thread");
    ///
    /// `nvtxNameOsThreadA`(getpid(), "Main thread");
    ///
    /// [`nvtxNameOsThreadA`]
    ///
    /// NVTX_DECLSPEC void NVTX_API nvtxNameOsThreadA(uint32_t threadId, const char \*name)
    ///
    /// Annotate an OS thread.
    ///
    /// Linux:
    ///
    /// #include &lt;sys/syscall.h>
    ///
    /// `nvtxNameOsThreadA`(syscall(SYS_gettid), "Current thread");
    ///
    /// #include &lt;unistd.h>
    ///
    /// `nvtxNameOsThreadA`(getpid(), "Main thread");
    ///
    /// macOS:
    ///
    /// #include &lt;sys/syscall.h>
    ///
    /// `nvtxNameOsThreadA`(syscall(SYS_thread_selfid), "Current thread");
    ///
    /// #include &lt;pthread.h>
    ///
    /// __uint64_t id;
    ///
    /// pthread_threadid_np(pthread_self(), &id);
    ///
    /// `nvtxNameOsThreadA`(id, "Current thread");
    ///
    /// pthread_threadid_np(somePThreadId, &id);
    ///
    /// `nvtxNameOsThreadA`(id, "Other thread");.
    ///
    /// # Parameters
    ///
    /// - `threadId`: The ID of the thread to name.
    /// - `name`: The name of the thread.
    pub fn nvtxNameOsThreadA(threadId: u32, name: *const ::core::ffi::c_char);
}
unsafe extern "C" {
    pub fn nvtxNameOsThreadW(threadId: u32, name: *const wchar_t);
}
unsafe extern "C" {
    /// Register a string.
    ///
    /// Registers an immutable string with NVTX. Once registered the pointer used to register the domain name can be used in nvtxEventAttributes_t [MESSAGE_FIELD](https://nvidia.github.io/NVTX/doxygen/structnvtx_event_attributes__v2.html#MESSAGE_FIELD). This allows NVTX implementation to skip copying the contents of the message on each event invocation.
    ///
    /// String registration is an optimization. It is recommended to use string registration if the string will be passed to an event many times.
    ///
    /// Strings are not unregistered, except that by unregistering the entire domain.
    ///
    /// # Parameters
    ///
    /// - `domain`: Domain handle. If NULL then the global domain is used.
    /// - `string`: A unique pointer to a sequence of characters.
    pub fn nvtxDomainRegisterStringA(
        domain: nvtxDomainHandle_t,
        string: *const ::core::ffi::c_char,
    ) -> nvtxStringHandle_t;
}
unsafe extern "C" {
    pub fn nvtxDomainRegisterStringW(
        domain: nvtxDomainHandle_t,
        string: *const wchar_t,
    ) -> nvtxStringHandle_t;
}
unsafe extern "C" {
    /// Register a NVTX domain.
    ///
    /// Domains are used to scope annotations. All NVTX_VERSION_0 and NVTX_VERSION_1 annotations are scoped to the global domain. The function nvtxDomainCreate creates a new named domain.
    ///
    /// Each domain maintains its own nvtxRangePush and nvtxRangePop stack.
    ///
    /// # Parameters
    ///
    /// - `name`: A unique string representing the domain.
    pub fn nvtxDomainCreateA(name: *const ::core::ffi::c_char) -> nvtxDomainHandle_t;
}
unsafe extern "C" {
    pub fn nvtxDomainCreateW(name: *const wchar_t) -> nvtxDomainHandle_t;
}
unsafe extern "C" {
    /// Unregister a NVTX domain.
    ///
    /// Unregisters the domain handle and frees all domain specific resources.
    ///
    /// # Parameters
    ///
    /// - `domain`: the domain handle.
    pub fn nvtxDomainDestroy(domain: nvtxDomainHandle_t);
}
pub type nvtx_CUdevice = ::core::ffi::c_int;
pub type nvtx_CUcontext = *mut ::core::ffi::c_void;
pub type nvtx_CUstream = *mut ::core::ffi::c_void;
pub type nvtx_CUevent = *mut ::core::ffi::c_void;
pub type nvtx_cudaStream_t = *mut ::core::ffi::c_void;
pub type nvtx_cudaEvent_t = *mut ::core::ffi::c_void;
pub type nvtx_cl_platform_id = *mut ::core::ffi::c_void;
pub type nvtx_cl_device_id = *mut ::core::ffi::c_void;
pub type nvtx_cl_context = *mut ::core::ffi::c_void;
pub type nvtx_cl_command_queue = *mut ::core::ffi::c_void;
pub type nvtx_cl_mem = *mut ::core::ffi::c_void;
pub type nvtx_cl_program = *mut ::core::ffi::c_void;
pub type nvtx_cl_kernel = *mut ::core::ffi::c_void;
pub type nvtx_cl_event = *mut ::core::ffi::c_void;
pub type nvtx_cl_sampler = *mut ::core::ffi::c_void;
pub type nvtx_nvtxSyncUser_t = *mut ::core::ffi::c_void;
pub type nvtx_nvtxSyncUserAttributes_t = ::core::ffi::c_void;
pub type nvtxMarkEx_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(eventAttrib: *const nvtxEventAttributes_t),
>;
pub type nvtxMarkA_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(message: *const ::core::ffi::c_char),
>;
pub type nvtxMarkW_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(message: *const wchar_t),
>;
pub type nvtxRangeStartEx_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(eventAttrib: *const nvtxEventAttributes_t) -> nvtxRangeId_t,
>;
pub type nvtxRangeStartA_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(message: *const ::core::ffi::c_char) -> nvtxRangeId_t,
>;
pub type nvtxRangeStartW_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(message: *const wchar_t) -> nvtxRangeId_t,
>;
pub type nvtxRangeEnd_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(id: nvtxRangeId_t),
>;
pub type nvtxRangePushEx_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(eventAttrib: *const nvtxEventAttributes_t) -> ::core::ffi::c_int,
>;
pub type nvtxRangePushA_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(message: *const ::core::ffi::c_char) -> ::core::ffi::c_int,
>;
pub type nvtxRangePushW_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(message: *const wchar_t) -> ::core::ffi::c_int,
>;
pub type nvtxRangePop_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn() -> ::core::ffi::c_int,
>;
pub type nvtxNameCategoryA_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(category: u32, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameCategoryW_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(category: u32, name: *const wchar_t),
>;
pub type nvtxNameOsThreadA_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(threadId: u32, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameOsThreadW_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(threadId: u32, name: *const wchar_t),
>;
pub type nvtxNameCuDeviceA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(device: nvtx_CUdevice, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameCuDeviceW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(device: nvtx_CUdevice, name: *const wchar_t),
>;
pub type nvtxNameCuContextA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(context: nvtx_CUcontext, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameCuContextW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(context: nvtx_CUcontext, name: *const wchar_t),
>;
pub type nvtxNameCuStreamA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(stream: nvtx_CUstream, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameCuStreamW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(stream: nvtx_CUstream, name: *const wchar_t),
>;
pub type nvtxNameCuEventA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(event: nvtx_CUevent, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameCuEventW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(event: nvtx_CUevent, name: *const wchar_t),
>;
pub type nvtxNameClDeviceA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(device: nvtx_cl_device_id, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameClDeviceW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(device: nvtx_cl_device_id, name: *const wchar_t),
>;
pub type nvtxNameClContextA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(context: nvtx_cl_context, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameClContextW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(context: nvtx_cl_context, name: *const wchar_t),
>;
pub type nvtxNameClCommandQueueA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        command_queue: nvtx_cl_command_queue,
        name: *const ::core::ffi::c_char,
    ),
>;
pub type nvtxNameClCommandQueueW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(command_queue: nvtx_cl_command_queue, name: *const wchar_t),
>;
pub type nvtxNameClMemObjectA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(memobj: nvtx_cl_mem, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameClMemObjectW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(memobj: nvtx_cl_mem, name: *const wchar_t),
>;
pub type nvtxNameClSamplerA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(sampler: nvtx_cl_sampler, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameClSamplerW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(sampler: nvtx_cl_sampler, name: *const wchar_t),
>;
pub type nvtxNameClProgramA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(program: nvtx_cl_program, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameClProgramW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(program: nvtx_cl_program, name: *const wchar_t),
>;
pub type nvtxNameClEventA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(evnt: nvtx_cl_event, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameClEventW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(evnt: nvtx_cl_event, name: *const wchar_t),
>;
pub type nvtxNameCudaDeviceA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(device: ::core::ffi::c_int, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameCudaDeviceW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(device: ::core::ffi::c_int, name: *const wchar_t),
>;
pub type nvtxNameCudaStreamA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(stream: nvtx_cudaStream_t, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameCudaStreamW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(stream: nvtx_cudaStream_t, name: *const wchar_t),
>;
pub type nvtxNameCudaEventA_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(event: nvtx_cudaEvent_t, name: *const ::core::ffi::c_char),
>;
pub type nvtxNameCudaEventW_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(event: nvtx_cudaEvent_t, name: *const wchar_t),
>;
pub type nvtxDomainMarkEx_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        domain: nvtxDomainHandle_t,
        eventAttrib: *const nvtxEventAttributes_t,
    ),
>;
pub type nvtxDomainRangeStartEx_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        domain: nvtxDomainHandle_t,
        eventAttrib: *const nvtxEventAttributes_t,
    ) -> nvtxRangeId_t,
>;
pub type nvtxDomainRangeEnd_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(domain: nvtxDomainHandle_t, id: nvtxRangeId_t),
>;
pub type nvtxDomainRangePushEx_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        domain: nvtxDomainHandle_t,
        eventAttrib: *const nvtxEventAttributes_t,
    ) -> ::core::ffi::c_int,
>;
pub type nvtxDomainRangePop_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(domain: nvtxDomainHandle_t) -> ::core::ffi::c_int,
>;
pub type nvtxDomainResourceCreate_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        domain: nvtxDomainHandle_t,
        attribs: *mut nvtxResourceAttributes_t,
    ) -> nvtxResourceHandle_t,
>;
pub type nvtxDomainResourceDestroy_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(resource: nvtxResourceHandle_t),
>;
pub type nvtxDomainNameCategoryA_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        domain: nvtxDomainHandle_t,
        category: u32,
        name: *const ::core::ffi::c_char,
    ),
>;
pub type nvtxDomainNameCategoryW_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(domain: nvtxDomainHandle_t, category: u32, name: *const wchar_t),
>;
pub type nvtxDomainRegisterStringA_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        domain: nvtxDomainHandle_t,
        string: *const ::core::ffi::c_char,
    ) -> nvtxStringHandle_t,
>;
pub type nvtxDomainRegisterStringW_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        domain: nvtxDomainHandle_t,
        string: *const wchar_t,
    ) -> nvtxStringHandle_t,
>;
pub type nvtxDomainCreateA_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(message: *const ::core::ffi::c_char) -> nvtxDomainHandle_t,
>;
pub type nvtxDomainCreateW_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(message: *const wchar_t) -> nvtxDomainHandle_t,
>;
pub type nvtxDomainDestroy_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(domain: nvtxDomainHandle_t),
>;
pub type nvtxInitialize_impl_fntype = ::core::option::Option<
    unsafe extern "C" fn(reserved: *const ::core::ffi::c_void),
>;
pub type nvtxDomainSyncUserCreate_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(
        domain: nvtxDomainHandle_t,
        attribs: *const nvtx_nvtxSyncUserAttributes_t,
    ) -> nvtx_nvtxSyncUser_t,
>;
pub type nvtxDomainSyncUserDestroy_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(handle: nvtx_nvtxSyncUser_t),
>;
pub type nvtxDomainSyncUserAcquireStart_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(handle: nvtx_nvtxSyncUser_t),
>;
pub type nvtxDomainSyncUserAcquireFailed_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(handle: nvtx_nvtxSyncUser_t),
>;
pub type nvtxDomainSyncUserAcquireSuccess_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(handle: nvtx_nvtxSyncUser_t),
>;
pub type nvtxDomainSyncUserReleasing_fakeimpl_fntype = ::core::option::Option<
    unsafe extern "C" fn(handle: nvtx_nvtxSyncUser_t),
>;