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
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
18766
18767
18768
18769
18770
18771
18772
18773
18774
18775
18776
18777
18778
18779
18780
18781
18782
18783
18784
18785
18786
18787
18788
18789
18790
18791
18792
18793
18794
18795
18796
18797
18798
18799
18800
18801
18802
18803
18804
18805
18806
18807
18808
18809
18810
18811
18812
18813
18814
18815
18816
18817
18818
18819
18820
18821
18822
18823
18824
18825
18826
18827
18828
18829
18830
18831
18832
18833
18834
18835
18836
18837
18838
18839
18840
18841
18842
18843
18844
18845
18846
18847
18848
18849
18850
18851
18852
18853
18854
18855
18856
18857
18858
18859
18860
18861
18862
18863
18864
18865
18866
18867
18868
18869
18870
18871
18872
18873
18874
18875
18876
18877
18878
18879
18880
18881
18882
18883
18884
18885
18886
18887
18888
18889
18890
18891
18892
18893
18894
18895
18896
18897
18898
18899
18900
18901
18902
18903
18904
18905
18906
18907
18908
18909
18910
18911
18912
18913
18914
18915
18916
18917
18918
18919
18920
18921
18922
18923
18924
18925
18926
18927
18928
18929
18930
18931
18932
18933
18934
18935
18936
18937
18938
18939
18940
18941
18942
18943
18944
18945
18946
18947
18948
18949
18950
18951
18952
18953
18954
18955
18956
18957
18958
18959
18960
18961
18962
18963
18964
18965
18966
18967
18968
18969
18970
18971
18972
18973
18974
18975
18976
18977
18978
18979
18980
18981
18982
18983
18984
18985
18986
18987
18988
18989
18990
18991
18992
18993
18994
18995
18996
18997
18998
18999
19000
19001
19002
19003
19004
19005
19006
19007
19008
19009
19010
19011
19012
19013
19014
19015
19016
19017
19018
19019
19020
19021
19022
19023
19024
19025
19026
19027
19028
19029
19030
19031
19032
19033
19034
19035
19036
19037
19038
19039
19040
19041
19042
19043
19044
19045
19046
19047
19048
19049
19050
19051
19052
19053
19054
19055
19056
19057
19058
19059
19060
19061
19062
19063
19064
19065
19066
19067
19068
19069
19070
19071
19072
19073
19074
19075
19076
19077
19078
19079
19080
19081
19082
19083
19084
19085
19086
19087
19088
19089
19090
19091
19092
19093
19094
19095
19096
19097
19098
19099
19100
19101
19102
19103
19104
19105
19106
19107
19108
19109
19110
19111
19112
19113
19114
19115
19116
19117
19118
19119
19120
19121
19122
19123
19124
19125
19126
19127
19128
19129
19130
19131
19132
19133
19134
19135
19136
19137
19138
19139
19140
19141
19142
19143
19144
19145
19146
19147
19148
19149
19150
19151
19152
19153
19154
19155
19156
19157
19158
19159
19160
19161
19162
19163
19164
19165
19166
19167
19168
19169
19170
19171
19172
19173
19174
19175
19176
19177
19178
19179
19180
19181
19182
19183
19184
19185
19186
19187
19188
19189
19190
19191
19192
19193
19194
19195
19196
19197
19198
19199
19200
19201
19202
19203
19204
19205
19206
19207
19208
19209
19210
19211
19212
19213
19214
19215
19216
19217
19218
19219
19220
19221
19222
19223
19224
19225
19226
19227
19228
19229
19230
19231
19232
19233
19234
19235
19236
19237
19238
19239
19240
19241
19242
19243
19244
19245
19246
19247
19248
19249
19250
19251
19252
19253
19254
19255
19256
19257
19258
19259
19260
19261
19262
19263
19264
19265
19266
19267
19268
19269
19270
19271
19272
19273
19274
19275
19276
19277
19278
19279
19280
19281
19282
19283
19284
19285
19286
19287
19288
19289
19290
19291
19292
19293
19294
19295
19296
19297
19298
19299
19300
19301
19302
19303
19304
19305
19306
19307
19308
19309
19310
19311
19312
19313
19314
19315
19316
19317
19318
19319
19320
19321
19322
19323
19324
19325
19326
19327
19328
19329
19330
19331
19332
19333
19334
19335
19336
19337
19338
19339
19340
19341
19342
19343
19344
19345
19346
19347
19348
19349
19350
19351
19352
19353
19354
19355
19356
19357
19358
19359
19360
19361
19362
19363
19364
19365
19366
19367
19368
19369
19370
19371
19372
19373
19374
19375
19376
19377
19378
19379
19380
19381
19382
19383
19384
19385
19386
19387
19388
19389
19390
19391
19392
19393
19394
19395
19396
19397
19398
19399
19400
19401
19402
19403
19404
19405
19406
19407
19408
19409
19410
19411
19412
19413
19414
19415
19416
19417
19418
19419
19420
19421
19422
19423
19424
19425
19426
19427
19428
19429
19430
19431
19432
19433
19434
19435
19436
19437
19438
19439
19440
19441
19442
19443
19444
19445
19446
19447
19448
19449
19450
19451
19452
19453
19454
19455
19456
19457
19458
19459
19460
19461
19462
19463
19464
19465
19466
19467
19468
19469
19470
19471
19472
19473
19474
19475
19476
19477
19478
19479
19480
19481
19482
19483
19484
19485
19486
19487
19488
19489
19490
19491
19492
19493
19494
19495
19496
19497
19498
19499
19500
19501
19502
19503
19504
19505
19506
19507
19508
19509
19510
19511
19512
19513
19514
19515
19516
19517
19518
19519
19520
19521
19522
19523
19524
19525
19526
19527
19528
19529
19530
19531
19532
19533
19534
19535
19536
19537
19538
19539
19540
19541
19542
19543
19544
19545
19546
19547
19548
19549
19550
19551
19552
19553
19554
19555
19556
19557
19558
19559
19560
19561
19562
19563
19564
19565
19566
19567
19568
19569
19570
19571
19572
19573
19574
19575
19576
19577
19578
19579
19580
19581
19582
19583
19584
19585
19586
19587
19588
19589
19590
19591
19592
19593
19594
19595
19596
19597
19598
19599
19600
19601
19602
19603
19604
19605
19606
19607
19608
19609
19610
19611
19612
19613
19614
19615
19616
19617
19618
19619
19620
19621
19622
19623
19624
19625
19626
19627
19628
19629
19630
19631
19632
19633
19634
19635
19636
19637
19638
19639
19640
19641
19642
19643
19644
19645
19646
19647
19648
19649
19650
19651
19652
19653
19654
19655
19656
19657
19658
19659
19660
19661
19662
19663
19664
19665
19666
19667
19668
19669
19670
19671
19672
19673
19674
19675
19676
19677
19678
19679
19680
19681
19682
19683
19684
19685
19686
19687
19688
19689
19690
19691
19692
19693
19694
19695
19696
19697
19698
19699
19700
19701
19702
19703
19704
19705
19706
19707
19708
19709
19710
19711
19712
19713
19714
19715
19716
19717
19718
19719
19720
19721
19722
19723
19724
19725
19726
19727
19728
19729
19730
19731
19732
19733
19734
19735
19736
19737
19738
19739
19740
19741
19742
19743
19744
19745
19746
19747
19748
19749
19750
19751
19752
19753
19754
19755
19756
19757
19758
19759
19760
19761
19762
19763
19764
19765
19766
19767
19768
19769
19770
19771
19772
19773
19774
19775
19776
19777
19778
19779
19780
19781
19782
19783
19784
19785
19786
19787
19788
19789
19790
19791
19792
19793
19794
19795
19796
19797
19798
19799
19800
19801
19802
19803
19804
19805
19806
19807
19808
19809
19810
19811
19812
19813
19814
19815
19816
19817
19818
19819
19820
19821
19822
19823
19824
19825
19826
19827
19828
19829
19830
19831
19832
19833
19834
19835
19836
19837
19838
19839
19840
19841
19842
19843
19844
19845
19846
19847
19848
19849
19850
19851
19852
19853
19854
19855
19856
19857
19858
19859
19860
19861
19862
19863
19864
19865
19866
19867
19868
19869
19870
19871
19872
19873
19874
19875
19876
19877
19878
19879
19880
19881
19882
19883
19884
19885
19886
19887
19888
19889
19890
19891
19892
19893
19894
19895
19896
19897
19898
19899
19900
19901
19902
19903
19904
19905
19906
19907
19908
19909
19910
19911
19912
19913
19914
19915
19916
19917
19918
19919
19920
19921
19922
19923
19924
19925
19926
19927
19928
19929
19930
19931
19932
19933
19934
19935
19936
19937
19938
19939
19940
19941
19942
19943
19944
19945
19946
19947
19948
19949
19950
19951
19952
19953
19954
19955
19956
19957
19958
19959
19960
19961
19962
19963
19964
19965
19966
19967
19968
19969
19970
19971
19972
19973
19974
19975
19976
19977
19978
19979
19980
19981
19982
19983
19984
19985
19986
19987
19988
19989
19990
19991
19992
19993
19994
19995
19996
19997
19998
19999
20000
20001
20002
20003
20004
20005
20006
20007
20008
20009
20010
20011
20012
20013
20014
20015
20016
20017
20018
20019
20020
20021
20022
20023
20024
20025
20026
20027
20028
20029
20030
20031
20032
20033
20034
20035
20036
20037
20038
20039
20040
20041
20042
20043
20044
20045
20046
20047
20048
20049
20050
20051
20052
20053
20054
20055
20056
20057
20058
20059
20060
20061
20062
20063
20064
20065
20066
20067
20068
20069
20070
20071
20072
20073
20074
20075
20076
20077
20078
20079
20080
20081
20082
20083
20084
20085
20086
20087
20088
20089
20090
20091
20092
20093
20094
20095
20096
20097
20098
20099
20100
20101
20102
20103
20104
20105
20106
20107
20108
20109
20110
20111
20112
20113
20114
20115
20116
20117
20118
20119
20120
20121
20122
20123
20124
20125
20126
20127
20128
20129
20130
20131
20132
20133
20134
20135
20136
20137
20138
20139
20140
20141
20142
20143
20144
20145
20146
20147
20148
20149
20150
20151
20152
20153
20154
20155
20156
20157
20158
20159
20160
20161
20162
20163
20164
20165
20166
20167
20168
20169
20170
20171
20172
20173
20174
20175
20176
20177
20178
20179
20180
20181
20182
20183
20184
20185
20186
20187
20188
20189
20190
20191
20192
20193
20194
20195
20196
20197
20198
20199
20200
20201
20202
20203
20204
20205
20206
20207
20208
20209
20210
20211
20212
20213
20214
20215
20216
20217
20218
20219
20220
20221
20222
20223
20224
20225
20226
20227
20228
20229
20230
20231
20232
20233
20234
20235
20236
20237
20238
20239
20240
20241
20242
20243
20244
20245
20246
20247
20248
20249
20250
20251
20252
20253
20254
20255
20256
20257
20258
20259
20260
20261
20262
20263
20264
20265
20266
20267
20268
20269
20270
20271
20272
20273
20274
20275
20276
20277
20278
20279
20280
20281
20282
20283
20284
20285
20286
20287
20288
20289
20290
20291
20292
20293
20294
20295
20296
20297
20298
20299
20300
20301
20302
20303
20304
20305
20306
20307
20308
20309
20310
20311
20312
20313
20314
20315
20316
20317
20318
20319
20320
20321
20322
20323
20324
20325
20326
20327
20328
20329
20330
20331
20332
20333
20334
20335
20336
20337
20338
20339
20340
20341
20342
20343
20344
20345
20346
20347
20348
20349
20350
20351
20352
20353
20354
20355
20356
20357
20358
20359
20360
20361
20362
20363
20364
20365
20366
20367
20368
20369
20370
20371
20372
20373
20374
20375
20376
20377
20378
20379
20380
20381
20382
20383
20384
20385
20386
20387
20388
20389
20390
20391
20392
20393
20394
20395
20396
20397
20398
20399
20400
20401
20402
20403
20404
20405
20406
20407
20408
20409
20410
20411
20412
20413
20414
20415
20416
20417
20418
20419
20420
20421
20422
20423
20424
20425
20426
20427
20428
20429
20430
20431
20432
20433
20434
20435
20436
20437
20438
20439
20440
20441
20442
20443
20444
20445
20446
20447
20448
20449
20450
20451
20452
20453
20454
20455
20456
20457
20458
20459
20460
20461
20462
20463
20464
20465
20466
20467
20468
20469
20470
20471
20472
20473
20474
20475
20476
20477
20478
20479
20480
20481
20482
20483
20484
20485
20486
20487
20488
20489
20490
20491
20492
20493
20494
20495
20496
20497
20498
20499
20500
20501
20502
20503
20504
20505
20506
20507
20508
20509
20510
20511
20512
20513
20514
20515
20516
20517
20518
20519
20520
20521
20522
20523
20524
20525
20526
20527
20528
20529
20530
20531
20532
20533
20534
20535
20536
20537
20538
20539
20540
20541
20542
20543
20544
20545
20546
20547
20548
20549
20550
20551
20552
20553
20554
20555
20556
20557
20558
20559
20560
20561
20562
20563
20564
20565
20566
20567
20568
20569
20570
20571
20572
20573
20574
20575
20576
20577
20578
20579
20580
20581
20582
20583
20584
20585
20586
20587
20588
20589
20590
20591
20592
20593
20594
20595
20596
20597
20598
20599
20600
20601
20602
20603
20604
20605
20606
20607
20608
20609
20610
20611
20612
20613
20614
20615
20616
20617
20618
20619
20620
20621
20622
20623
20624
20625
20626
20627
20628
20629
20630
20631
20632
20633
20634
20635
20636
20637
20638
20639
20640
20641
20642
20643
20644
20645
20646
20647
20648
20649
20650
20651
20652
20653
20654
20655
20656
20657
20658
20659
20660
20661
20662
20663
20664
20665
20666
20667
20668
20669
20670
20671
20672
20673
20674
20675
20676
20677
20678
20679
20680
20681
20682
20683
20684
20685
20686
20687
20688
20689
20690
20691
20692
20693
20694
20695
20696
20697
20698
20699
20700
20701
20702
20703
20704
20705
20706
20707
20708
20709
20710
20711
20712
20713
20714
20715
20716
20717
20718
20719
20720
20721
20722
20723
20724
20725
20726
20727
20728
20729
20730
20731
20732
20733
20734
20735
20736
20737
20738
20739
20740
20741
20742
20743
20744
20745
20746
20747
20748
20749
20750
20751
20752
20753
20754
20755
20756
20757
20758
20759
20760
20761
20762
20763
20764
20765
20766
20767
20768
20769
20770
20771
20772
20773
20774
20775
20776
20777
20778
20779
20780
20781
20782
20783
20784
20785
20786
20787
20788
20789
20790
20791
20792
20793
20794
20795
20796
20797
20798
20799
20800
20801
20802
20803
20804
20805
20806
20807
20808
20809
20810
20811
20812
20813
20814
20815
20816
20817
20818
20819
20820
20821
20822
20823
20824
20825
20826
20827
20828
20829
20830
20831
20832
20833
20834
20835
20836
20837
20838
20839
20840
20841
20842
20843
20844
20845
20846
20847
20848
20849
20850
20851
20852
20853
20854
20855
20856
20857
20858
20859
20860
20861
20862
20863
20864
20865
20866
20867
20868
20869
20870
20871
20872
20873
20874
20875
20876
20877
20878
20879
20880
20881
20882
20883
20884
20885
20886
20887
20888
20889
20890
20891
20892
20893
20894
20895
20896
20897
20898
20899
20900
20901
20902
20903
20904
20905
20906
20907
20908
20909
20910
20911
20912
20913
20914
20915
20916
20917
20918
20919
20920
20921
20922
20923
20924
20925
20926
20927
20928
20929
20930
20931
20932
20933
20934
20935
20936
20937
20938
20939
20940
20941
20942
20943
20944
20945
20946
20947
20948
20949
20950
20951
20952
20953
20954
20955
20956
20957
20958
20959
20960
20961
20962
20963
20964
20965
20966
20967
20968
20969
20970
20971
20972
20973
20974
20975
20976
20977
20978
20979
20980
20981
20982
20983
20984
20985
20986
20987
20988
20989
20990
20991
20992
20993
20994
20995
20996
20997
20998
20999
21000
21001
21002
21003
21004
21005
21006
21007
21008
21009
21010
21011
21012
21013
21014
21015
21016
21017
21018
21019
21020
21021
21022
21023
21024
21025
21026
21027
21028
21029
21030
21031
21032
21033
21034
21035
21036
21037
21038
21039
21040
21041
21042
21043
21044
21045
21046
21047
21048
21049
21050
21051
21052
21053
21054
21055
21056
21057
21058
21059
21060
21061
21062
21063
21064
21065
21066
21067
21068
21069
21070
21071
21072
21073
21074
21075
21076
21077
21078
21079
21080
21081
21082
21083
21084
21085
21086
21087
21088
21089
21090
21091
21092
21093
21094
21095
21096
21097
21098
21099
21100
21101
21102
21103
21104
21105
21106
21107
21108
21109
21110
21111
21112
21113
21114
21115
21116
21117
21118
21119
21120
21121
21122
21123
21124
21125
21126
21127
21128
21129
21130
21131
21132
21133
21134
21135
21136
21137
21138
21139
21140
21141
21142
21143
21144
21145
21146
21147
21148
21149
21150
21151
21152
21153
21154
21155
21156
21157
21158
21159
21160
21161
21162
21163
21164
21165
21166
21167
21168
21169
21170
21171
21172
21173
21174
21175
21176
21177
21178
21179
21180
21181
21182
21183
21184
21185
21186
21187
21188
21189
21190
21191
21192
21193
21194
21195
21196
21197
21198
21199
21200
21201
21202
21203
21204
21205
21206
21207
21208
21209
21210
21211
21212
21213
21214
21215
21216
21217
21218
21219
21220
21221
21222
21223
21224
21225
21226
21227
21228
21229
21230
21231
21232
21233
21234
21235
21236
21237
21238
21239
21240
21241
21242
21243
21244
21245
21246
21247
21248
21249
21250
21251
21252
21253
21254
21255
21256
21257
21258
21259
21260
21261
21262
21263
21264
21265
21266
21267
21268
21269
21270
21271
21272
21273
21274
21275
21276
21277
21278
21279
21280
21281
21282
21283
21284
21285
21286
21287
21288
21289
21290
21291
21292
21293
21294
21295
21296
21297
21298
21299
21300
21301
21302
21303
21304
21305
21306
21307
21308
21309
21310
21311
21312
21313
21314
21315
21316
21317
21318
21319
21320
21321
21322
21323
21324
21325
21326
21327
21328
21329
21330
21331
21332
21333
21334
21335
21336
21337
21338
21339
21340
21341
21342
21343
21344
21345
21346
21347
21348
21349
21350
21351
21352
21353
21354
21355
21356
21357
21358
21359
21360
21361
21362
21363
21364
21365
21366
21367
21368
21369
21370
21371
21372
21373
21374
21375
21376
21377
21378
21379
21380
21381
21382
21383
21384
21385
21386
21387
21388
21389
21390
21391
21392
21393
21394
21395
21396
21397
21398
21399
21400
21401
21402
21403
21404
21405
21406
21407
21408
21409
21410
21411
21412
21413
21414
21415
21416
21417
21418
21419
21420
21421
21422
21423
21424
21425
21426
21427
21428
21429
21430
21431
21432
21433
21434
21435
21436
21437
21438
21439
21440
21441
21442
21443
21444
21445
21446
21447
21448
21449
21450
21451
21452
21453
21454
21455
21456
21457
21458
21459
21460
21461
21462
21463
21464
21465
21466
21467
21468
21469
21470
21471
21472
21473
21474
21475
21476
21477
21478
21479
21480
21481
21482
21483
21484
21485
21486
21487
21488
21489
21490
21491
21492
21493
21494
21495
21496
21497
21498
21499
21500
21501
21502
21503
21504
21505
21506
21507
21508
21509
21510
21511
21512
21513
21514
21515
21516
21517
21518
21519
21520
21521
21522
21523
21524
21525
21526
21527
21528
21529
21530
21531
21532
21533
21534
21535
21536
21537
21538
21539
21540
21541
21542
21543
21544
21545
21546
21547
21548
21549
21550
21551
21552
21553
21554
21555
21556
21557
21558
21559
21560
21561
21562
21563
21564
21565
21566
21567
21568
21569
21570
21571
21572
21573
21574
21575
21576
21577
21578
21579
21580
21581
21582
21583
21584
21585
21586
21587
21588
21589
21590
21591
21592
21593
21594
21595
21596
21597
21598
21599
21600
21601
21602
21603
21604
21605
21606
21607
21608
21609
21610
21611
21612
21613
21614
21615
21616
21617
21618
21619
21620
21621
21622
21623
21624
21625
21626
21627
21628
21629
21630
21631
21632
21633
21634
21635
21636
21637
21638
21639
21640
21641
21642
21643
21644
21645
21646
21647
21648
21649
21650
21651
21652
21653
21654
21655
21656
21657
21658
21659
21660
21661
21662
21663
21664
21665
21666
21667
21668
21669
21670
21671
21672
21673
21674
21675
21676
21677
21678
21679
21680
21681
21682
21683
21684
21685
21686
21687
21688
21689
21690
21691
21692
21693
21694
21695
21696
21697
21698
21699
21700
21701
21702
21703
21704
21705
21706
21707
21708
21709
21710
21711
21712
21713
21714
21715
21716
21717
21718
21719
21720
21721
21722
21723
21724
21725
21726
21727
21728
21729
21730
21731
21732
21733
21734
21735
21736
21737
21738
21739
21740
21741
21742
21743
21744
21745
21746
21747
21748
21749
21750
21751
21752
21753
21754
21755
21756
21757
21758
21759
21760
21761
21762
21763
21764
21765
21766
21767
21768
21769
21770
21771
21772
21773
21774
21775
21776
21777
21778
21779
21780
21781
21782
21783
21784
21785
21786
21787
21788
21789
21790
21791
21792
21793
21794
21795
21796
21797
21798
21799
21800
21801
21802
21803
21804
21805
21806
21807
21808
21809
21810
21811
21812
21813
21814
21815
21816
21817
21818
21819
21820
21821
21822
21823
21824
21825
21826
21827
21828
21829
21830
21831
21832
21833
21834
21835
21836
21837
21838
21839
21840
21841
21842
21843
/* automatically generated by rust-bindgen 0.72.1 */

/// CUDA API version number.
pub const CUDA_VERSION: u32 = 13020;
/// CUDA IPC handle size.
pub const CU_IPC_HANDLE_SIZE: u32 = 64;
pub const CU_COMPUTE_ACCELERATED_TARGET_BASE: u32 = 65536;
pub const CU_COMPUTE_FAMILY_TARGET_BASE: u32 = 131072;
/// Conditional node handle flags Default value is applied when graph is launched.
pub const CU_GRAPH_COND_ASSIGN_DEFAULT: u32 = 1;
/// This port activates when the kernel has finished executing.
pub const CU_GRAPH_KERNEL_NODE_PORT_DEFAULT: u32 = 0;
/// This port activates when all blocks of the kernel have performed [cudaTriggerProgrammaticLaunchCompletion()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EXECUTION.html#group__CUDART__EXECUTION_1ge194af462d927583bed3acf60d450218) or have terminated. It must be used with edge type CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC. See also CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT.
pub const CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC: u32 = 1;
/// This port activates when all blocks of the kernel have begun execution. See also CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT.
pub const CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER: u32 = 2;
/// If set, host memory is portable between CUDA contexts. Flag for [`cuMemHostAlloc`].
pub const CU_MEMHOSTALLOC_PORTABLE: u32 = 1;
/// If set, host memory is mapped into CUDA address space and [`cuMemHostGetDevicePointer_v2`] may be called on the host pointer. Flag for [`cuMemHostAlloc`].
pub const CU_MEMHOSTALLOC_DEVICEMAP: u32 = 2;
/// If set, host memory is allocated as write-combined - fast to write, faster to DMA, slow to read except via SSE4 streaming
/// load instruction (MOVNTDQA). Flag for [`cuMemHostAlloc`].
pub const CU_MEMHOSTALLOC_WRITECOMBINED: u32 = 4;
/// If set, host memory is portable between CUDA contexts. Flag for [`cuMemHostRegister_v2`].
pub const CU_MEMHOSTREGISTER_PORTABLE: u32 = 1;
/// If set, host memory is mapped into CUDA address space and [`cuMemHostGetDevicePointer_v2`] may be called on the host pointer. Flag for [`cuMemHostRegister_v2`].
pub const CU_MEMHOSTREGISTER_DEVICEMAP: u32 = 2;
/// If set, the passed memory pointer is treated as pointing to some memory-mapped I/O space, e.g. belonging to a third-party
/// PCIe device. On Windows the flag is a no-op. On Linux that memory is marked as non cache-coherent for the GPU and is expected
/// to be physically contiguous. It may return CUDA_ERROR_NOT_PERMITTED if run as an unprivileged user, CUDA_ERROR_NOT_SUPPORTED on older Linux kernel versions. On all other platforms, it is not supported and CUDA_ERROR_NOT_SUPPORTED is returned. Flag for [`cuMemHostRegister_v2`].
pub const CU_MEMHOSTREGISTER_IOMEMORY: u32 = 4;
/// If set, the passed memory pointer is treated as pointing to memory that is considered read-only by the device. On platforms
/// without CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES, this flag is required in order to register memory mapped to the CPU as read-only. Support for the use of this flag can be
/// queried from the device attribute CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED. Using this flag with a current context associated with a device that does not have this attribute set will cause [`cuMemHostRegister_v2`] to error with CUDA_ERROR_NOT_SUPPORTED.
pub const CU_MEMHOSTREGISTER_READ_ONLY: u32 = 8;
/// Indicates that the layered sparse CUDA array or CUDA mipmapped array has a single mip tail region for all layers.
pub const CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL: u32 = 1;
/// Size of tensor map descriptor.
pub const CU_TENSOR_MAP_NUM_QWORDS: u32 = 16;
/// Indicates that the external memory object is a dedicated resource.
pub const CUDA_EXTERNAL_MEMORY_DEDICATED: u32 = 1;
/// When the flags parameter of CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS contains this flag, it indicates that signaling an external semaphore
/// object should skip performing appropriate memory synchronization operations over all the external memory objects that are
/// imported as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects.
pub const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC: u32 = 1;
/// When the flags parameter of CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS contains this flag, it indicates that waiting on an external semaphore object
/// should skip performing appropriate memory synchronization operations over all the external memory objects that are imported
/// as CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF, which otherwise are performed by default to ensure data coherency with other importers of the same NvSciBuf memory objects.
pub const CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC: u32 = 2;
/// When flags of [`cuDeviceGetNvSciSyncAttributes`] is set to this, it indicates that application needs signaler specific NvSciSyncAttr to be filled by [`cuDeviceGetNvSciSyncAttributes`].
pub const CUDA_NVSCISYNC_ATTR_SIGNAL: u32 = 1;
/// When flags of [`cuDeviceGetNvSciSyncAttributes`] is set to this, it indicates that application needs waiter specific NvSciSyncAttr to be filled by [`cuDeviceGetNvSciSyncAttributes`].
pub const CUDA_NVSCISYNC_ATTR_WAIT: u32 = 2;
/// This flag if set indicates that the memory will be used as a tile pool.
pub const CU_MEM_CREATE_USAGE_TILE_POOL: u32 = 1;
/// This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression.
pub const CU_MEM_CREATE_USAGE_HW_DECOMPRESS: u32 = 2;
/// This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression.
pub const CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS: u32 = 2;
/// If set, each kernel launched as part of [`cuLaunchCooperativeKernelMultiDevice`] only waits for prior work in the stream corresponding to that GPU to complete before the kernel begins execution.
pub const CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC: u32 = 1;
/// If set, any subsequent work pushed in a stream that participated in a call to [`cuLaunchCooperativeKernelMultiDevice`] will only wait for the kernel launched on the GPU corresponding to that stream to complete before it begins execution.
pub const CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC: u32 = 2;
/// If set, the CUDA array is a collection of layers, where each layer is either a 1D or a 2D array and the Depth member of CUDA_ARRAY3D_DESCRIPTOR
/// specifies the number of layers, not the depth of a 3D array.
pub const CUDA_ARRAY3D_LAYERED: u32 = 1;
/// use [`CUDA_ARRAY3D_LAYERED`].
#[deprecated]
pub const CUDA_ARRAY3D_2DARRAY: u32 = 1;
/// This flag must be set in order to bind a surface reference to the CUDA array.
pub const CUDA_ARRAY3D_SURFACE_LDST: u32 = 2;
/// If set, the CUDA array is a collection of six 2D arrays, representing faces of a cube. The width of such a CUDA array must
/// be equal to its height, and Depth must be six. If [`CUDA_ARRAY3D_LAYERED`] flag is also set, then the CUDA array is a collection of cubemaps and Depth must be a multiple of six.
pub const CUDA_ARRAY3D_CUBEMAP: u32 = 4;
/// This flag must be set in order to perform texture gather operations on a CUDA array.
pub const CUDA_ARRAY3D_TEXTURE_GATHER: u32 = 8;
/// This flag if set indicates that the CUDA array is a DEPTH_TEXTURE.
pub const CUDA_ARRAY3D_DEPTH_TEXTURE: u32 = 16;
/// This flag indicates that the CUDA array may be bound as a color target in an external graphics API.
pub const CUDA_ARRAY3D_COLOR_ATTACHMENT: u32 = 32;
/// This flag if set indicates that the CUDA array or CUDA mipmapped array is a sparse CUDA array or CUDA mipmapped array respectively.
pub const CUDA_ARRAY3D_SPARSE: u32 = 64;
/// This flag if set indicates that the CUDA array or CUDA mipmapped array will allow deferred memory mapping.
pub const CUDA_ARRAY3D_DEFERRED_MAPPING: u32 = 128;
/// This flag indicates that the CUDA array will be used for hardware accelerated video encode/decode operations.
pub const CUDA_ARRAY3D_VIDEO_ENCODE_DECODE: u32 = 256;
/// Override the texref format with a format inferred from the array. Flag for [`cuTexRefSetArray`].
#[deprecated]
pub const CU_TRSA_OVERRIDE_FORMAT: u32 = 1;
/// Read the texture as integers rather than promoting the values to floats in the range \[0,1\]. Flag for [`cuTexRefSetFlags`] and [`cuTexObjectCreate`].
#[deprecated]
pub const CU_TRSF_READ_AS_INTEGER: u32 = 1;
/// Use normalized texture coordinates in the range 0,1) instead of [0,dim). Flag for [cuTexRefSetFlags() and [`cuTexObjectCreate`].
#[deprecated]
pub const CU_TRSF_NORMALIZED_COORDINATES: u32 = 2;
/// Perform sRGB->linear conversion during texture read. Flag for [`cuTexRefSetFlags`] and [`cuTexObjectCreate`].
#[deprecated]
pub const CU_TRSF_SRGB: u32 = 16;
/// Disable any trilinear filtering optimizations. Flag for [`cuTexRefSetFlags`] and [`cuTexObjectCreate`].
#[deprecated]
pub const CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION: u32 = 32;
/// Enable seamless cube map filtering. Flag for [`cuTexObjectCreate`].
pub const CU_TRSF_SEAMLESS_CUBEMAP: u32 = 64;
/// Launch with the required block dimension.
pub const CU_LAUNCH_KERNEL_REQUIRED_BLOCK_DIM: u32 = 1;
/// C++ compile time constant for CU_LAUNCH_PARAM_END.
pub const CU_LAUNCH_PARAM_END_AS_INT: u32 = 0;
/// C++ compile time constant for CU_LAUNCH_PARAM_BUFFER_POINTER.
pub const CU_LAUNCH_PARAM_BUFFER_POINTER_AS_INT: u32 = 1;
/// C++ compile time constant for CU_LAUNCH_PARAM_BUFFER_SIZE.
pub const CU_LAUNCH_PARAM_BUFFER_SIZE_AS_INT: u32 = 2;
/// For texture references loaded into the module, use default texunit from texture reference.
pub const CU_PARAM_TR_DEFAULT: i32 = -1;
pub type size_t = ::core::ffi::c_ulong;
pub type cuuint32_t = u32;
pub type cuuint64_t = u64;
/// CUDA device pointer CUdeviceptr is defined as an unsigned integer type whose size matches the size of a pointer on the target
/// platform.
pub type CUdeviceptr_v2 = ::core::ffi::c_ulonglong;
/// CUDA device pointer.
pub type CUdeviceptr = CUdeviceptr_v2;
/// CUDA device.
pub type CUdevice_v1 = ::core::ffi::c_int;
/// CUDA device.
pub type CUdevice = CUdevice_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUctx_st {
    _unused: [u8; 0],
}
/// A regular context handle.
pub type CUcontext = *mut CUctx_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUmod_st {
    _unused: [u8; 0],
}
/// CUDA module.
pub type CUmodule = *mut CUmod_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUfunc_st {
    _unused: [u8; 0],
}
/// CUDA function.
pub type CUfunction = *mut CUfunc_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUlib_st {
    _unused: [u8; 0],
}
/// CUDA library.
pub type CUlibrary = *mut CUlib_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUkern_st {
    _unused: [u8; 0],
}
/// CUDA kernel.
pub type CUkernel = *mut CUkern_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUarray_st {
    _unused: [u8; 0],
}
/// CUDA array.
pub type CUarray = *mut CUarray_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUmipmappedArray_st {
    _unused: [u8; 0],
}
/// CUDA mipmapped array.
pub type CUmipmappedArray = *mut CUmipmappedArray_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUtexref_st {
    _unused: [u8; 0],
}
/// CUDA texture reference.
pub type CUtexref = *mut CUtexref_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUsurfref_st {
    _unused: [u8; 0],
}
/// CUDA surface reference.
pub type CUsurfref = *mut CUsurfref_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUevent_st {
    _unused: [u8; 0],
}
/// CUDA event.
pub type CUevent = *mut CUevent_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUstream_st {
    _unused: [u8; 0],
}
/// CUDA stream.
pub type CUstream = *mut CUstream_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUgraphicsResource_st {
    _unused: [u8; 0],
}
/// CUDA graphics interop resource.
pub type CUgraphicsResource = *mut CUgraphicsResource_st;
/// An opaque value that represents a CUDA texture object.
pub type CUtexObject_v1 = ::core::ffi::c_ulonglong;
/// An opaque value that represents a CUDA texture object.
pub type CUtexObject = CUtexObject_v1;
/// An opaque value that represents a CUDA surface object.
pub type CUsurfObject_v1 = ::core::ffi::c_ulonglong;
/// An opaque value that represents a CUDA surface object.
pub type CUsurfObject = CUsurfObject_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUextMemory_st {
    _unused: [u8; 0],
}
/// CUDA external memory.
pub type CUexternalMemory = *mut CUextMemory_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUextSemaphore_st {
    _unused: [u8; 0],
}
/// CUDA external semaphore.
pub type CUexternalSemaphore = *mut CUextSemaphore_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUgraph_st {
    _unused: [u8; 0],
}
/// CUDA graph.
pub type CUgraph = *mut CUgraph_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUgraphNode_st {
    _unused: [u8; 0],
}
/// CUDA graph node.
pub type CUgraphNode = *mut CUgraphNode_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUgraphExec_st {
    _unused: [u8; 0],
}
/// CUDA executable graph.
pub type CUgraphExec = *mut CUgraphExec_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUmemPoolHandle_st {
    _unused: [u8; 0],
}
/// CUDA memory pool.
pub type CUmemoryPool = *mut CUmemPoolHandle_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUuserObject_st {
    _unused: [u8; 0],
}
/// CUDA user object for graphs.
pub type CUuserObject = *mut CUuserObject_st;
/// CUDA graph conditional handle.
pub type CUgraphConditionalHandle = cuuint64_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUgraphDeviceUpdatableNode_st {
    _unused: [u8; 0],
}
/// CUDA graph device node handle.
pub type CUgraphDeviceNode = *mut CUgraphDeviceUpdatableNode_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUasyncCallbackEntry_st {
    _unused: [u8; 0],
}
/// CUDA async notification callback handle.
pub type CUasyncCallbackHandle = *mut CUasyncCallbackEntry_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUgreenCtx_st {
    _unused: [u8; 0],
}
/// A green context handle. This handle can be used safely from only one CPU thread at a time. Created via [`cuGreenCtxCreate`].
pub type CUgreenCtx = *mut CUgreenCtx_st;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUuuid_st {
    pub bytes: [::core::ffi::c_char; 16usize],
}
pub type CUuuid = CUuuid_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUmemFabricHandle_st {
    pub data: [::core::ffi::c_uchar; 64usize],
}
impl Default for CUmemFabricHandle_st {
    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()
        }
    }
}
/// Fabric handle - An opaque handle representing a memory allocation that can be exported to processes in same or different nodes.
/// For IPC between processes on different nodes they must be connected via the NVSwitch fabric.
pub type CUmemFabricHandle_v1 = CUmemFabricHandle_st;
pub type CUmemFabricHandle = CUmemFabricHandle_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUipcEventHandle_st {
    pub reserved: [::core::ffi::c_char; 64usize],
}
impl Default for CUipcEventHandle_st {
    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()
        }
    }
}
/// CUDA IPC event handle.
pub type CUipcEventHandle_v1 = CUipcEventHandle_st;
pub type CUipcEventHandle = CUipcEventHandle_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUipcMemHandle_st {
    pub reserved: [::core::ffi::c_char; 64usize],
}
impl Default for CUipcMemHandle_st {
    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()
        }
    }
}
/// CUDA IPC mem handle.
pub type CUipcMemHandle_v1 = CUipcMemHandle_st;
pub type CUipcMemHandle = CUipcMemHandle_v1;
/// CUDA Ipc Mem Flags.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUipcMem_flags_enum {
    /// Automatically enable peer access between remote devices as needed.
    CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS = 1,
}
pub use self::CUipcMem_flags_enum as CUipcMem_flags;
/// CUDA Mem Attach Flags.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemAttach_flags_enum {
    /// Memory can be accessed by any stream on any device.
    CU_MEM_ATTACH_GLOBAL = 1,
    /// Memory cannot be accessed by any stream on any device.
    CU_MEM_ATTACH_HOST = 2,
    /// Memory can only be accessed by a single stream on the associated device.
    CU_MEM_ATTACH_SINGLE = 4,
}
pub use self::CUmemAttach_flags_enum as CUmemAttach_flags;
impl CUctx_flags_enum {
    pub const CU_CTX_BLOCKING_SYNC: CUctx_flags_enum = CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC;
}
/// Context creation flags.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUctx_flags_enum {
    /// Automatic scheduling.
    CU_CTX_SCHED_AUTO = 0,
    /// Set spin as default scheduling.
    CU_CTX_SCHED_SPIN = 1,
    /// Set yield as default scheduling.
    CU_CTX_SCHED_YIELD = 2,
    /// Set blocking synchronization as default scheduling.
    CU_CTX_SCHED_BLOCKING_SYNC = 4,
    CU_CTX_SCHED_MASK = 7,
    /// flag is enabled.
    #[deprecated]
    CU_CTX_MAP_HOST = 8,
    /// Keep local memory allocation after launch.
    CU_CTX_LMEM_RESIZE_TO_MAX = 16,
    /// Trigger coredumps from exceptions in this context.
    CU_CTX_COREDUMP_ENABLE = 32,
    /// Enable user pipe to trigger coredumps in this context.
    CU_CTX_USER_COREDUMP_ENABLE = 64,
    /// Ensure synchronous memory operations on this context will synchronize.
    CU_CTX_SYNC_MEMOPS = 128,
    CU_CTX_FLAGS_MASK = 255,
}
pub use self::CUctx_flags_enum as CUctx_flags;
/// Event sched flags.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUevent_sched_flags_enum {
    /// Automatic scheduling.
    CU_EVENT_SCHED_AUTO = 0,
    /// Set spin as default scheduling.
    CU_EVENT_SCHED_SPIN = 1,
    /// Set yield as default scheduling.
    CU_EVENT_SCHED_YIELD = 2,
    /// Set blocking synchronization as default scheduling.
    CU_EVENT_SCHED_BLOCKING_SYNC = 4,
}
pub use self::CUevent_sched_flags_enum as CUevent_sched_flags;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUhostTaskSyncMode_enum {
    CU_HOST_TASK_BLOCKING = 0,
    CU_HOST_TASK_SPINWAIT = 1,
}
pub use self::CUhostTaskSyncMode_enum as CUhostTaskSyncMode;
/// Stream creation flags.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUstream_flags_enum {
    /// Default stream flag.
    CU_STREAM_DEFAULT = 0,
    /// Stream does not synchronize with stream 0 (the NULL stream).
    CU_STREAM_NON_BLOCKING = 1,
}
pub use self::CUstream_flags_enum as CUstream_flags;
/// Event creation flags.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUevent_flags_enum {
    /// Default event flag.
    CU_EVENT_DEFAULT = 0,
    /// Event uses blocking synchronization.
    CU_EVENT_BLOCKING_SYNC = 1,
    /// Event will not record timing data.
    CU_EVENT_DISABLE_TIMING = 2,
    /// Event is suitable for interprocess use. [`CUevent_flags::CU_EVENT_DISABLE_TIMING`] must be set.
    CU_EVENT_INTERPROCESS = 4,
}
pub use self::CUevent_flags_enum as CUevent_flags;
/// Event record flags.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUevent_record_flags_enum {
    /// Default event record flag.
    CU_EVENT_RECORD_DEFAULT = 0,
    /// When using stream capture, create an event record node instead of the default behavior. This flag is invalid when used outside
    /// of capture.
    CU_EVENT_RECORD_EXTERNAL = 1,
}
pub use self::CUevent_record_flags_enum as CUevent_record_flags;
/// Event wait flags.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUevent_wait_flags_enum {
    /// Default event wait flag.
    CU_EVENT_WAIT_DEFAULT = 0,
    /// When using stream capture, create an event wait node instead of the default behavior. This flag is invalid when used outside
    /// of capture.
    CU_EVENT_WAIT_EXTERNAL = 1,
}
pub use self::CUevent_wait_flags_enum as CUevent_wait_flags;
/// CUDA-valid Atomic Operations.
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUatomicOperation_enum {
    CU_ATOMIC_OPERATION_INTEGER_ADD = 0,
    CU_ATOMIC_OPERATION_INTEGER_MIN = 1,
    CU_ATOMIC_OPERATION_INTEGER_MAX = 2,
    CU_ATOMIC_OPERATION_INTEGER_INCREMENT = 3,
    CU_ATOMIC_OPERATION_INTEGER_DECREMENT = 4,
    CU_ATOMIC_OPERATION_AND = 5,
    CU_ATOMIC_OPERATION_OR = 6,
    CU_ATOMIC_OPERATION_XOR = 7,
    CU_ATOMIC_OPERATION_EXCHANGE = 8,
    CU_ATOMIC_OPERATION_CAS = 9,
    CU_ATOMIC_OPERATION_FLOAT_ADD = 10,
    CU_ATOMIC_OPERATION_FLOAT_MIN = 11,
    CU_ATOMIC_OPERATION_FLOAT_MAX = 12,
    CU_ATOMIC_OPERATION_MAX = 13,
}
pub use self::CUatomicOperation_enum as CUatomicOperation;
/// CUDA-valid Atomic Operation capabilities.
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUatomicOperationCapability_enum {
    CU_ATOMIC_CAPABILITY_SIGNED = 1,
    CU_ATOMIC_CAPABILITY_UNSIGNED = 2,
    CU_ATOMIC_CAPABILITY_REDUCTION = 4,
    CU_ATOMIC_CAPABILITY_SCALAR_32 = 8,
    CU_ATOMIC_CAPABILITY_SCALAR_64 = 16,
    CU_ATOMIC_CAPABILITY_SCALAR_128 = 32,
    CU_ATOMIC_CAPABILITY_VECTOR_32x4 = 64,
}
pub use self::CUatomicOperationCapability_enum as CUatomicOperationCapability;
/// Flags for [`cuStreamWaitValue32_v2`] and [`cuStreamWaitValue64_v2`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUstreamWaitValue_flags_enum {
    /// Wait until (int32_t)(\*addr - value) >= 0 (or int64_t for 64 bit values). Note this is a cyclic comparison which ignores wraparound.
    /// (Default behavior.)
    CU_STREAM_WAIT_VALUE_GEQ = 0,
    /// Wait until \*addr == value.
    CU_STREAM_WAIT_VALUE_EQ = 1,
    /// Wait until (\*addr & value) != 0.
    CU_STREAM_WAIT_VALUE_AND = 2,
    /// Wait until ~(\*addr | value) != 0. Support for this operation can be queried with [`cuDeviceGetAttribute`] and CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR.
    CU_STREAM_WAIT_VALUE_NOR = 3,
    /// Follow the wait operation with a flush of outstanding remote writes. This means that, if a remote write operation is guaranteed
    /// to have reached the device before the wait can be satisfied, that write is guaranteed to be visible to downstream device work.
    /// The device is permitted to reorder remote writes internally. For example, this flag would be required if two remote writes
    /// arrive in a defined order, the wait is satisfied by the second write, and downstream work needs to observe the first write.
    /// Support for this operation is restricted to selected platforms and can be queried with CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES.
    CU_STREAM_WAIT_VALUE_FLUSH = 1073741824,
}
pub use self::CUstreamWaitValue_flags_enum as CUstreamWaitValue_flags;
/// Flags for [`cuStreamWriteValue32_v2`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUstreamWriteValue_flags_enum {
    /// Default behavior.
    CU_STREAM_WRITE_VALUE_DEFAULT = 0,
    /// Permits the write to be reordered with writes which were issued before it, as a performance optimization. Normally, [`cuStreamWriteValue32_v2`] will provide a memory fence before the write, which has similar semantics to __threadfence_system() but is scoped to the
    /// stream rather than a CUDA thread. This flag is not supported in the v2 API.
    CU_STREAM_WRITE_VALUE_NO_MEMORY_BARRIER = 1,
}
pub use self::CUstreamWriteValue_flags_enum as CUstreamWriteValue_flags;
/// Operations for [`cuStreamBatchMemOp_v2`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUstreamBatchMemOpType_enum {
    /// Represents a [`cuStreamWaitValue32_v2`] operation.
    CU_STREAM_MEM_OP_WAIT_VALUE_32 = 1,
    /// Represents a [`cuStreamWriteValue32_v2`] operation.
    CU_STREAM_MEM_OP_WRITE_VALUE_32 = 2,
    /// Represents a [`cuStreamWaitValue64_v2`] operation.
    CU_STREAM_MEM_OP_WAIT_VALUE_64 = 4,
    /// Represents a [`cuStreamWriteValue64_v2`] operation.
    CU_STREAM_MEM_OP_WRITE_VALUE_64 = 5,
    /// Insert a memory barrier of the specified type.
    CU_STREAM_MEM_OP_BARRIER = 6,
    /// Perform a atomic reduction. See CUstreamBatchMemOpParams::atomicReduction.
    CU_STREAM_MEM_OP_ATOMIC_REDUCTION = 8,
    /// This has the same effect as CU_STREAM_WAIT_VALUE_FLUSH, but as a standalone operation.
    CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3,
}
pub use self::CUstreamBatchMemOpType_enum as CUstreamBatchMemOpType;
/// Flags for [CUstreamBatchMemOpParams::memoryBarrier](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUstreamBatchMemOpParams__v1.html#unionCUstreamBatchMemOpParams__v1_16133c06182986968a5f5e381194566ef).
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUstreamMemoryBarrier_flags_enum {
    /// System-wide memory barrier.
    CU_STREAM_MEMORY_BARRIER_TYPE_SYS = 0,
    /// Limit memory barrier scope to the GPU.
    CU_STREAM_MEMORY_BARRIER_TYPE_GPU = 1,
}
pub use self::CUstreamMemoryBarrier_flags_enum as CUstreamMemoryBarrier_flags;
/// Atomic reduction operation types for CUstreamBatchMemOpParams::atomicReduction::reductionOp.
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUstreamAtomicReductionOpType_enum {
    /// Performs an atomic OR: \*(address) = \*(address) | value.
    CU_STREAM_ATOMIC_REDUCTION_OP_OR = 6,
    /// Performs an atomic AND: \*(address) = \*(address) & value.
    CU_STREAM_ATOMIC_REDUCTION_OP_AND = 5,
    /// Performs an atomic ADD: \*(address) = \*(address) + value.
    CU_STREAM_ATOMIC_REDUCTION_OP_ADD = 0,
}
pub use self::CUstreamAtomicReductionOpType_enum as CUstreamAtomicReductionOpType;
/// Atomic reduction data types for CUstreamBatchMemOpParams::atomicReduction::dataType.
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUstreamAtomicReductionDataType_enum {
    CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_32 = 14,
    CU_STREAM_ATOMIC_REDUCTION_UNSIGNED_64 = 22,
}
pub use self::CUstreamAtomicReductionDataType_enum as CUstreamAtomicReductionDataType;
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUstreamBatchMemOpParams_union {
    pub operation: CUstreamBatchMemOpType,
    pub waitValue: CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st,
    pub writeValue: CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st,
    pub flushRemoteWrites: CUstreamBatchMemOpParams_union_CUstreamMemOpFlushRemoteWritesParams_st,
    pub memoryBarrier: CUstreamBatchMemOpParams_union_CUstreamMemOpMemoryBarrierParams_st,
    pub atomicReduction: CUstreamBatchMemOpParams_union_CUstreamMemOpAtomicReductionParams_st,
    pub pad: [cuuint64_t; 6usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st {
    pub operation: CUstreamBatchMemOpType,
    pub address: CUdeviceptr,
    pub __bindgen_anon_1: CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1,
    pub flags: ::core::ffi::c_uint,
    pub alias: CUdeviceptr,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1 {
    pub value: cuuint32_t,
    pub value64: cuuint64_t,
}
impl Default
for CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st__bindgen_ty_1 {
    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 CUstreamBatchMemOpParams_union_CUstreamMemOpWaitValueParams_st {
    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()
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st {
    pub operation: CUstreamBatchMemOpType,
    pub address: CUdeviceptr,
    pub __bindgen_anon_1: CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1,
    pub flags: ::core::ffi::c_uint,
    pub alias: CUdeviceptr,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1 {
    pub value: cuuint32_t,
    pub value64: cuuint64_t,
}
impl Default
for CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st__bindgen_ty_1 {
    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 CUstreamBatchMemOpParams_union_CUstreamMemOpWriteValueParams_st {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpFlushRemoteWritesParams_st {
    pub operation: CUstreamBatchMemOpType,
    pub flags: ::core::ffi::c_uint,
}
impl Default for CUstreamBatchMemOpParams_union_CUstreamMemOpFlushRemoteWritesParams_st {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpMemoryBarrierParams_st {
    pub operation: CUstreamBatchMemOpType,
    pub flags: ::core::ffi::c_uint,
}
impl Default for CUstreamBatchMemOpParams_union_CUstreamMemOpMemoryBarrierParams_st {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUstreamBatchMemOpParams_union_CUstreamMemOpAtomicReductionParams_st {
    pub operation: CUstreamBatchMemOpType,
    pub flags: ::core::ffi::c_uint,
    pub reductionOp: CUstreamAtomicReductionOpType,
    pub dataType: CUstreamAtomicReductionDataType,
    pub address: CUdeviceptr,
    pub value: cuuint64_t,
    pub alias: CUdeviceptr,
}
impl Default for CUstreamBatchMemOpParams_union_CUstreamMemOpAtomicReductionParams_st {
    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 CUstreamBatchMemOpParams_union {
    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()
        }
    }
}
/// Per-operation parameters for [`cuStreamBatchMemOp_v2`].
pub type CUstreamBatchMemOpParams_v1 = CUstreamBatchMemOpParams_union;
pub type CUstreamBatchMemOpParams = CUstreamBatchMemOpParams_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st {
    pub ctx: CUcontext,
    pub count: ::core::ffi::c_uint,
    pub paramArray: *mut CUstreamBatchMemOpParams,
    pub flags: ::core::ffi::c_uint,
}
impl Default for CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st {
    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()
        }
    }
}
/// Batch memory operation node parameters
///
/// Used in the legacy [`cuGraphAddBatchMemOpNode`] api. New code should use [`cuGraphAddNode_v2`].
pub type CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 = CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st;
pub type CUDA_BATCH_MEM_OP_NODE_PARAMS = CUDA_BATCH_MEM_OP_NODE_PARAMS_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st {
    pub ctx: CUcontext,
    pub count: ::core::ffi::c_uint,
    pub paramArray: *mut CUstreamBatchMemOpParams,
    pub flags: ::core::ffi::c_uint,
}
impl Default for CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st {
    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 CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 = CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st;
/// Occupancy calculator flag.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUoccupancy_flags_enum {
    /// Default behavior.
    CU_OCCUPANCY_DEFAULT = 0,
    /// Assume global caching is enabled and cannot be automatically turned off.
    CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE = 1,
}
pub use self::CUoccupancy_flags_enum as CUoccupancy_flags;
/// Flags for [`cuStreamUpdateCaptureDependencies_v2`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUstreamUpdateCaptureDependencies_flags_enum {
    /// Add new nodes to the dependency set.
    CU_STREAM_ADD_CAPTURE_DEPENDENCIES = 0,
    /// Replace the dependency set with the new nodes.
    CU_STREAM_SET_CAPTURE_DEPENDENCIES = 1,
}
pub use self::CUstreamUpdateCaptureDependencies_flags_enum as CUstreamUpdateCaptureDependencies_flags;
/// Types of async notification that can be sent.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUasyncNotificationType_enum {
    /// Sent when the process has exceeded its device memory budget.
    CU_ASYNC_NOTIFICATION_TYPE_OVER_BUDGET = 1,
}
pub use self::CUasyncNotificationType_enum as CUasyncNotificationType;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUasyncNotificationInfo_st {
    pub type_: CUasyncNotificationType,
    pub info: CUasyncNotificationInfo_st__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUasyncNotificationInfo_st__bindgen_ty_1 {
    pub overBudget: CUasyncNotificationInfo_st__bindgen_ty_1__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUasyncNotificationInfo_st__bindgen_ty_1__bindgen_ty_1 {
    pub bytesOverBudget: ::core::ffi::c_ulonglong,
}
impl Default for CUasyncNotificationInfo_st__bindgen_ty_1 {
    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 CUasyncNotificationInfo_st {
    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()
        }
    }
}
/// Information passed to the user via the async notification callback.
pub type CUasyncNotificationInfo = CUasyncNotificationInfo_st;
/// CUDA async notification callback.
pub type CUasyncCallback = ::core::option::Option<
    unsafe extern "C" fn(
        info: *mut CUasyncNotificationInfo,
        userData: *mut ::core::ffi::c_void,
        callback: CUasyncCallbackHandle,
    ),
>;
/// Array formats.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUarray_format_enum {
    /// Unsigned 8-bit integers.
    CU_AD_FORMAT_UNSIGNED_INT8 = 1,
    /// Unsigned 16-bit integers.
    CU_AD_FORMAT_UNSIGNED_INT16 = 2,
    /// Unsigned 32-bit integers.
    CU_AD_FORMAT_UNSIGNED_INT32 = 3,
    /// Signed 8-bit integers.
    CU_AD_FORMAT_SIGNED_INT8 = 8,
    /// Signed 16-bit integers.
    CU_AD_FORMAT_SIGNED_INT16 = 9,
    /// Signed 32-bit integers.
    CU_AD_FORMAT_SIGNED_INT32 = 10,
    /// 16-bit floating point.
    CU_AD_FORMAT_HALF = 16,
    /// 32-bit floating point.
    CU_AD_FORMAT_FLOAT = 32,
    /// 8-bit YUV planar format, with 4:2:0 sampling.
    CU_AD_FORMAT_NV12 = 176,
    /// 1 channel unsigned 8-bit normalized integer.
    CU_AD_FORMAT_UNORM_INT8X1 = 192,
    /// 2 channel unsigned 8-bit normalized integer.
    CU_AD_FORMAT_UNORM_INT8X2 = 193,
    /// 4 channel unsigned 8-bit normalized integer.
    CU_AD_FORMAT_UNORM_INT8X4 = 194,
    /// 1 channel unsigned 16-bit normalized integer.
    CU_AD_FORMAT_UNORM_INT16X1 = 195,
    /// 2 channel unsigned 16-bit normalized integer.
    CU_AD_FORMAT_UNORM_INT16X2 = 196,
    /// 4 channel unsigned 16-bit normalized integer.
    CU_AD_FORMAT_UNORM_INT16X4 = 197,
    /// 1 channel signed 8-bit normalized integer.
    CU_AD_FORMAT_SNORM_INT8X1 = 198,
    /// 2 channel signed 8-bit normalized integer.
    CU_AD_FORMAT_SNORM_INT8X2 = 199,
    /// 4 channel signed 8-bit normalized integer.
    CU_AD_FORMAT_SNORM_INT8X4 = 200,
    /// 1 channel signed 16-bit normalized integer.
    CU_AD_FORMAT_SNORM_INT16X1 = 201,
    /// 2 channel signed 16-bit normalized integer.
    CU_AD_FORMAT_SNORM_INT16X2 = 202,
    /// 4 channel signed 16-bit normalized integer.
    CU_AD_FORMAT_SNORM_INT16X4 = 203,
    /// 4 channel unsigned normalized block-compressed (BC1 compression) format.
    CU_AD_FORMAT_BC1_UNORM = 145,
    /// 4 channel unsigned normalized block-compressed (BC1 compression) format with sRGB encoding.
    CU_AD_FORMAT_BC1_UNORM_SRGB = 146,
    /// 4 channel unsigned normalized block-compressed (BC2 compression) format.
    CU_AD_FORMAT_BC2_UNORM = 147,
    /// 4 channel unsigned normalized block-compressed (BC2 compression) format with sRGB encoding.
    CU_AD_FORMAT_BC2_UNORM_SRGB = 148,
    /// 4 channel unsigned normalized block-compressed (BC3 compression) format.
    CU_AD_FORMAT_BC3_UNORM = 149,
    /// 4 channel unsigned normalized block-compressed (BC3 compression) format with sRGB encoding.
    CU_AD_FORMAT_BC3_UNORM_SRGB = 150,
    /// 1 channel unsigned normalized block-compressed (BC4 compression) format.
    CU_AD_FORMAT_BC4_UNORM = 151,
    /// 1 channel signed normalized block-compressed (BC4 compression) format.
    CU_AD_FORMAT_BC4_SNORM = 152,
    /// 2 channel unsigned normalized block-compressed (BC5 compression) format.
    CU_AD_FORMAT_BC5_UNORM = 153,
    /// 2 channel signed normalized block-compressed (BC5 compression) format.
    CU_AD_FORMAT_BC5_SNORM = 154,
    /// 3 channel unsigned half-float block-compressed (BC6H compression) format.
    CU_AD_FORMAT_BC6H_UF16 = 155,
    /// 3 channel signed half-float block-compressed (BC6H compression) format.
    CU_AD_FORMAT_BC6H_SF16 = 156,
    /// 4 channel unsigned normalized block-compressed (BC7 compression) format.
    CU_AD_FORMAT_BC7_UNORM = 157,
    /// 4 channel unsigned normalized block-compressed (BC7 compression) format with sRGB encoding.
    CU_AD_FORMAT_BC7_UNORM_SRGB = 158,
    /// 10-bit YUV planar format, with 4:2:0 sampling.
    CU_AD_FORMAT_P010 = 159,
    /// 16-bit YUV planar format, with 4:2:0 sampling.
    CU_AD_FORMAT_P016 = 161,
    /// 8-bit YUV planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_NV16 = 162,
    /// 10-bit YUV planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_P210 = 163,
    /// 16-bit YUV planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_P216 = 164,
    /// 2 channel, 8-bit YUV packed planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_YUY2 = 165,
    /// 2 channel, 10-bit YUV packed planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_Y210 = 166,
    /// 2 channel, 16-bit YUV packed planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_Y216 = 167,
    /// 4 channel, 8-bit YUV packed planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_AYUV = 168,
    /// 10-bit YUV packed planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_Y410 = 169,
    /// 4 channel, 12-bit YUV packed planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_Y416 = 177,
    /// 3 channel 8-bit YUV planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_Y444_PLANAR8 = 178,
    /// 3 channel 10-bit YUV planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_Y444_PLANAR10 = 179,
    /// 3 channel 8-bit YUV semi-planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 180,
    /// 3 channel 16-bit YUV semi-planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 181,
    /// 4 channel unorm R10G10B10A2 RGB format.
    CU_AD_FORMAT_UNORM_INT_101010_2 = 80,
    /// 4 channel unsigned 8-bit YUV packed format, with 4:2:2 sampling.
    CU_AD_FORMAT_UINT8_PACKED_422 = 81,
    /// 4 channel unsigned 8-bit YUV packed format, with 4:4:4 sampling.
    CU_AD_FORMAT_UINT8_PACKED_444 = 82,
    /// 3 channel unsigned 8-bit YUV semi-planar format, with 4:2:0 sampling.
    CU_AD_FORMAT_UINT8_SEMIPLANAR_420 = 83,
    /// 3 channel unsigned 16-bit YUV semi-planar format, with 4:2:0 sampling.
    CU_AD_FORMAT_UINT16_SEMIPLANAR_420 = 84,
    /// 3 channel unsigned 8-bit YUV semi-planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_UINT8_SEMIPLANAR_422 = 85,
    /// 3 channel unsigned 16-bit YUV semi-planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_UINT16_SEMIPLANAR_422 = 86,
    /// 3 channel unsigned 8-bit YUV semi-planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_UINT8_SEMIPLANAR_444 = 87,
    /// 3 channel unsigned 16-bit YUV semi-planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_UINT16_SEMIPLANAR_444 = 88,
    /// 3 channel unsigned 8-bit YUV planar format, with 4:2:0 sampling.
    CU_AD_FORMAT_UINT8_PLANAR_420 = 89,
    /// 3 channel unsigned 16-bit YUV planar format, with 4:2:0 sampling.
    CU_AD_FORMAT_UINT16_PLANAR_420 = 90,
    /// 3 channel unsigned 8-bit YUV planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_UINT8_PLANAR_422 = 91,
    /// 3 channel unsigned 16-bit YUV planar format, with 4:2:2 sampling.
    CU_AD_FORMAT_UINT16_PLANAR_422 = 92,
    /// 3 channel unsigned 8-bit YUV planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_UINT8_PLANAR_444 = 93,
    /// 3 channel unsigned 16-bit YUV planar format, with 4:4:4 sampling.
    CU_AD_FORMAT_UINT16_PLANAR_444 = 94,
    CU_AD_FORMAT_MAX = 2147483647,
}
pub use self::CUarray_format_enum as CUarray_format;
/// Texture reference addressing modes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUaddress_mode_enum {
    /// Wrapping address mode.
    CU_TR_ADDRESS_MODE_WRAP = 0,
    /// Clamp to edge address mode.
    CU_TR_ADDRESS_MODE_CLAMP = 1,
    /// Mirror address mode.
    CU_TR_ADDRESS_MODE_MIRROR = 2,
    /// Border address mode.
    CU_TR_ADDRESS_MODE_BORDER = 3,
}
pub use self::CUaddress_mode_enum as CUaddress_mode;
/// Texture reference filtering modes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUfilter_mode_enum {
    /// Point filter mode.
    CU_TR_FILTER_MODE_POINT = 0,
    /// Linear filter mode.
    CU_TR_FILTER_MODE_LINEAR = 1,
}
pub use self::CUfilter_mode_enum as CUfilter_mode;
impl CUdevice_attribute_enum {
    pub const CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK;
}
impl CUdevice_attribute_enum {
    pub const CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK: CUdevice_attribute_enum = CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK;
}
impl CUdevice_attribute_enum {
    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH: CUdevice_attribute_enum = CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH;
}
impl CUdevice_attribute_enum {
    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT: CUdevice_attribute_enum = CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT;
}
impl CUdevice_attribute_enum {
    pub const CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES: CUdevice_attribute_enum = CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS;
}
impl CUdevice_attribute_enum {
    pub const CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED: CUdevice_attribute_enum = CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED;
}
/// Device properties.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUdevice_attribute_enum {
    /// Maximum number of threads per block.
    CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 1,
    /// Maximum block dimension X.
    CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_X = 2,
    /// Maximum block dimension Y.
    CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Y = 3,
    /// Maximum block dimension Z.
    CU_DEVICE_ATTRIBUTE_MAX_BLOCK_DIM_Z = 4,
    /// Maximum grid dimension X.
    CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_X = 5,
    /// Maximum grid dimension Y.
    CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Y = 6,
    /// Maximum grid dimension Z.
    CU_DEVICE_ATTRIBUTE_MAX_GRID_DIM_Z = 7,
    /// Maximum shared memory available per block in bytes.
    CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK = 8,
    /// Memory available on device for __constant__ variables in a CUDA C kernel in bytes.
    CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY = 9,
    /// Warp size in threads.
    CU_DEVICE_ATTRIBUTE_WARP_SIZE = 10,
    /// Maximum pitch in bytes allowed by memory copies.
    CU_DEVICE_ATTRIBUTE_MAX_PITCH = 11,
    /// Maximum number of 32-bit registers available per block.
    CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK = 12,
    /// Typical clock frequency in kilohertz.
    CU_DEVICE_ATTRIBUTE_CLOCK_RATE = 13,
    /// Alignment requirement for textures.
    CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT = 14,
    /// Device can possibly copy memory and execute a kernel concurrently. Deprecated. Use instead [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT`].
    #[deprecated]
    CU_DEVICE_ATTRIBUTE_GPU_OVERLAP = 15,
    /// Number of multiprocessors on device.
    CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT = 16,
    /// Specifies whether there is a run time limit on kernels.
    CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT = 17,
    /// Device is integrated with host memory.
    CU_DEVICE_ATTRIBUTE_INTEGRATED = 18,
    /// Device can map host memory into CUDA address space.
    CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY = 19,
    /// Compute mode (See `CUcomputemode` for details).
    CU_DEVICE_ATTRIBUTE_COMPUTE_MODE = 20,
    /// Maximum 1D texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH = 21,
    /// Maximum 2D texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_WIDTH = 22,
    /// Maximum 2D texture height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_HEIGHT = 23,
    /// Maximum 3D texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH = 24,
    /// Maximum 3D texture height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT = 25,
    /// Maximum 3D texture depth.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH = 26,
    /// Maximum 2D layered texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH = 27,
    /// Maximum 2D layered texture height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT = 28,
    /// Maximum layers in a 2D layered texture.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS = 29,
    /// Alignment requirement for surfaces.
    CU_DEVICE_ATTRIBUTE_SURFACE_ALIGNMENT = 30,
    /// Device can possibly execute multiple kernels concurrently.
    CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS = 31,
    /// Device has ECC support enabled.
    CU_DEVICE_ATTRIBUTE_ECC_ENABLED = 32,
    /// PCI bus ID of the device.
    CU_DEVICE_ATTRIBUTE_PCI_BUS_ID = 33,
    /// PCI device ID of the device.
    CU_DEVICE_ATTRIBUTE_PCI_DEVICE_ID = 34,
    /// Device is using TCC driver model.
    CU_DEVICE_ATTRIBUTE_TCC_DRIVER = 35,
    /// Peak memory clock frequency in kilohertz.
    CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE = 36,
    /// Global memory bus width in bits.
    CU_DEVICE_ATTRIBUTE_GLOBAL_MEMORY_BUS_WIDTH = 37,
    /// Size of L2 cache in bytes.
    CU_DEVICE_ATTRIBUTE_L2_CACHE_SIZE = 38,
    /// Maximum resident threads per multiprocessor.
    CU_DEVICE_ATTRIBUTE_MAX_THREADS_PER_MULTIPROCESSOR = 39,
    /// Number of asynchronous engines.
    CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT = 40,
    /// Device shares a unified address space with the host.
    CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING = 41,
    /// Maximum 1D layered texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_WIDTH = 42,
    /// Maximum layers in a 1D layered texture.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LAYERED_LAYERS = 43,
    /// do not use.
    #[deprecated]
    CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER = 44,
    /// Maximum 2D texture width if CUDA_ARRAY3D_TEXTURE_GATHER is set.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH = 45,
    /// Maximum 2D texture height if CUDA_ARRAY3D_TEXTURE_GATHER is set.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT = 46,
    /// Alternate maximum 3D texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_WIDTH_ALTERNATE = 47,
    /// Alternate maximum 3D texture height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_HEIGHT_ALTERNATE = 48,
    /// Alternate maximum 3D texture depth.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE3D_DEPTH_ALTERNATE = 49,
    /// PCI domain ID of the device.
    CU_DEVICE_ATTRIBUTE_PCI_DOMAIN_ID = 50,
    /// Pitch alignment requirement for textures.
    CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT = 51,
    /// Maximum cubemap texture width/height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_WIDTH = 52,
    /// Maximum cubemap layered texture width/height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_WIDTH = 53,
    /// Maximum layers in a cubemap layered texture.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURECUBEMAP_LAYERED_LAYERS = 54,
    /// Maximum 1D surface width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_WIDTH = 55,
    /// Maximum 2D surface width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_WIDTH = 56,
    /// Maximum 2D surface height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_HEIGHT = 57,
    /// Maximum 3D surface width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_WIDTH = 58,
    /// Maximum 3D surface height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_HEIGHT = 59,
    /// Maximum 3D surface depth.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE3D_DEPTH = 60,
    /// Maximum 1D layered surface width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_WIDTH = 61,
    /// Maximum layers in a 1D layered surface.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE1D_LAYERED_LAYERS = 62,
    /// Maximum 2D layered surface width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_WIDTH = 63,
    /// Maximum 2D layered surface height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_HEIGHT = 64,
    /// Maximum layers in a 2D layered surface.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACE2D_LAYERED_LAYERS = 65,
    /// Maximum cubemap surface width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_WIDTH = 66,
    /// Maximum cubemap layered surface width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_WIDTH = 67,
    /// Maximum layers in a cubemap layered surface.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_SURFACECUBEMAP_LAYERED_LAYERS = 68,
    /// do not use. Use [cudaDeviceGetTexture1DLinearMaxWidth()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g45f0345fd7a3697d0766596593920f61) or [`cuDeviceGetTexture1DLinearMaxWidth`] instead.
    #[deprecated]
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH = 69,
    /// Maximum 2D linear texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH = 70,
    /// Maximum 2D linear texture height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT = 71,
    /// Maximum 2D linear texture pitch in bytes.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH = 72,
    /// Maximum mipmapped 2D texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_WIDTH = 73,
    /// Maximum mipmapped 2D texture height.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_MIPMAPPED_HEIGHT = 74,
    /// Major compute capability version number.
    CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR = 75,
    /// Minor compute capability version number.
    CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR = 76,
    /// Maximum mipmapped 1D texture width.
    CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH = 77,
    /// Device supports stream priorities.
    CU_DEVICE_ATTRIBUTE_STREAM_PRIORITIES_SUPPORTED = 78,
    /// Device supports caching globals in L1.
    CU_DEVICE_ATTRIBUTE_GLOBAL_L1_CACHE_SUPPORTED = 79,
    /// Device supports caching locals in L1.
    CU_DEVICE_ATTRIBUTE_LOCAL_L1_CACHE_SUPPORTED = 80,
    /// Maximum shared memory available per multiprocessor in bytes.
    CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR = 81,
    /// Maximum number of 32-bit registers available per multiprocessor.
    CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_MULTIPROCESSOR = 82,
    /// Device can allocate managed memory on this system.
    CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY = 83,
    /// Device is on a multi-GPU board.
    CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD = 84,
    /// Unique id for a group of devices on the same multi-GPU board.
    CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD_GROUP_ID = 85,
    /// Link between the device and the host supports all native atomic operations.
    CU_DEVICE_ATTRIBUTE_HOST_NATIVE_ATOMIC_SUPPORTED = 86,
    /// Ratio of single precision performance (in floating-point operations per second) to double precision performance.
    CU_DEVICE_ATTRIBUTE_SINGLE_TO_DOUBLE_PRECISION_PERF_RATIO = 87,
    /// Device supports coherently accessing pageable memory without calling cudaHostRegister on it.
    CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS = 88,
    /// Device can coherently access managed memory concurrently with the CPU.
    CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS = 89,
    /// Device supports compute preemption.
    CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED = 90,
    /// Device can access host registered memory at the same virtual address as the CPU.
    CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM = 91,
    /// along with v1 MemOps API, [`cuStreamBatchMemOp_v2`] and related APIs are supported.
    #[deprecated]
    CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_MEM_OPS_V1 = 92,
    /// along with v1 MemOps API, 64-bit operations are supported in [`cuStreamBatchMemOp_v2`] and related APIs.
    #[deprecated]
    CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS_V1 = 93,
    /// along with v1 MemOps API, CU_STREAM_WAIT_VALUE_NOR is supported.
    #[deprecated]
    CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V1 = 94,
    /// Device supports launching cooperative kernels via [`cuLaunchCooperativeKernel`].
    CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH = 95,
    /// [`cuLaunchCooperativeKernelMultiDevice`] is deprecated.
    #[deprecated]
    CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH = 96,
    /// Maximum optin shared memory per block.
    CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN = 97,
    /// The CU_STREAM_WAIT_VALUE_FLUSH flag and the CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES MemOp are supported on the device. See [Stream Memory Operations](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-memory-operations.html#group__CUDA__MEMOP) for additional details.
    CU_DEVICE_ATTRIBUTE_CAN_FLUSH_REMOTE_WRITES = 98,
    /// Device supports host memory registration via [cudaHostRegister](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1ge8d5c17670f16ac4fc8fcb4181cb490c).
    CU_DEVICE_ATTRIBUTE_HOST_REGISTER_SUPPORTED = 99,
    /// Device accesses pageable memory via the host's page tables.
    CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES = 100,
    /// The host can directly access managed memory on the device without migration.
    CU_DEVICE_ATTRIBUTE_DIRECT_MANAGED_MEM_ACCESS_FROM_HOST = 101,
    /// Use [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED`].
    #[deprecated]
    CU_DEVICE_ATTRIBUTE_VIRTUAL_ADDRESS_MANAGEMENT_SUPPORTED = 102,
    /// Device supports exporting memory to a posix file descriptor with [`cuMemExportToShareableHandle`], if requested via [`cuMemCreate`].
    CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR_SUPPORTED = 103,
    /// Device supports exporting memory to a Win32 NT handle with [`cuMemExportToShareableHandle`], if requested via [`cuMemCreate`].
    CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_HANDLE_SUPPORTED = 104,
    /// Device supports exporting memory to a Win32 KMT handle with [`cuMemExportToShareableHandle`], if requested via [`cuMemCreate`].
    CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_WIN32_KMT_HANDLE_SUPPORTED = 105,
    /// Maximum number of blocks per multiprocessor.
    CU_DEVICE_ATTRIBUTE_MAX_BLOCKS_PER_MULTIPROCESSOR = 106,
    /// Device supports compression of memory.
    CU_DEVICE_ATTRIBUTE_GENERIC_COMPRESSION_SUPPORTED = 107,
    /// Maximum L2 persisting lines capacity setting in bytes.
    CU_DEVICE_ATTRIBUTE_MAX_PERSISTING_L2_CACHE_SIZE = 108,
    /// Maximum value of [CUaccessPolicyWindow::num_bytes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUaccessPolicyWindow__v1.html#structCUaccessPolicyWindow__v1_179ee4c983788bc68605d42aee2701eec).
    CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE = 109,
    /// Device supports specifying the GPUDirect RDMA flag with [`cuMemCreate`].
    CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_CUDA_VMM_SUPPORTED = 110,
    /// Shared memory reserved by CUDA driver per block in bytes.
    CU_DEVICE_ATTRIBUTE_RESERVED_SHARED_MEMORY_PER_BLOCK = 111,
    /// Device supports sparse CUDA arrays and sparse CUDA mipmapped arrays.
    CU_DEVICE_ATTRIBUTE_SPARSE_CUDA_ARRAY_SUPPORTED = 112,
    /// Device supports using the [`cuMemHostRegister_v2`] flag CU_MEMHOSTERGISTER_READ_ONLY to register memory that must be mapped as read-only to the GPU.
    CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED = 113,
    /// External timeline semaphore interop is supported on the device.
    CU_DEVICE_ATTRIBUTE_TIMELINE_SEMAPHORE_INTEROP_SUPPORTED = 114,
    /// Device supports using the [`cuMemAllocAsync`] and cuMemPool family of APIs.
    CU_DEVICE_ATTRIBUTE_MEMORY_POOLS_SUPPORTED = 115,
    /// Device supports GPUDirect RDMA APIs, like nvidia_p2p_get_pages (see <https://docs.nvidia.com/cuda/gpudirect-rdma> for more information).
    CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_SUPPORTED = 116,
    /// The returned attribute shall be interpreted as a bitmask, where the individual bits are described by the `CUflushGPUDirectRDMAWritesOptions` enum.
    CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS = 117,
    /// GPUDirect RDMA writes to the device do not need to be flushed for consumers within the scope indicated by the returned attribute.
    /// See `CUGPUDirectRDMAWritesOrdering` for the numerical values returned here.
    CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING = 118,
    /// Handle types supported with mempool based IPC.
    CU_DEVICE_ATTRIBUTE_MEMPOOL_SUPPORTED_HANDLE_TYPES = 119,
    /// Indicates device supports cluster launch.
    CU_DEVICE_ATTRIBUTE_CLUSTER_LAUNCH = 120,
    /// Device supports deferred mapping CUDA arrays and CUDA mipmapped arrays.
    CU_DEVICE_ATTRIBUTE_DEFERRED_MAPPING_CUDA_ARRAY_SUPPORTED = 121,
    /// 64-bit operations are supported in [`cuStreamBatchMemOp_v2`] and related MemOp APIs.
    CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS = 122,
    /// CU_STREAM_WAIT_VALUE_NOR is supported by MemOp APIs.
    CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR = 123,
    /// Device supports buffer sharing with dma_buf mechanism.
    CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED = 124,
    /// Device supports IPC Events.
    CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED = 125,
    /// Number of memory domains the device supports.
    CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT = 126,
    /// Device supports accessing memory using Tensor Map.
    CU_DEVICE_ATTRIBUTE_TENSOR_MAP_ACCESS_SUPPORTED = 127,
    /// Device supports exporting memory to a fabric handle with [`cuMemExportToShareableHandle`] or requested with [`cuMemCreate`].
    CU_DEVICE_ATTRIBUTE_HANDLE_TYPE_FABRIC_SUPPORTED = 128,
    /// Device supports unified function pointers.
    CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS = 129,
    /// NUMA configuration of a device: value is of type `CUdeviceNumaConfig` enum.
    CU_DEVICE_ATTRIBUTE_NUMA_CONFIG = 130,
    /// NUMA node ID of the GPU memory.
    CU_DEVICE_ATTRIBUTE_NUMA_ID = 131,
    /// Device supports switch multicast and reduction operations.
    CU_DEVICE_ATTRIBUTE_MULTICAST_SUPPORTED = 132,
    /// Indicates if contexts created on this device will be shared via MPS.
    CU_DEVICE_ATTRIBUTE_MPS_ENABLED = 133,
    /// NUMA ID of the host node closest to the device. Returns -1 when system does not support NUMA.
    CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID = 134,
    /// Device supports CIG with D3D12.
    CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED = 135,
    /// The returned valued shall be interpreted as a bitmask, where the individual bits are described by the `CUmemDecompressAlgorithm` enum.
    CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_ALGORITHM_MASK = 136,
    /// The returned valued is the maximum length in bytes of a single decompress operation that is allowed.
    CU_DEVICE_ATTRIBUTE_MEM_DECOMPRESS_MAXIMUM_LENGTH = 137,
    /// Device supports CIG with Vulkan.
    CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED = 138,
    /// The combined 16-bit PCI device ID and 16-bit PCI vendor ID.
    CU_DEVICE_ATTRIBUTE_GPU_PCI_DEVICE_ID = 139,
    /// The combined 16-bit PCI subsystem ID and 16-bit PCI subsystem vendor ID.
    CU_DEVICE_ATTRIBUTE_GPU_PCI_SUBSYSTEM_ID = 140,
    /// Device supports HOST_NUMA location with the virtual memory management APIs like [`cuMemCreate`], [`cuMemMap`] and related APIs.
    CU_DEVICE_ATTRIBUTE_HOST_NUMA_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 141,
    /// Device supports HOST_NUMA location with the [`cuMemAllocAsync`] and cuMemPool family of APIs.
    CU_DEVICE_ATTRIBUTE_HOST_NUMA_MEMORY_POOLS_SUPPORTED = 142,
    /// Device supports HOST_NUMA location IPC between nodes in a multi-node system.
    CU_DEVICE_ATTRIBUTE_HOST_NUMA_MULTINODE_IPC_SUPPORTED = 143,
    /// Device suports HOST location with the [`cuMemAllocAsync`] and cuMemPool family of APIs.
    CU_DEVICE_ATTRIBUTE_HOST_MEMORY_POOLS_SUPPORTED = 144,
    /// Device supports HOST location with the virtual memory management APIs like [`cuMemCreate`], [`cuMemMap`] and related APIs.
    CU_DEVICE_ATTRIBUTE_HOST_VIRTUAL_MEMORY_MANAGEMENT_SUPPORTED = 145,
    /// Device supports page-locked host memory buffer sharing with dma_buf mechanism.
    CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED = 146,
    /// Link between the device and the host supports only some native atomic operations.
    CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED = 147,
    /// Device supports atomic reduction operations in stream batch memory operations.
    CU_DEVICE_ATTRIBUTE_ATOMIC_REDUCTION_SUPPORTED = 148,
    CU_DEVICE_ATTRIBUTE_MAX = 149,
}
pub use self::CUdevice_attribute_enum as CUdevice_attribute;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUdevprop_st {
    pub maxThreadsPerBlock: ::core::ffi::c_int,
    pub maxThreadsDim: [::core::ffi::c_int; 3usize],
    pub maxGridSize: [::core::ffi::c_int; 3usize],
    pub sharedMemPerBlock: ::core::ffi::c_int,
    pub totalConstantMemory: ::core::ffi::c_int,
    pub SIMDWidth: ::core::ffi::c_int,
    pub memPitch: ::core::ffi::c_int,
    pub regsPerBlock: ::core::ffi::c_int,
    pub clockRate: ::core::ffi::c_int,
    pub textureAlign: ::core::ffi::c_int,
}
/// Legacy device properties.
pub type CUdevprop_v1 = CUdevprop_st;
pub type CUdevprop = CUdevprop_v1;
/// Pointer information.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUpointer_attribute_enum {
    /// The [`CUcontext`] on which a pointer was allocated or registered.
    CU_POINTER_ATTRIBUTE_CONTEXT = 1,
    /// The `CUmemorytype` describing the physical location of a pointer.
    CU_POINTER_ATTRIBUTE_MEMORY_TYPE = 2,
    /// The address at which a pointer's memory may be accessed on the device.
    CU_POINTER_ATTRIBUTE_DEVICE_POINTER = 3,
    /// The address at which a pointer's memory may be accessed on the host.
    CU_POINTER_ATTRIBUTE_HOST_POINTER = 4,
    /// A pair of tokens for use with the nv-p2p.h Linux kernel interface.
    CU_POINTER_ATTRIBUTE_P2P_TOKENS = 5,
    /// Synchronize every synchronous memory operation initiated on this region.
    CU_POINTER_ATTRIBUTE_SYNC_MEMOPS = 6,
    /// A process-wide unique ID for an allocated memory region.
    CU_POINTER_ATTRIBUTE_BUFFER_ID = 7,
    /// Indicates if the pointer points to managed memory.
    CU_POINTER_ATTRIBUTE_IS_MANAGED = 8,
    /// A device ordinal of a device on which a pointer was allocated or registered.
    CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL = 9,
    /// 1 if this pointer maps to an allocation that is suitable for [cudaIpcGetMemHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g8a37f7dfafaca652391d0758b3667539), 0 otherwise.
    CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE = 10,
    /// Starting address for this requested pointer.
    CU_POINTER_ATTRIBUTE_RANGE_START_ADDR = 11,
    /// Size of the address range for this requested pointer.
    CU_POINTER_ATTRIBUTE_RANGE_SIZE = 12,
    /// 1 if this pointer is in a valid address range that is mapped to a backing allocation, 0 otherwise.
    CU_POINTER_ATTRIBUTE_MAPPED = 13,
    /// Bitmask of allowed `CUmemAllocationHandleType` for this allocation.
    CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES = 14,
    /// 1 if the memory this pointer is referencing can be used with the GPUDirect RDMA API.
    CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE = 15,
    /// Returns the access flags the device associated with the current context has on the corresponding memory referenced by the
    /// pointer given.
    CU_POINTER_ATTRIBUTE_ACCESS_FLAGS = 16,
    /// Returns the mempool handle for the allocation if it was allocated from a mempool. Otherwise returns NULL.
    CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE = 17,
    /// Size of the actual underlying mapping that the pointer belongs to.
    CU_POINTER_ATTRIBUTE_MAPPING_SIZE = 18,
    /// The start address of the mapping that the pointer belongs to.
    CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR = 19,
    /// A process-wide unique id corresponding to the physical allocation the pointer belongs to.
    CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID = 20,
    /// Returns in \*data a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression.
    CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE = 21,
}
pub use self::CUpointer_attribute_enum as CUpointer_attribute;
/// Function properties.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUfunction_attribute_enum {
    /// The maximum number of threads per block, beyond which a launch of the function would fail. This number depends on both the
    /// function and the device on which the function is currently loaded.
    CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK = 0,
    /// The size in bytes of statically-allocated shared memory required by this function. This does not include dynamically-allocated
    /// shared memory requested by the user at runtime.
    CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES = 1,
    /// The size in bytes of user-allocated constant memory required by this function.
    CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES = 2,
    /// The size in bytes of local memory used by each thread of this function.
    CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES = 3,
    /// The number of registers used by each thread of this function.
    CU_FUNC_ATTRIBUTE_NUM_REGS = 4,
    /// The PTX virtual architecture version for which the function was compiled. This value is the major PTX version \* 10 + the minor
    /// PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for
    /// cubins compiled prior to CUDA 3.0.
    CU_FUNC_ATTRIBUTE_PTX_VERSION = 5,
    /// The binary architecture version for which the function was compiled. This value is the major binary version \* 10 + the minor
    /// binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy
    /// cubins that do not have a properly-encoded binary architecture version.
    CU_FUNC_ATTRIBUTE_BINARY_VERSION = 6,
    /// The attribute to indicate whether the function has been compiled with user specified option "-Xptxas --dlcm=ca" set .
    CU_FUNC_ATTRIBUTE_CACHE_MODE_CA = 7,
    /// The maximum size in bytes of dynamically-allocated shared memory that can be used by this function. If the user-specified
    /// dynamic shared memory size is larger than this value, the launch will fail. The default value of this attribute is CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK - CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES, except when CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES is greater than CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK, then the default value of this attribute is 0. The value can be increased to CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN - CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES. See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
    CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES = 8,
    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference,
    /// in percent of the total shared memory. Refer to CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR. This is only a hint, and the driver can choose a different ratio if required to execute the function. See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
    CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 9,
    /// If this attribute is set, the kernel must launch with a valid cluster size specified. See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
    CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET = 10,
    /// The required cluster width in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions
    /// is otherwise checked at launch time.If the value is set during compile time, it cannot be set at runtime. Setting it at runtime
    /// will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`]. See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
    CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH = 11,
    /// The required cluster height in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions
    /// is otherwise checked at launch time.If the value is set during compile time, it cannot be set at runtime. Setting it at runtime
    /// should return [`CUresult::CUDA_ERROR_NOT_PERMITTED`]. See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
    CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT = 12,
    /// The required cluster depth in blocks. The values must either all be 0 or all be positive. The validity of the cluster dimensions
    /// is otherwise checked at launch time.If the value is set during compile time, it cannot be set at runtime. Setting it at runtime
    /// should return [`CUresult::CUDA_ERROR_NOT_PERMITTED`]. See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
    CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH = 13,
    /// Whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable cluster
    /// size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run on a different
    /// hardware platform.CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired size can be
    /// launched on the current device.Portable Cluster SizeA portable cluster size is guaranteed to be functional on all compute
    /// capabilities higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This
    /// value may increase for future compute capabilities.The specific hardware unit may support higher cluster sizes that’s not
    /// guaranteed to be portable. See [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
    CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED = 14,
    /// The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy / cudaClusterSchedulingPolicy. See
    /// [`cuFuncSetAttribute`], [`cuKernelSetAttribute`].
    CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 15,
    CU_FUNC_ATTRIBUTE_MAX = 16,
}
pub use self::CUfunction_attribute_enum as CUfunction_attribute;
/// Function cache configurations.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUfunc_cache_enum {
    /// no preference for shared memory or L1 (default).
    CU_FUNC_CACHE_PREFER_NONE = 0,
    /// prefer larger shared memory and smaller L1 cache.
    CU_FUNC_CACHE_PREFER_SHARED = 1,
    /// prefer larger L1 cache and smaller shared memory.
    CU_FUNC_CACHE_PREFER_L1 = 2,
    /// prefer equal sized L1 cache and shared memory.
    CU_FUNC_CACHE_PREFER_EQUAL = 3,
}
pub use self::CUfunc_cache_enum as CUfunc_cache;
/// Shared memory configurations.
#[deprecated]
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUsharedconfig_enum {
    /// set default shared memory bank size.
    #[deprecated]
    CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE = 0,
    /// set shared memory bank width to four bytes.
    #[deprecated]
    CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE = 1,
    /// set shared memory bank width to eight bytes.
    #[deprecated]
    CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE = 2,
}
pub use self::CUsharedconfig_enum as CUsharedconfig;
/// Shared memory carveout configurations. These may be passed to [`cuFuncSetAttribute`] or [`cuKernelSetAttribute`].
#[repr(i32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUshared_carveout_enum {
    /// No preference for shared memory or L1 (default).
    CU_SHAREDMEM_CARVEOUT_DEFAULT = -1,
    /// Prefer maximum available shared memory, minimum L1 cache.
    CU_SHAREDMEM_CARVEOUT_MAX_SHARED = 100,
    /// Prefer maximum available L1 cache, minimum shared memory.
    CU_SHAREDMEM_CARVEOUT_MAX_L1 = 0,
}
pub use self::CUshared_carveout_enum as CUshared_carveout;
/// Memory types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemorytype_enum {
    /// Host memory.
    CU_MEMORYTYPE_HOST = 1,
    /// Device memory.
    CU_MEMORYTYPE_DEVICE = 2,
    /// Array memory.
    CU_MEMORYTYPE_ARRAY = 3,
    /// Unified device or host memory.
    CU_MEMORYTYPE_UNIFIED = 4,
}
pub use self::CUmemorytype_enum as CUmemorytype;
/// Compute Modes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUcomputemode_enum {
    /// Default compute mode (Multiple contexts allowed per device).
    CU_COMPUTEMODE_DEFAULT = 0,
    /// Compute-prohibited mode (No contexts can be created on this device at this time).
    CU_COMPUTEMODE_PROHIBITED = 2,
    /// Compute-exclusive-process mode (Only one context used by a single process can be present on this device at a time).
    CU_COMPUTEMODE_EXCLUSIVE_PROCESS = 3,
}
pub use self::CUcomputemode_enum as CUcomputemode;
/// Memory advise values.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmem_advise_enum {
    /// Data will mostly be read and only occasionally be written to.
    CU_MEM_ADVISE_SET_READ_MOSTLY = 1,
    /// Undo the effect of CU_MEM_ADVISE_SET_READ_MOSTLY.
    CU_MEM_ADVISE_UNSET_READ_MOSTLY = 2,
    /// Set the preferred location for the data as the specified device.
    CU_MEM_ADVISE_SET_PREFERRED_LOCATION = 3,
    /// Clear the preferred location for the data.
    CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION = 4,
    /// Data will be accessed by the specified device, so prevent page faults as much as possible.
    CU_MEM_ADVISE_SET_ACCESSED_BY = 5,
    /// Let the Unified Memory subsystem decide on the page faulting policy for the specified device.
    CU_MEM_ADVISE_UNSET_ACCESSED_BY = 6,
}
pub use self::CUmem_advise_enum as CUmem_advise;
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmem_range_attribute_enum {
    CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY = 1,
    CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION = 2,
    CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY = 3,
    CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION = 4,
    CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE = 5,
    CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID = 6,
    CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE = 7,
    CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID = 8,
}
pub use self::CUmem_range_attribute_enum as CUmem_range_attribute;
/// Online compiler and linker options.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUjit_option_enum {
    /// Max number of registers that a thread may use.
    /// Option type: unsigned int
    /// Applies to: compiler only.
    CU_JIT_MAX_REGISTERS = 0,
    /// IN: Specifies minimum number of threads per block to target compilation for
    /// OUT: Returns the number of threads the compiler actually targeted. This restricts the resource utilization of the compiler
    /// (e.g. max registers) such that a block with the given number of threads should be able to launch based on register limitations.
    /// Note, this option does not currently take into account any other resource limitations, such as shared memory utilization.
    /// Cannot be combined with CU_JIT_TARGET.
    /// Option type: unsigned int
    /// Applies to: compiler only.
    CU_JIT_THREADS_PER_BLOCK = 1,
    /// Overwrites the option value with the total wall clock time, in milliseconds, spent in the compiler and linker
    /// Option type: float
    /// Applies to: compiler and linker.
    CU_JIT_WALL_TIME = 2,
    /// Pointer to a buffer in which to print any log messages that are informational in nature (the buffer size is specified via
    /// option CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES)
    /// Option type: char \*
    /// Applies to: compiler and linker.
    CU_JIT_INFO_LOG_BUFFER = 3,
    /// IN: Log buffer size in bytes. Log messages will be capped at this size (including null terminator)
    /// OUT: Amount of log buffer filled with messages
    /// Option type: unsigned int
    /// Applies to: compiler and linker.
    CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES = 4,
    /// Pointer to a buffer in which to print any log messages that reflect errors (the buffer size is specified via option CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES)
    /// Option type: char \*
    /// Applies to: compiler and linker.
    CU_JIT_ERROR_LOG_BUFFER = 5,
    /// IN: Log buffer size in bytes. Log messages will be capped at this size (including null terminator)
    /// OUT: Amount of log buffer filled with messages
    /// Option type: unsigned int
    /// Applies to: compiler and linker.
    CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES = 6,
    /// Level of optimizations to apply to generated code (0 - 4), with 4 being the default and highest level of optimizations.
    /// Option type: unsigned int
    /// Applies to: compiler only.
    CU_JIT_OPTIMIZATION_LEVEL = 7,
    /// No option value required. Determines the target based on the current attached context (default)
    /// Option type: No option value needed
    /// Applies to: compiler and linker.
    CU_JIT_TARGET_FROM_CUCONTEXT = 8,
    /// Target is chosen based on supplied `CUjit_target`. Cannot be combined with CU_JIT_THREADS_PER_BLOCK.
    /// Option type: unsigned int for enumerated type `CUjit_target`
    /// Applies to: compiler and linker.
    CU_JIT_TARGET = 9,
    /// Specifies choice of fallback strategy if matching cubin is not found. Choice is based on supplied `CUjit_fallback`. This option cannot be used with cuLink\* APIs as the linker requires exact matches.
    /// Option type: unsigned int for enumerated type `CUjit_fallback`
    /// Applies to: compiler only.
    CU_JIT_FALLBACK_STRATEGY = 10,
    /// Specifies whether to create debug information in output (-g) (0: false, default)
    /// Option type: int
    /// Applies to: compiler and linker.
    CU_JIT_GENERATE_DEBUG_INFO = 11,
    /// Generate verbose log messages (0: false, default)
    /// Option type: int
    /// Applies to: compiler and linker.
    CU_JIT_LOG_VERBOSE = 12,
    /// Generate line number information (-lineinfo) (0: false, default)
    /// Option type: int
    /// Applies to: compiler only.
    CU_JIT_GENERATE_LINE_INFO = 13,
    /// Specifies whether to enable caching explicitly (-dlcm)
    /// Choice is based on supplied CUjit_cacheMode_enum.
    /// Option type: unsigned int for enumerated type CUjit_cacheMode_enum
    /// Applies to: compiler only.
    CU_JIT_CACHE_MODE = 14,
    #[deprecated]
    CU_JIT_NEW_SM3X_OPT = 15,
    /// This jit option is used for internal purpose only.
    CU_JIT_FAST_COMPILE = 16,
    /// Array of device symbol names that will be relocated to the corresponding host addresses stored in CU_JIT_GLOBAL_SYMBOL_ADDRESSES.
    /// Must contain CU_JIT_GLOBAL_SYMBOL_COUNT entries.
    /// When loading a device module, driver will relocate all encountered unresolved symbols to the host addresses.
    /// It is only allowed to register symbols that correspond to unresolved global variables.
    /// It is illegal to register the same device symbol at multiple addresses.
    /// Option type: const char \*\*
    /// Applies to: dynamic linker only.
    CU_JIT_GLOBAL_SYMBOL_NAMES = 17,
    /// Array of host addresses that will be used to relocate corresponding device symbols stored in CU_JIT_GLOBAL_SYMBOL_NAMES.
    /// Must contain CU_JIT_GLOBAL_SYMBOL_COUNT entries.
    /// Option type: void \*\*
    /// Applies to: dynamic linker only.
    CU_JIT_GLOBAL_SYMBOL_ADDRESSES = 18,
    /// Number of entries in CU_JIT_GLOBAL_SYMBOL_NAMES and CU_JIT_GLOBAL_SYMBOL_ADDRESSES arrays.
    /// Option type: unsigned int
    /// Applies to: dynamic linker only.
    CU_JIT_GLOBAL_SYMBOL_COUNT = 19,
    /// Enable link-time optimization (-dlto) for device code (Disabled by default).
    /// This option is not supported on 32-bit platforms.
    /// Option type: int
    /// Applies to: compiler and linker
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_LTO = 20,
    /// Control single-precision denormals (-ftz) support (0: false, default). 1 : flushes denormal values to zero 0 : preserves denormal
    /// values Option type: int
    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`]
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_FTZ = 21,
    /// Control single-precision floating-point division and reciprocals (-prec-div) support (1: true, default). 1 : Enables the IEEE
    /// round-to-nearest mode 0 : Enables the fast approximation mode Option type: int
    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`]
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_PREC_DIV = 22,
    /// Control single-precision floating-point square root (-prec-sqrt) support (1: true, default). 1 : Enables the IEEE round-to-nearest
    /// mode 0 : Enables the fast approximation mode Option type: int
    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`]
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_PREC_SQRT = 23,
    /// Enable/Disable the contraction of floating-point multiplies and adds/subtracts into floating-point multiply-add (-fma) operations
    /// ```text
    /// (1: Enable, default; 0: Disable). Option type: int
    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`]
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0
    /// ```
    #[deprecated]
    CU_JIT_FMA = 24,
    /// Array of kernel names that should be preserved at link time while others can be removed.
    /// Must contain CU_JIT_REFERENCED_KERNEL_COUNT entries.
    /// Note that kernel names can be mangled by the compiler in which case the mangled name needs to be specified.
    /// Wildcard "\*" can be used to represent zero or more characters instead of specifying the full or mangled name.
    /// It is important to note that the wildcard "\*" is also added implicitly. For example, specifying "foo" will match "foobaz",
    /// "barfoo", "barfoobaz" and thus preserve all kernels with those names. This can be avoided by providing a more specific name
    /// like "barfoobaz".
    /// Option type: const char \*\*
    /// Applies to: dynamic linker only
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_REFERENCED_KERNEL_NAMES = 25,
    /// Number of entries in CU_JIT_REFERENCED_KERNEL_NAMES array.
    /// Option type: unsigned int
    /// Applies to: dynamic linker only
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_REFERENCED_KERNEL_COUNT = 26,
    /// Array of variable names (__device__ and/or __constant__) that should be preserved at link time while others can be removed.
    /// Must contain CU_JIT_REFERENCED_VARIABLE_COUNT entries.
    /// Note that variable names can be mangled by the compiler in which case the mangled name needs to be specified.
    /// Wildcard "\*" can be used to represent zero or more characters instead of specifying the full or mangled name.
    /// It is important to note that the wildcard "\*" is also added implicitly. For example, specifying "foo" will match "foobaz",
    /// "barfoo", "barfoobaz" and thus preserve all variables with those names. This can be avoided by providing a more specific name
    /// like "barfoobaz".
    /// Option type: const char \*\*
    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`]
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_REFERENCED_VARIABLE_NAMES = 27,
    /// Number of entries in CU_JIT_REFERENCED_VARIABLE_NAMES array.
    /// Option type: unsigned int
    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`]
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_REFERENCED_VARIABLE_COUNT = 28,
    /// This option serves as a hint to enable the JIT compiler/linker to remove constant (__constant__) and device (__device__) variables
    /// unreferenced in device code (Disabled by default).
    /// Note that host references to constant and device variables using APIs like [`cuModuleGetGlobal_v2`] with this option specified may result in undefined behavior unless the variables are explicitly specified using CU_JIT_REFERENCED_VARIABLE_NAMES.
    /// Option type: int
    /// Applies to: link-time optimization specified with [`CUjit_option::CU_JIT_LTO`]
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES = 29,
    /// Generate position independent code (0: false)
    /// Option type: int
    /// Applies to: compiler only.
    CU_JIT_POSITION_INDEPENDENT_CODE = 30,
    /// This option hints to the JIT compiler the minimum number of CTAs from the kernel’s grid to be mapped to a SM. This option
    /// is ignored when used together with CU_JIT_MAX_REGISTERS or CU_JIT_THREADS_PER_BLOCK. Optimizations based on this option need CU_JIT_MAX_THREADS_PER_BLOCK to be specified as well. For kernels already using PTX directive .minnctapersm, this option will be ignored by default. Use
    /// CU_JIT_OVERRIDE_DIRECTIVE_VALUES to let this option take precedence over the PTX directive. Option type: unsigned int
    /// Applies to: compiler only.
    CU_JIT_MIN_CTA_PER_SM = 31,
    /// Maximum number threads in a thread block, computed as the product of the maximum extent specifed for each dimension of the
    /// block. This limit is guaranteed not to be exeeded in any invocation of the kernel. Exceeding the maximum number of threads
    /// results in runtime error or kernel launch failure. For kernels already using PTX directive .maxntid, this option will be ignored
    /// by default. Use CU_JIT_OVERRIDE_DIRECTIVE_VALUES to let this option take precedence over the PTX directive. Option type: int
    /// Applies to: compiler only.
    CU_JIT_MAX_THREADS_PER_BLOCK = 32,
    /// This option lets the values specified using CU_JIT_MAX_REGISTERS, CU_JIT_THREADS_PER_BLOCK, CU_JIT_MAX_THREADS_PER_BLOCK and CU_JIT_MIN_CTA_PER_SM take precedence over any PTX directives. (0: Disable, default; 1: Enable) Option type: int
    /// Applies to: compiler only.
    CU_JIT_OVERRIDE_DIRECTIVE_VALUES = 33,
    /// This option specifies the maximum number of concurrent threads to use when running compiler optimizations. If the specified
    /// value is 1, the option will be ignored. If the specified value is 0, the number of threads will match the number of CPUs on
    /// the underlying machine. Otherwise, if the option is N, then up to N threads will be used. Option type: unsigned int
    /// Applies to: compiler only.
    CU_JIT_SPLIT_COMPILE = 34,
    /// This option specifies the maximum number of concurrent threads to use when compiling device code. If the specified value is
    /// ```text
    /// 1, the option will be ignored. If the specified value is 0, the number of threads will match the number of CPUs on the underlying
    /// machine. Otherwise, if the option is N, then up to N threads will be used. This option is ignored if the env var CUDA_BINARY_LOADER_THREAD_COUNT
    /// is set. Option type: unsigned int
    /// Applies to: compiler and linker
    /// ```
    CU_JIT_BINARY_LOADER_THREAD_COUNT = 35,
    CU_JIT_NUM_OPTIONS = 36,
}
pub use self::CUjit_option_enum as CUjit_option;
/// Online compilation targets.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUjit_target_enum {
    /// Compute device class 3.0.
    CU_TARGET_COMPUTE_30 = 30,
    /// Compute device class 3.2.
    CU_TARGET_COMPUTE_32 = 32,
    /// Compute device class 3.5.
    CU_TARGET_COMPUTE_35 = 35,
    /// Compute device class 3.7.
    CU_TARGET_COMPUTE_37 = 37,
    /// Compute device class 5.0.
    CU_TARGET_COMPUTE_50 = 50,
    /// Compute device class 5.2.
    CU_TARGET_COMPUTE_52 = 52,
    /// Compute device class 5.3.
    CU_TARGET_COMPUTE_53 = 53,
    /// Compute device class 6.0.
    CU_TARGET_COMPUTE_60 = 60,
    /// Compute device class 6.1.
    CU_TARGET_COMPUTE_61 = 61,
    /// Compute device class 6.2.
    CU_TARGET_COMPUTE_62 = 62,
    /// Compute device class 7.0.
    CU_TARGET_COMPUTE_70 = 70,
    /// Compute device class 7.2.
    CU_TARGET_COMPUTE_72 = 72,
    /// Compute device class 7.5.
    CU_TARGET_COMPUTE_75 = 75,
    /// Compute device class 8.0.
    CU_TARGET_COMPUTE_80 = 80,
    /// Compute device class 8.6.
    CU_TARGET_COMPUTE_86 = 86,
    /// Compute device class 8.7.
    CU_TARGET_COMPUTE_87 = 87,
    /// Compute device class 8.9.
    CU_TARGET_COMPUTE_89 = 89,
    /// Compute device class 9.0.
    CU_TARGET_COMPUTE_90 = 90,
    /// Compute device class 10.0.
    CU_TARGET_COMPUTE_100 = 100,
    /// Compute device class 11.0.
    CU_TARGET_COMPUTE_110 = 110,
    /// Compute device class 10.3.
    CU_TARGET_COMPUTE_103 = 103,
    /// Compute device class 12.0.
    CU_TARGET_COMPUTE_120 = 120,
    /// Compute device class 12.1. Compute device class 9.0. with accelerated features.
    CU_TARGET_COMPUTE_121 = 121,
    /// Compute device class 10.0. with accelerated features.
    CU_TARGET_COMPUTE_90A = 65626,
    /// Compute device class 11.0 with accelerated features.
    CU_TARGET_COMPUTE_100A = 65636,
    /// Compute device class 10.3. with accelerated features.
    CU_TARGET_COMPUTE_110A = 65646,
    /// Compute device class 12.0. with accelerated features.
    CU_TARGET_COMPUTE_103A = 65639,
    /// Compute device class 12.1. with accelerated features.
    CU_TARGET_COMPUTE_120A = 65656,
    /// Compute device class 10.x with family features.
    CU_TARGET_COMPUTE_121A = 65657,
    /// Compute device class 11.0 with family features.
    CU_TARGET_COMPUTE_100F = 131172,
    /// Compute device class 10.3. with family features.
    CU_TARGET_COMPUTE_110F = 131182,
    /// Compute device class 12.0. with family features.
    CU_TARGET_COMPUTE_103F = 131175,
    /// Compute device class 12.1. with family features.
    CU_TARGET_COMPUTE_120F = 131192,
    CU_TARGET_COMPUTE_121F = 131193,
}
pub use self::CUjit_target_enum as CUjit_target;
/// Cubin matching fallback strategies.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUjit_fallback_enum {
    /// Prefer to compile ptx if exact binary match not found.
    CU_PREFER_PTX = 0,
    /// Prefer to fall back to compatible binary code if exact match not found.
    CU_PREFER_BINARY = 1,
}
pub use self::CUjit_fallback_enum as CUjit_fallback;
/// Caching modes for dlcm.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUjit_cacheMode_enum {
    /// Compile with no -dlcm flag specified.
    CU_JIT_CACHE_OPTION_NONE = 0,
    /// Compile with L1 cache disabled.
    CU_JIT_CACHE_OPTION_CG = 1,
    /// Compile with L1 cache enabled.
    CU_JIT_CACHE_OPTION_CA = 2,
}
pub use self::CUjit_cacheMode_enum as CUjit_cacheMode;
/// Device code formats.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUjitInputType_enum {
    /// Compiled device-class-specific device code
    /// Applicable options: none.
    CU_JIT_INPUT_CUBIN = 0,
    /// PTX source code
    /// Applicable options: PTX compiler options.
    CU_JIT_INPUT_PTX = 1,
    /// Bundle of multiple cubins and/or PTX of some device code
    /// Applicable options: PTX compiler options, CU_JIT_FALLBACK_STRATEGY.
    CU_JIT_INPUT_FATBINARY = 2,
    /// Host object with embedded device code
    /// Applicable options: PTX compiler options, CU_JIT_FALLBACK_STRATEGY.
    CU_JIT_INPUT_OBJECT = 3,
    /// Archive of host objects with embedded device code
    /// Applicable options: PTX compiler options, CU_JIT_FALLBACK_STRATEGY.
    CU_JIT_INPUT_LIBRARY = 4,
    /// High-level intermediate code for link-time optimization
    /// Applicable options: NVVM compiler options, PTX compiler options
    ///
    /// Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0.
    #[deprecated]
    CU_JIT_INPUT_NVVM = 5,
    CU_JIT_NUM_INPUT_TYPES = 6,
}
pub use self::CUjitInputType_enum as CUjitInputType;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUlinkState_st {
    _unused: [u8; 0],
}
pub type CUlinkState = *mut CUlinkState_st;
/// Flags to register a graphics resource.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphicsRegisterFlags_enum {
    CU_GRAPHICS_REGISTER_FLAGS_NONE = 0,
    CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY = 1,
    CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD = 2,
    CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST = 4,
    CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER = 8,
}
pub use self::CUgraphicsRegisterFlags_enum as CUgraphicsRegisterFlags;
/// Flags for mapping and unmapping interop resources.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphicsMapResourceFlags_enum {
    CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE = 0,
    CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY = 1,
    CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD = 2,
}
pub use self::CUgraphicsMapResourceFlags_enum as CUgraphicsMapResourceFlags;
/// Array indices for cube faces.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUarray_cubemap_face_enum {
    /// Positive X face of cubemap.
    CU_CUBEMAP_FACE_POSITIVE_X = 0,
    /// Negative X face of cubemap.
    CU_CUBEMAP_FACE_NEGATIVE_X = 1,
    /// Positive Y face of cubemap.
    CU_CUBEMAP_FACE_POSITIVE_Y = 2,
    /// Negative Y face of cubemap.
    CU_CUBEMAP_FACE_NEGATIVE_Y = 3,
    /// Positive Z face of cubemap.
    CU_CUBEMAP_FACE_POSITIVE_Z = 4,
    /// Negative Z face of cubemap.
    CU_CUBEMAP_FACE_NEGATIVE_Z = 5,
}
pub use self::CUarray_cubemap_face_enum as CUarray_cubemap_face;
/// Limits.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUlimit_enum {
    /// GPU thread stack size.
    CU_LIMIT_STACK_SIZE = 0,
    /// GPU printf FIFO size.
    CU_LIMIT_PRINTF_FIFO_SIZE = 1,
    /// GPU malloc heap size.
    CU_LIMIT_MALLOC_HEAP_SIZE = 2,
    /// GPU device runtime launch synchronize depth.
    CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH = 3,
    /// GPU device runtime pending launch count.
    CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT = 4,
    /// A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes). This is a hint.
    CU_LIMIT_MAX_L2_FETCH_GRANULARITY = 5,
    /// A size in bytes for L2 persisting lines cache size.
    CU_LIMIT_PERSISTING_L2_CACHE_SIZE = 6,
    /// A maximum size in bytes of shared memory available to CUDA kernels on a CIG context. Can only be queried, cannot be set.
    CU_LIMIT_SHMEM_SIZE = 7,
    /// A non-zero value indicates this CUDA context is a CIG-enabled context. Can only be queried, cannot be set.
    CU_LIMIT_CIG_ENABLED = 8,
    /// When set to zero, CUDA will fail to launch a kernel on a CIG context, instead of using the fallback path, if the kernel uses
    /// more shared memory than available.
    CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED = 9,
    CU_LIMIT_MAX = 10,
}
pub use self::CUlimit_enum as CUlimit;
/// Resource types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUresourcetype_enum {
    /// Array resource.
    CU_RESOURCE_TYPE_ARRAY = 0,
    /// Mipmapped array resource.
    CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 1,
    /// Linear resource.
    CU_RESOURCE_TYPE_LINEAR = 2,
    /// Pitch 2D resource.
    CU_RESOURCE_TYPE_PITCH2D = 3,
}
pub use self::CUresourcetype_enum as CUresourcetype;
/// CUDA host function.
pub type CUhostFn = ::core::option::Option<
    unsafe extern "C" fn(userData: *mut ::core::ffi::c_void),
>;
/// Specifies performance hint with [`CUaccessPolicyWindow`] for hitProp and missProp members.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUaccessProperty_enum {
    /// Normal cache persistence.
    CU_ACCESS_PROPERTY_NORMAL = 0,
    /// Streaming access is less likely to persit from cache.
    CU_ACCESS_PROPERTY_STREAMING = 1,
    /// Persisting access is more likely to persist in cache.
    CU_ACCESS_PROPERTY_PERSISTING = 2,
}
pub use self::CUaccessProperty_enum as CUaccessProperty;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
pub struct CUaccessPolicyWindow_st {
    pub base_ptr: *mut ::core::ffi::c_void,
    pub num_bytes: size_t,
    pub hitRatio: f32,
    pub hitProp: CUaccessProperty,
    pub missProp: CUaccessProperty,
}
impl Default for CUaccessPolicyWindow_st {
    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()
        }
    }
}
/// Specifies an access policy for a window, a contiguous extent of memory beginning at base_ptr and ending at base_ptr + num_bytes.
/// num_bytes is limited by [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_MAX_ACCESS_POLICY_WINDOW_SIZE`]. Partition into many segments and assign segments
/// such that: sum of "hit segments" / window == approx. ratio. sum of "miss segments" / window == approx 1-ratio. Segments and
/// ratio specifications are fitted to the capabilities of the architecture. Accesses in a hit segment apply the hitProp access
/// policy. Accesses in a miss segment apply the missProp access policy.
pub type CUaccessPolicyWindow_v1 = CUaccessPolicyWindow_st;
/// Access policy window.
pub type CUaccessPolicyWindow = CUaccessPolicyWindow_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_KERNEL_NODE_PARAMS_st {
    pub func: CUfunction,
    pub gridDimX: ::core::ffi::c_uint,
    pub gridDimY: ::core::ffi::c_uint,
    pub gridDimZ: ::core::ffi::c_uint,
    pub blockDimX: ::core::ffi::c_uint,
    pub blockDimY: ::core::ffi::c_uint,
    pub blockDimZ: ::core::ffi::c_uint,
    pub sharedMemBytes: ::core::ffi::c_uint,
    pub kernelParams: *mut *mut ::core::ffi::c_void,
    pub extra: *mut *mut ::core::ffi::c_void,
}
impl Default for CUDA_KERNEL_NODE_PARAMS_st {
    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()
        }
    }
}
/// GPU kernel node parameters.
pub type CUDA_KERNEL_NODE_PARAMS_v1 = CUDA_KERNEL_NODE_PARAMS_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_KERNEL_NODE_PARAMS_v2_st {
    pub func: CUfunction,
    pub gridDimX: ::core::ffi::c_uint,
    pub gridDimY: ::core::ffi::c_uint,
    pub gridDimZ: ::core::ffi::c_uint,
    pub blockDimX: ::core::ffi::c_uint,
    pub blockDimY: ::core::ffi::c_uint,
    pub blockDimZ: ::core::ffi::c_uint,
    pub sharedMemBytes: ::core::ffi::c_uint,
    pub kernelParams: *mut *mut ::core::ffi::c_void,
    pub extra: *mut *mut ::core::ffi::c_void,
    pub kern: CUkernel,
    pub ctx: CUcontext,
}
impl Default for CUDA_KERNEL_NODE_PARAMS_v2_st {
    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()
        }
    }
}
/// GPU kernel node parameters.
pub type CUDA_KERNEL_NODE_PARAMS_v2 = CUDA_KERNEL_NODE_PARAMS_v2_st;
pub type CUDA_KERNEL_NODE_PARAMS = CUDA_KERNEL_NODE_PARAMS_v2;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_KERNEL_NODE_PARAMS_v3_st {
    pub func: CUfunction,
    pub gridDimX: ::core::ffi::c_uint,
    pub gridDimY: ::core::ffi::c_uint,
    pub gridDimZ: ::core::ffi::c_uint,
    pub blockDimX: ::core::ffi::c_uint,
    pub blockDimY: ::core::ffi::c_uint,
    pub blockDimZ: ::core::ffi::c_uint,
    pub sharedMemBytes: ::core::ffi::c_uint,
    pub kernelParams: *mut *mut ::core::ffi::c_void,
    pub extra: *mut *mut ::core::ffi::c_void,
    pub kern: CUkernel,
    pub ctx: CUcontext,
}
impl Default for CUDA_KERNEL_NODE_PARAMS_v3_st {
    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()
        }
    }
}
/// GPU kernel node parameters.
pub type CUDA_KERNEL_NODE_PARAMS_v3 = CUDA_KERNEL_NODE_PARAMS_v3_st;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_MEMSET_NODE_PARAMS_st {
    pub dst: CUdeviceptr,
    pub pitch: size_t,
    pub value: ::core::ffi::c_uint,
    pub elementSize: ::core::ffi::c_uint,
    pub width: size_t,
    pub height: size_t,
}
/// Memset node parameters.
pub type CUDA_MEMSET_NODE_PARAMS_v1 = CUDA_MEMSET_NODE_PARAMS_st;
pub type CUDA_MEMSET_NODE_PARAMS = CUDA_MEMSET_NODE_PARAMS_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_MEMSET_NODE_PARAMS_v2_st {
    pub dst: CUdeviceptr,
    pub pitch: size_t,
    pub value: ::core::ffi::c_uint,
    pub elementSize: ::core::ffi::c_uint,
    pub width: size_t,
    pub height: size_t,
    pub ctx: CUcontext,
}
impl Default for CUDA_MEMSET_NODE_PARAMS_v2_st {
    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()
        }
    }
}
/// Memset node parameters.
pub type CUDA_MEMSET_NODE_PARAMS_v2 = CUDA_MEMSET_NODE_PARAMS_v2_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_HOST_NODE_PARAMS_st {
    pub fn_: CUhostFn,
    pub userData: *mut ::core::ffi::c_void,
}
impl Default for CUDA_HOST_NODE_PARAMS_st {
    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()
        }
    }
}
/// Host node parameters.
pub type CUDA_HOST_NODE_PARAMS_v1 = CUDA_HOST_NODE_PARAMS_st;
pub type CUDA_HOST_NODE_PARAMS = CUDA_HOST_NODE_PARAMS_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_HOST_NODE_PARAMS_v2_st {
    pub fn_: CUhostFn,
    pub userData: *mut ::core::ffi::c_void,
    pub syncMode: ::core::ffi::c_uint,
}
impl Default for CUDA_HOST_NODE_PARAMS_v2_st {
    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()
        }
    }
}
/// Host node parameters.
pub type CUDA_HOST_NODE_PARAMS_v2 = CUDA_HOST_NODE_PARAMS_v2_st;
/// Conditional node types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphConditionalNodeType_enum {
    /// Conditional 'if/else' Node. Body\[0\] executed if condition is non-zero. If size == 2, an optional ELSE graph is created and this is executed if the condition is zero.
    CU_GRAPH_COND_TYPE_IF = 0,
    /// Conditional 'while' Node. Body executed repeatedly while condition value is non-zero.
    CU_GRAPH_COND_TYPE_WHILE = 1,
    /// Conditional 'switch' Node. Body\[n\] is executed once, where 'n' is the value of the condition. If the condition does not match
    /// a body index, no body is launched.
    CU_GRAPH_COND_TYPE_SWITCH = 2,
}
pub use self::CUgraphConditionalNodeType_enum as CUgraphConditionalNodeType;
/// Conditional node parameters.
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_CONDITIONAL_NODE_PARAMS {
    /// Conditional node handle. Handles must be created in advance of creating the node using [`cuGraphConditionalHandleCreate`].
    pub handle: CUgraphConditionalHandle,
    pub type_: CUgraphConditionalNodeType,
    /// Size of graph output array. Allowed values are 1 for [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_WHILE`], 1 or 2 for [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_IF`], or any value
    /// greater than zero for [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_SWITCH`].
    pub size: ::core::ffi::c_uint,
    /// CUDA-owned array populated with conditional node child graphs during creation of the node. Valid for the lifetime of the
    /// conditional node. The contents of the graph(s) are subject to the following constraints:
    ///
    /// * Allowed node types are kernel nodes, empty nodes, child graphs, memsets, memcopies, and conditionals. This applies recursively
    ///   to child graphs and conditional bodies.
    /// * All kernels, including kernels in nested conditionals or child graphs at any level, must belong to the same CUDA context.
    ///
    /// These graphs may be populated using graph node creation APIs or [`cuStreamBeginCaptureToGraph`].
    ///
    /// [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_IF`]: phGraph_out\[0\] is executed when the condition is non-zero. If size == 2, phGraph_out\[1\] will be executed when the condition is zero. [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_WHILE`]: phGraph_out\[0\] is executed as
    /// long as the condition is non-zero. [`CUgraphConditionalNodeType::CU_GRAPH_COND_TYPE_SWITCH`]: phGraph_out\[n\] is executed when the condition is equal to n.
    /// If the condition >= size, no body graph is executed.
    pub phGraph_out: *mut CUgraph,
    /// Context on which to run the node. Must match context used to create the handle and all body nodes.
    pub ctx: CUcontext,
}
impl Default for CUDA_CONDITIONAL_NODE_PARAMS {
    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()
        }
    }
}
/// Graph node types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphNodeType_enum {
    /// GPU kernel node.
    CU_GRAPH_NODE_TYPE_KERNEL = 0,
    /// Memcpy node.
    CU_GRAPH_NODE_TYPE_MEMCPY = 1,
    /// Memset node.
    CU_GRAPH_NODE_TYPE_MEMSET = 2,
    /// Host (executable) node.
    CU_GRAPH_NODE_TYPE_HOST = 3,
    /// Node which executes an embedded graph.
    CU_GRAPH_NODE_TYPE_GRAPH = 4,
    /// Empty (no-op) node.
    CU_GRAPH_NODE_TYPE_EMPTY = 5,
    /// External event wait node.
    CU_GRAPH_NODE_TYPE_WAIT_EVENT = 6,
    /// External event record node.
    CU_GRAPH_NODE_TYPE_EVENT_RECORD = 7,
    /// External semaphore signal node.
    CU_GRAPH_NODE_TYPE_EXT_SEMAS_SIGNAL = 8,
    /// External semaphore wait node.
    CU_GRAPH_NODE_TYPE_EXT_SEMAS_WAIT = 9,
    /// Memory Allocation Node.
    CU_GRAPH_NODE_TYPE_MEM_ALLOC = 10,
    /// Memory Free Node.
    CU_GRAPH_NODE_TYPE_MEM_FREE = 11,
    /// Batch MemOp Node See [`cuStreamBatchMemOp_v2`] and `CUstreamBatchMemOpType` for what these nodes can do.
    CU_GRAPH_NODE_TYPE_BATCH_MEM_OP = 12,
    /// Conditional NodeMay be used to implement a conditional execution path or loop inside of a graph. The graph(s) contained within
    /// the body of the conditional node can be selectively executed or iterated upon based on the value of a conditional variable.Handles
    /// must be created in advance of creating the node using [`cuGraphConditionalHandleCreate`].The following restrictions apply to graphs which contain conditional nodes: The graph cannot be used in a child node. Only
    /// one instantiation of the graph may exist at any point in time. The graph cannot be cloned.To set the control value, supply
    /// a default value when creating the handle and/or call [cudaGraphSetConditional](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1gde392fa316b963233219ab3caac9f1b3) from device code.
    CU_GRAPH_NODE_TYPE_CONDITIONAL = 13,
}
pub use self::CUgraphNodeType_enum as CUgraphNodeType;
/// Type annotations that can be applied to graph edges as part of [`CUgraphEdgeData`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphDependencyType_enum {
    /// This is an ordinary dependency.
    CU_GRAPH_DEPENDENCY_TYPE_DEFAULT = 0,
    /// This dependency type allows the downstream node to use &lt;cudaGridDependencySynchronize()>. It may only be used between kernel nodes, and must be used with either the [`CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC`] or [`CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER`] outgoing port.
    CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC = 1,
}
pub use self::CUgraphDependencyType_enum as CUgraphDependencyType;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUgraphEdgeData_st {
    pub from_port: ::core::ffi::c_uchar,
    pub to_port: ::core::ffi::c_uchar,
    pub type_: ::core::ffi::c_uchar,
    pub reserved: [::core::ffi::c_uchar; 5usize],
}
/// Optional annotation for edges in a CUDA graph. Note, all edges implicitly have annotations and default to a zero-initialized
/// value if not specified. A zero-initialized struct indicates a standard full serialization of two nodes with memory visibility.
pub type CUgraphEdgeData = CUgraphEdgeData_st;
/// Graph instantiation results.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphInstantiateResult_enum {
    /// Instantiation succeeded.
    CUDA_GRAPH_INSTANTIATE_SUCCESS = 0,
    /// Instantiation failed for an unexpected reason which is described in the return value of the function.
    CUDA_GRAPH_INSTANTIATE_ERROR = 1,
    /// Instantiation failed due to invalid structure, such as cycles.
    CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE = 2,
    /// Instantiation for device launch failed because the graph contained an unsupported operation.
    CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED = 3,
    /// Instantiation for device launch failed due to the nodes belonging to different contexts.
    CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED = 4,
    /// One or more conditional handles are not associated with conditional nodes.
    CUDA_GRAPH_INSTANTIATE_CONDITIONAL_HANDLE_UNUSED = 5,
}
pub use self::CUgraphInstantiateResult_enum as CUgraphInstantiateResult;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_GRAPH_INSTANTIATE_PARAMS_st {
    pub flags: cuuint64_t,
    pub hUploadStream: CUstream,
    pub hErrNode_out: CUgraphNode,
    pub result_out: CUgraphInstantiateResult,
}
impl Default for CUDA_GRAPH_INSTANTIATE_PARAMS_st {
    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()
        }
    }
}
/// Graph instantiation parameters.
pub type CUDA_GRAPH_INSTANTIATE_PARAMS = CUDA_GRAPH_INSTANTIATE_PARAMS_st;
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUsynchronizationPolicy_enum {
    CU_SYNC_POLICY_AUTO = 1,
    CU_SYNC_POLICY_SPIN = 2,
    CU_SYNC_POLICY_YIELD = 3,
    CU_SYNC_POLICY_BLOCKING_SYNC = 4,
}
pub use self::CUsynchronizationPolicy_enum as CUsynchronizationPolicy;
/// Cluster scheduling policies. These may be passed to [`cuFuncSetAttribute`] or [`cuKernelSetAttribute`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUclusterSchedulingPolicy_enum {
    /// the default policy.
    CU_CLUSTER_SCHEDULING_POLICY_DEFAULT = 0,
    /// spread the blocks within a cluster to the SMs.
    CU_CLUSTER_SCHEDULING_POLICY_SPREAD = 1,
    /// allow the hardware to load-balance the blocks in a cluster to the SMs.
    CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING = 2,
}
pub use self::CUclusterSchedulingPolicy_enum as CUclusterSchedulingPolicy;
/// Memory Synchronization Domain
///
/// A kernel can be launched in a specified memory synchronization domain that affects all memory operations issued by that kernel.
/// A memory barrier issued in one domain will only order memory operations in that domain, thus eliminating latency increase
/// from memory barriers ordering unrelated traffic.
///
/// By default, kernels are launched in domain 0. Kernel launched with CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE will have a different domain ID. User may also alter the domain ID with [`CUlaunchMemSyncDomainMap`] for a specific stream / graph node / kernel launch. See CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN, [`cuStreamSetAttribute`], [`cuLaunchKernelEx`], [`cuGraphKernelNodeSetAttribute`].
///
/// Memory operations done in kernels launched in different domains are considered system-scope distanced. In other words, a GPU
/// scoped memory synchronization is not sufficient for memory order to be observed by kernels in another memory synchronization
/// domain even if they are on the same GPU.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUlaunchMemSyncDomain_enum {
    /// Launch kernels in the default domain.
    CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT = 0,
    /// Launch kernels in the remote domain.
    CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE = 1,
}
pub use self::CUlaunchMemSyncDomain_enum as CUlaunchMemSyncDomain;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUlaunchMemSyncDomainMap_st {
    pub default_: ::core::ffi::c_uchar,
    pub remote: ::core::ffi::c_uchar,
}
/// Memory Synchronization Domain map
///
/// See [cudaLaunchMemSyncDomain](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1gafb98f7ea7b0397ed6503780f3e672d5).
///
/// By default, kernels are launched in domain 0. Kernel launched with [`CUlaunchMemSyncDomain_enum::CU_LAUNCH_MEM_SYNC_DOMAIN_REMOTE`] will have a different domain ID. User may also alter the domain ID with [`CUlaunchMemSyncDomainMap`] for a specific stream / graph node / kernel launch. See [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP`].
///
/// Domain ID range is available through [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MEM_SYNC_DOMAIN_COUNT`].
pub type CUlaunchMemSyncDomainMap = CUlaunchMemSyncDomainMap_st;
/// Enum for defining applicability of portable cluster size, used with [`cuLaunchKernelEx`].
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUlaunchAttributePortableClusterMode_enum {
    /// The default to use for allowing non-portable cluster size on launch - uses current function attribute for CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED.
    CU_LAUNCH_PORTABLE_CLUSTER_MODE_DEFAULT = 0,
    /// Specifies that the cluster size requested must be a portable size.
    CU_LAUNCH_PORTABLE_CLUSTER_MODE_REQUIRE_PORTABLE = 1,
    /// Specifies that the cluster size requested may be a non-portable size.
    CU_LAUNCH_PORTABLE_CLUSTER_MODE_ALLOW_NON_PORTABLE = 2,
}
pub use self::CUlaunchAttributePortableClusterMode_enum as CUlaunchAttributePortableClusterMode;
/// Shared memory related attributes for use with [`cuLaunchKernelEx`].
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUsharedMemoryMode_enum {
    /// The default to use for shared memory on launch - uses current function attribute for CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES.
    CU_SHARED_MEMORY_MODE_DEFAULT = 0,
    /// Specifies that the dynamic shared size bytes requested must be a portable size within the bounds of CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK.
    CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE = 1,
    /// Specifies that the dynamic shared size bytes requested may be a non-portable size but still within the bounds of CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN.
    CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE = 2,
}
pub use self::CUsharedMemoryMode_enum as CUsharedMemoryMode;
/// Launch attributes enum; used as id field of [`CUlaunchAttribute`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUlaunchAttributeID_enum {
    /// Ignored entry, for convenient composition.
    CU_LAUNCH_ATTRIBUTE_IGNORE = 0,
    /// Valid for streams, graph nodes, launches. See [CUlaunchAttributeValue::accessPolicyWindow](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_1154aa6110d2610fb68ec60bc9337073b).
    CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW = 1,
    /// Valid for graph nodes, launches. See [CUlaunchAttributeValue::cooperative](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_13015f3dc785dce3a2c250b852457082a).
    CU_LAUNCH_ATTRIBUTE_COOPERATIVE = 2,
    /// Valid for streams. See [CUlaunchAttributeValue::syncPolicy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_1bfc7b2566d09fbd679636513d5c07cd8).
    CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3,
    /// Valid for graph nodes, launches. See [CUlaunchAttributeValue::clusterDim](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_171f9182ab9f932025a038def93ce1a94).
    CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION = 4,
    /// Valid for graph nodes, launches. See [CUlaunchAttributeValue::clusterSchedulingPolicyPreference](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_1714fd4571d6ef99a53a20d378eebb2ba).
    CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5,
    /// Valid for launches. Setting [CUlaunchAttributeValue::programmaticStreamSerializationAllowed](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_121590ca9c3de21690d12d9c7f73917ab) to non-0 signals that the kernel will use programmatic means to resolve its stream dependency, so that the CUDA runtime should
    /// opportunistically allow the grid's execution to overlap with the previous kernel in the stream, if that kernel requests the
    /// overlap. The dependent launches can choose to wait on the dependency using the programmatic sync ([cudaGridDependencySynchronize()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EXECUTION.html#group__CUDART__EXECUTION_1g9057f99234a8311c4c5d426cd501d99d) or equivalent PTX instructions).
    CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION = 6,
    /// Valid for launches. Set [CUlaunchAttributeValue::programmaticEvent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_149992756050c46d440486034949a2c0c) to record the event. Event recorded through this launch attribute is guaranteed to only trigger after all block in the associated
    /// kernel trigger the event. A block can trigger the event through PTX launchdep.release or CUDA builtin function [cudaTriggerProgrammaticLaunchCompletion()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EXECUTION.html#group__CUDART__EXECUTION_1ge194af462d927583bed3acf60d450218). A trigger can also be inserted at the beginning of each block's execution if triggerAtBlockStart is set to non-0. The dependent
    /// launches can choose to wait on the dependency using the programmatic sync ([cudaGridDependencySynchronize()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EXECUTION.html#group__CUDART__EXECUTION_1g9057f99234a8311c4c5d426cd501d99d) or equivalent PTX instructions). Note that dependents (including the CPU thread calling [`cuEventSynchronize`]) are not guaranteed to observe the release precisely when it is released. For example, [`cuEventSynchronize`] may only observe the event trigger long after the associated kernel has completed. This recording type is primarily meant
    /// for establishing programmatic dependency between device tasks. Note also this type of dependency allows, but does not guarantee,
    /// concurrent execution of tasks.
    /// The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with
    /// the CU_EVENT_DISABLE_TIMING flag set).
    CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT = 7,
    /// Valid for streams, graph nodes, launches. See [CUlaunchAttributeValue::priority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_18b3a370124a50866fcdb1c9cb5580e96).
    CU_LAUNCH_ATTRIBUTE_PRIORITY = 8,
    /// Valid for streams, graph nodes, launches. See [CUlaunchAttributeValue::memSyncDomainMap](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_134552cdc66a0a5373d8515108d9c63d6).
    CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP = 9,
    /// Valid for streams, graph nodes, launches. See [CUlaunchAttributeValue::memSyncDomain](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_168b8301d88ce5c6e69fc5f08734e55a8).
    CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN = 10,
    /// Valid for graph nodes, launches. Set [CUlaunchAttributeValue::preferredClusterDim](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_12e4405d769d2302fd8d0f9b7764f3cb3) to allow the kernel launch to specify a preferred substitute cluster dimension. Blocks may be grouped according to either
    /// the dimensions specified with this attribute (grouped into a "preferred substitute cluster"), or the one specified with CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION attribute (grouped into a "regular cluster"). The cluster dimensions of a "preferred substitute cluster" shall be an integer
    /// multiple greater than zero of the regular cluster dimensions. The device will attempt - on a best-effort basis - to group
    /// thread blocks into preferred clusters over grouping them into regular clusters. When it deems necessary (primarily when the
    /// device temporarily runs out of physical resources to launch the larger preferred clusters), the device may switch to launch
    /// the regular clusters instead to attempt to utilize as much of the physical device resources as possible.
    /// Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For
    /// example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously
    /// a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute
    /// cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks.
    /// This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute cluster
    /// dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide the grid. It must
    /// also be no more than `maxBlocksPerCluster`, if it is set in the kernel's `__launch_bounds__`. Otherwise it must be less than
    /// the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable to fit on any particular
    /// device is permitted.
    CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = 11,
    /// Valid for launches. Set [CUlaunchAttributeValue::launchCompletionEvent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_1af92a022a05eba8d91f8c6b39c8d3db2) to record the event.
    /// Nominally, the event is triggered once all blocks of the kernel have begun execution. Currently this is a best effort. If
    /// a kernel B has a launch completion dependency on a kernel A, B may wait until A is complete. Alternatively, blocks of B may
    /// begin before all blocks of A have begun, for example if B can claim execution resources unavailable to A (e.g. they run on
    /// different GPUs) or if B is a higher priority than A. Exercise caution if such an ordering inversion could lead to deadlock.
    /// A launch completion event is nominally similar to a programmatic event with triggerAtBlockStart set except that it is not visible to &lt;cudaGridDependencySynchronize()> and can be used with compute capability less than 9.0.
    /// The event supplied must not be an interprocess or interop event. The event must disable timing (i.e. must be created with
    /// the CU_EVENT_DISABLE_TIMING flag set).
    CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = 12,
    /// Valid for graph nodes, launches. This attribute is graphs-only, and passing it to a launch in a non-capturing stream will
    /// result in an error.
    /// CUlaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can only be set to 0 or 1. Setting the field to 1 indicates
    /// that the corresponding kernel node should be device-updatable. On success, a handle will be returned via CUlaunchAttributeValue::deviceUpdatableKernelNode::devNode
    /// which can be passed to the various device-side update functions to update the node's kernel parameters from within another
    /// kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof,
    /// see [cudaGraphKernelNodeUpdatesApply](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g2d558cf37c9616365c67447e61ac0d6a).
    /// Nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable
    /// nodes cannot be removed from their graph via [`cuGraphDestroyNode`]. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the deviceUpdatable attribute
    /// to 0 will result in an error. Device-updatable kernel nodes also cannot have their attributes copied to/from another kernel
    /// node via [`cuGraphKernelNodeCopyAttributes`]. Graphs containing one or more device-updatable nodes also do not allow multiple instantiation, and neither the graph nor
    /// its instantiated version can be passed to [`cuGraphExecUpdate_v2`].
    /// If a graph contains device-updatable nodes and updates those nodes from the device from within the graph, the graph must be
    /// uploaded with [`cuGraphUpload`] before it is launched. For such a graph, if host-side executable graph updates are made to the device-updatable nodes, the
    /// graph must be uploaded before it is launched again.
    CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13,
    /// Valid for launches. On devices where the L1 cache and shared memory use the same hardware resources, setting [CUlaunchAttributeValue::sharedMemCarveout](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_1b4890866538ded7d27e648d399caaff2) to a percentage between 0-100 signals the CUDA driver to set the shared memory carveout preference, in percent of the total
    /// shared memory for that kernel launch. This attribute takes precedence over CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT. This is only a hint, and the CUDA driver can choose a different configuration if required for the launch.
    CU_LAUNCH_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT = 14,
    /// Valid for streams, graph nodes, launches. This attribute is a hint to the CUDA runtime that the launch should attempt to make
    /// the kernel maximize its NVLINK utilization.
    /// When possible to honor this hint, CUDA will assume each block in the grid launch will carry out an even amount of NVLINK traffic,
    /// and make a best-effort attempt to adjust the kernel launch based on that assumption.
    /// This attribute is a hint only. CUDA makes no functional or performance guarantee. Its applicability can be affected by many
    /// different factors, including driver version (i.e. CUDA doesn't guarantee the performance characteristics will be maintained
    /// between driver versions or a driver update could alter or regress previously observed perf characteristics.) It also doesn't
    /// guarantee a successful result, i.e. applying the attribute may not improve the performance of either the targeted kernel or
    /// the encapsulating application.
    /// Valid values for CUlaunchAttributeValue::nvlinkUtilCentricScheduling are 0 (disabled) and 1 (enabled).
    CU_LAUNCH_ATTRIBUTE_NVLINK_UTIL_CENTRIC_SCHEDULING = 16,
    /// Valid for graph nodes, launches. This controls whether the kernel launch is allowed to use a non-portable cluster size. Valid
    /// values for [CUlaunchAttributeValue::portableClusterSizeMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unionCUlaunchAttributeValue.html#unionCUlaunchAttributeValue_1b59ceb6906a7de4ce07de5f2269d18b3) are described in `CUlaunchAttributePortableClusterMode`. Any other value will return CUDA_ERROR_INVALID_VALUE.
    CU_LAUNCH_ATTRIBUTE_PORTABLE_CLUSTER_SIZE_MODE = 17,
    /// Valid for graph nodes, launches. This indicates if the kernel is allowed to use a non-portable dynamic shared memory mode.
    CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = 18,
}
pub use self::CUlaunchAttributeID_enum as CUlaunchAttributeID;
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUlaunchAttributeValue_union {
    pub pad: [::core::ffi::c_char; 64usize],
    pub accessPolicyWindow: CUaccessPolicyWindow,
    pub cooperative: ::core::ffi::c_int,
    pub syncPolicy: CUsynchronizationPolicy,
    pub clusterDim: CUlaunchAttributeValue_union__bindgen_ty_1,
    pub clusterSchedulingPolicyPreference: CUclusterSchedulingPolicy,
    pub programmaticStreamSerializationAllowed: ::core::ffi::c_int,
    pub programmaticEvent: CUlaunchAttributeValue_union__bindgen_ty_2,
    pub launchCompletionEvent: CUlaunchAttributeValue_union__bindgen_ty_3,
    pub priority: ::core::ffi::c_int,
    pub memSyncDomainMap: CUlaunchMemSyncDomainMap,
    pub memSyncDomain: CUlaunchMemSyncDomain,
    pub preferredClusterDim: CUlaunchAttributeValue_union__bindgen_ty_4,
    pub deviceUpdatableKernelNode: CUlaunchAttributeValue_union__bindgen_ty_5,
    pub sharedMemCarveout: ::core::ffi::c_uint,
    pub nvlinkUtilCentricScheduling: ::core::ffi::c_uint,
    pub portableClusterSizeMode: CUlaunchAttributePortableClusterMode,
    pub sharedMemoryMode: CUsharedMemoryMode,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUlaunchAttributeValue_union__bindgen_ty_1 {
    pub x: ::core::ffi::c_uint,
    pub y: ::core::ffi::c_uint,
    pub z: ::core::ffi::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUlaunchAttributeValue_union__bindgen_ty_2 {
    pub event: CUevent,
    pub flags: ::core::ffi::c_int,
    pub triggerAtBlockStart: ::core::ffi::c_int,
}
impl Default for CUlaunchAttributeValue_union__bindgen_ty_2 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUlaunchAttributeValue_union__bindgen_ty_3 {
    pub event: CUevent,
    pub flags: ::core::ffi::c_int,
}
impl Default for CUlaunchAttributeValue_union__bindgen_ty_3 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUlaunchAttributeValue_union__bindgen_ty_4 {
    pub x: ::core::ffi::c_uint,
    pub y: ::core::ffi::c_uint,
    pub z: ::core::ffi::c_uint,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUlaunchAttributeValue_union__bindgen_ty_5 {
    pub deviceUpdatable: ::core::ffi::c_int,
    pub devNode: CUgraphDeviceNode,
}
impl Default for CUlaunchAttributeValue_union__bindgen_ty_5 {
    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 CUlaunchAttributeValue_union {
    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()
        }
    }
}
/// Launch attributes union; used as value field of [`CUlaunchAttribute`].
pub type CUlaunchAttributeValue = CUlaunchAttributeValue_union;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUlaunchAttribute_st {
    pub id: CUlaunchAttributeID,
    pub pad: [::core::ffi::c_char; 4usize],
    pub value: CUlaunchAttributeValue,
}
impl Default for CUlaunchAttribute_st {
    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()
        }
    }
}
/// Launch attribute.
pub type CUlaunchAttribute = CUlaunchAttribute_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUlaunchConfig_st {
    pub gridDimX: ::core::ffi::c_uint,
    pub gridDimY: ::core::ffi::c_uint,
    pub gridDimZ: ::core::ffi::c_uint,
    pub blockDimX: ::core::ffi::c_uint,
    pub blockDimY: ::core::ffi::c_uint,
    pub blockDimZ: ::core::ffi::c_uint,
    pub sharedMemBytes: ::core::ffi::c_uint,
    pub hStream: CUstream,
    pub attrs: *mut CUlaunchAttribute,
    pub numAttrs: ::core::ffi::c_uint,
}
impl Default for CUlaunchConfig_st {
    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()
        }
    }
}
/// CUDA extensible launch configuration.
pub type CUlaunchConfig = CUlaunchConfig_st;
pub use self::CUlaunchAttributeID as CUkernelNodeAttrID;
pub type CUkernelNodeAttrValue_v1 = CUlaunchAttributeValue;
pub type CUkernelNodeAttrValue = CUkernelNodeAttrValue_v1;
/// Possible stream capture statuses returned by [`cuStreamIsCapturing`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUstreamCaptureStatus_enum {
    /// Stream is not capturing.
    CU_STREAM_CAPTURE_STATUS_NONE = 0,
    /// Stream is actively capturing.
    CU_STREAM_CAPTURE_STATUS_ACTIVE = 1,
    /// Stream is part of a capture sequence that has been invalidated, but not terminated.
    CU_STREAM_CAPTURE_STATUS_INVALIDATED = 2,
}
pub use self::CUstreamCaptureStatus_enum as CUstreamCaptureStatus;
/// Possible modes for stream capture thread interactions. For more details see [`cuStreamBeginCapture_v2`] and [`cuThreadExchangeStreamCaptureMode`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUstreamCaptureMode_enum {
    CU_STREAM_CAPTURE_MODE_GLOBAL = 0,
    CU_STREAM_CAPTURE_MODE_THREAD_LOCAL = 1,
    CU_STREAM_CAPTURE_MODE_RELAXED = 2,
}
pub use self::CUlaunchAttributeID as CUstreamAttrID;
pub use self::CUstreamCaptureMode_enum as CUstreamCaptureMode;
pub type CUstreamAttrValue_v1 = CUlaunchAttributeValue;
pub type CUstreamAttrValue = CUstreamAttrValue_v1;
/// Flags to specify search options. For more details see [`cuGetProcAddress_v2`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUdriverProcAddress_flags_enum {
    /// Default search mode for driver symbols.
    CU_GET_PROC_ADDRESS_DEFAULT = 0,
    /// Search for legacy versions of driver symbols.
    CU_GET_PROC_ADDRESS_LEGACY_STREAM = 1,
    /// Search for per-thread versions of driver symbols.
    CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM = 2,
}
pub use self::CUdriverProcAddress_flags_enum as CUdriverProcAddress_flags;
/// Flags to indicate search status. For more details see [`cuGetProcAddress_v2`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUdriverProcAddressQueryResult_enum {
    /// Symbol was succesfully found.
    CU_GET_PROC_ADDRESS_SUCCESS = 0,
    /// Symbol was not found in search.
    CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND = 1,
    /// Symbol was found but version supplied was not sufficient.
    CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT = 2,
}
pub use self::CUdriverProcAddressQueryResult_enum as CUdriverProcAddressQueryResult;
/// Execution Affinity Types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUexecAffinityType_enum {
    /// Create a context with limited SMs.
    CU_EXEC_AFFINITY_TYPE_SM_COUNT = 0,
    CU_EXEC_AFFINITY_TYPE_MAX = 1,
}
pub use self::CUexecAffinityType_enum as CUexecAffinityType;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUexecAffinitySmCount_st {
    pub val: ::core::ffi::c_uint,
}
/// Value for [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`].
pub type CUexecAffinitySmCount_v1 = CUexecAffinitySmCount_st;
pub type CUexecAffinitySmCount = CUexecAffinitySmCount_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUexecAffinityParam_st {
    pub type_: CUexecAffinityType,
    pub param: CUexecAffinityParam_st__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUexecAffinityParam_st__bindgen_ty_1 {
    pub smCount: CUexecAffinitySmCount,
}
impl Default for CUexecAffinityParam_st__bindgen_ty_1 {
    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 CUexecAffinityParam_st {
    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()
        }
    }
}
/// Execution Affinity Parameters.
pub type CUexecAffinityParam_v1 = CUexecAffinityParam_st;
/// Execution Affinity Parameters.
pub type CUexecAffinityParam = CUexecAffinityParam_v1;
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUcigDataType_enum {
    CIG_DATA_TYPE_D3D12_COMMAND_QUEUE = 1,
    CIG_DATA_TYPE_NV_BLOB = 2,
}
pub use self::CUcigDataType_enum as CUcigDataType;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUctxCigParam_st {
    pub sharedDataType: CUcigDataType,
    pub sharedData: *mut ::core::ffi::c_void,
}
impl Default for CUctxCigParam_st {
    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()
        }
    }
}
/// CIG Context Create Params.
pub type CUctxCigParam = CUctxCigParam_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUctxCreateParams_st {
    pub execAffinityParams: *mut CUexecAffinityParam,
    pub numExecAffinityParams: ::core::ffi::c_int,
    pub cigParams: *mut CUctxCigParam,
}
impl Default for CUctxCreateParams_st {
    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()
        }
    }
}
/// Params for creating CUDA context. Both execAffinityParams and cigParams cannot be non-NULL at the same time. If both are NULL,
/// the context will be created as a regular CUDA context.
pub type CUctxCreateParams = CUctxCreateParams_st;
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUstreamCigDataType_enum {
    STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST = 1,
}
pub use self::CUstreamCigDataType_enum as CUstreamCigDataType;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUstreamCigParam_st {
    pub streamSharedDataType: CUstreamCigDataType,
    pub streamSharedData: *mut ::core::ffi::c_void,
}
impl Default for CUstreamCigParam_st {
    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 CUstreamCigParam = CUstreamCigParam_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUstreamCigCaptureParams_st {
    pub streamCigParams: *mut CUstreamCigParam,
}
impl Default for CUstreamCigCaptureParams_st {
    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 CUstreamCigCaptureParams = CUstreamCigCaptureParams_st;
/// Library options to be specified with [`cuLibraryLoadData`] or [`cuLibraryLoadFromFile`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUlibraryOption_enum {
    CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE = 0,
    /// Specifes that the argument code passed to [`cuLibraryLoadData`] will be preserved. Specifying this option will let the driver know that code can be accessed at any point until [`cuLibraryUnload`]. The default behavior is for the driver to allocate and maintain its own copy of code. Note that this is only a memory usage optimization hint and the driver can choose to ignore it if required. Specifying this
    /// option with [`cuLibraryLoadFromFile`] is invalid and will return CUDA_ERROR_INVALID_VALUE.
    CU_LIBRARY_BINARY_IS_PRESERVED = 1,
    CU_LIBRARY_NUM_OPTIONS = 2,
}
pub use self::CUlibraryOption_enum as CUlibraryOption;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUlibraryHostUniversalFunctionAndDataTable_st {
    pub functionTable: *mut ::core::ffi::c_void,
    pub functionWindowSize: size_t,
    pub dataTable: *mut ::core::ffi::c_void,
    pub dataWindowSize: size_t,
}
impl Default for CUlibraryHostUniversalFunctionAndDataTable_st {
    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 CUlibraryHostUniversalFunctionAndDataTable = CUlibraryHostUniversalFunctionAndDataTable_st;
/// Error codes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cudaError_enum {
    /// The API call returned with no errors. In the case of query calls, this also means that the operation being queried is complete
    /// (see [`cuEventQuery`] and [`cuStreamQuery`]).
    CUDA_SUCCESS = 0,
    /// This indicates that one or more of the parameters passed to the API call is not within an acceptable range of values.
    CUDA_ERROR_INVALID_VALUE = 1,
    /// The API call failed because it was unable to allocate enough memory or other resources to perform the requested operation.
    CUDA_ERROR_OUT_OF_MEMORY = 2,
    /// This indicates that the CUDA driver has not been initialized with [`cuInit`] has not been called, any function from the driver API will return [`CUresult::CUDA_ERROR_NOT_INITIALIZED`].") or that initialization has failed.
    CUDA_ERROR_NOT_INITIALIZED = 3,
    /// This indicates that the CUDA driver is in the process of shutting down.
    CUDA_ERROR_DEINITIALIZED = 4,
    /// This indicates profiler is not initialized for this run. This can happen when the application is running with external profiling
    /// tools like visual profiler.
    CUDA_ERROR_PROFILER_DISABLED = 5,
    #[deprecated]
    CUDA_ERROR_PROFILER_NOT_INITIALIZED = 6,
    #[deprecated]
    CUDA_ERROR_PROFILER_ALREADY_STARTED = 7,
    #[deprecated]
    CUDA_ERROR_PROFILER_ALREADY_STOPPED = 8,
    /// This indicates that the CUDA driver that the application has loaded is a stub library. Applications that run with the stub
    /// rather than a real driver loaded will result in CUDA API returning this error.
    CUDA_ERROR_STUB_LIBRARY = 34,
    /// This indicates that the API call requires a newer CUDA driver than the one currently installed. Users should install an updated
    /// NVIDIA CUDA driver to allow the API call to succeed.
    CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER = 36,
    /// This indicates that requested CUDA device is unavailable at the current time. Devices are often unavailable due to use of
    /// CU_COMPUTEMODE_EXCLUSIVE_PROCESS or CU_COMPUTEMODE_PROHIBITED.
    CUDA_ERROR_DEVICE_UNAVAILABLE = 46,
    /// This indicates that no CUDA-capable devices were detected by the installed CUDA driver.
    CUDA_ERROR_NO_DEVICE = 100,
    /// This indicates that the device ordinal supplied by the user does not correspond to a valid CUDA device or that the action
    /// requested is invalid for the specified device.
    CUDA_ERROR_INVALID_DEVICE = 101,
    /// This error indicates that the Grid license is not applied.
    CUDA_ERROR_DEVICE_NOT_LICENSED = 102,
    /// This indicates that the device kernel image is invalid. This can also indicate an invalid CUDA module.
    CUDA_ERROR_INVALID_IMAGE = 200,
    /// This most frequently indicates that there is no context bound to the current thread. This can also be returned if the context
    /// passed to an API call is not a valid handle (such as a context that has had [`cuCtxDestroy_v2`] invoked on it). This can also be returned if a user mixes different API versions (i.e. 3010 context with 3020 API calls).
    /// See [`cuCtxGetApiVersion`] for more details. This can also be returned if the green context passed to an API call was not converted to a [`CUcontext`] using [`cuCtxFromGreenCtx`] API.
    CUDA_ERROR_INVALID_CONTEXT = 201,
    /// This indicated that the context being supplied as a parameter to the API call was already the active context.
    #[deprecated]
    CUDA_ERROR_CONTEXT_ALREADY_CURRENT = 202,
    /// This indicates that a map or register operation has failed.
    CUDA_ERROR_MAP_FAILED = 205,
    /// This indicates that an unmap or unregister operation has failed.
    CUDA_ERROR_UNMAP_FAILED = 206,
    /// This indicates that the specified array is currently mapped and thus cannot be destroyed.
    CUDA_ERROR_ARRAY_IS_MAPPED = 207,
    /// This indicates that the resource is already mapped.
    CUDA_ERROR_ALREADY_MAPPED = 208,
    /// This indicates that there is no kernel image available that is suitable for the device. This can occur when a user specifies
    /// code generation options for a particular CUDA source file that do not include the corresponding device configuration.
    CUDA_ERROR_NO_BINARY_FOR_GPU = 209,
    /// This indicates that a resource has already been acquired.
    CUDA_ERROR_ALREADY_ACQUIRED = 210,
    /// This indicates that a resource is not mapped.
    CUDA_ERROR_NOT_MAPPED = 211,
    /// This indicates that a mapped resource is not available for access as an array.
    CUDA_ERROR_NOT_MAPPED_AS_ARRAY = 212,
    /// This indicates that a mapped resource is not available for access as a pointer.
    CUDA_ERROR_NOT_MAPPED_AS_POINTER = 213,
    /// This indicates that an uncorrectable ECC error was detected during execution.
    CUDA_ERROR_ECC_UNCORRECTABLE = 214,
    /// This indicates that the `CUlimit` passed to the API call is not supported by the active device.
    CUDA_ERROR_UNSUPPORTED_LIMIT = 215,
    /// This indicates that the [`CUcontext`] passed to the API call can only be bound to a single CPU thread at a time but is already bound to a CPU thread.
    CUDA_ERROR_CONTEXT_ALREADY_IN_USE = 216,
    /// This indicates that peer access is not supported across the given devices.
    CUDA_ERROR_PEER_ACCESS_UNSUPPORTED = 217,
    /// This indicates that a PTX JIT compilation failed.
    CUDA_ERROR_INVALID_PTX = 218,
    /// This indicates an error with OpenGL or DirectX context.
    CUDA_ERROR_INVALID_GRAPHICS_CONTEXT = 219,
    /// This indicates that an uncorrectable NVLink error was detected during the execution.
    CUDA_ERROR_NVLINK_UNCORRECTABLE = 220,
    /// This indicates that the PTX JIT compiler library was not found.
    CUDA_ERROR_JIT_COMPILER_NOT_FOUND = 221,
    /// This indicates that the provided PTX was compiled with an unsupported toolchain.
    CUDA_ERROR_UNSUPPORTED_PTX_VERSION = 222,
    /// This indicates that the PTX JIT compilation was disabled.
    CUDA_ERROR_JIT_COMPILATION_DISABLED = 223,
    /// This indicates that the `CUexecAffinityType` passed to the API call is not supported by the active device.
    CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY = 224,
    /// This indicates that the code to be compiled by the PTX JIT contains unsupported call to cudaDeviceSynchronize.
    CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC = 225,
    /// This indicates that an exception occurred on the device that is now contained by the GPU's error containment capability. Common
    /// causes are - a. Certain types of invalid accesses of peer GPU memory over nvlink b. Certain classes of hardware errors This
    /// leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA,
    /// the process must be terminated and relaunched.
    CUDA_ERROR_CONTAINED = 226,
    /// This indicates that the device kernel source is invalid. This includes compilation/linker errors encountered in device code
    /// or user error.
    CUDA_ERROR_INVALID_SOURCE = 300,
    /// This indicates that the file specified was not found.
    CUDA_ERROR_FILE_NOT_FOUND = 301,
    /// This indicates that a link to a shared object failed to resolve.
    CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND = 302,
    /// This indicates that initialization of a shared object failed.
    CUDA_ERROR_SHARED_OBJECT_INIT_FAILED = 303,
    /// This indicates that an OS call failed.
    CUDA_ERROR_OPERATING_SYSTEM = 304,
    /// This indicates that a resource handle passed to the API call was not valid. Resource handles are opaque types like [`CUstream`] and [`CUevent`].
    CUDA_ERROR_INVALID_HANDLE = 400,
    /// This indicates that a resource required by the API call is not in a valid state to perform the requested operation.
    CUDA_ERROR_ILLEGAL_STATE = 401,
    /// This indicates an attempt was made to introspect an object in a way that would discard semantically important information.
    /// This is either due to the object using funtionality newer than the API version used to introspect it or omission of optional
    /// return arguments.
    CUDA_ERROR_LOSSY_QUERY = 402,
    /// This indicates that a named symbol was not found. Examples of symbols are global/constant variable names, driver function
    /// names, texture names, and surface names.
    CUDA_ERROR_NOT_FOUND = 500,
    /// This indicates that asynchronous operations issued previously have not completed yet. This result is not actually an error,
    /// but must be indicated differently than CUDA_SUCCESS (which indicates completion). Calls that may return this value include [`cuEventQuery`] and [`cuStreamQuery`].
    CUDA_ERROR_NOT_READY = 600,
    /// While executing a kernel, the device encountered a load or store instruction on an invalid memory address. This leaves the
    /// process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process
    /// must be terminated and relaunched.
    CUDA_ERROR_ILLEGAL_ADDRESS = 700,
    /// This indicates that a launch did not occur because it did not have appropriate resources. This error usually indicates that
    /// the user has attempted to pass too many arguments to the device kernel, or the kernel launch specifies too many threads for
    /// the kernel's register count. Passing arguments of the wrong size (i.e. a 64-bit pointer when a 32-bit int is expected) is
    /// equivalent to passing too many arguments and can also result in this error.
    CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES = 701,
    /// This indicates that the device kernel took too long to execute. This can only occur if timeouts are enabled - see the device
    /// attribute CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT for more information. This leaves the process in an inconsistent state and any further CUDA work will return the same error.
    /// To continue using CUDA, the process must be terminated and relaunched.
    CUDA_ERROR_LAUNCH_TIMEOUT = 702,
    /// This error indicates a kernel launch that uses an incompatible texturing mode.
    CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING = 703,
    /// This error indicates that a call to [`cuCtxEnablePeerAccess`] is trying to re-enable peer access to a context which has already had peer access to it enabled.
    CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED = 704,
    /// This error indicates that [`cuCtxDisablePeerAccess`] is trying to disable peer access which has not been enabled yet via [`cuCtxEnablePeerAccess`].
    CUDA_ERROR_PEER_ACCESS_NOT_ENABLED = 705,
    /// This error indicates that the primary context for the specified device has already been initialized.
    CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE = 708,
    /// This error indicates that the context current to the calling thread has been destroyed using [`cuCtxDestroy_v2`], or is a primary context which has not yet been initialized.
    CUDA_ERROR_CONTEXT_IS_DESTROYED = 709,
    /// A device-side assert triggered during kernel execution. The context cannot be used anymore, and must be destroyed. All existing
    /// device memory allocations from this context are invalid and must be reconstructed if the program is to continue using CUDA.
    CUDA_ERROR_ASSERT = 710,
    /// This error indicates that the hardware resources required to enable peer access have been exhausted for one or more of the
    /// devices passed to [`cuCtxEnablePeerAccess`].
    CUDA_ERROR_TOO_MANY_PEERS = 711,
    /// This error indicates that the memory range passed to [`cuMemHostRegister_v2`] has already been registered.
    CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED = 712,
    /// This error indicates that the pointer passed to [`cuMemHostUnregister`] does not correspond to any currently registered memory region.
    CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED = 713,
    /// While executing a kernel, the device encountered a stack error. This can be due to stack corruption or exceeding the stack
    /// size limit. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue
    /// using CUDA, the process must be terminated and relaunched.
    CUDA_ERROR_HARDWARE_STACK_ERROR = 714,
    /// While executing a kernel, the device encountered an illegal instruction. This leaves the process in an inconsistent state
    /// and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
    CUDA_ERROR_ILLEGAL_INSTRUCTION = 715,
    /// While executing a kernel, the device encountered a load or store instruction on a memory address which is not aligned. This
    /// leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA,
    /// the process must be terminated and relaunched.
    CUDA_ERROR_MISALIGNED_ADDRESS = 716,
    /// While executing a kernel, the device encountered an instruction which can only operate on memory locations in certain address
    /// spaces (global, shared, or local), but was supplied a memory address not belonging to an allowed address space. This leaves
    /// the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process
    /// must be terminated and relaunched.
    CUDA_ERROR_INVALID_ADDRESS_SPACE = 717,
    /// While executing a kernel, the device program counter wrapped its address space. This leaves the process in an inconsistent
    /// state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
    CUDA_ERROR_INVALID_PC = 718,
    /// An exception occurred on the device while executing a kernel. Common causes include dereferencing an invalid device pointer
    /// and accessing out of bounds shared memory. Less common cases can be system specific - more information about these cases can
    /// be found in the system specific user guide. This leaves the process in an inconsistent state and any further CUDA work will
    /// return the same error. To continue using CUDA, the process must be terminated and relaunched.
    CUDA_ERROR_LAUNCH_FAILED = 719,
    /// This error indicates that the number of blocks launched per grid for a kernel that was launched via either [`cuLaunchCooperativeKernel`] or [`cuLaunchCooperativeKernelMultiDevice`] exceeds the maximum number of blocks as allowed by [`cuOccupancyMaxActiveBlocksPerMultiprocessor`] or [`cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`] times the number of multiprocessors as specified by the device attribute CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT.
    CUDA_ERROR_COOPERATIVE_LAUNCH_TOO_LARGE = 720,
    /// An exception occurred on the device while exiting a kernel using tensor memory: the tensor memory was not completely deallocated.
    /// This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA,
    /// the process must be terminated and relaunched.
    CUDA_ERROR_TENSOR_MEMORY_LEAK = 721,
    /// This error indicates that the attempted operation is not permitted.
    CUDA_ERROR_NOT_PERMITTED = 800,
    /// This error indicates that the attempted operation is not supported on the current system or device.
    CUDA_ERROR_NOT_SUPPORTED = 801,
    /// This error indicates that the system is not yet ready to start any CUDA work. To continue using CUDA, verify the system configuration
    /// is in a valid state and all required driver daemons are actively running. More information about this error can be found in
    /// the system specific user guide.
    CUDA_ERROR_SYSTEM_NOT_READY = 802,
    /// This error indicates that there is a mismatch between the versions of the display driver and the CUDA driver. Refer to the
    /// compatibility documentation for supported versions.
    CUDA_ERROR_SYSTEM_DRIVER_MISMATCH = 803,
    /// This error indicates that the system was upgraded to run with forward compatibility but the visible hardware detected by CUDA
    /// does not support this configuration. Refer to the compatibility documentation for the supported hardware matrix or ensure
    /// that only supported hardware is visible during initialization via the CUDA_VISIBLE_DEVICES environment variable.
    CUDA_ERROR_COMPAT_NOT_SUPPORTED_ON_DEVICE = 804,
    /// This error indicates that the MPS client failed to connect to the MPS control daemon or the MPS server.
    CUDA_ERROR_MPS_CONNECTION_FAILED = 805,
    /// This error indicates that the remote procedural call between the MPS server and the MPS client failed.
    CUDA_ERROR_MPS_RPC_FAILURE = 806,
    /// This error indicates that the MPS server is not ready to accept new MPS client requests. This error can be returned when the
    /// MPS server is in the process of recovering from a fatal failure.
    CUDA_ERROR_MPS_SERVER_NOT_READY = 807,
    /// This error indicates that the hardware resources required to create MPS client have been exhausted.
    CUDA_ERROR_MPS_MAX_CLIENTS_REACHED = 808,
    /// This error indicates the hardware resources required to support device connections have been exhausted.
    CUDA_ERROR_MPS_MAX_CONNECTIONS_REACHED = 809,
    /// This error indicates that the MPS client has been terminated by the server. To continue using CUDA, the process must be terminated
    /// and relaunched.
    CUDA_ERROR_MPS_CLIENT_TERMINATED = 810,
    /// This error indicates that the module is using CUDA Dynamic Parallelism, but the current configuration, like MPS, does not
    /// support it.
    CUDA_ERROR_CDP_NOT_SUPPORTED = 811,
    /// This error indicates that a module contains an unsupported interaction between different versions of CUDA Dynamic Parallelism.
    CUDA_ERROR_CDP_VERSION_MISMATCH = 812,
    /// This error indicates that the operation is not permitted when the stream is capturing.
    CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED = 900,
    /// This error indicates that the current capture sequence on the stream has been invalidated due to a previous error.
    CUDA_ERROR_STREAM_CAPTURE_INVALIDATED = 901,
    /// This error indicates that the operation would have resulted in a merge of two independent capture sequences.
    CUDA_ERROR_STREAM_CAPTURE_MERGE = 902,
    /// This error indicates that the capture was not initiated in this stream.
    CUDA_ERROR_STREAM_CAPTURE_UNMATCHED = 903,
    /// This error indicates that the capture sequence contains a fork that was not joined to the primary stream.
    CUDA_ERROR_STREAM_CAPTURE_UNJOINED = 904,
    /// This error indicates that a dependency would have been created which crosses the capture sequence boundary. Only implicit
    /// in-stream ordering dependencies are allowed to cross the boundary.
    CUDA_ERROR_STREAM_CAPTURE_ISOLATION = 905,
    /// This error indicates a disallowed implicit dependency on a current capture sequence from cudaStreamLegacy.
    CUDA_ERROR_STREAM_CAPTURE_IMPLICIT = 906,
    /// This error indicates that the operation is not permitted on an event which was last recorded in a capturing stream.
    CUDA_ERROR_CAPTURED_EVENT = 907,
    /// A stream capture sequence not initiated with the [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`] argument to [`cuStreamBeginCapture_v2`] was passed to [`cuStreamEndCapture`] in a different thread.
    CUDA_ERROR_STREAM_CAPTURE_WRONG_THREAD = 908,
    /// This error indicates that the timeout specified for the wait operation has lapsed.
    CUDA_ERROR_TIMEOUT = 909,
    /// This error indicates that the graph update was not performed because it included changes which violated constraints specific
    /// to instantiated graph update.
    CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE = 910,
    /// This indicates that an error has occurred in a device outside of GPU. It can be a synchronous error with respect to CUDA API or an
    /// asynchronous error from the external device. In case of asynchronous error, it means that if CUDA was waiting for an external
    /// device's signal before consuming shared data, the external device signaled an error indicating that the data is not valid
    /// for consumption. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To
    /// continue using CUDA, the process must be terminated and relaunched. In case of synchronous error, it means that one or more
    /// external devices have encountered an error and cannot complete the operation.
    CUDA_ERROR_EXTERNAL_DEVICE = 911,
    /// Indicates a kernel launch error due to cluster misconfiguration.
    CUDA_ERROR_INVALID_CLUSTER_SIZE = 912,
    /// Indiciates a function handle is not loaded when calling an API that requires a loaded function.
    CUDA_ERROR_FUNCTION_NOT_LOADED = 913,
    /// This error indicates one or more resources passed in are not valid resource types for the operation.
    CUDA_ERROR_INVALID_RESOURCE_TYPE = 914,
    /// This error indicates one or more resources are insufficient or non-applicable for the operation.
    CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION = 915,
    /// This error indicates that an error happened during the key rotation sequence.
    CUDA_ERROR_KEY_ROTATION = 916,
    /// This error indicates that the requested operation is not permitted because the stream is in a detached state. This can occur
    /// if the green context associated with the stream has been destroyed, limiting the stream's operational capabilities.
    CUDA_ERROR_STREAM_DETACHED = 917,
    /// This indicates that an unknown internal error has occurred.
    CUDA_ERROR_UNKNOWN = 999,
}
pub use self::cudaError_enum as CUresult;
impl CUdevice_P2PAttribute_enum {
    pub const CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED: CUdevice_P2PAttribute_enum = CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED;
}
/// P2P Attributes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUdevice_P2PAttribute_enum {
    /// A relative value indicating the performance of the link between two devices.
    CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK = 1,
    /// P2P Access is enable.
    CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED = 2,
    /// All CUDA-valid atomic operation over the link are supported.
    CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED = 3,
    /// use [`CUdevice_P2PAttribute::CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED`] instead.
    #[deprecated]
    CU_DEVICE_P2P_ATTRIBUTE_ACCESS_ACCESS_SUPPORTED = 4,
    /// Only some CUDA-valid atomic operations over the link are supported.
    CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED = 5,
}
pub use self::CUdevice_P2PAttribute_enum as CUdevice_P2PAttribute;
/// CUDA stream callback.
pub type CUstreamCallback = ::core::option::Option<
    unsafe extern "C" fn(
        hStream: CUstream,
        status: CUresult,
        userData: *mut ::core::ffi::c_void,
    ),
>;
/// Block size to per-block dynamic shared memory mapping for a certain kernel.
pub type CUoccupancyB2DSize = ::core::option::Option<
    unsafe extern "C" fn(blockSize: ::core::ffi::c_int) -> size_t,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_MEMCPY2D_st {
    pub srcXInBytes: size_t,
    pub srcY: size_t,
    pub srcMemoryType: CUmemorytype,
    pub srcHost: *const ::core::ffi::c_void,
    pub srcDevice: CUdeviceptr,
    pub srcArray: CUarray,
    pub srcPitch: size_t,
    pub dstXInBytes: size_t,
    pub dstY: size_t,
    pub dstMemoryType: CUmemorytype,
    pub dstHost: *mut ::core::ffi::c_void,
    pub dstDevice: CUdeviceptr,
    pub dstArray: CUarray,
    pub dstPitch: size_t,
    pub WidthInBytes: size_t,
    pub Height: size_t,
}
impl Default for CUDA_MEMCPY2D_st {
    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()
        }
    }
}
/// 2D memory copy parameters.
pub type CUDA_MEMCPY2D_v2 = CUDA_MEMCPY2D_st;
pub type CUDA_MEMCPY2D = CUDA_MEMCPY2D_v2;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_MEMCPY3D_st {
    pub srcXInBytes: size_t,
    pub srcY: size_t,
    pub srcZ: size_t,
    pub srcLOD: size_t,
    pub srcMemoryType: CUmemorytype,
    pub srcHost: *const ::core::ffi::c_void,
    pub srcDevice: CUdeviceptr,
    pub srcArray: CUarray,
    pub reserved0: *mut ::core::ffi::c_void,
    pub srcPitch: size_t,
    pub srcHeight: size_t,
    pub dstXInBytes: size_t,
    pub dstY: size_t,
    pub dstZ: size_t,
    pub dstLOD: size_t,
    pub dstMemoryType: CUmemorytype,
    pub dstHost: *mut ::core::ffi::c_void,
    pub dstDevice: CUdeviceptr,
    pub dstArray: CUarray,
    pub reserved1: *mut ::core::ffi::c_void,
    pub dstPitch: size_t,
    pub dstHeight: size_t,
    pub WidthInBytes: size_t,
    pub Height: size_t,
    pub Depth: size_t,
}
impl Default for CUDA_MEMCPY3D_st {
    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()
        }
    }
}
/// 3D memory copy parameters.
pub type CUDA_MEMCPY3D_v2 = CUDA_MEMCPY3D_st;
pub type CUDA_MEMCPY3D = CUDA_MEMCPY3D_v2;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_MEMCPY3D_PEER_st {
    pub srcXInBytes: size_t,
    pub srcY: size_t,
    pub srcZ: size_t,
    pub srcLOD: size_t,
    pub srcMemoryType: CUmemorytype,
    pub srcHost: *const ::core::ffi::c_void,
    pub srcDevice: CUdeviceptr,
    pub srcArray: CUarray,
    pub srcContext: CUcontext,
    pub srcPitch: size_t,
    pub srcHeight: size_t,
    pub dstXInBytes: size_t,
    pub dstY: size_t,
    pub dstZ: size_t,
    pub dstLOD: size_t,
    pub dstMemoryType: CUmemorytype,
    pub dstHost: *mut ::core::ffi::c_void,
    pub dstDevice: CUdeviceptr,
    pub dstArray: CUarray,
    pub dstContext: CUcontext,
    pub dstPitch: size_t,
    pub dstHeight: size_t,
    pub WidthInBytes: size_t,
    pub Height: size_t,
    pub Depth: size_t,
}
impl Default for CUDA_MEMCPY3D_PEER_st {
    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()
        }
    }
}
/// 3D memory cross-context copy parameters.
pub type CUDA_MEMCPY3D_PEER_v1 = CUDA_MEMCPY3D_PEER_st;
pub type CUDA_MEMCPY3D_PEER = CUDA_MEMCPY3D_PEER_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_MEMCPY_NODE_PARAMS_st {
    pub flags: ::core::ffi::c_int,
    pub reserved: ::core::ffi::c_int,
    pub copyCtx: CUcontext,
    pub copyParams: CUDA_MEMCPY3D,
}
impl Default for CUDA_MEMCPY_NODE_PARAMS_st {
    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()
        }
    }
}
/// Memcpy node parameters.
pub type CUDA_MEMCPY_NODE_PARAMS = CUDA_MEMCPY_NODE_PARAMS_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_ARRAY_DESCRIPTOR_st {
    pub Width: size_t,
    pub Height: size_t,
    pub Format: CUarray_format,
    pub NumChannels: ::core::ffi::c_uint,
}
impl Default for CUDA_ARRAY_DESCRIPTOR_st {
    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()
        }
    }
}
/// Array descriptor.
pub type CUDA_ARRAY_DESCRIPTOR_v2 = CUDA_ARRAY_DESCRIPTOR_st;
pub type CUDA_ARRAY_DESCRIPTOR = CUDA_ARRAY_DESCRIPTOR_v2;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_ARRAY3D_DESCRIPTOR_st {
    pub Width: size_t,
    pub Height: size_t,
    pub Depth: size_t,
    pub Format: CUarray_format,
    pub NumChannels: ::core::ffi::c_uint,
    pub Flags: ::core::ffi::c_uint,
}
impl Default for CUDA_ARRAY3D_DESCRIPTOR_st {
    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()
        }
    }
}
/// 3D array descriptor.
pub type CUDA_ARRAY3D_DESCRIPTOR_v2 = CUDA_ARRAY3D_DESCRIPTOR_st;
pub type CUDA_ARRAY3D_DESCRIPTOR = CUDA_ARRAY3D_DESCRIPTOR_v2;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_ARRAY_SPARSE_PROPERTIES_st {
    pub tileExtent: CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1,
    pub miptailFirstLevel: ::core::ffi::c_uint,
    pub miptailSize: ::core::ffi::c_ulonglong,
    pub flags: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 4usize],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_ARRAY_SPARSE_PROPERTIES_st__bindgen_ty_1 {
    pub width: ::core::ffi::c_uint,
    pub height: ::core::ffi::c_uint,
    pub depth: ::core::ffi::c_uint,
}
/// CUDA array sparse properties.
pub type CUDA_ARRAY_SPARSE_PROPERTIES_v1 = CUDA_ARRAY_SPARSE_PROPERTIES_st;
pub type CUDA_ARRAY_SPARSE_PROPERTIES = CUDA_ARRAY_SPARSE_PROPERTIES_v1;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_ARRAY_MEMORY_REQUIREMENTS_st {
    pub size: size_t,
    pub alignment: size_t,
    pub reserved: [::core::ffi::c_uint; 4usize],
}
/// CUDA array memory requirements.
pub type CUDA_ARRAY_MEMORY_REQUIREMENTS_v1 = CUDA_ARRAY_MEMORY_REQUIREMENTS_st;
pub type CUDA_ARRAY_MEMORY_REQUIREMENTS = CUDA_ARRAY_MEMORY_REQUIREMENTS_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_RESOURCE_DESC_st {
    pub resType: CUresourcetype,
    pub res: CUDA_RESOURCE_DESC_st__bindgen_ty_1,
    pub flags: ::core::ffi::c_uint,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUDA_RESOURCE_DESC_st__bindgen_ty_1 {
    pub array: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1,
    pub mipmap: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2,
    pub linear: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3,
    pub pitch2D: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4,
    pub reserved: CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_5,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
    pub hArray: CUarray,
}
impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 {
    pub hMipmappedArray: CUmipmappedArray,
}
impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_2 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3 {
    pub devPtr: CUdeviceptr,
    pub format: CUarray_format,
    pub numChannels: ::core::ffi::c_uint,
    pub sizeInBytes: size_t,
}
impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_3 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4 {
    pub devPtr: CUdeviceptr,
    pub format: CUarray_format,
    pub numChannels: ::core::ffi::c_uint,
    pub width: size_t,
    pub height: size_t,
    pub pitchInBytes: size_t,
}
impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_4 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_RESOURCE_DESC_st__bindgen_ty_1__bindgen_ty_5 {
    pub reserved: [::core::ffi::c_int; 32usize],
}
impl Default for CUDA_RESOURCE_DESC_st__bindgen_ty_1 {
    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 CUDA_RESOURCE_DESC_st {
    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()
        }
    }
}
/// CUDA Resource descriptor.
pub type CUDA_RESOURCE_DESC_v1 = CUDA_RESOURCE_DESC_st;
pub type CUDA_RESOURCE_DESC = CUDA_RESOURCE_DESC_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
pub struct CUDA_TEXTURE_DESC_st {
    pub addressMode: [CUaddress_mode; 3usize],
    pub filterMode: CUfilter_mode,
    pub flags: ::core::ffi::c_uint,
    pub maxAnisotropy: ::core::ffi::c_uint,
    pub mipmapFilterMode: CUfilter_mode,
    pub mipmapLevelBias: f32,
    pub minMipmapLevelClamp: f32,
    pub maxMipmapLevelClamp: f32,
    pub borderColor: [f32; 4usize],
    pub reserved: [::core::ffi::c_int; 12usize],
}
impl Default for CUDA_TEXTURE_DESC_st {
    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()
        }
    }
}
/// Texture descriptor.
pub type CUDA_TEXTURE_DESC_v1 = CUDA_TEXTURE_DESC_st;
pub type CUDA_TEXTURE_DESC = CUDA_TEXTURE_DESC_v1;
/// Resource view format.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUresourceViewFormat_enum {
    /// No resource view format (use underlying resource format).
    CU_RES_VIEW_FORMAT_NONE = 0,
    /// 1 channel unsigned 8-bit integers.
    CU_RES_VIEW_FORMAT_UINT_1X8 = 1,
    /// 2 channel unsigned 8-bit integers.
    CU_RES_VIEW_FORMAT_UINT_2X8 = 2,
    /// 4 channel unsigned 8-bit integers.
    CU_RES_VIEW_FORMAT_UINT_4X8 = 3,
    /// 1 channel signed 8-bit integers.
    CU_RES_VIEW_FORMAT_SINT_1X8 = 4,
    /// 2 channel signed 8-bit integers.
    CU_RES_VIEW_FORMAT_SINT_2X8 = 5,
    /// 4 channel signed 8-bit integers.
    CU_RES_VIEW_FORMAT_SINT_4X8 = 6,
    /// 1 channel unsigned 16-bit integers.
    CU_RES_VIEW_FORMAT_UINT_1X16 = 7,
    /// 2 channel unsigned 16-bit integers.
    CU_RES_VIEW_FORMAT_UINT_2X16 = 8,
    /// 4 channel unsigned 16-bit integers.
    CU_RES_VIEW_FORMAT_UINT_4X16 = 9,
    /// 1 channel signed 16-bit integers.
    CU_RES_VIEW_FORMAT_SINT_1X16 = 10,
    /// 2 channel signed 16-bit integers.
    CU_RES_VIEW_FORMAT_SINT_2X16 = 11,
    /// 4 channel signed 16-bit integers.
    CU_RES_VIEW_FORMAT_SINT_4X16 = 12,
    /// 1 channel unsigned 32-bit integers.
    CU_RES_VIEW_FORMAT_UINT_1X32 = 13,
    /// 2 channel unsigned 32-bit integers.
    CU_RES_VIEW_FORMAT_UINT_2X32 = 14,
    /// 4 channel unsigned 32-bit integers.
    CU_RES_VIEW_FORMAT_UINT_4X32 = 15,
    /// 1 channel signed 32-bit integers.
    CU_RES_VIEW_FORMAT_SINT_1X32 = 16,
    /// 2 channel signed 32-bit integers.
    CU_RES_VIEW_FORMAT_SINT_2X32 = 17,
    /// 4 channel signed 32-bit integers.
    CU_RES_VIEW_FORMAT_SINT_4X32 = 18,
    /// 1 channel 16-bit floating point.
    CU_RES_VIEW_FORMAT_FLOAT_1X16 = 19,
    /// 2 channel 16-bit floating point.
    CU_RES_VIEW_FORMAT_FLOAT_2X16 = 20,
    /// 4 channel 16-bit floating point.
    CU_RES_VIEW_FORMAT_FLOAT_4X16 = 21,
    /// 1 channel 32-bit floating point.
    CU_RES_VIEW_FORMAT_FLOAT_1X32 = 22,
    /// 2 channel 32-bit floating point.
    CU_RES_VIEW_FORMAT_FLOAT_2X32 = 23,
    /// 4 channel 32-bit floating point.
    CU_RES_VIEW_FORMAT_FLOAT_4X32 = 24,
    /// Block compressed 1.
    CU_RES_VIEW_FORMAT_UNSIGNED_BC1 = 25,
    /// Block compressed 2.
    CU_RES_VIEW_FORMAT_UNSIGNED_BC2 = 26,
    /// Block compressed 3.
    CU_RES_VIEW_FORMAT_UNSIGNED_BC3 = 27,
    /// Block compressed 4 unsigned.
    CU_RES_VIEW_FORMAT_UNSIGNED_BC4 = 28,
    /// Block compressed 4 signed.
    CU_RES_VIEW_FORMAT_SIGNED_BC4 = 29,
    /// Block compressed 5 unsigned.
    CU_RES_VIEW_FORMAT_UNSIGNED_BC5 = 30,
    /// Block compressed 5 signed.
    CU_RES_VIEW_FORMAT_SIGNED_BC5 = 31,
    /// Block compressed 6 unsigned half-float.
    CU_RES_VIEW_FORMAT_UNSIGNED_BC6H = 32,
    /// Block compressed 6 signed half-float.
    CU_RES_VIEW_FORMAT_SIGNED_BC6H = 33,
    /// Block compressed 7.
    CU_RES_VIEW_FORMAT_UNSIGNED_BC7 = 34,
}
pub use self::CUresourceViewFormat_enum as CUresourceViewFormat;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_RESOURCE_VIEW_DESC_st {
    pub format: CUresourceViewFormat,
    pub width: size_t,
    pub height: size_t,
    pub depth: size_t,
    pub firstMipmapLevel: ::core::ffi::c_uint,
    pub lastMipmapLevel: ::core::ffi::c_uint,
    pub firstLayer: ::core::ffi::c_uint,
    pub lastLayer: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 16usize],
}
impl Default for CUDA_RESOURCE_VIEW_DESC_st {
    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()
        }
    }
}
/// Resource view descriptor.
pub type CUDA_RESOURCE_VIEW_DESC_v1 = CUDA_RESOURCE_VIEW_DESC_st;
pub type CUDA_RESOURCE_VIEW_DESC = CUDA_RESOURCE_VIEW_DESC_v1;
#[repr(C)]
#[repr(align(128))]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUtensorMap_st {
    pub opaque: [cuuint64_t; 16usize],
}
impl Default for CUtensorMap_st {
    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()
        }
    }
}
/// Tensor map descriptor. Requires compiler support for aligning to 128 bytes.
pub type CUtensorMap = CUtensorMap_st;
/// Tensor map data type.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUtensorMapDataType_enum {
    CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0,
    CU_TENSOR_MAP_DATA_TYPE_UINT16 = 1,
    CU_TENSOR_MAP_DATA_TYPE_UINT32 = 2,
    CU_TENSOR_MAP_DATA_TYPE_INT32 = 3,
    CU_TENSOR_MAP_DATA_TYPE_UINT64 = 4,
    CU_TENSOR_MAP_DATA_TYPE_INT64 = 5,
    CU_TENSOR_MAP_DATA_TYPE_FLOAT16 = 6,
    CU_TENSOR_MAP_DATA_TYPE_FLOAT32 = 7,
    CU_TENSOR_MAP_DATA_TYPE_FLOAT64 = 8,
    CU_TENSOR_MAP_DATA_TYPE_BFLOAT16 = 9,
    CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ = 10,
    CU_TENSOR_MAP_DATA_TYPE_TFLOAT32 = 11,
    CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ = 12,
    CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B = 13,
    CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B = 14,
    CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B = 15,
}
pub use self::CUtensorMapDataType_enum as CUtensorMapDataType;
/// Tensor map interleave layout type.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUtensorMapInterleave_enum {
    CU_TENSOR_MAP_INTERLEAVE_NONE = 0,
    CU_TENSOR_MAP_INTERLEAVE_16B = 1,
    CU_TENSOR_MAP_INTERLEAVE_32B = 2,
}
pub use self::CUtensorMapInterleave_enum as CUtensorMapInterleave;
/// Tensor map swizzling mode of shared memory banks.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUtensorMapSwizzle_enum {
    CU_TENSOR_MAP_SWIZZLE_NONE = 0,
    CU_TENSOR_MAP_SWIZZLE_32B = 1,
    CU_TENSOR_MAP_SWIZZLE_64B = 2,
    CU_TENSOR_MAP_SWIZZLE_128B = 3,
    CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B = 4,
    CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B = 5,
    CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B = 6,
}
pub use self::CUtensorMapSwizzle_enum as CUtensorMapSwizzle;
/// Tensor map L2 promotion type.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUtensorMapL2promotion_enum {
    CU_TENSOR_MAP_L2_PROMOTION_NONE = 0,
    CU_TENSOR_MAP_L2_PROMOTION_L2_64B = 1,
    CU_TENSOR_MAP_L2_PROMOTION_L2_128B = 2,
    CU_TENSOR_MAP_L2_PROMOTION_L2_256B = 3,
}
pub use self::CUtensorMapL2promotion_enum as CUtensorMapL2promotion;
/// Tensor map out-of-bounds fill type.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUtensorMapFloatOOBfill_enum {
    CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0,
    CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA = 1,
}
pub use self::CUtensorMapFloatOOBfill_enum as CUtensorMapFloatOOBfill;
/// Tensor map Im2Col wide mode.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUtensorMapIm2ColWideMode_enum {
    CU_TENSOR_MAP_IM2COL_WIDE_MODE_W = 0,
    CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 = 1,
}
pub use self::CUtensorMapIm2ColWideMode_enum as CUtensorMapIm2ColWideMode;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st {
    pub p2pToken: ::core::ffi::c_ulonglong,
    pub vaSpaceToken: ::core::ffi::c_uint,
}
/// GPU Direct v3 tokens.
pub type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1 = CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_st;
pub type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS = CUDA_POINTER_ATTRIBUTE_P2P_TOKENS_v1;
/// Access flags that specify the level of access the current context's device has on the memory referenced.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum {
    /// No access, meaning the device cannot access this memory at all, thus must be staged through accessible memory in order to
    /// complete certain operations.
    CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE = 0,
    /// Read-only access, meaning writes to this memory are considered invalid accesses and thus return error in that case.
    CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READ = 1,
    /// Read-write access, the device has full read-write access to the memory.
    CU_POINTER_ATTRIBUTE_ACCESS_FLAG_READWRITE = 3,
}
pub use self::CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS_enum as CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_LAUNCH_PARAMS_st {
    pub function: CUfunction,
    pub gridDimX: ::core::ffi::c_uint,
    pub gridDimY: ::core::ffi::c_uint,
    pub gridDimZ: ::core::ffi::c_uint,
    pub blockDimX: ::core::ffi::c_uint,
    pub blockDimY: ::core::ffi::c_uint,
    pub blockDimZ: ::core::ffi::c_uint,
    pub sharedMemBytes: ::core::ffi::c_uint,
    pub hStream: CUstream,
    pub kernelParams: *mut *mut ::core::ffi::c_void,
}
impl Default for CUDA_LAUNCH_PARAMS_st {
    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()
        }
    }
}
/// Kernel launch parameters.
pub type CUDA_LAUNCH_PARAMS_v1 = CUDA_LAUNCH_PARAMS_st;
pub type CUDA_LAUNCH_PARAMS = CUDA_LAUNCH_PARAMS_v1;
/// External memory handle types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUexternalMemoryHandleType_enum {
    /// Handle is an opaque file descriptor.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD = 1,
    /// Handle is an opaque shared NT handle.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32 = 2,
    /// Handle is an opaque, globally shared handle.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3,
    /// Handle is a D3D12 heap object.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP = 4,
    /// Handle is a D3D12 committed resource.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE = 5,
    /// Handle is a shared NT handle to a D3D11 resource.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE = 6,
    /// Handle is a globally shared handle to a D3D11 resource.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = 7,
    /// Handle is an NvSciBuf object.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF = 8,
    /// Handle is a dma_buf file descriptor.
    CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD = 9,
}
pub use self::CUexternalMemoryHandleType_enum as CUexternalMemoryHandleType;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
    pub type_: CUexternalMemoryHandleType,
    pub handle: CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1,
    pub size: ::core::ffi::c_ulonglong,
    pub flags: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 16usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1 {
    pub fd: ::core::ffi::c_int,
    pub win32: CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1,
    pub nvSciBufObject: *const ::core::ffi::c_void,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
    pub handle: *mut ::core::ffi::c_void,
    pub name: *const ::core::ffi::c_void,
}
impl Default for CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
    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 CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st__bindgen_ty_1 {
    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 CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
    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()
        }
    }
}
/// External memory handle descriptor.
pub type CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1 = CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st;
pub type CUDA_EXTERNAL_MEMORY_HANDLE_DESC = CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st {
    pub offset: ::core::ffi::c_ulonglong,
    pub size: ::core::ffi::c_ulonglong,
    pub flags: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 16usize],
}
/// External memory buffer descriptor.
pub type CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1 = CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st;
pub type CUDA_EXTERNAL_MEMORY_BUFFER_DESC = CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
    pub offset: ::core::ffi::c_ulonglong,
    pub arrayDesc: CUDA_ARRAY3D_DESCRIPTOR,
    pub numLevels: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 16usize],
}
impl Default for CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
    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()
        }
    }
}
/// External memory mipmap descriptor.
pub type CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 = CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st;
pub type CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC = CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1;
/// External semaphore handle types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUexternalSemaphoreHandleType_enum {
    /// Handle is an opaque file descriptor.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD = 1,
    /// Handle is an opaque shared NT handle.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32 = 2,
    /// Handle is an opaque, globally shared handle.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT = 3,
    /// Handle is a shared NT handle referencing a D3D12 fence object.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE = 4,
    /// Handle is a shared NT handle referencing a D3D11 fence object.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE = 5,
    /// Opaque handle to NvSciSync Object.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC = 6,
    /// Handle is a shared NT handle referencing a D3D11 keyed mutex object.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX = 7,
    /// Handle is a globally shared handle referencing a D3D11 keyed mutex object.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT = 8,
    /// Handle is an opaque file descriptor referencing a timeline semaphore.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD = 9,
    /// Handle is an opaque shared NT handle referencing a timeline semaphore.
    CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10,
}
pub use self::CUexternalSemaphoreHandleType_enum as CUexternalSemaphoreHandleType;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
    pub type_: CUexternalSemaphoreHandleType,
    pub handle: CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1,
    pub flags: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 16usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1 {
    pub fd: ::core::ffi::c_int,
    pub win32: CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1,
    pub nvSciSyncObj: *const ::core::ffi::c_void,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
    pub handle: *mut ::core::ffi::c_void,
    pub name: *const ::core::ffi::c_void,
}
impl Default for CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1__bindgen_ty_1 {
    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 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st__bindgen_ty_1 {
    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 CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
    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()
        }
    }
}
/// External semaphore handle descriptor.
pub type CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 = CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st;
pub type CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC = CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st {
    pub params: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1,
    pub flags: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 16usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1 {
    pub fence: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_1,
    pub nvSciSync: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_2,
    pub keyedMutex: CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_3,
    pub reserved: [::core::ffi::c_uint; 12usize],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_1 {
    pub value: ::core::ffi::c_ulonglong,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_2 {
    pub fence: *mut ::core::ffi::c_void,
    pub reserved: ::core::ffi::c_ulonglong,
}
impl Default for CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_2 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1__bindgen_ty_3 {
    pub key: ::core::ffi::c_ulonglong,
}
impl Default for CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st__bindgen_ty_1 {
    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 CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st {
    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()
        }
    }
}
/// External semaphore signal parameters.
pub type CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 = CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st;
pub type CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS = CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st {
    pub params: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1,
    pub flags: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 16usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1 {
    pub fence: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_1,
    pub nvSciSync: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_2,
    pub keyedMutex: CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_3,
    pub reserved: [::core::ffi::c_uint; 10usize],
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_1 {
    pub value: ::core::ffi::c_ulonglong,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_2 {
    pub fence: *mut ::core::ffi::c_void,
    pub reserved: ::core::ffi::c_ulonglong,
}
impl Default for CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_2 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1__bindgen_ty_3 {
    pub key: ::core::ffi::c_ulonglong,
    pub timeoutMs: ::core::ffi::c_uint,
}
impl Default for CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st__bindgen_ty_1 {
    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 CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st {
    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()
        }
    }
}
/// External semaphore wait parameters.
pub type CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 = CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st;
pub type CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS = CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st {
    pub extSemArray: *mut CUexternalSemaphore,
    pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,
    pub numExtSems: ::core::ffi::c_uint,
}
impl Default for CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st {
    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()
        }
    }
}
/// Semaphore signal node parameters.
pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1 = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st;
pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st {
    pub extSemArray: *mut CUexternalSemaphore,
    pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,
    pub numExtSems: ::core::ffi::c_uint,
}
impl Default for CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st {
    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()
        }
    }
}
/// Semaphore signal node parameters.
pub type CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 = CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_st {
    pub extSemArray: *mut CUexternalSemaphore,
    pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,
    pub numExtSems: ::core::ffi::c_uint,
}
impl Default for CUDA_EXT_SEM_WAIT_NODE_PARAMS_st {
    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()
        }
    }
}
/// Semaphore wait node parameters.
pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 = CUDA_EXT_SEM_WAIT_NODE_PARAMS_st;
pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS = CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st {
    pub extSemArray: *mut CUexternalSemaphore,
    pub paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,
    pub numExtSems: ::core::ffi::c_uint,
}
impl Default for CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st {
    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()
        }
    }
}
/// Semaphore wait node parameters.
pub type CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 = CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st;
pub type CUmemGenericAllocationHandle_v1 = ::core::ffi::c_ulonglong;
pub type CUmemGenericAllocationHandle = CUmemGenericAllocationHandle_v1;
/// Flags for specifying particular handle types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemAllocationHandleType_enum {
    /// Does not allow any export mechanism. >.
    CU_MEM_HANDLE_TYPE_NONE = 0,
    /// Allows a file descriptor to be used for exporting. Permitted only on POSIX systems. (int).
    CU_MEM_HANDLE_TYPE_POSIX_FILE_DESCRIPTOR = 1,
    /// Allows a Win32 NT handle to be used for exporting. (HANDLE).
    CU_MEM_HANDLE_TYPE_WIN32 = 2,
    /// Allows a Win32 KMT handle to be used for exporting. (D3DKMT_HANDLE).
    CU_MEM_HANDLE_TYPE_WIN32_KMT = 4,
    /// Allows a fabric handle to be used for exporting. (CUmemFabricHandle).
    CU_MEM_HANDLE_TYPE_FABRIC = 8,
    CU_MEM_HANDLE_TYPE_MAX = 2147483647,
}
pub use self::CUmemAllocationHandleType_enum as CUmemAllocationHandleType;
/// Specifies the memory protection flags for mapping.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemAccess_flags_enum {
    /// Default, make the address range not accessible.
    CU_MEM_ACCESS_FLAGS_PROT_NONE = 0,
    /// Make the address range read accessible.
    CU_MEM_ACCESS_FLAGS_PROT_READ = 1,
    /// Make the address range read-write accessible.
    CU_MEM_ACCESS_FLAGS_PROT_READWRITE = 3,
    CU_MEM_ACCESS_FLAGS_PROT_MAX = 2147483647,
}
pub use self::CUmemAccess_flags_enum as CUmemAccess_flags;
impl CUmemLocationType_enum {
    pub const CU_MEM_LOCATION_TYPE_NONE: CUmemLocationType_enum = CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_INVALID;
}
/// Specifies the type of location.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemLocationType_enum {
    CU_MEM_LOCATION_TYPE_INVALID = 0,
    /// Location is a device location, thus id is a device ordinal.
    CU_MEM_LOCATION_TYPE_DEVICE = 1,
    /// Location is host, id is ignored.
    CU_MEM_LOCATION_TYPE_HOST = 2,
    /// Location is a host NUMA node, thus id is a host NUMA node id.
    CU_MEM_LOCATION_TYPE_HOST_NUMA = 3,
    /// Location is a host NUMA node of the current thread, id is ignored.
    CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT = 4,
    /// Location is not visible but device is accessible, id is always CU_DEVICE_INVALID.
    CU_MEM_LOCATION_TYPE_INVISIBLE = 5,
    CU_MEM_LOCATION_TYPE_MAX = 2147483647,
}
pub use self::CUmemLocationType_enum as CUmemLocationType;
/// Defines the allocation types available.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemAllocationType_enum {
    CU_MEM_ALLOCATION_TYPE_INVALID = 0,
    /// This allocation type is 'pinned', i.e. cannot migrate from its current location while the application is actively using it.
    CU_MEM_ALLOCATION_TYPE_PINNED = 1,
    /// This allocation type is managed memory.
    CU_MEM_ALLOCATION_TYPE_MANAGED = 2,
    CU_MEM_ALLOCATION_TYPE_MAX = 2147483647,
}
pub use self::CUmemAllocationType_enum as CUmemAllocationType;
/// Flag for requesting different optimal and required granularities for an allocation.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemAllocationGranularity_flags_enum {
    /// Minimum required granularity for allocation.
    CU_MEM_ALLOC_GRANULARITY_MINIMUM = 0,
    /// Recommended granularity for allocation for best performance.
    CU_MEM_ALLOC_GRANULARITY_RECOMMENDED = 1,
}
pub use self::CUmemAllocationGranularity_flags_enum as CUmemAllocationGranularity_flags;
/// Specifies the handle type for address range.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemRangeHandleType_enum {
    CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD = 1,
    CU_MEM_RANGE_HANDLE_TYPE_MAX = 2147483647,
}
pub use self::CUmemRangeHandleType_enum as CUmemRangeHandleType;
/// Flag for requesting handle type for address range.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemRangeFlags_enum {
    /// Indicates that DMA_BUF handle should be mapped via PCIe BAR1.
    CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE = 1,
}
pub use self::CUmemRangeFlags_enum as CUmemRangeFlags;
/// Sparse subresource types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUarraySparseSubresourceType_enum {
    CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0,
    CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1,
}
pub use self::CUarraySparseSubresourceType_enum as CUarraySparseSubresourceType;
/// Memory operation types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemOperationType_enum {
    CU_MEM_OPERATION_TYPE_MAP = 1,
    CU_MEM_OPERATION_TYPE_UNMAP = 2,
}
pub use self::CUmemOperationType_enum as CUmemOperationType;
/// Memory handle types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemHandleType_enum {
    CU_MEM_HANDLE_TYPE_GENERIC = 0,
}
pub use self::CUmemHandleType_enum as CUmemHandleType;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUarrayMapInfo_st {
    pub resourceType: CUresourcetype,
    pub resource: CUarrayMapInfo_st__bindgen_ty_1,
    pub subresourceType: CUarraySparseSubresourceType,
    pub subresource: CUarrayMapInfo_st__bindgen_ty_2,
    pub memOperationType: CUmemOperationType,
    pub memHandleType: CUmemHandleType,
    pub memHandle: CUarrayMapInfo_st__bindgen_ty_3,
    pub offset: ::core::ffi::c_ulonglong,
    pub deviceBitMask: ::core::ffi::c_uint,
    pub flags: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 2usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUarrayMapInfo_st__bindgen_ty_1 {
    pub mipmap: CUmipmappedArray,
    pub array: CUarray,
}
impl Default for CUarrayMapInfo_st__bindgen_ty_1 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUarrayMapInfo_st__bindgen_ty_2 {
    pub sparseLevel: CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1,
    pub miptail: CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_1 {
    pub level: ::core::ffi::c_uint,
    pub layer: ::core::ffi::c_uint,
    pub offsetX: ::core::ffi::c_uint,
    pub offsetY: ::core::ffi::c_uint,
    pub offsetZ: ::core::ffi::c_uint,
    pub extentWidth: ::core::ffi::c_uint,
    pub extentHeight: ::core::ffi::c_uint,
    pub extentDepth: ::core::ffi::c_uint,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUarrayMapInfo_st__bindgen_ty_2__bindgen_ty_2 {
    pub layer: ::core::ffi::c_uint,
    pub offset: ::core::ffi::c_ulonglong,
    pub size: ::core::ffi::c_ulonglong,
}
impl Default for CUarrayMapInfo_st__bindgen_ty_2 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUarrayMapInfo_st__bindgen_ty_3 {
    pub memHandle: CUmemGenericAllocationHandle,
}
impl Default for CUarrayMapInfo_st__bindgen_ty_3 {
    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 CUarrayMapInfo_st {
    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()
        }
    }
}
/// Specifies the CUDA array or CUDA mipmapped array memory mapping information.
pub type CUarrayMapInfo_v1 = CUarrayMapInfo_st;
pub type CUarrayMapInfo = CUarrayMapInfo_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUmemLocation_st {
    pub type_: CUmemLocationType,
    pub __bindgen_anon_1: CUmemLocation_st__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUmemLocation_st__bindgen_ty_1 {
    pub id: ::core::ffi::c_int,
}
impl Default for CUmemLocation_st__bindgen_ty_1 {
    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 CUmemLocation_st {
    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()
        }
    }
}
/// Specifies a memory location.
pub type CUmemLocation_v1 = CUmemLocation_st;
pub type CUmemLocation = CUmemLocation_v1;
/// Specifies compression attribute for an allocation.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemAllocationCompType_enum {
    /// Allocating non-compressible memory.
    CU_MEM_ALLOCATION_COMP_NONE = 0,
    /// Allocating compressible memory.
    CU_MEM_ALLOCATION_COMP_GENERIC = 1,
}
pub use self::CUmemAllocationCompType_enum as CUmemAllocationCompType;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUmemAllocationProp_st {
    pub type_: CUmemAllocationType,
    pub requestedHandleTypes: CUmemAllocationHandleType,
    pub location: CUmemLocation,
    pub win32HandleMetaData: *mut ::core::ffi::c_void,
    pub allocFlags: CUmemAllocationProp_st__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUmemAllocationProp_st__bindgen_ty_1 {
    pub compressionType: ::core::ffi::c_uchar,
    pub gpuDirectRDMACapable: ::core::ffi::c_uchar,
    pub usage: ::core::ffi::c_ushort,
    pub reserved: [::core::ffi::c_uchar; 4usize],
}
impl Default for CUmemAllocationProp_st {
    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()
        }
    }
}
/// Specifies the allocation properties for a allocation.
pub type CUmemAllocationProp_v1 = CUmemAllocationProp_st;
pub type CUmemAllocationProp = CUmemAllocationProp_v1;
/// Flags for querying different granularities for a multicast object.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmulticastGranularity_flags_enum {
    /// Minimum required granularity.
    CU_MULTICAST_GRANULARITY_MINIMUM = 0,
    /// Recommended granularity for best performance.
    CU_MULTICAST_GRANULARITY_RECOMMENDED = 1,
}
pub use self::CUmulticastGranularity_flags_enum as CUmulticastGranularity_flags;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUmulticastObjectProp_st {
    pub numDevices: ::core::ffi::c_uint,
    pub size: size_t,
    pub handleTypes: ::core::ffi::c_ulonglong,
    pub flags: ::core::ffi::c_ulonglong,
}
/// Specifies the properties for a multicast object.
pub type CUmulticastObjectProp_v1 = CUmulticastObjectProp_st;
pub type CUmulticastObjectProp = CUmulticastObjectProp_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUmemAccessDesc_st {
    pub location: CUmemLocation,
    pub flags: CUmemAccess_flags,
}
impl Default for CUmemAccessDesc_st {
    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()
        }
    }
}
/// Memory access descriptor.
pub type CUmemAccessDesc_v1 = CUmemAccessDesc_st;
pub type CUmemAccessDesc = CUmemAccessDesc_v1;
/// CUDA Graph Update error types.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphExecUpdateResult_enum {
    /// The update succeeded.
    CU_GRAPH_EXEC_UPDATE_SUCCESS = 0,
    /// The update failed for an unexpected reason which is described in the return value of the function.
    CU_GRAPH_EXEC_UPDATE_ERROR = 1,
    /// The update failed because the topology changed.
    CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED = 2,
    /// The update failed because a node type changed.
    CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED = 3,
    /// The update failed because the function of a kernel node changed (CUDA driver &lt; 11.2).
    CU_GRAPH_EXEC_UPDATE_ERROR_FUNCTION_CHANGED = 4,
    /// The update failed because the parameters changed in a way that is not supported.
    CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED = 5,
    /// The update failed because something about the node is not supported.
    CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED = 6,
    /// The update failed because the function of a kernel node changed in an unsupported way.
    CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE = 7,
    /// The update failed because the node attributes changed in a way that is not supported.
    CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED = 8,
}
pub use self::CUgraphExecUpdateResult_enum as CUgraphExecUpdateResult;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUgraphExecUpdateResultInfo_st {
    pub result: CUgraphExecUpdateResult,
    pub errorNode: CUgraphNode,
    pub errorFromNode: CUgraphNode,
}
impl Default for CUgraphExecUpdateResultInfo_st {
    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()
        }
    }
}
/// Result information returned by cuGraphExecUpdate.
pub type CUgraphExecUpdateResultInfo_v1 = CUgraphExecUpdateResultInfo_st;
pub type CUgraphExecUpdateResultInfo = CUgraphExecUpdateResultInfo_v1;
/// CUDA memory pool attributes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemPool_attribute_enum {
    /// (value type = int) Allow cuMemAllocAsync to use memory asynchronously freed in another streams as long as a stream ordering
    /// dependency of the allocating stream on the free action exists. CUDA events and null stream interactions can create the required
    /// stream ordered dependencies. (default enabled).
    CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES = 1,
    /// (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default
    /// ```text
    /// enabled)
    /// ```
    CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC = 2,
    /// (value type = int) Allow cuMemAllocAsync to insert new stream dependencies in order to establish the stream ordering required
    /// to reuse a piece of memory released by cuMemFreeAsync (default enabled).
    CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES = 3,
    /// (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS.
    /// When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory
    /// back to the OS on the next call to stream, event or context synchronize. (default 0).
    CU_MEMPOOL_ATTR_RELEASE_THRESHOLD = 4,
    /// (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool.
    CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT = 5,
    /// (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset. High
    /// watermark can only be reset to zero.
    CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH = 6,
    /// (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application.
    CU_MEMPOOL_ATTR_USED_MEM_CURRENT = 7,
    /// (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application since the
    /// last time it was reset. High watermark can only be reset to zero.
    CU_MEMPOOL_ATTR_USED_MEM_HIGH = 8,
    /// (value type = CUmemAllocationType) The allocation type of the mempool.
    CU_MEMPOOL_ATTR_ALLOCATION_TYPE = 9,
    /// (value type = CUmemAllocationHandleType) Available export handle types for the mempool. For imported pools this value is always
    /// [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] as an imported pool cannot be re-exported.
    CU_MEMPOOL_ATTR_EXPORT_HANDLE_TYPES = 10,
    /// (value type = int) The location id for the mempool. If the location type for this pool is [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVISIBLE`] then
    /// ID will be CU_DEVICE_INVALID.
    CU_MEMPOOL_ATTR_LOCATION_ID = 11,
    /// (value type = CUmemLocationType) The location type for the mempool. For imported memory pools where the device is not directly
    /// visible to the importing process or pools imported via fabric handles across nodes this will be [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVISIBLE`].
    CU_MEMPOOL_ATTR_LOCATION_TYPE = 12,
    /// (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cuMemPoolCreate
    /// due to alignment requirements. A value of 0 indicates no maximum size. For [`CUmemAllocationType::CU_MEM_ALLOCATION_TYPE_MANAGED`] and IPC imported
    /// pools this value will be system dependent.
    CU_MEMPOOL_ATTR_MAX_POOL_SIZE = 13,
    /// (value type = int) Indicates whether the pool has hardware compresssion enabled.
    CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED = 14,
}
pub use self::CUmemPool_attribute_enum as CUmemPool_attribute;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUmemPoolProps_st {
    pub allocType: CUmemAllocationType,
    pub handleTypes: CUmemAllocationHandleType,
    pub location: CUmemLocation,
    pub win32SecurityAttributes: *mut ::core::ffi::c_void,
    pub maxSize: size_t,
    pub usage: ::core::ffi::c_ushort,
    pub reserved: [::core::ffi::c_uchar; 54usize],
}
impl Default for CUmemPoolProps_st {
    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()
        }
    }
}
/// Specifies the properties of allocations made from the pool.
pub type CUmemPoolProps_v1 = CUmemPoolProps_st;
pub type CUmemPoolProps = CUmemPoolProps_v1;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUmemPoolPtrExportData_st {
    pub reserved: [::core::ffi::c_uchar; 64usize],
}
impl Default for CUmemPoolPtrExportData_st {
    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()
        }
    }
}
/// Opaque data for exporting a pool allocation.
pub type CUmemPoolPtrExportData_v1 = CUmemPoolPtrExportData_st;
pub type CUmemPoolPtrExportData = CUmemPoolPtrExportData_v1;
/// Flags to specify for copies within a batch. For more details see [`cuMemcpyBatchAsync_v2`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemcpyFlags_enum {
    CU_MEMCPY_FLAG_DEFAULT = 0,
    /// Hint to the driver to try and overlap the copy with compute work on the SMs.
    CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE = 1,
}
pub use self::CUmemcpyFlags_enum as CUmemcpyFlags;
/// These flags allow applications to convey the source access ordering CUDA must maintain. The destination will always be accessed
/// in stream order.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemcpySrcAccessOrder_enum {
    /// Default invalid.
    CU_MEMCPY_SRC_ACCESS_ORDER_INVALID = 0,
    /// Indicates that access to the source pointer must be in stream order.
    CU_MEMCPY_SRC_ACCESS_ORDER_STREAM = 1,
    /// Indicates that access to the source pointer can be out of stream order and all accesses must be complete before the API call
    /// returns. This flag is suited for ephemeral sources (ex., stack variables) when it's known that no prior operations in the
    /// stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source variable
    /// was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to synchronize
    /// the stream after the API call.
    CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL = 2,
    /// Indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call
    /// returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior operations
    /// in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms.
    CU_MEMCPY_SRC_ACCESS_ORDER_ANY = 3,
    CU_MEMCPY_SRC_ACCESS_ORDER_MAX = 2147483647,
}
pub use self::CUmemcpySrcAccessOrder_enum as CUmemcpySrcAccessOrder;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUmemcpyAttributes_st {
    pub srcAccessOrder: CUmemcpySrcAccessOrder,
    pub srcLocHint: CUmemLocation,
    pub dstLocHint: CUmemLocation,
    pub flags: ::core::ffi::c_uint,
}
impl Default for CUmemcpyAttributes_st {
    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()
        }
    }
}
/// Attributes specific to copies within a batch. For more details on usage see [`cuMemcpyBatchAsync_v2`].
pub type CUmemcpyAttributes_v1 = CUmemcpyAttributes_st;
pub type CUmemcpyAttributes = CUmemcpyAttributes_v1;
/// These flags allow applications to convey the operand type for individual copies specified in [`cuMemcpy3DBatchAsync_v2`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmemcpy3DOperandType_enum {
    /// Memcpy operand is a valid pointer.
    CU_MEMCPY_OPERAND_TYPE_POINTER = 1,
    /// Memcpy operand is a CUarray.
    CU_MEMCPY_OPERAND_TYPE_ARRAY = 2,
    CU_MEMCPY_OPERAND_TYPE_MAX = 2147483647,
}
pub use self::CUmemcpy3DOperandType_enum as CUmemcpy3DOperandType;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUoffset3D_st {
    pub x: size_t,
    pub y: size_t,
    pub z: size_t,
}
/// Struct representing a 3D offset.
pub type CUoffset3D_v1 = CUoffset3D_st;
pub type CUoffset3D = CUoffset3D_v1;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUextent3D_st {
    pub width: size_t,
    pub height: size_t,
    pub depth: size_t,
}
/// Struct representing width/height/depth of a CUarray in elements.
pub type CUextent3D_v1 = CUextent3D_st;
pub type CUextent3D = CUextent3D_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUmemcpy3DOperand_st {
    pub type_: CUmemcpy3DOperandType,
    pub op: CUmemcpy3DOperand_st__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUmemcpy3DOperand_st__bindgen_ty_1 {
    pub ptr: CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_1,
    pub array: CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_2,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_1 {
    pub ptr: CUdeviceptr,
    pub rowLength: size_t,
    pub layerHeight: size_t,
    pub locHint: CUmemLocation,
}
impl Default for CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_1 {
    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()
        }
    }
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_2 {
    pub array: CUarray,
    pub offset: CUoffset3D,
}
impl Default for CUmemcpy3DOperand_st__bindgen_ty_1__bindgen_ty_2 {
    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 CUmemcpy3DOperand_st__bindgen_ty_1 {
    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 CUmemcpy3DOperand_st {
    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()
        }
    }
}
/// Struct representing an operand for copy with [`cuMemcpy3DBatchAsync_v2`].
pub type CUmemcpy3DOperand_v1 = CUmemcpy3DOperand_st;
pub type CUmemcpy3DOperand = CUmemcpy3DOperand_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_MEMCPY3D_BATCH_OP_st {
    pub src: CUmemcpy3DOperand,
    pub dst: CUmemcpy3DOperand,
    pub extent: CUextent3D,
    pub srcAccessOrder: CUmemcpySrcAccessOrder,
    pub flags: ::core::ffi::c_uint,
}
impl Default for CUDA_MEMCPY3D_BATCH_OP_st {
    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 CUDA_MEMCPY3D_BATCH_OP_v1 = CUDA_MEMCPY3D_BATCH_OP_st;
pub type CUDA_MEMCPY3D_BATCH_OP = CUDA_MEMCPY3D_BATCH_OP_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_MEM_ALLOC_NODE_PARAMS_v1_st {
    pub poolProps: CUmemPoolProps,
    pub accessDescs: *const CUmemAccessDesc,
    pub accessDescCount: size_t,
    pub bytesize: size_t,
    pub dptr: CUdeviceptr,
}
impl Default for CUDA_MEM_ALLOC_NODE_PARAMS_v1_st {
    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()
        }
    }
}
/// Memory allocation node parameters.
pub type CUDA_MEM_ALLOC_NODE_PARAMS_v1 = CUDA_MEM_ALLOC_NODE_PARAMS_v1_st;
pub type CUDA_MEM_ALLOC_NODE_PARAMS = CUDA_MEM_ALLOC_NODE_PARAMS_v1;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUDA_MEM_ALLOC_NODE_PARAMS_v2_st {
    pub poolProps: CUmemPoolProps,
    pub accessDescs: *const CUmemAccessDesc,
    pub accessDescCount: size_t,
    pub bytesize: size_t,
    pub dptr: CUdeviceptr,
}
impl Default for CUDA_MEM_ALLOC_NODE_PARAMS_v2_st {
    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()
        }
    }
}
/// Memory allocation node parameters.
pub type CUDA_MEM_ALLOC_NODE_PARAMS_v2 = CUDA_MEM_ALLOC_NODE_PARAMS_v2_st;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_MEM_FREE_NODE_PARAMS_st {
    pub dptr: CUdeviceptr,
}
/// Memory free node parameters.
pub type CUDA_MEM_FREE_NODE_PARAMS = CUDA_MEM_FREE_NODE_PARAMS_st;
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphMem_attribute_enum {
    CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT = 0,
    CU_GRAPH_MEM_ATTR_USED_MEM_HIGH = 1,
    CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT = 2,
    CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH = 3,
}
pub use self::CUgraphMem_attribute_enum as CUgraphMem_attribute;
/// Child graph node ownership.
#[repr(i32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUgraphChildGraphNodeOwnership_enum {
    /// Default behavior for a child graph node. Child graph is cloned into the parent and memory allocation/free nodes can't be present
    /// in the child graph.
    CU_GRAPH_CHILD_GRAPH_OWNERSHIP_CLONE = 0,
    /// The child graph is moved to the parent. The handle to the child graph is owned by the parent and will be destroyed when the
    /// ```text
    /// parent is destroyed.The following restrictions apply to child graphs after they have been moved: Cannot be independently instantiated
    /// or destroyed; Cannot be added as a child graph of a separate parent graph; Cannot be used as an argument to cuGraphExecUpdate;
    /// Cannot have additional memory allocation or free nodes added.
    /// ```
    CU_GRAPH_CHILD_GRAPH_OWNERSHIP_MOVE = 1,
    /// Invalid ownership flag. Set when params are queried to prevent accidentally reusing the driver-owned graph object.
    CU_GRAPH_CHILD_GRAPH_OWNERSHIP_INVALID = -1,
}
pub use self::CUgraphChildGraphNodeOwnership_enum as CUgraphChildGraphNodeOwnership;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_CHILD_GRAPH_NODE_PARAMS_st {
    pub graph: CUgraph,
    pub ownership: CUgraphChildGraphNodeOwnership,
}
impl Default for CUDA_CHILD_GRAPH_NODE_PARAMS_st {
    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()
        }
    }
}
/// Child graph node parameters.
pub type CUDA_CHILD_GRAPH_NODE_PARAMS = CUDA_CHILD_GRAPH_NODE_PARAMS_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EVENT_RECORD_NODE_PARAMS_st {
    pub event: CUevent,
}
impl Default for CUDA_EVENT_RECORD_NODE_PARAMS_st {
    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()
        }
    }
}
/// Event record node parameters.
pub type CUDA_EVENT_RECORD_NODE_PARAMS = CUDA_EVENT_RECORD_NODE_PARAMS_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUDA_EVENT_WAIT_NODE_PARAMS_st {
    pub event: CUevent,
}
impl Default for CUDA_EVENT_WAIT_NODE_PARAMS_st {
    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()
        }
    }
}
/// Event wait node parameters.
pub type CUDA_EVENT_WAIT_NODE_PARAMS = CUDA_EVENT_WAIT_NODE_PARAMS_st;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUgraphNodeParams_st {
    pub type_: CUgraphNodeType,
    pub reserved0: [::core::ffi::c_int; 3usize],
    pub __bindgen_anon_1: CUgraphNodeParams_st__bindgen_ty_1,
    pub reserved2: ::core::ffi::c_longlong,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUgraphNodeParams_st__bindgen_ty_1 {
    pub reserved1: [::core::ffi::c_longlong; 29usize],
    pub kernel: CUDA_KERNEL_NODE_PARAMS_v3,
    pub memcpy: CUDA_MEMCPY_NODE_PARAMS,
    pub memset: CUDA_MEMSET_NODE_PARAMS_v2,
    pub host: CUDA_HOST_NODE_PARAMS_v2,
    pub graph: CUDA_CHILD_GRAPH_NODE_PARAMS,
    pub eventWait: CUDA_EVENT_WAIT_NODE_PARAMS,
    pub eventRecord: CUDA_EVENT_RECORD_NODE_PARAMS,
    pub extSemSignal: CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2,
    pub extSemWait: CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2,
    pub alloc: CUDA_MEM_ALLOC_NODE_PARAMS_v2,
    pub free: CUDA_MEM_FREE_NODE_PARAMS,
    pub memOp: CUDA_BATCH_MEM_OP_NODE_PARAMS_v2,
    pub conditional: CUDA_CONDITIONAL_NODE_PARAMS,
}
impl Default for CUgraphNodeParams_st__bindgen_ty_1 {
    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 CUgraphNodeParams_st {
    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()
        }
    }
}
/// Graph node parameters. See [`cuGraphAddNode_v2`].
pub type CUgraphNodeParams = CUgraphNodeParams_st;
/// Bitmasks for CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_FLUSH_WRITES_OPTIONS.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUflushGPUDirectRDMAWritesOptions_enum {
    /// [`cuFlushGPUDirectRDMAWrites`] and its CUDA Runtime API counterpart are supported on the device.
    CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_HOST = 1,
    /// The CU_STREAM_WAIT_VALUE_FLUSH flag and the CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES MemOp are supported on the device.
    CU_FLUSH_GPU_DIRECT_RDMA_WRITES_OPTION_MEMOPS = 2,
}
pub use self::CUflushGPUDirectRDMAWritesOptions_enum as CUflushGPUDirectRDMAWritesOptions;
/// Platform native ordering for GPUDirect RDMA writes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUGPUDirectRDMAWritesOrdering_enum {
    /// The device does not natively support ordering of remote writes. [`cuFlushGPUDirectRDMAWrites`] can be leveraged if supported.
    CU_GPU_DIRECT_RDMA_WRITES_ORDERING_NONE = 0,
    /// Natively, the device can consistently consume remote writes, although other CUDA devices may not.
    CU_GPU_DIRECT_RDMA_WRITES_ORDERING_OWNER = 100,
    /// Any CUDA device in the system can consistently consume remote writes to this device.
    CU_GPU_DIRECT_RDMA_WRITES_ORDERING_ALL_DEVICES = 200,
}
pub use self::CUGPUDirectRDMAWritesOrdering_enum as CUGPUDirectRDMAWritesOrdering;
/// The scopes for [`cuFlushGPUDirectRDMAWrites`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUflushGPUDirectRDMAWritesScope_enum {
    /// Blocks until remote writes are visible to the CUDA device context owning the data.
    CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_OWNER = 100,
    /// Blocks until remote writes are visible to all CUDA device contexts.
    CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TO_ALL_DEVICES = 200,
}
pub use self::CUflushGPUDirectRDMAWritesScope_enum as CUflushGPUDirectRDMAWritesScope;
/// The targets for [`cuFlushGPUDirectRDMAWrites`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUflushGPUDirectRDMAWritesTarget_enum {
    /// Sets the target for [`cuFlushGPUDirectRDMAWrites`] to the currently active CUDA device context.
    CU_FLUSH_GPU_DIRECT_RDMA_WRITES_TARGET_CURRENT_CTX = 0,
}
pub use self::CUflushGPUDirectRDMAWritesTarget_enum as CUflushGPUDirectRDMAWritesTarget;
/// The additional write options for [`cuGraphDebugDotPrint`].
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphDebugDot_flags_enum {
    /// Output all debug data as if every debug flag is enabled.
    CU_GRAPH_DEBUG_DOT_FLAGS_VERBOSE = 1,
    /// Use CUDA Runtime structures for output.
    CU_GRAPH_DEBUG_DOT_FLAGS_RUNTIME_TYPES = 2,
    /// Adds CUDA_KERNEL_NODE_PARAMS values to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_PARAMS = 4,
    /// Adds CUDA_MEMCPY3D values to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_NODE_PARAMS = 8,
    /// Adds CUDA_MEMSET_NODE_PARAMS values to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_MEMSET_NODE_PARAMS = 16,
    /// Adds CUDA_HOST_NODE_PARAMS values to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_HOST_NODE_PARAMS = 32,
    /// Adds CUevent handle from record and wait nodes to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_EVENT_NODE_PARAMS = 64,
    /// Adds CUDA_EXT_SEM_SIGNAL_NODE_PARAMS values to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_SIGNAL_NODE_PARAMS = 128,
    /// Adds CUDA_EXT_SEM_WAIT_NODE_PARAMS values to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_EXT_SEMAS_WAIT_NODE_PARAMS = 256,
    /// Adds CUkernelNodeAttrValue values to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_KERNEL_NODE_ATTRIBUTES = 512,
    /// Adds node handles and every kernel function handle to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_HANDLES = 1024,
    /// Adds memory alloc node parameters to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_MEM_ALLOC_NODE_PARAMS = 2048,
    /// Adds memory free node parameters to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_MEM_FREE_NODE_PARAMS = 4096,
    /// Adds batch mem op node parameters to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS = 8192,
    /// Adds edge numbering information.
    CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO = 16384,
    /// Adds conditional node parameters to output.
    CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS = 32768,
}
pub use self::CUgraphDebugDot_flags_enum as CUgraphDebugDot_flags;
/// Flags for user objects for graphs.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUuserObject_flags_enum {
    /// Indicates the destructor execution is not synchronized by any CUDA handle.
    CU_USER_OBJECT_NO_DESTRUCTOR_SYNC = 1,
}
pub use self::CUuserObject_flags_enum as CUuserObject_flags;
/// Flags for retaining user object references for graphs.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUuserObjectRetain_flags_enum {
    /// Transfer references from the caller rather than creating new references.
    CU_GRAPH_USER_OBJECT_MOVE = 1,
}
pub use self::CUuserObjectRetain_flags_enum as CUuserObjectRetain_flags;
/// Flags for instantiating a graph.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgraphInstantiate_flags_enum {
    /// Automatically free memory allocated in a graph before relaunching.
    CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH = 1,
    /// Automatically upload the graph after instantiation. Only supported by [`cuGraphInstantiateWithParams`]. The upload will be performed using the stream provided in instantiateParams.
    CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD = 2,
    /// Instantiate the graph to be launchable from the device. This flag can only be used on platforms which support unified addressing.
    /// This flag cannot be used in conjunction with [`CUgraphInstantiate_flags::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`].
    CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH = 4,
    /// Run the graph using the per-node priority attributes rather than the priority of the stream it is launched into.
    CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY = 8,
}
pub use self::CUgraphInstantiate_flags_enum as CUgraphInstantiate_flags;
/// CUDA device NUMA configuration.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUdeviceNumaConfig_enum {
    /// The GPU is not a NUMA node.
    CU_DEVICE_NUMA_CONFIG_NONE = 0,
    /// The GPU is a NUMA node, [`CUdevice_attribute::CU_DEVICE_ATTRIBUTE_NUMA_ID`] contains its NUMA ID.
    CU_DEVICE_NUMA_CONFIG_NUMA_NODE = 1,
}
pub use self::CUdeviceNumaConfig_enum as CUdeviceNumaConfig;
/// CUDA Process States.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUprocessState_enum {
    /// Default process state.
    CU_PROCESS_STATE_RUNNING = 0,
    /// CUDA API locks are taken so further CUDA API calls will block.
    CU_PROCESS_STATE_LOCKED = 1,
    /// Application memory contents have been checkpointed and underlying allocations and device handles have been released.
    CU_PROCESS_STATE_CHECKPOINTED = 2,
    /// Application entered an uncorrectable error during the checkpoint/restore process.
    CU_PROCESS_STATE_FAILED = 3,
}
pub use self::CUprocessState_enum as CUprocessState;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUcheckpointLockArgs_st {
    pub timeoutMs: ::core::ffi::c_uint,
    pub reserved0: ::core::ffi::c_uint,
    pub reserved1: [cuuint64_t; 7usize],
}
/// CUDA checkpoint optional lock arguments.
pub type CUcheckpointLockArgs = CUcheckpointLockArgs_st;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUcheckpointCheckpointArgs_st {
    pub reserved: [cuuint64_t; 8usize],
}
/// CUDA checkpoint optional checkpoint arguments.
pub type CUcheckpointCheckpointArgs = CUcheckpointCheckpointArgs_st;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUcheckpointGpuPair_st {
    pub oldUuid: CUuuid,
    pub newUuid: CUuuid,
}
/// CUDA checkpoint GPU UUID pairs for device remapping during restore.
pub type CUcheckpointGpuPair = CUcheckpointGpuPair_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUcheckpointRestoreArgs_st {
    pub gpuPairs: *mut CUcheckpointGpuPair,
    pub gpuPairsCount: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_char; 44usize],
    pub reserved1: cuuint64_t,
}
impl Default for CUcheckpointRestoreArgs_st {
    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()
        }
    }
}
/// CUDA checkpoint optional restore arguments.
pub type CUcheckpointRestoreArgs = CUcheckpointRestoreArgs_st;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUcheckpointUnlockArgs_st {
    pub reserved: [cuuint64_t; 8usize],
}
/// CUDA checkpoint optional unlock arguments.
pub type CUcheckpointUnlockArgs = CUcheckpointUnlockArgs_st;
unsafe extern "C" {
    /// Gets the string description of an error code.
    ///
    /// Sets \*pStr to the address of a NULL-terminated string description of the error code error. If the error code is not recognized, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned and \*pStr will be set to the NULL address.
    ///
    /// **See also:**
    ///
    /// `CUresult`, [cudaGetErrorString](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__ERROR.html#group__CUDART__ERROR_1g4bc9e35a618dfd0877c29c8ee45148f1).
    ///
    /// # Parameters
    ///
    /// - `error`: Error code to convert to string.
    /// - `pStr`: Address of the string pointer.
    pub fn cuGetErrorString(
        error: CUresult,
        pStr: *mut *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets the string representation of an error code enum name.
    ///
    /// Sets \*pStr to the address of a NULL-terminated string representation of the name of the enum error code error. If the error code is not recognized, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned and \*pStr will be set to the NULL address.
    ///
    /// **See also:**
    ///
    /// `CUresult`, [cudaGetErrorName](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__ERROR.html#group__CUDART__ERROR_1gb3de7da2f23736878270026dcfc70075).
    ///
    /// # Parameters
    ///
    /// - `error`: Error code to convert to string.
    /// - `pStr`: Address of the string pointer.
    pub fn cuGetErrorName(
        error: CUresult,
        pStr: *mut *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API
    /// in the current process. Currently, the Flags parameter must be 0. If cuInit() has not been called, any function from the driver API will return [`CUresult::CUDA_ERROR_NOT_INITIALIZED`].
    ///
    /// Note: cuInit preloads various libraries needed for JIT compilation. To opt-out of this behavior, set the environment variable
    /// CUDA_FORCE_PRELOAD_LIBRARIES=0. CUDA will lazily load JIT libraries as needed. To disable JIT entirely, set the environment
    /// variable CUDA_DISABLE_JIT=1.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// # Parameters
    ///
    /// - `Flags`: Initialization flag for CUDA.
    pub fn cuInit(Flags: ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Returns the latest CUDA version supported by driver.
    ///
    /// Returns in \*driverVersion the version of CUDA supported by the driver. The version is returned as (1000 \* major + 10 \* minor). For example, CUDA 9.2
    /// would be represented by 9020.
    ///
    /// This function automatically returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if driverVersion is NULL.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cudaDriverGetVersion](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART____VERSION.html#group__CUDART____VERSION_1g8a06ee14a0551606b7c780084d5564ab), [cudaRuntimeGetVersion](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART____VERSION.html#group__CUDART____VERSION_1g0e3952c7802fd730432180f1f4a6cdc6).
    ///
    /// # Parameters
    ///
    /// - `driverVersion`: Returns the CUDA driver version.
    pub fn cuDriverGetVersion(driverVersion: *mut ::core::ffi::c_int) -> CUresult;
}
unsafe extern "C" {
    /// Returns a handle to a compute device.
    ///
    /// Returns in \*device a device handle given an ordinal in the range **0, \[cuDeviceGetCount()-1\]**.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid_v2`], [`cuDeviceGetLuid`], [`cuDeviceTotalMem_v2`], [`cuDeviceGetExecAffinitySupport`].
    ///
    /// # Parameters
    ///
    /// - `device`: Returned device handle.
    /// - `ordinal`: Device number to get handle for.
    pub fn cuDeviceGet(device: *mut CUdevice, ordinal: ::core::ffi::c_int) -> CUresult;
}
unsafe extern "C" {
    /// Returns the number of compute-capable devices.
    ///
    /// Returns in \*count the number of devices with compute capability greater than or equal to 2.0 that are available for execution. If there is
    /// no such device, [`cuDeviceGetCount`] returns 0.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetName`], [`cuDeviceGetUuid_v2`], [`cuDeviceGetLuid`], [`cuDeviceGet`], [`cuDeviceTotalMem_v2`], [`cuDeviceGetExecAffinitySupport`], [cudaGetDeviceCount](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g18808e54893cfcaafefeab31a73cc55f).
    ///
    /// # Parameters
    ///
    /// - `count`: Returned number of compute-capable devices.
    pub fn cuDeviceGetCount(count: *mut ::core::ffi::c_int) -> CUresult;
}
unsafe extern "C" {
    /// Returns an identifier string for the device.
    ///
    /// Returns an ASCII string identifying the device dev in the NULL-terminated string pointed to by name. len specifies the maximum length of the string that may be returned. name is shortened to the specified len, if len is less than the device name
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetUuid_v2`], [`cuDeviceGetLuid`], [`cuDeviceGetCount`], [`cuDeviceGet`], [`cuDeviceTotalMem_v2`], [`cuDeviceGetExecAffinitySupport`], [cudaGetDeviceProperties](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g1bf9d625a931d657e08db2b4391170f0).
    ///
    /// # Parameters
    ///
    /// - `name`: Returned identifier string for the device.
    /// - `len`: Maximum length of string to store in name.
    /// - `dev`: Device to get identifier string for.
    pub fn cuDeviceGetName(
        name: *mut ::core::ffi::c_char,
        len: ::core::ffi::c_int,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Return an UUID for the device.
    ///
    /// Returns 16-octets identifying the device dev in the structure pointed by the uuid. If the device is in MIG mode, returns its MIG UUID which uniquely identifies the subscribed MIG compute instance.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetLuid`], [`cuDeviceGet`], [`cuDeviceTotalMem_v2`], [cudaGetDeviceProperties](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g1bf9d625a931d657e08db2b4391170f0).
    ///
    /// # Parameters
    ///
    /// - `uuid`: Returned UUID.
    /// - `dev`: Device to get identifier string for.
    pub fn cuDeviceGetUuid_v2(uuid: *mut CUuuid, dev: CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Return an LUID and device node mask for the device.
    ///
    /// Return identifying information (luid and deviceNodeMask) to allow matching device with graphics APIs.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGet`], [`cuDeviceTotalMem_v2`], [`cuDeviceGetExecAffinitySupport`], [cudaGetDeviceProperties](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g1bf9d625a931d657e08db2b4391170f0).
    ///
    /// # Parameters
    ///
    /// - `luid`: Returned LUID.
    /// - `deviceNodeMask`: Returned device node mask.
    /// - `dev`: Device to get identifier string for.
    pub fn cuDeviceGetLuid(
        luid: *mut ::core::ffi::c_char,
        deviceNodeMask: *mut ::core::ffi::c_uint,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the total amount of memory on the device.
    ///
    /// Returns in \*bytes the total amount of memory available on the device dev in bytes.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid_v2`], [`cuDeviceGet`], [`cuDeviceGetExecAffinitySupport`], [cudaMemGetInfo](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g376b97f5ab20321ca46f7cfa9511b978).
    ///
    /// # Parameters
    ///
    /// - `bytes`: Returned memory available on device in bytes.
    /// - `dev`: Device handle.
    pub fn cuDeviceTotalMem_v2(bytes: *mut size_t, dev: CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Returns the maximum number of elements allocatable in a 1D linear texture for a given texture element size.
    ///
    /// Returns in maxWidthInElements the maximum number of texture elements allocatable in a 1D linear texture for given format and numChannels.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid_v2`], [`cuDeviceGet`], [cudaMemGetInfo](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g376b97f5ab20321ca46f7cfa9511b978), [`cuDeviceTotalMem_v2`].
    ///
    /// # Parameters
    ///
    /// - `maxWidthInElements`: Returned maximum number of texture elements allocatable for given format and numChannels.
    /// - `format`: Texture format.
    /// - `numChannels`: Number of channels per texture element.
    /// - `dev`: Device handle.
    pub fn cuDeviceGetTexture1DLinearMaxWidth(
        maxWidthInElements: *mut size_t,
        format: CUarray_format,
        numChannels: ::core::ffi::c_uint,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns information about the device.
    ///
    /// Returns in \*pi the integer value of the attribute attrib on device dev.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid_v2`], [`cuDeviceGet`], [`cuDeviceTotalMem_v2`], [`cuDeviceGetExecAffinitySupport`], [cudaDeviceGetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gb22e8256592b836df9a9cc36c9db7151), [cudaGetDeviceProperties](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g1bf9d625a931d657e08db2b4391170f0).
    ///
    /// # Parameters
    ///
    /// - `pi`: Returned device attribute value.
    /// - `attrib`: Device attribute to query.
    /// - `dev`: Device handle.
    pub fn cuDeviceGetAttribute(
        pi: *mut ::core::ffi::c_int,
        attrib: CUdevice_attribute,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Queries details about atomic operations supported between the device and host.
    ///
    /// Returns in \*capabilities the details about requested atomic \*operations over the link between dev and the host. The allocated size of \*operations and \*capabilities must be count.
    ///
    /// For each `CUatomicOperation` in \*operations, the corresponding result in \*capabilities will be a bitmask indicating which of `CUatomicOperationCapability` the link supports natively.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`] if dev is not valid.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if \*capabilities or \*operations is NULL, if count is 0, or if any of \*operations is not valid.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetP2PAtomicCapabilities`], cudaDeviceGeHostAtomicCapabilities.
    ///
    /// # Parameters
    ///
    /// - `capabilities`: Returned capability details of each requested operation.
    /// - `operations`: Requested operations.
    /// - `count`: Count of requested operations and size of capabilities.
    /// - `dev`: Device handle.
    pub fn cuDeviceGetHostAtomicCapabilities(
        capabilities: *mut ::core::ffi::c_uint,
        operations: *const CUatomicOperation,
        count: ::core::ffi::c_uint,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Return NvSciSync attributes that this device can support.
    ///
    /// Returns in nvSciSyncAttrList, the properties of NvSciSync that this CUDA device, dev can support. The returned nvSciSyncAttrList can be used to create an NvSciSync object that matches this device's capabilities.
    ///
    /// If NvSciSyncAttrKey_RequiredPerm field in nvSciSyncAttrList is already set this API will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// The applications should set nvSciSyncAttrList to a valid NvSciSyncAttrList failing which this API will return [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`].
    ///
    /// The flags controls how applications intends to use the NvSciSync created from the nvSciSyncAttrList. The valid flags are:
    ///
    /// * [`CUDA_NVSCISYNC_ATTR_SIGNAL`], specifies that the applications intends to signal an NvSciSync on this CUDA device.
    /// * [`CUDA_NVSCISYNC_ATTR_WAIT`], specifies that the applications intends to wait on an NvSciSync on this CUDA device.
    ///
    /// At least one of these flags must be set, failing which the API returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. Both the flags are orthogonal to one another: a developer may set both these flags that allows to set both wait and signal
    /// specific attributes in the same nvSciSyncAttrList.
    ///
    /// Note that this API updates the input nvSciSyncAttrList with values equivalent to the following public attribute key-values: NvSciSyncAttrKey_RequiredPerm is set to
    ///
    /// * NvSciSyncAccessPerm_SignalOnly if [`CUDA_NVSCISYNC_ATTR_SIGNAL`] is set in flags.
    /// * NvSciSyncAccessPerm_WaitOnly if [`CUDA_NVSCISYNC_ATTR_WAIT`] is set in flags.
    /// * NvSciSyncAccessPerm_WaitSignal if both [`CUDA_NVSCISYNC_ATTR_WAIT`] and [`CUDA_NVSCISYNC_ATTR_SIGNAL`] are set in flags. NvSciSyncAttrKey_PrimitiveInfo is set to
    /// * NvSciSyncAttrValPrimitiveType_SysmemSemaphore on any valid device.
    /// * NvSciSyncAttrValPrimitiveType_Syncpoint if device is a Tegra device.
    /// * NvSciSyncAttrValPrimitiveType_SysmemSemaphorePayload64b if device is GA10X+. NvSciSyncAttrKey_GpuId is set to the same UUID that is returned for this device from [`cuDeviceGetUuid_v2`].
    ///
    /// [`cudaError_enum::CUDA_SUCCESS`], [`cudaError_enum::CUDA_ERROR_DEINITIALIZED`], [`cudaError_enum::CUDA_ERROR_NOT_INITIALIZED`], [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`], [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`], [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`], [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`], [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`]
    ///
    /// **See also:**
    ///
    /// [`cuImportExternalSemaphore`], [`cuDestroyExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `nvSciSyncAttrList`: Return NvSciSync attributes supported.
    /// - `dev`: Valid CUDA Device to get NvSciSync attributes for.
    /// - `flags`: flags describing NvSciSync usage.
    pub fn cuDeviceGetNvSciSyncAttributes(
        nvSciSyncAttrList: *mut ::core::ffi::c_void,
        dev: CUdevice,
        flags: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the current memory pool of a device.
    ///
    /// The memory pool must be local to the specified device. [`cuMemAllocAsync`] allocates from the current mempool of the provided stream's device. By default, a device's current memory pool is its default
    /// memory pool.
    ///
    /// Note:
    ///
    /// Use [`cuMemAllocFromPoolAsync`] to specify asynchronous allocations from a device different than the one the stream runs on.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolDestroy`], [`cuMemAllocFromPoolAsync`].
    pub fn cuDeviceSetMemPool(dev: CUdevice, pool: CUmemoryPool) -> CUresult;
}
unsafe extern "C" {
    /// Gets the current mempool for a device.
    ///
    /// Returns the last pool provided to [`cuDeviceSetMemPool`] for this device or the device's default memory pool if [`cuDeviceSetMemPool`] has never been called. By default the current mempool is the default mempool for a device. Otherwise the returned pool must
    /// have been set with [`cuDeviceSetMemPool`].
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetDefaultMemPool`], [`cuMemPoolCreate`], [`cuDeviceSetMemPool`].
    pub fn cuDeviceGetMemPool(pool: *mut CUmemoryPool, dev: CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Returns the default mempool of a device.
    ///
    /// The default mempool of a device contains device memory from that device.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocAsync`], [`cuMemPoolTrimTo`], [`cuMemPoolGetAttribute`], [`cuMemPoolSetAttribute`], [`cuMemPoolSetAccess`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
    pub fn cuDeviceGetDefaultMemPool(
        pool_out: *mut CUmemoryPool,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns information about the execution affinity support of the device.
    ///
    /// Returns in \*pi whether execution affinity type type is supported by device dev. The supported types are:
    ///
    /// * [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`]: 1 if context with limited SMs is supported by the device, or 0 if not;
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid_v2`], [`cuDeviceGet`], [`cuDeviceTotalMem_v2`].
    ///
    /// # Parameters
    ///
    /// - `pi`: 1 if the execution affinity type type is supported by the device, or 0 if not.
    /// - `dev`: Device handle.
    pub fn cuDeviceGetExecAffinitySupport(
        pi: *mut ::core::ffi::c_int,
        type_: CUexecAffinityType,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Blocks until remote writes are visible to the specified scope.
    ///
    /// Blocks until GPUDirect RDMA writes to the target context via mappings created through APIs like nvidia_p2p_get_pages (see
    /// <https://docs.nvidia.com/cuda/gpudirect-rdma> for more information), are visible to the specified scope.
    ///
    /// If the scope equals or lies within the scope indicated by [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WRITES_ORDERING`], the call will be a no-op and can be safely omitted for performance. This can be determined by comparing the numerical values
    /// between the two enums, with smaller scopes having smaller values.
    ///
    /// On platforms that support GPUDirect RDMA writes via more than one path in hardware (see [`CUmemRangeFlags_enum::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`]), the user should consider those paths as belonging to separate ordering domains. Note that in such cases CUDA driver will
    /// report both RDMA writes ordering and RDMA write scope as ALL_DEVICES and a call to cuFlushGPUDirectRDMA will be a no-op, but
    /// when these multiple paths are used simultaneously, it is the user's responsibility to ensure ordering by using mechanisms
    /// outside the scope of CUDA.
    ///
    /// Users may query support for this API via CU_DEVICE_ATTRIBUTE_FLUSH_FLUSH_GPU_DIRECT_RDMA_OPTIONS.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// # Parameters
    ///
    /// - `target`: The target of the operation, see `CUflushGPUDirectRDMAWritesTarget`.
    /// - `scope`: The scope of the operation, see `CUflushGPUDirectRDMAWritesScope`.
    pub fn cuFlushGPUDirectRDMAWrites(
        target: CUflushGPUDirectRDMAWritesTarget,
        scope: CUflushGPUDirectRDMAWritesScope,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns properties for a selected device.
    ///
    /// Returns in \*prop the properties of device dev. The CUdevprop structure is defined as:
    ///
    /// ```text
    /// typedef struct CUdevprop_st {
    /// int maxThreadsPerBlock;
    /// int maxThreadsDim\[3\];
    /// int maxGridSize\[3\];
    /// int sharedMemPerBlock;
    /// int totalConstantMemory;
    /// int SIMDWidth;
    /// int memPitch;
    /// int regsPerBlock;
    /// int clockRate;
    /// int textureAlign
    /// } CUdevprop;
    /// ```
    ///
    /// * maxThreadsPerBlock is the maximum number of threads per block;
    /// * maxThreadsDim\[3\] is the maximum sizes of each dimension of a block;
    /// * maxGridSize\[3\] is the maximum sizes of each dimension of a grid;
    /// * sharedMemPerBlock is the total amount of shared memory available per block in bytes;
    /// * totalConstantMemory is the total amount of constant memory available on the device in bytes;
    /// * SIMDWidth is the warp size;
    /// * memPitch is the maximum pitch allowed by the memory copy functions that involve memory regions allocated through [`cuMemAllocPitch_v2`];
    /// * regsPerBlock is the total number of registers available per block;
    /// * clockRate is the clock frequency in kilohertz;
    /// * textureAlign is the alignment requirement; texture base addresses that are aligned to textureAlign bytes do not need an offset
    ///   applied to texture fetches.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid_v2`], [`cuDeviceGet`], [`cuDeviceTotalMem_v2`].
    ///
    /// # Parameters
    ///
    /// - `prop`: Returned properties of device.
    /// - `dev`: Device to get properties for.
    #[deprecated]
    pub fn cuDeviceGetProperties(prop: *mut CUdevprop, dev: CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Returns the compute capability of the device.
    ///
    /// Returns in \*major and \*minor the major and minor revision numbers that define the compute capability of the device dev.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetAttribute`], [`cuDeviceGetCount`], [`cuDeviceGetName`], [`cuDeviceGetUuid_v2`], [`cuDeviceGet`], [`cuDeviceTotalMem_v2`].
    ///
    /// # Parameters
    ///
    /// - `major`: Major revision number.
    /// - `minor`: Minor revision number.
    /// - `dev`: Device handle.
    #[deprecated]
    pub fn cuDeviceComputeCapability(
        major: *mut ::core::ffi::c_int,
        minor: *mut ::core::ffi::c_int,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Retain the primary context on the GPU.
    ///
    /// Retains the primary context on the device. Once the user successfully retains the primary context, the primary context will
    /// be active and available to the user until the user releases it with [`cuDevicePrimaryCtxRelease_v2`] or resets it with [`cuDevicePrimaryCtxReset_v2`]. Unlike [`cuCtxCreate_v4`] the newly retained context is not pushed onto the stack.
    ///
    /// Retaining the primary context for the first time will fail with [`cudaError_enum::CUDA_ERROR_UNKNOWN`] if the compute mode of the device is [`CUcomputemode_enum::CU_COMPUTEMODE_PROHIBITED`]. The function [`cuDeviceGetAttribute`] can be used with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_COMPUTE_MODE`] to determine the compute mode of the device. The nvidia-smi tool can be used to set the compute mode for devices. Documentation
    /// for nvidia-smi can be obtained by passing a -h option to it.
    ///
    /// Please note that the primary context always supports pinned allocations. Other flags can be specified by [`cuDevicePrimaryCtxSetFlags_v2`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDevicePrimaryCtxRelease_v2`], [`cuDevicePrimaryCtxSetFlags_v2`], [`cuCtxCreate_v4`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `pctx`: Returned context handle of the new context.
    /// - `dev`: Device for which primary context is requested.
    pub fn cuDevicePrimaryCtxRetain(pctx: *mut CUcontext, dev: CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Release the primary context on the GPU.
    ///
    /// Releases the primary context interop on the device. A retained context should always be released once the user is done using
    /// it. The context is automatically reset once the last reference to it is released. This behavior is different when the primary
    /// context was retained by the CUDA runtime from CUDA 4.0 and earlier. In this case, the primary context remains always active.
    ///
    /// Releasing a primary context that has not been previously retained will fail with [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`].
    ///
    /// Please note that unlike [`cuCtxDestroy_v2`] this method does not pop the context from stack in any circumstances.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDevicePrimaryCtxRetain`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `dev`: Device which primary context is released.
    pub fn cuDevicePrimaryCtxRelease_v2(dev: CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Set flags for the primary context.
    ///
    /// Sets the flags for the primary context on the device overwriting previously set ones.
    ///
    /// The three LSBs of the flags parameter can be used to control how the OS thread, which owns the CUDA context at the time of an API call, interacts with
    /// the OS scheduler when waiting for results from the GPU. Only one of the scheduling flags can be set when creating a context.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SCHED_SPIN`]: Instruct CUDA to actively spin when waiting for results from the GPU. This can decrease latency when waiting for the GPU,
    ///   but may lower the performance of CPU threads if they are performing work in parallel with the CUDA thread.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SCHED_YIELD`]: Instruct CUDA to yield its thread when waiting for results from the GPU. This can increase latency when waiting for the
    ///   GPU, but can increase the performance of CPU threads performing work in parallel with the GPU.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`]: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work.
    ///
    /// * [CU_CTX_BLOCKING_SYNC](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/types.html#group__CUDA__TYPES_1gg9f889e28a45a295b5c8ce13aa05f6cd4b5bf395cc60a8cbded4c329ae9430b91): Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work.
    ///
    ///   **Deprecated:** This flag was deprecated as of CUDA 4.0 and was replaced with [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`].
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SCHED_AUTO`]: The default value if the flags parameter is zero, uses a heuristic based on the number of active CUDA contexts in the process C and the number of logical
    ///   processors in the system P. If C > P, then CUDA will yield to other OS threads when waiting for the GPU ([`CUctx_flags_enum::CU_CTX_SCHED_YIELD`]), otherwise CUDA will not yield while waiting for results and actively spin on the processor ([`CUctx_flags_enum::CU_CTX_SCHED_SPIN`]). Additionally, on Tegra devices, [`CUctx_flags_enum::CU_CTX_SCHED_AUTO`] uses a heuristic based on the power profile of the platform and may choose [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] for low-powered devices.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_LMEM_RESIZE_TO_MAX`]: Instruct CUDA to not reduce local memory after resizing local memory for a kernel. This can prevent thrashing by local memory
    ///   allocations when launching many kernels with high local memory usage at the cost of potentially increased memory usage.
    ///
    ///   **Deprecated:** This flag is deprecated and the behavior enabled by this flag is now the default and cannot be disabled.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_COREDUMP_ENABLE`]: If GPU coredumps have not been enabled globally with [`cuCoredumpSetAttributeGlobal`] or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if this context
    ///   raises an exception during execution. These environment variables are described in the CUDA-GDB user guide under the "GPU
    ///   core dump support" section. The initial settings will be taken from the global settings at the time of context creation. The
    ///   other settings that control coredump output can be modified by calling [`cuCoredumpSetAttribute`] from the created context after it becomes current.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_USER_COREDUMP_ENABLE`]: If user-triggered GPU coredumps have not been enabled globally with [`cuCoredumpSetAttributeGlobal`] or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if data is written
    ///   to a certain pipe that is present in the OS space. These environment variables are described in the CUDA-GDB user guide under
    ///   the "GPU core dump support" section. It is important to note that the pipe name \*must\* be set with [`cuCoredumpSetAttributeGlobal`] before creating the context if this flag is used. Setting this flag implies that [`CUctx_flags_enum::CU_CTX_COREDUMP_ENABLE`] is set. The initial settings will be taken from the global settings at the time of context creation. The other settings that
    ///   control coredump output can be modified by calling [`cuCoredumpSetAttribute`] from the created context after it becomes current.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SYNC_MEMOPS`]: Ensures that synchronous memory operations initiated on this context will always synchronize. See further documentation
    ///   in the section titled "API Synchronization behavior" to learn more about cases when synchronous memory operations can exhibit
    ///   asynchronous behavior.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDevicePrimaryCtxRetain`], [`cuDevicePrimaryCtxGetState`], [`cuCtxCreate_v4`], [`cuCtxGetFlags`], [`cuCtxSetFlags`], [cudaSetDeviceFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g69e73c7dda3fc05306ae7c811a690fac).
    ///
    /// # Parameters
    ///
    /// - `dev`: Device for which the primary context flags are set.
    /// - `flags`: New flags for the device.
    pub fn cuDevicePrimaryCtxSetFlags_v2(
        dev: CUdevice,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get the state of the primary context.
    ///
    /// Returns in \*flags the flags for the primary context of dev, and in \*active whether it is active. See [`cuDevicePrimaryCtxSetFlags_v2`] for flag values.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDevicePrimaryCtxSetFlags_v2`], [`cuCtxGetFlags`], [`cuCtxSetFlags`], [cudaGetDeviceFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gf830794caf068b71638c6182bba8f77a).
    ///
    /// # Parameters
    ///
    /// - `dev`: Device to get primary context flags for.
    /// - `flags`: Pointer to store flags.
    /// - `active`: Pointer to store context state; 0 = inactive, 1 = active.
    pub fn cuDevicePrimaryCtxGetState(
        dev: CUdevice,
        flags: *mut ::core::ffi::c_uint,
        active: *mut ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroy all allocations and reset all state on the primary context.
    ///
    /// Explicitly destroys and cleans up all resources associated with the current device in the current process.
    ///
    /// Note that it is responsibility of the calling function to ensure that no other module in the process is using the device any
    /// more. For that reason it is recommended to use [`cuDevicePrimaryCtxRelease_v2`] in most cases. However it is safe for other modules to call [`cuDevicePrimaryCtxRelease_v2`] even after resetting the device. Resetting the primary context does not release it, an application that has retained the
    /// primary context should explicitly release its usage.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDevicePrimaryCtxRetain`], [`cuDevicePrimaryCtxRelease_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [cudaDeviceReset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gef69dd5c6d0206c2b8d099abac61f217).
    ///
    /// # Parameters
    ///
    /// - `dev`: Device for which primary context is destroyed.
    pub fn cuDevicePrimaryCtxReset_v2(dev: CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Create a CUDA context.
    ///
    /// Creates a new CUDA context and associates it with the calling thread. The flags parameter is described below. The context is created with a usage count of 1 and the caller of [`cuCtxCreate_v4`] must call [`cuCtxDestroy_v2`] when done using the context. If a context is already current to the thread, it is supplanted by the newly created context
    /// and may be restored by a subsequent call to [`cuCtxPopCurrent_v2`].
    ///
    /// A regular CUDA context can be created by setting ctxCreateParams to NULL.
    ///
    /// A CUDA context can be created with execution affinity. The type and the amount of execution resource the context can use is
    /// limited by paramsArray and numExecAffinityParams in execAffinity. The paramsArray is an array of CUexecAffinityParam and the numExecAffinityParams describes the size of the paramsArray. If two CUexecAffinityParam in the array have the same type, the latter execution affinity parameter overrides the former execution affinity parameter.
    /// The supported execution affinity types are:
    ///
    /// * [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`] limits the portion of SMs that the context can use. The portion of SMs is specified as the number of SMs via CUexecAffinitySmCount. This limit will be internally rounded up to the next hardware-supported amount. Hence, it is imperative to query the actual
    ///   execution affinity of the context via [`cuCtxGetExecAffinity`] after context creation. Currently, this attribute is only supported under Volta+ MPS.
    ///
    /// A CUDA context can be created in CIG(CUDA in Graphics) mode by setting cigParams. Data from graphics client is shared with CUDA via the sharedData in cigParams. Support for D3D12 graphics client can be determined using [`cuDeviceGetAttribute`] with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_D3D12_CIG_SUPPORTED`]. sharedData is a ID3D12CommandQueue handle. Support for Vulkan graphics client can be determined using [`cuDeviceGetAttribute`] with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_VULKAN_CIG_SUPPORTED`]. sharedData is a Nvidia specific data blob populated by calling vkGetExternalComputeQueueDataNV(). execAffinityParams and cigParams are mutually exclusive and cannot both be non-NULL. Setting both to non-NULL values will result in undefined behavior. If
    /// both execAffinityParams and cigParams are NULL, the context will be created as a regular CUDA context.
    ///
    /// The three LSBs of the flags parameter can be used to control how the OS thread, which owns the CUDA context at the time of an API call, interacts with
    /// the OS scheduler when waiting for results from the GPU. Only one of the scheduling flags can be set when creating a context.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SCHED_SPIN`]: Instruct CUDA to actively spin when waiting for results from the GPU. This can decrease latency when waiting for the GPU,
    ///   but may lower the performance of CPU threads if they are performing work in parallel with the CUDA thread.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SCHED_YIELD`]: Instruct CUDA to yield its thread when waiting for results from the GPU. This can increase latency when waiting for the
    ///   GPU, but can increase the performance of CPU threads performing work in parallel with the GPU.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`]: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work.
    ///
    /// * [CU_CTX_BLOCKING_SYNC](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/types.html#group__CUDA__TYPES_1gg9f889e28a45a295b5c8ce13aa05f6cd4b5bf395cc60a8cbded4c329ae9430b91): Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the GPU to finish work.
    ///
    ///   **Deprecated:** This flag was deprecated as of CUDA 4.0 and was replaced with [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`].
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SCHED_AUTO`]: The default value if the flags parameter is zero, uses a heuristic based on the number of active CUDA contexts in the process C and the number of logical
    ///   processors in the system P. If C > P, then CUDA will yield to other OS threads when waiting for the GPU ([`CUctx_flags_enum::CU_CTX_SCHED_YIELD`]), otherwise CUDA will not yield while waiting for results and actively spin on the processor ([`CUctx_flags_enum::CU_CTX_SCHED_SPIN`]). Additionally, on Tegra devices, [`CUctx_flags_enum::CU_CTX_SCHED_AUTO`] uses a heuristic based on the power profile of the platform and may choose [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] for low-powered devices.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_MAP_HOST`]: Instruct CUDA to support mapped pinned allocations. This flag must be set in order to allocate pinned host memory that is
    ///   accessible to the GPU.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_LMEM_RESIZE_TO_MAX`]: Instruct CUDA to not reduce local memory after resizing local memory for a kernel. This can prevent thrashing by local memory
    ///   allocations when launching many kernels with high local memory usage at the cost of potentially increased memory usage.
    ///
    ///   **Deprecated:** This flag is deprecated and the behavior enabled by this flag is now the default and cannot be disabled. Instead, the per-thread
    ///   stack size can be controlled with [`cuCtxSetLimit`].
    ///
    /// * [`CUctx_flags_enum::CU_CTX_COREDUMP_ENABLE`]: If GPU coredumps have not been enabled globally with [`cuCoredumpSetAttributeGlobal`] or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if this context
    ///   raises an exception during execution. These environment variables are described in the CUDA-GDB user guide under the "GPU
    ///   core dump support" section. The initial attributes will be taken from the global attributes at the time of context creation.
    ///   The other attributes that control coredump output can be modified by calling [`cuCoredumpSetAttribute`] from the created context after it becomes current. This flag is not supported when CUDA context is created in CIG(CUDA in
    ///   Graphics) mode.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_USER_COREDUMP_ENABLE`]: If user-triggered GPU coredumps have not been enabled globally with [`cuCoredumpSetAttributeGlobal`] or environment variables, this flag can be set during context creation to instruct CUDA to create a coredump if data is written
    ///   to a certain pipe that is present in the OS space. These environment variables are described in the CUDA-GDB user guide under
    ///   the "GPU core dump support" section. It is important to note that the pipe name \*must\* be set with [`cuCoredumpSetAttributeGlobal`] before creating the context if this flag is used. Setting this flag implies that [`CUctx_flags_enum::CU_CTX_COREDUMP_ENABLE`] is set. The initial attributes will be taken from the global attributes at the time of context creation. The other attributes
    ///   that control coredump output can be modified by calling [`cuCoredumpSetAttribute`] from the created context after it becomes current. Setting this flag on any context creation is equivalent to setting the
    ///   [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`] attribute to true globally. This flag is not supported when CUDA context is created in CIG(CUDA in Graphics) mode.
    ///
    /// * [`CUctx_flags_enum::CU_CTX_SYNC_MEMOPS`]: Ensures that synchronous memory operations initiated on this context will always synchronize. See further documentation
    ///   in the section titled "API Synchronization behavior" to learn more about cases when synchronous memory operations can exhibit
    ///   asynchronous behavior.
    ///
    /// Context creation will fail with [`cudaError_enum::CUDA_ERROR_UNKNOWN`] if the compute mode of the device is [`CUcomputemode_enum::CU_COMPUTEMODE_PROHIBITED`]. The function [`cuDeviceGetAttribute`] can be used with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_COMPUTE_MODE`] to determine the compute mode of the device. The nvidia-smi tool can be used to set the compute mode for \* devices. Documentation
    /// for nvidia-smi can be obtained by passing a -h option to it.
    ///
    /// Context creation will fail with [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if invalid parameter was passed by client to create the CUDA context.
    ///
    /// Context creation in CIG mode will fail with [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`] if CIG is not supported by the device or the driver.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCoredumpSetAttributeGlobal`], [`cuCoredumpSetAttribute`], [`cuCtxSynchronize`][`cuCtxGetExecAffinity`],.
    ///
    /// # Parameters
    ///
    /// - `pctx`: Returned context handle of the new context.
    /// - `ctxCreateParams`: Context creation parameters. Can be NULL to create a regular CUDA context. See [`CUctxCreateParams`] for details.
    /// - `flags`: Context creation flags.
    /// - `dev`: Device to create context on.
    pub fn cuCtxCreate_v4(
        pctx: *mut CUcontext,
        ctxCreateParams: *mut CUctxCreateParams,
        flags: ::core::ffi::c_uint,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroy a CUDA context.
    ///
    /// Destroys the CUDA context specified by ctx. The context ctx will be destroyed regardless of how many threads it is current to. It is the responsibility of the calling function to ensure
    /// that no API call issues using ctx while [`cuCtxDestroy_v2`] is executing.
    ///
    /// Destroys and cleans up all resources associated with the context. It is the caller's responsibility to ensure that the context
    /// or its resources are not accessed or passed in subsequent API calls and doing so will result in undefined behavior. These
    /// resources include CUDA types [`CUmodule`], [`CUfunction`], [`CUstream`], [`CUevent`], [`CUarray`], [`CUmipmappedArray`], [`CUtexObject`], [`CUsurfObject`], [`CUtexref`], [`CUsurfref`], [`CUgraphicsResource`], CUlinkState, [`CUexternalMemory`] and [`CUexternalSemaphore`]. These resources also include memory allocations by [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocManaged`] and [`cuMemAllocPitch_v2`].
    ///
    /// If ctx is current to the calling thread then ctx will also be popped from the current thread's context stack (as though [`cuCtxPopCurrent_v2`] were called). If ctx is current to other threads, then ctx will remain current to those threads, and attempting to access ctx from those threads will result in the error [`cudaError_enum::CUDA_ERROR_CONTEXT_IS_DESTROYED`].
    ///
    /// Note:
    ///
    /// [`cuCtxDestroy_v2`] will not destroy memory allocations by [`cuMemCreate`], [`cuMemAllocAsync`] and [`cuMemAllocFromPoolAsync`]. These memory allocations are not associated with any CUDA context and need to be destroyed explicitly.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `ctx`: Context to destroy.
    pub fn cuCtxDestroy_v2(ctx: CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Pushes a context on the current CPU thread.
    ///
    /// Pushes the given context ctx onto the CPU thread's stack of current contexts. The specified context becomes the CPU thread's current context, so all CUDA
    /// functions that operate on the current context are affected.
    ///
    /// The previous current context may be made current again by calling [`cuCtxDestroy_v2`] or [`cuCtxPopCurrent_v2`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `ctx`: Context to push.
    pub fn cuCtxPushCurrent_v2(ctx: CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Pops the current CUDA context from the current CPU thread.
    ///
    /// Pops the current CUDA context from the CPU thread and passes back the old context handle in \*pctx. That context may then be made current to a different CPU thread by calling [`cuCtxPushCurrent_v2`].
    ///
    /// If a context was current to the CPU thread before [`cuCtxCreate_v4`] or [`cuCtxPushCurrent_v2`] was called, this function makes that context current to the CPU thread again.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `pctx`: Returned popped context handle.
    pub fn cuCtxPopCurrent_v2(pctx: *mut CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Binds the specified CUDA context to the calling CPU thread.
    ///
    /// Binds the specified CUDA context to the calling CPU thread. If ctx is NULL then the CUDA context previously bound to the calling CPU thread is unbound and [`cudaError_enum::CUDA_SUCCESS`] is returned.
    ///
    /// If there exists a CUDA context stack on the calling CPU thread, this will replace the top of that stack with ctx. If ctx is NULL then this will be equivalent to popping the top of the calling CPU thread's CUDA context stack (or a no-op if the
    /// calling CPU thread's CUDA context stack is empty).
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCurrent`], [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [cudaSetDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g159587909ffa0791bbe4b40187a4c6bb).
    ///
    /// # Parameters
    ///
    /// - `ctx`: Context to bind to the calling CPU thread.
    pub fn cuCtxSetCurrent(ctx: CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Returns the CUDA context bound to the calling CPU thread.
    ///
    /// Returns in \*pctx the CUDA context bound to the calling CPU thread. If no context is bound to the calling CPU thread then \*pctx is set to NULL and [`cudaError_enum::CUDA_SUCCESS`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxSetCurrent`], [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [cudaGetDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g80861db2ce7c29b6e8055af8ae01bc78).
    ///
    /// # Parameters
    ///
    /// - `pctx`: Returned context handle.
    pub fn cuCtxGetCurrent(pctx: *mut CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Returns the device handle for the current context.
    ///
    /// Returns in \*device the handle of the current context's device.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [cudaGetDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g80861db2ce7c29b6e8055af8ae01bc78).
    ///
    /// # Parameters
    ///
    /// - `device`: Returned device handle for the current context.
    pub fn cuCtxGetDevice(device: *mut CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Returns the device handle for the specified context.
    ///
    /// Returns in \*device the handle of the specified context's device. If the specified context is NULL, the API will return the current context's
    /// device.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCurrent`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`].
    ///
    /// # Parameters
    ///
    /// - `device`: Returned device handle for the specified context.
    /// - `ctx`: Context for which to obtain the device.
    pub fn cuCtxGetDevice_v2(device: *mut CUdevice, ctx: CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Returns the flags for the current context.
    ///
    /// Returns in \*flags the flags of the current context. See [`cuCtxCreate_v4`] for flag values.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetCurrent`], [`cuCtxGetDevice`], [`cuCtxGetLimit`], [`cuCtxGetSharedMemConfig`], [`cuCtxGetStreamPriorityRange`], [`cuCtxSetFlags`], [cudaGetDeviceFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gf830794caf068b71638c6182bba8f77a).
    ///
    /// # Parameters
    ///
    /// - `flags`: Pointer to store flags of current context.
    pub fn cuCtxGetFlags(flags: *mut ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Sets the flags for the current context.
    ///
    /// Sets the flags for the current context overwriting previously set ones. See [`cuDevicePrimaryCtxSetFlags_v2`] for flag values.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetCurrent`], [`cuCtxGetDevice`], [`cuCtxGetLimit`], [`cuCtxGetSharedMemConfig`], [`cuCtxGetStreamPriorityRange`], [`cuCtxGetFlags`], [cudaGetDeviceFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gf830794caf068b71638c6182bba8f77a), [`cuDevicePrimaryCtxSetFlags_v2`],.
    ///
    /// # Parameters
    ///
    /// - `flags`: Flags to set on the current context.
    pub fn cuCtxSetFlags(flags: ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Returns the unique Id associated with the context supplied.
    ///
    /// Returns in ctxId the unique Id which is associated with a given context. The Id is unique for the life of the program for this instance of
    /// CUDA. If context is supplied as NULL and there is one current, the Id of the current context is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPushCurrent_v2`].
    ///
    /// # Parameters
    ///
    /// - `ctx`: Context for which to obtain the Id.
    /// - `ctxId`: Pointer to store the Id of the context.
    pub fn cuCtxGetId(ctx: CUcontext, ctxId: *mut ::core::ffi::c_ulonglong) -> CUresult;
}
unsafe extern "C" {
    /// Block for the current context's tasks to complete.
    ///
    /// Blocks until the current context has completed all preceding requested tasks. If the current context is the primary context,
    /// green contexts that have been created will also be synchronized. [`cuCtxSynchronize`] returns an error if one of the preceding tasks failed. If the context was created with the [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] flag, the CPU thread will block until the GPU context has finished its work.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [cudaDeviceSynchronize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g10e20b05a95f638a4071a655503df25d).
    pub fn cuCtxSynchronize() -> CUresult;
}
unsafe extern "C" {
    /// Block for the specified context's tasks to complete.
    ///
    /// Blocks until the specified context has completed all preceding requested tasks. If the specified context is the primary context,
    /// green contexts that have been created will also be synchronized. The API returns an error if one of the preceding tasks failed.
    ///
    /// If the context was created with the [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] flag, the CPU thread will block until the GPU context has finished its work.
    ///
    /// If the specified context is NULL, the API will operate on the current context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCurrent`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuGreenCtxCreate`], [`cuCtxFromGreenCtx`], [cudaDeviceSynchronize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g10e20b05a95f638a4071a655503df25d).
    ///
    /// # Parameters
    ///
    /// - `ctx`: Context to synchronize.
    pub fn cuCtxSynchronize_v2(ctx: CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Set resource limits.
    ///
    /// Setting limit to value is a request by the application to update the current limit maintained by the context. The driver is free to modify the requested
    /// value to meet h/w requirements (this could be clamping to minimum or maximum values, rounding up to nearest element size,
    /// etc). The application can use [`cuCtxGetLimit`] to find out exactly what the limit has been set to.
    ///
    /// Setting each `CUlimit` has its own specific restrictions, so each is discussed here.
    ///
    /// * [`CUlimit_enum::CU_LIMIT_STACK_SIZE`] controls the stack size in bytes of each GPU thread. The driver automatically increases the per-thread stack size for each
    ///   kernel launch as needed. This size isn't reset back to the original value after each launch. Setting this value will take
    ///   effect immediately, and if necessary, the device will block until all preceding requested tasks are complete.
    ///
    /// * [`CUlimit_enum::CU_LIMIT_PRINTF_FIFO_SIZE`] controls the size in bytes of the FIFO used by the printf() device system call. Setting [`CUlimit_enum::CU_LIMIT_PRINTF_FIFO_SIZE`] must be performed before launching any kernel that uses the printf() device system call, otherwise [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned.
    ///
    /// * [`CUlimit_enum::CU_LIMIT_MALLOC_HEAP_SIZE`] controls the size in bytes of the heap used by the malloc() and free() device system calls. Setting [`CUlimit_enum::CU_LIMIT_MALLOC_HEAP_SIZE`] must be performed before launching any kernel that uses the malloc() or free() device system calls, otherwise [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned.
    ///
    /// * [`CUlimit_enum::CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH`] controls the maximum nesting depth of a grid at which a thread can safely call [cudaDeviceSynchronize()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g10e20b05a95f638a4071a655503df25d). Setting this limit must be performed before any launch of a kernel that uses the device runtime and calls [cudaDeviceSynchronize()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g10e20b05a95f638a4071a655503df25d) above the default sync depth, two levels of grids. Calls to [cudaDeviceSynchronize()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g10e20b05a95f638a4071a655503df25d) will fail with error code [cudaErrorSyncDepthExceeded](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038265dbf94c45903cd582cfc40f93a176a) if the limitation is violated. This limit can be set smaller than the default or up the maximum launch depth of 24. When
    ///   setting this limit, keep in mind that additional levels of sync depth require the driver to reserve large amounts of device
    ///   memory which can no longer be used for user allocations. If these reservations of device memory fail, [`cuCtxSetLimit`] will return [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`], and the limit can be reset to a lower value. This limit is only applicable to devices of compute capability &lt; 9.0. Attempting
    ///   to set this limit on devices of other compute capability versions will result in the error [`cudaError_enum::CUDA_ERROR_UNSUPPORTED_LIMIT`] being returned.
    ///
    /// * [`CUlimit_enum::CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT`] controls the maximum number of outstanding device runtime launches that can be made from the current context. A grid is outstanding
    ///   from the point of launch up until the grid is known to have been completed. Device runtime launches which violate this limitation
    ///   fail and return [cudaErrorLaunchPendingCountExceeded](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382372902b9ffd65825d138e16125b1376) when [cudaGetLastError()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__ERROR.html#group__CUDART__ERROR_1g3529f94cb530a83a76613616782bd233) is called after launch. If more pending launches than the default (2048 launches) are needed for a module using the device
    ///   runtime, this limit can be increased. Keep in mind that being able to sustain additional pending launches will require the
    ///   driver to reserve larger amounts of device memory upfront which can no longer be used for allocations. If these reservations
    ///   fail, [`cuCtxSetLimit`] will return [`cudaError_enum::CUDA_ERROR_OUT_OF_MEMORY`], and the limit can be reset to a lower value. This limit is only applicable to devices of compute capability 3.5 and higher.
    ///   Attempting to set this limit on devices of compute capability less than 3.5 will result in the error [`cudaError_enum::CUDA_ERROR_UNSUPPORTED_LIMIT`] being returned.
    ///
    /// * [`CUlimit_enum::CU_LIMIT_MAX_L2_FETCH_GRANULARITY`] controls the L2 cache fetch granularity. Values can range from 0B to 128B. This is purely a performance hint and it can be
    ///   ignored or clamped depending on the platform.
    ///
    /// * [`CUlimit_enum::CU_LIMIT_PERSISTING_L2_CACHE_SIZE`] controls size in bytes available for persisting L2 cache. This is purely a performance hint and it can be ignored or clamped
    ///   depending on the platform.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSynchronize`], [cudaDeviceSetLimit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g05956f16eaa47ef3a4efee84563ccb7d).
    ///
    /// # Parameters
    ///
    /// - `limit`: Limit to set.
    /// - `value`: Size of limit.
    pub fn cuCtxSetLimit(limit: CUlimit, value: size_t) -> CUresult;
}
unsafe extern "C" {
    /// Returns resource limits.
    ///
    /// Returns in \*pvalue the current size of limit. The supported `CUlimit` values are:
    ///
    /// * [`CUlimit_enum::CU_LIMIT_STACK_SIZE`]: stack size in bytes of each GPU thread.
    /// * [`CUlimit_enum::CU_LIMIT_PRINTF_FIFO_SIZE`]: size in bytes of the FIFO used by the printf() device system call.
    /// * [`CUlimit_enum::CU_LIMIT_MALLOC_HEAP_SIZE`]: size in bytes of the heap used by the malloc() and free() device system calls.
    /// * [`CUlimit_enum::CU_LIMIT_DEV_RUNTIME_SYNC_DEPTH`]: maximum grid depth at which a thread can issue the device runtime call [cudaDeviceSynchronize()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g10e20b05a95f638a4071a655503df25d) to wait on child grid launches to complete.
    /// * [`CUlimit_enum::CU_LIMIT_DEV_RUNTIME_PENDING_LAUNCH_COUNT`]: maximum number of outstanding device runtime launches that can be made from this context.
    /// * [`CUlimit_enum::CU_LIMIT_MAX_L2_FETCH_GRANULARITY`]: L2 cache fetch granularity.
    /// * [`CUlimit_enum::CU_LIMIT_PERSISTING_L2_CACHE_SIZE`]: Persisting L2 cache size in bytes
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [cudaDeviceGetLimit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g720e159aeb125910c22aa20fe9611ec2).
    ///
    /// # Parameters
    ///
    /// - `pvalue`: Returned size of limit.
    /// - `limit`: Limit to query.
    pub fn cuCtxGetLimit(pvalue: *mut size_t, limit: CUlimit) -> CUresult;
}
unsafe extern "C" {
    /// Returns the preferred cache configuration for the current context.
    ///
    /// On devices where the L1 cache and shared memory use the same hardware resources, this function returns through pconfig the preferred cache configuration for the current context. This is only a preference. The driver will use the requested configuration
    /// if possible, but it is free to choose a different configuration if required to execute functions.
    ///
    /// This will return a pconfig of [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`] on devices where the size of the L1 cache and shared memory are fixed.
    ///
    /// The supported cache configurations are:
    ///
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal sized L1 cache and shared memory
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [`cuFuncSetCacheConfig`], [cudaDeviceGetCacheConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gd9bf5eae6d464de05aa3840df9f5deeb).
    ///
    /// # Parameters
    ///
    /// - `pconfig`: Returned cache configuration.
    pub fn cuCtxGetCacheConfig(pconfig: *mut CUfunc_cache) -> CUresult;
}
unsafe extern "C" {
    /// Sets the preferred cache configuration for the current context.
    ///
    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through config the preferred cache configuration for the current context. This is only a preference. The driver will use the requested configuration
    /// if possible, but it is free to choose a different configuration if required to execute the function. Any function preference
    /// set via [`cuFuncSetCacheConfig`] or [`cuKernelSetCacheConfig`] will be preferred over this context-wide setting. Setting the context-wide cache configuration to [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`] will cause subsequent kernel launches to prefer to not change the cache configuration unless required to launch the kernel.
    ///
    /// This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
    ///
    /// Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization
    /// point.
    ///
    /// The supported cache configurations are:
    ///
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal sized L1 cache and shared memory
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [`cuFuncSetCacheConfig`], [cudaDeviceSetCacheConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g6c9cc78ca80490386cf593b4baa35a15), [`cuKernelSetCacheConfig`].
    ///
    /// # Parameters
    ///
    /// - `config`: Requested cache configuration.
    pub fn cuCtxSetCacheConfig(config: CUfunc_cache) -> CUresult;
}
unsafe extern "C" {
    /// Gets the context's API version.
    ///
    /// Returns a version number in version corresponding to the capabilities of the context (e.g. 3010 or 3020), which library developers can use to direct callers
    /// to a specific API version. If ctx is NULL, returns the API version used to create the currently bound context.
    ///
    /// Note that new API versions are only introduced when context capabilities are changed that break binary compatibility, so the
    /// API version and driver version may be different. For example, it is valid for the API version to be 3020 while the driver
    /// version is 4020.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `ctx`: Context to check.
    /// - `version`: Pointer to version.
    pub fn cuCtxGetApiVersion(
        ctx: CUcontext,
        version: *mut ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns numerical values that correspond to the least and greatest stream priorities.
    ///
    /// Returns in \*leastPriority and \*greatestPriority the numerical values that correspond to the least and greatest stream priorities respectively. Stream priorities follow a
    /// convention where lower numbers imply greater priorities. The range of meaningful stream priorities is given by \[\*greatestPriority, \*leastPriority\]. If the user attempts to create a stream with a priority value that is outside the meaningful range as specified by this
    /// API, the priority is automatically clamped down or up to either \*leastPriority or \*greatestPriority respectively. See [`cuStreamCreateWithPriority`] for details on creating a priority stream. A NULL may be passed in for \*leastPriority or \*greatestPriority if the value is not desired.
    ///
    /// This function will return '0' in both \*leastPriority and \*greatestPriority if the current context's device does not support stream priorities (see [`cuDeviceGetAttribute`]).
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreateWithPriority`], [`cuStreamGetPriority`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [cudaDeviceGetStreamPriorityRange](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gfdb79818f7c0ee7bc585648c91770275).
    ///
    /// # Parameters
    ///
    /// - `leastPriority`: Pointer to an int in which the numerical value for least stream priority is returned.
    /// - `greatestPriority`: Pointer to an int in which the numerical value for greatest stream priority is returned.
    pub fn cuCtxGetStreamPriorityRange(
        leastPriority: *mut ::core::ffi::c_int,
        greatestPriority: *mut ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Resets all persisting lines in cache to normal status.
    ///
    /// [`cuCtxResetPersistingL2Cache`] Resets all persisting lines in cache to normal status. Takes effect on function return.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`CUaccessPolicyWindow`].
    pub fn cuCtxResetPersistingL2Cache() -> CUresult;
}
unsafe extern "C" {
    /// Returns the execution affinity setting for the current context.
    ///
    /// Returns in \*pExecAffinity the current value of type. The supported `CUexecAffinityType` values are:
    ///
    /// * [`CUexecAffinityType_enum::CU_EXEC_AFFINITY_TYPE_SM_COUNT`]: number of SMs the context is limited to use.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`CUexecAffinityParam`].
    ///
    /// # Parameters
    ///
    /// - `pExecAffinity`: Returned execution affinity.
    pub fn cuCtxGetExecAffinity(
        pExecAffinity: *mut CUexecAffinityParam,
        type_: CUexecAffinityType,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Records an event.
    ///
    /// Captures in hEvent all the activities of the context hCtx at the time of this call. hEvent and hCtx must be from the same CUDA context, otherwise [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] will be returned. Calls such as [`cuEventQuery`] or [`cuCtxWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of hCtx after this call do not modify hEvent. If the context passed to hCtx is the primary context, hEvent will capture all the activities of the primary context and its green contexts. If the context passed to hCtx is a context converted from green context via [`cuCtxFromGreenCtx`], hEvent will capture only the activities of the green context.
    ///
    /// Note:
    ///
    /// The API will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] if the specified context hCtx has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures.
    ///
    /// **See also:**
    ///
    /// [`cuCtxWaitEvent`], [`cuGreenCtxRecordEvent`], [`cuGreenCtxWaitEvent`], [`cuEventRecord`].
    ///
    /// # Parameters
    ///
    /// - `hCtx`: Context to record event for.
    /// - `hEvent`: Event to record.
    pub fn cuCtxRecordEvent(hCtx: CUcontext, hEvent: CUevent) -> CUresult;
}
unsafe extern "C" {
    /// Make a context wait on an event.
    ///
    /// Makes all future work submitted to context hCtx wait for all work captured in hEvent. The synchronization will be performed on the device and will not block the calling CPU thread. See [`cuCtxRecordEvent`] for details on what is captured by an event. If the context passed to hCtx is the primary context, the primary context and its green contexts will wait for hEvent. If the context passed to hCtx is a context converted from green context via [`cuCtxFromGreenCtx`], the green context will wait for hEvent.
    ///
    /// Note:
    ///
    /// * hEvent may be from a different context or device than hCtx.
    /// * The API will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] and invalidate the capture if the specified event hEvent is part of an ongoing capture sequence or if the specified context hCtx has a stream in the capture mode.
    ///
    /// **See also:**
    ///
    /// [`cuCtxRecordEvent`], [`cuGreenCtxRecordEvent`], [`cuGreenCtxWaitEvent`], [`cuStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `hCtx`: Context to wait.
    /// - `hEvent`: Event to wait on.
    pub fn cuCtxWaitEvent(hCtx: CUcontext, hEvent: CUevent) -> CUresult;
}
unsafe extern "C" {
    /// Increment a context's usage-count.
    ///
    /// Note that
    ///
    /// Increments the usage count of the context and passes back a context handle in \*pctx that must be passed to [`cuCtxDetach`] when the application is done with the context. [`cuCtxAttach`] fails if there is no context current to the thread.
    ///
    /// Currently, the flags parameter must be 0.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxDetach`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `pctx`: Returned context handle of the current context.
    /// - `flags`: Context attach flags (must be 0).
    #[deprecated]
    pub fn cuCtxAttach(pctx: *mut CUcontext, flags: ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Decrement a context's usage-count.
    ///
    /// Note that
    ///
    /// Decrements the usage count of the context ctx, and destroys the context if the usage count goes to 0. The context must be a handle that was passed back by [`cuCtxCreate_v4`] or [`cuCtxAttach`], and must be current to the calling thread.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetCacheConfig`], [`cuCtxSetLimit`], [`cuCtxSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `ctx`: Context to destroy.
    #[deprecated]
    pub fn cuCtxDetach(ctx: CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Returns the current shared memory configuration for the current context.
    ///
    /// pConfig
    ///
    /// [`cuCtxSetSharedMemConfig`]
    ///
    /// [`cuCtxGetSharedMemConfig`]
    ///
    /// The returned bank configurations can be either:
    ///
    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`]: shared memory bank width is four bytes.
    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`]: shared memory bank width will eight bytes.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [`cuCtxGetSharedMemConfig`], [`cuFuncSetCacheConfig`], [cudaDeviceGetSharedMemConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE__DEPRECATED.html#group__CUDART__DEVICE__DEPRECATED_1g542246258996a39a3ce2bc311bbb2421).
    ///
    /// # Parameters
    ///
    /// - `pConfig`: returned shared memory configuration.
    #[deprecated]
    pub fn cuCtxGetSharedMemConfig(pConfig: *mut CUsharedconfig) -> CUresult;
}
unsafe extern "C" {
    /// Sets the shared memory configuration for the current context.
    ///
    /// Changed the shared memory configuration between launches may insert a device side synchronization point between those launches.
    ///
    /// Changing the shared memory bank size will not increase shared memory usage or affect occupancy of kernels, but may have major
    /// effects on performance. Larger bank sizes will allow for greater potential bandwidth to shared memory, but will change what
    /// kinds of accesses to shared memory will result in bank conflicts.
    ///
    /// This function will do nothing on devices with fixed shared memory bank size.
    ///
    /// The supported bank configurations are:
    ///
    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE`]: set bank width to the default initial setting (currently, four bytes).
    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`]: set shared memory bank width to be natively four bytes.
    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`]: set shared memory bank width to be natively eight bytes.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxCreate_v4`], [`cuCtxDestroy_v2`], [`cuCtxGetApiVersion`], [`cuCtxGetCacheConfig`], [`cuCtxGetDevice`], [`cuCtxGetFlags`], [`cuCtxGetLimit`], [`cuCtxPopCurrent_v2`], [`cuCtxPushCurrent_v2`], [`cuCtxSetLimit`], [`cuCtxSynchronize`], [`cuCtxGetSharedMemConfig`], [`cuFuncSetCacheConfig`], [cudaDeviceSetSharedMemConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE__DEPRECATED.html#group__CUDART__DEVICE__DEPRECATED_1g76cb4f94c7af96c1247dfc7f105eabae).
    ///
    /// # Parameters
    ///
    /// - `config`: requested shared memory configuration.
    #[deprecated]
    pub fn cuCtxSetSharedMemConfig(config: CUsharedconfig) -> CUresult;
}
unsafe extern "C" {
    /// Loads a compute module.
    ///
    /// Takes a filename fname and loads the corresponding module module into the current context. The CUDA driver API does not attempt to lazily allocate the resources needed by a module; if the
    /// memory for functions and data (constant and global) needed by the module cannot be allocated, [`cuModuleLoad`] fails. The file should be a cubin file as output by **nvcc**, or a PTX file either as output by **nvcc** or handwritten, or a fatbin file as output by **nvcc** from toolchain 4.0 or later, or a Tile IR file.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetGlobal_v2`], [`cuModuleGetTexRef`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
    ///
    /// # Parameters
    ///
    /// - `module`: Returned module.
    /// - `fname`: Filename of module to load.
    pub fn cuModuleLoad(
        module: *mut CUmodule,
        fname: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Load a module's data.
    ///
    /// Takes a pointer image and loads the corresponding module module into the current context. The image may be a cubin or fatbin as output by **nvcc**, or a NULL-terminated PTX, either as output by **nvcc** or hand-written, or Tile IR data.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetGlobal_v2`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
    ///
    /// # Parameters
    ///
    /// - `module`: Returned module.
    /// - `image`: Module data to load.
    pub fn cuModuleLoadData(
        module: *mut CUmodule,
        image: *const ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Load a module's data with options.
    ///
    /// Takes a pointer image and loads the corresponding module module into the current context. The image may be a cubin or fatbin as output by **nvcc**, or a NULL-terminated PTX, either as output by **nvcc** or hand-written, or Tile IR data.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetGlobal_v2`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
    ///
    /// # Parameters
    ///
    /// - `module`: Returned module.
    /// - `image`: Module data to load.
    /// - `numOptions`: Number of options.
    /// - `options`: Options for JIT.
    /// - `optionValues`: Option values for JIT.
    pub fn cuModuleLoadDataEx(
        module: *mut CUmodule,
        image: *const ::core::ffi::c_void,
        numOptions: ::core::ffi::c_uint,
        options: *mut CUjit_option,
        optionValues: *mut *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Load a module's data.
    ///
    /// Takes a pointer fatCubin and loads the corresponding module module into the current context. The pointer represents a fat binary object, which is a collection of different cubin and/or PTX
    /// files, all representing the same device code, but compiled and optimized for different architectures.
    ///
    /// Prior to CUDA 4.0, there was no documented API for constructing and using fat binary objects by programmers. Starting with
    /// CUDA 4.0, fat binary objects can be constructed by providing the -fatbin option to **nvcc**. More information can be found in the **nvcc** document.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetGlobal_v2`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleUnload`].
    ///
    /// # Parameters
    ///
    /// - `module`: Returned module.
    /// - `fatCubin`: Fat binary to load.
    pub fn cuModuleLoadFatBinary(
        module: *mut CUmodule,
        fatCubin: *const ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unloads a module.
    ///
    /// Unloads a module hmod from the current context. Attempting to unload a module which was obtained from the Library Management API such as [`cuLibraryGetModule`] will return [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetGlobal_v2`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`].
    ///
    /// # Parameters
    ///
    /// - `hmod`: Module to unload.
    pub fn cuModuleUnload(hmod: CUmodule) -> CUresult;
}
/// CUDA Lazy Loading status.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUmoduleLoadingMode_enum {
    /// Lazy Kernel Loading is not enabled.
    CU_MODULE_EAGER_LOADING = 1,
    /// Lazy Kernel Loading is enabled.
    CU_MODULE_LAZY_LOADING = 2,
}
pub use self::CUmoduleLoadingMode_enum as CUmoduleLoadingMode;
unsafe extern "C" {
    /// Query lazy loading mode.
    ///
    /// Returns lazy loading mode Module loading mode is controlled by CUDA_MODULE_LOADING env variable
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleLoad`],.
    ///
    /// # Parameters
    ///
    /// - `mode`: Returns the lazy loading mode.
    pub fn cuModuleGetLoadingMode(mode: *mut CUmoduleLoadingMode) -> CUresult;
}
unsafe extern "C" {
    /// Returns a function handle.
    ///
    /// Returns in \*hfunc the handle of the function of name name located in module hmod. If no function of that name exists, [`cuModuleGetFunction`] returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetGlobal_v2`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Returned function handle.
    /// - `hmod`: Module to retrieve function from.
    /// - `name`: Name of function to retrieve.
    pub fn cuModuleGetFunction(
        hfunc: *mut CUfunction,
        hmod: CUmodule,
        name: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the number of functions within a module.
    ///
    /// Returns in count the number of functions in mod.
    ///
    /// # Parameters
    ///
    /// - `count`: Number of functions found within the module.
    pub fn cuModuleGetFunctionCount(
        count: *mut ::core::ffi::c_uint,
        mod_: CUmodule,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the function handles within a module.
    ///
    /// Returns in functions a maximum number of numFunctions function handles within mod. When function loading mode is set to LAZY the function retrieved may be partially loaded. The loading state of a function
    /// can be queried using cuFunctionIsLoaded. CUDA APIs may load the function automatically when called with partially loaded function
    /// handle which may incur additional latency. Alternatively, cuFunctionLoad can be used to explicitly load a function. The returned
    /// function handles become invalid when the module is unloaded.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetFunctionCount`], [`cuFuncIsLoaded`], [`cuFuncLoad`].
    ///
    /// # Parameters
    ///
    /// - `functions`: Buffer where the function handles are returned to.
    /// - `numFunctions`: Maximum number of function handles may be returned to the buffer.
    pub fn cuModuleEnumerateFunctions(
        functions: *mut CUfunction,
        numFunctions: ::core::ffi::c_uint,
        mod_: CUmodule,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a global pointer from a module.
    ///
    /// Returns in \*dptr and \*bytes the base pointer and size of the global of name name located in module hmod. If no variable of that name exists, [`cuModuleGetGlobal_v2`] returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. One of the parameters dptr or bytes (not both) can be NULL in which case it is ignored.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`], [cudaGetSymbolAddress](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g3a0f010e70a3343db18227cec9615177), [cudaGetSymbolSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g0561c8ffee270bff0bbb7deb81ad865c).
    ///
    /// # Parameters
    ///
    /// - `dptr`: Returned global device pointer.
    /// - `bytes`: Returned global size in bytes.
    /// - `hmod`: Module to retrieve global from.
    /// - `name`: Name of global to retrieve.
    pub fn cuModuleGetGlobal_v2(
        dptr: *mut CUdeviceptr,
        bytes: *mut size_t,
        hmod: CUmodule,
        name: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a pending JIT linker invocation.
    ///
    /// If the call is successful, the caller owns the returned CUlinkState, which should eventually be destroyed with [`cuLinkDestroy`]. The device code machine size (32 or 64 bit) will match the calling application.
    ///
    /// Both linker and compiler options may be specified. Compiler options will be applied to inputs to this linker action which
    /// must be compiled from PTX. The options [`CUjit_option_enum::CU_JIT_WALL_TIME`], [`CUjit_option_enum::CU_JIT_INFO_LOG_BUFFER_SIZE_BYTES`], and [`CUjit_option_enum::CU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES`] will accumulate data until the CUlinkState is destroyed.
    ///
    /// The data passed in via [`cuLinkAddData_v2`] and [`cuLinkAddFile_v2`] will be treated as relocatable (-rdc=true to nvcc) when linking the final cubin during [`cuLinkComplete`] and will have similar consequences as offline relocatable device code linking.
    ///
    /// optionValues must remain valid for the life of the CUlinkState if output options are used. No other references to inputs are maintained
    /// after this call returns.
    ///
    /// Note:
    ///
    /// For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuLinkAddData_v2`], [`cuLinkAddFile_v2`], [`cuLinkComplete`], [`cuLinkDestroy`].
    ///
    /// # Parameters
    ///
    /// - `numOptions`: Size of options arrays.
    /// - `options`: Array of linker and compiler options.
    /// - `optionValues`: Array of option values, each cast to void \*.
    /// - `stateOut`: On success, this will contain a CUlinkState to specify and complete this action.
    pub fn cuLinkCreate_v2(
        numOptions: ::core::ffi::c_uint,
        options: *mut CUjit_option,
        optionValues: *mut *mut ::core::ffi::c_void,
        stateOut: *mut CUlinkState,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Add an input to a pending linker invocation.
    ///
    /// Ownership of data is retained by the caller. No reference is retained to any inputs after this call returns.
    ///
    /// This method accepts only compiler options, which are used if the data must be compiled from PTX, and does not accept any of
    /// [`CUjit_option_enum::CU_JIT_WALL_TIME`], [`CUjit_option_enum::CU_JIT_INFO_LOG_BUFFER`], [`CUjit_option_enum::CU_JIT_ERROR_LOG_BUFFER`], [`CUjit_option_enum::CU_JIT_TARGET_FROM_CUCONTEXT`], or [`CUjit_option_enum::CU_JIT_TARGET`].
    ///
    /// Note:
    ///
    /// For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted
    ///
    /// **See also:**
    ///
    /// [`cuLinkCreate_v2`], [`cuLinkAddFile_v2`], [`cuLinkComplete`], [`cuLinkDestroy`].
    ///
    /// # Parameters
    ///
    /// - `state`: A pending linker action.
    /// - `data`: The input data. PTX must be NULL-terminated.
    /// - `size`: The length of the input data.
    /// - `name`: An optional name for this input in log messages.
    /// - `numOptions`: Size of options.
    /// - `options`: Options to be applied only for this input (overrides options from [`cuLinkCreate_v2`]).
    /// - `optionValues`: Array of option values, each cast to void \*.
    pub fn cuLinkAddData_v2(
        state: CUlinkState,
        type_: CUjitInputType,
        data: *mut ::core::ffi::c_void,
        size: size_t,
        name: *const ::core::ffi::c_char,
        numOptions: ::core::ffi::c_uint,
        options: *mut CUjit_option,
        optionValues: *mut *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Add a file input to a pending linker invocation.
    ///
    /// No reference is retained to any inputs after this call returns.
    ///
    /// This method accepts only compiler options, which are used if the input must be compiled from PTX, and does not accept any
    /// of [`CUjit_option_enum::CU_JIT_WALL_TIME`], [`CUjit_option_enum::CU_JIT_INFO_LOG_BUFFER`], [`CUjit_option_enum::CU_JIT_ERROR_LOG_BUFFER`], [`CUjit_option_enum::CU_JIT_TARGET_FROM_CUCONTEXT`], or [`CUjit_option_enum::CU_JIT_TARGET`].
    ///
    /// This method is equivalent to invoking [`cuLinkAddData_v2`] on the contents of the file.
    ///
    /// Note:
    ///
    /// For LTO-IR input, only LTO-IR compiled with toolkits prior to CUDA 12.0 will be accepted
    ///
    /// **See also:**
    ///
    /// [`cuLinkCreate_v2`], [`cuLinkAddData_v2`], [`cuLinkComplete`], [`cuLinkDestroy`].
    ///
    /// # Parameters
    ///
    /// - `state`: A pending linker action.
    /// - `path`: Path to the input file.
    /// - `numOptions`: Size of options.
    /// - `options`: Options to be applied only for this input (overrides options from [`cuLinkCreate_v2`]).
    /// - `optionValues`: Array of option values, each cast to void \*.
    pub fn cuLinkAddFile_v2(
        state: CUlinkState,
        type_: CUjitInputType,
        path: *const ::core::ffi::c_char,
        numOptions: ::core::ffi::c_uint,
        options: *mut CUjit_option,
        optionValues: *mut *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Complete a pending linker invocation.
    ///
    /// Completes the pending linker action and returns the cubin image for the linked device code, which can be used with [`cuModuleLoadData`]. The cubin is owned by state, so it should be loaded before state is destroyed via [`cuLinkDestroy`]. This call does not destroy state.
    ///
    /// **See also:**
    ///
    /// [`cuLinkCreate_v2`], [`cuLinkAddData_v2`], [`cuLinkAddFile_v2`], [`cuLinkDestroy`], [`cuModuleLoadData`].
    ///
    /// # Parameters
    ///
    /// - `state`: A pending linker invocation.
    /// - `cubinOut`: On success, this will point to the output image.
    /// - `sizeOut`: Optional parameter to receive the size of the generated image.
    pub fn cuLinkComplete(
        state: CUlinkState,
        cubinOut: *mut *mut ::core::ffi::c_void,
        sizeOut: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys state for a JIT linker invocation.
    ///
    /// **See also:**
    ///
    /// [`cuLinkCreate_v2`].
    ///
    /// # Parameters
    ///
    /// - `state`: State object for the linker invocation.
    pub fn cuLinkDestroy(state: CUlinkState) -> CUresult;
}
unsafe extern "C" {
    /// Returns a handle to a texture reference.
    ///
    /// \*pTexRef
    ///
    /// name
    ///
    /// hmod
    ///
    /// [`cuModuleGetTexRef`]
    ///
    /// [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetGlobal_v2`], [`cuModuleGetSurfRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
    ///
    /// # Parameters
    ///
    /// - `pTexRef`: Returned texture reference.
    /// - `hmod`: Module to retrieve texture reference from.
    /// - `name`: Name of texture reference to retrieve.
    #[deprecated]
    pub fn cuModuleGetTexRef(
        pTexRef: *mut CUtexref,
        hmod: CUmodule,
        name: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a handle to a surface reference.
    ///
    /// \*pSurfRef
    ///
    /// name
    ///
    /// hmod
    ///
    /// [`cuModuleGetSurfRef`]
    ///
    /// [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetFunction`], [`cuModuleGetGlobal_v2`], [`cuModuleGetTexRef`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`], [`cuModuleLoadFatBinary`], [`cuModuleUnload`].
    ///
    /// # Parameters
    ///
    /// - `pSurfRef`: Returned surface reference.
    /// - `hmod`: Module to retrieve surface reference from.
    /// - `name`: Name of surface reference to retrieve.
    #[deprecated]
    pub fn cuModuleGetSurfRef(
        pSurfRef: *mut CUsurfref,
        hmod: CUmodule,
        name: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Load a library with specified code and options.
    ///
    /// Takes a pointer code and loads the corresponding library library based on the application defined library loading mode:
    ///
    /// * If module loading is set to EAGER, via the environment variables described in "Module loading", library is loaded eagerly into all contexts at the time of the call and future contexts at the time of creation until the library
    ///   is unloaded with [`cuLibraryUnload`].
    /// * If the environment variables are set to LAZY, library is not immediately loaded onto all existent contexts and will only be loaded when a function is needed for that context,
    ///   such as a kernel launch.
    ///
    /// These environment variables are described in the CUDA programming guide under the "CUDA environment variables" section.
    ///
    /// The code may be a cubin or fatbin as output by **nvcc**, or a NULL-terminated PTX, either as output by **nvcc** or hand-written, or Tile IR data. A fatbin should also contain relocatable code when doing separate compilation.
    ///
    /// Options are passed as an array via jitOptions and any corresponding parameters are passed in jitOptionsValues. The number of total JIT options is supplied via numJitOptions. Any outputs will be returned via jitOptionsValues.
    ///
    /// Library load options are passed as an array via libraryOptions and any corresponding parameters are passed in libraryOptionValues. The number of total library load options is supplied via numLibraryOptions.
    ///
    /// Note:
    ///
    /// If the library contains managed variables and no device in the system supports managed variables this call is expected to
    /// return [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`]
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`].
    ///
    /// # Parameters
    ///
    /// - `library`: Returned library.
    /// - `code`: Code to load.
    /// - `jitOptions`: Options for JIT.
    /// - `jitOptionsValues`: Option values for JIT.
    /// - `numJitOptions`: Number of options.
    /// - `libraryOptions`: Options for loading.
    /// - `libraryOptionValues`: Option values for loading.
    /// - `numLibraryOptions`: Number of options for loading.
    pub fn cuLibraryLoadData(
        library: *mut CUlibrary,
        code: *const ::core::ffi::c_void,
        jitOptions: *mut CUjit_option,
        jitOptionsValues: *mut *mut ::core::ffi::c_void,
        numJitOptions: ::core::ffi::c_uint,
        libraryOptions: *mut CUlibraryOption,
        libraryOptionValues: *mut *mut ::core::ffi::c_void,
        numLibraryOptions: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Load a library with specified file and options.
    ///
    /// Takes a pointer code and loads the corresponding library library based on the application defined library loading mode:
    ///
    /// * If module loading is set to EAGER, via the environment variables described in "Module loading", library is loaded eagerly into all contexts at the time of the call and future contexts at the time of creation until the library
    ///   is unloaded with [`cuLibraryUnload`].
    /// * If the environment variables are set to LAZY, library is not immediately loaded onto all existent contexts and will only be loaded when a function is needed for that context,
    ///   such as a kernel launch.
    ///
    /// These environment variables are described in the CUDA programming guide under the "CUDA environment variables" section.
    ///
    /// The file should be a cubin file as output by **nvcc**, or a PTX file either as output by **nvcc** or handwritten, or a fatbin file as output by **nvcc** or hand-written, or Tile IR file. A fatbin should also contain relocatable code when doing separate compilation.
    ///
    /// Options are passed as an array via jitOptions and any corresponding parameters are passed in jitOptionsValues. The number of total options is supplied via numJitOptions. Any outputs will be returned via jitOptionsValues.
    ///
    /// Library load options are passed as an array via libraryOptions and any corresponding parameters are passed in libraryOptionValues. The number of total library load options is supplied via numLibraryOptions.
    ///
    /// Note:
    ///
    /// If the library contains managed variables and no device in the system supports managed variables this call is expected to
    /// return [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`]
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryUnload`], [`cuModuleLoad`], [`cuModuleLoadData`], [`cuModuleLoadDataEx`].
    ///
    /// # Parameters
    ///
    /// - `library`: Returned library.
    /// - `fileName`: File to load from.
    /// - `jitOptions`: Options for JIT.
    /// - `jitOptionsValues`: Option values for JIT.
    /// - `numJitOptions`: Number of options.
    /// - `libraryOptions`: Options for loading.
    /// - `libraryOptionValues`: Option values for loading.
    /// - `numLibraryOptions`: Number of options for loading.
    pub fn cuLibraryLoadFromFile(
        library: *mut CUlibrary,
        fileName: *const ::core::ffi::c_char,
        jitOptions: *mut CUjit_option,
        jitOptionsValues: *mut *mut ::core::ffi::c_void,
        numJitOptions: ::core::ffi::c_uint,
        libraryOptions: *mut CUlibraryOption,
        libraryOptionValues: *mut *mut ::core::ffi::c_void,
        numLibraryOptions: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unloads a library.
    ///
    /// Unloads the library specified with library
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuModuleUnload`].
    ///
    /// # Parameters
    ///
    /// - `library`: Library to unload.
    pub fn cuLibraryUnload(library: CUlibrary) -> CUresult;
}
unsafe extern "C" {
    /// Returns a kernel handle.
    ///
    /// Returns in pKernel the handle of the kernel with name name located in library library. If kernel handle is not found, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuKernelGetFunction`], [`cuLibraryGetModule`], [`cuModuleGetFunction`].
    ///
    /// # Parameters
    ///
    /// - `pKernel`: Returned kernel handle.
    /// - `library`: Library to retrieve kernel from.
    /// - `name`: Name of kernel to retrieve.
    pub fn cuLibraryGetKernel(
        pKernel: *mut CUkernel,
        library: CUlibrary,
        name: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the number of kernels within a library.
    ///
    /// Returns in count the number of kernels in lib.
    ///
    /// # Parameters
    ///
    /// - `count`: Number of kernels found within the library.
    /// - `lib`: Library to query.
    pub fn cuLibraryGetKernelCount(
        count: *mut ::core::ffi::c_uint,
        lib: CUlibrary,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Retrieve the kernel handles within a library.
    ///
    /// Returns in kernels a maximum number of numKernels kernel handles within lib. The returned kernel handle becomes invalid when the library is unloaded.
    ///
    /// **See also:**
    ///
    /// [`cuLibraryGetKernelCount`].
    ///
    /// # Parameters
    ///
    /// - `kernels`: Buffer where the kernel handles are returned to.
    /// - `numKernels`: Maximum number of kernel handles may be returned to the buffer.
    /// - `lib`: Library to query from.
    pub fn cuLibraryEnumerateKernels(
        kernels: *mut CUkernel,
        numKernels: ::core::ffi::c_uint,
        lib: CUlibrary,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a module handle.
    ///
    /// Returns in pMod the module handle associated with the current context located in library library. If module handle is not found, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuModuleGetFunction`].
    ///
    /// # Parameters
    ///
    /// - `pMod`: Returned module handle.
    /// - `library`: Library to retrieve module from.
    pub fn cuLibraryGetModule(pMod: *mut CUmodule, library: CUlibrary) -> CUresult;
}
unsafe extern "C" {
    /// Returns a function handle.
    ///
    /// Returns in pFunc the handle of the function for the requested kernel kernel and the current context. If function handle is not found, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuLibraryGetKernel`], [`cuLibraryGetModule`], [`cuModuleGetFunction`].
    ///
    /// # Parameters
    ///
    /// - `pFunc`: Returned function handle.
    /// - `kernel`: Kernel to retrieve function for the requested context.
    pub fn cuKernelGetFunction(pFunc: *mut CUfunction, kernel: CUkernel) -> CUresult;
}
unsafe extern "C" {
    /// Returns a library handle.
    ///
    /// Returns in pLib the handle of the library for the requested kernel kernel
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuLibraryGetKernel`].
    ///
    /// # Parameters
    ///
    /// - `pLib`: Returned library handle.
    /// - `kernel`: Kernel to retrieve library handle.
    pub fn cuKernelGetLibrary(pLib: *mut CUlibrary, kernel: CUkernel) -> CUresult;
}
unsafe extern "C" {
    /// Returns a global device pointer.
    ///
    /// Returns in \*dptr and \*bytes the base pointer and size of the global with name name for the requested library library and the current context. If no global for the requested name name exists, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. One of the parameters dptr or bytes (not both) can be NULL in which case it is ignored.
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuLibraryGetModule`], [`cuModuleGetGlobal_v2`].
    ///
    /// # Parameters
    ///
    /// - `dptr`: Returned global device pointer for the requested context.
    /// - `bytes`: Returned global size in bytes.
    /// - `library`: Library to retrieve global from.
    /// - `name`: Name of global to retrieve.
    pub fn cuLibraryGetGlobal(
        dptr: *mut CUdeviceptr,
        bytes: *mut size_t,
        library: CUlibrary,
        name: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a pointer to managed memory.
    ///
    /// Returns in \*dptr and \*bytes the base pointer and size of the managed memory with name name for the requested library library. If no managed memory with the requested name name exists, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. One of the parameters dptr or bytes (not both) can be NULL in which case it is ignored. Note that managed memory for library library is shared across devices and is registered when the library is loaded into at least one context.
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`].
    ///
    /// # Parameters
    ///
    /// - `dptr`: Returned pointer to the managed memory.
    /// - `bytes`: Returned memory size in bytes.
    /// - `library`: Library to retrieve managed memory from.
    /// - `name`: Name of managed memory to retrieve.
    pub fn cuLibraryGetManaged(
        dptr: *mut CUdeviceptr,
        bytes: *mut size_t,
        library: CUlibrary,
        name: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a pointer to a unified function.
    ///
    /// Returns in \*fptr the function pointer to a unified function denoted by symbol. If no unified function with name symbol exists, the call returns [`cudaError_enum::CUDA_ERROR_NOT_FOUND`]. If there is no device with attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_UNIFIED_FUNCTION_POINTERS`] present in the system, the call may return [`cudaError_enum::CUDA_ERROR_NOT_FOUND`].
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`].
    ///
    /// # Parameters
    ///
    /// - `fptr`: Returned pointer to a unified function.
    /// - `library`: Library to retrieve function pointer memory from.
    /// - `symbol`: Name of function pointer to retrieve.
    pub fn cuLibraryGetUnifiedFunction(
        fptr: *mut *mut ::core::ffi::c_void,
        library: CUlibrary,
        symbol: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns information about a kernel.
    ///
    /// Returns in \*pi the integer value of the attribute attrib for the kernel kernel for the requested device dev. The supported attributes are:
    ///
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK`]: The maximum number of threads per block, beyond which a launch of the kernel would fail. This number depends on both the
    ///   kernel and the requested device.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`]: The size in bytes of statically-allocated shared memory per block required by this kernel. This does not include dynamically-allocated
    ///   shared memory requested by the user at runtime.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES`]: The size in bytes of user-allocated constant memory required by this kernel.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES`]: The size in bytes of local memory used by each thread of this kernel.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NUM_REGS`]: The number of registers used by each thread of this kernel.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PTX_VERSION`]: The PTX virtual architecture version for which the kernel was compiled. This value is the major PTX version \* 10 + the minor
    ///   PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value of 0 for
    ///   cubins compiled prior to CUDA 3.0.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_BINARY_VERSION`]: The binary architecture version for which the kernel was compiled. This value is the major binary version \* 10 + the minor
    ///   binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy
    ///   cubins that do not have a properly-encoded binary architecture version.
    /// * CU_FUNC_CACHE_MODE_CA: The attribute to indicate whether the kernel has been compiled with user specified option "-Xptxas
    ///   --dlcm=ca" set.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]: The maximum size in bytes of dynamically-allocated shared memory.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]: Preferred shared memory-L1 cache split ratio in percent of total shared memory.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET`]: If this attribute is set, the kernel must launch with a valid cluster size specified.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`]: The required cluster width in blocks.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`]: The required cluster height in blocks.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`]: The required cluster depth in blocks.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`]: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable
    ///   cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run
    ///   on a different hardware platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired
    ///   size can be launched on the current device. A portable cluster size is guaranteed to be functional on all compute capabilities
    ///   higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase
    ///   for future compute capabilities. The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy.
    ///
    /// Note:
    ///
    /// If another thread is trying to set the same attribute on the same device using [`cuKernelSetAttribute`] simultaneously, the attribute query will give the old or new value depending on the interleavings chosen by the OS scheduler
    /// and memory consistency.
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuKernelSetAttribute`], [`cuLibraryGetKernel`], [`cuLaunchKernel`], [`cuKernelGetFunction`], [`cuLibraryGetModule`], [`cuModuleGetFunction`], [`cuFuncGetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `pi`: Returned attribute value.
    /// - `attrib`: Attribute requested.
    /// - `kernel`: Kernel to query attribute of.
    /// - `dev`: Device to query attribute of.
    pub fn cuKernelGetAttribute(
        pi: *mut ::core::ffi::c_int,
        attrib: CUfunction_attribute,
        kernel: CUkernel,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets information about a kernel.
    ///
    /// This call sets the value of a specified attribute attrib on the kernel kernel for the requested device dev to an integer value specified by val. This function returns [`CUresult::CUDA_SUCCESS`] if the new value of the attribute could be successfully set. If the set fails, this call
    /// will return an error. Not all attributes can have values set. Attempting to set a value on a read-only attribute will result
    /// in an error ([`CUresult::CUDA_ERROR_INVALID_VALUE`])
    ///
    /// Note that attributes set using [`cuFuncSetAttribute`] will override the attribute set by this API irrespective of whether the call to [`cuFuncSetAttribute`] is made before or after this API call. However, [`cuKernelGetAttribute`] will always return the attribute value set by this API.
    ///
    /// Supported attributes are:
    ///
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]: This is the maximum size in bytes of dynamically-allocated shared memory. The value should contain the requested maximum
    ///   size of dynamically-allocated shared memory. The sum of this value and the function attribute [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`] cannot exceed the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`]. The maximal size of requestable dynamic shared memory may differ by GPU architecture.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]: On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference,
    ///   in percent of the total shared memory. See [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`] This is only a hint, and the driver can choose a different ratio if required to execute the function.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`]: The required cluster width in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity
    ///   of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime.
    ///   Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`]: The required cluster height in blocks. The width, height, and depth values must either all be 0 or all be positive. The
    ///   validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at
    ///   runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`]: The required cluster depth in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity
    ///   of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime.
    ///   Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`]: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy.
    ///
    /// Note:
    ///
    /// The API has stricter locking requirements in comparison to its legacy counterpart [`cuFuncSetAttribute`] due to device-wide semantics. If multiple threads are trying to set the same attribute on the same device simultaneously,
    /// the attribute setting will depend on the interleavings chosen by the OS scheduler and memory consistency.
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuKernelGetAttribute`], [`cuLibraryGetKernel`], [`cuLaunchKernel`], [`cuKernelGetFunction`], [`cuLibraryGetModule`], [`cuModuleGetFunction`], [`cuFuncSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `attrib`: Attribute requested.
    /// - `val`: Value to set.
    /// - `kernel`: Kernel to set attribute of.
    /// - `dev`: Device to set attribute of.
    pub fn cuKernelSetAttribute(
        attrib: CUfunction_attribute,
        val: ::core::ffi::c_int,
        kernel: CUkernel,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the preferred cache configuration for a device kernel.
    ///
    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through config the preferred cache configuration for the device kernel kernel on the requested device dev. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different
    /// configuration if required to execute kernel. Any context-wide preference set via [`cuCtxSetCacheConfig`] will be overridden by this per-kernel setting.
    ///
    /// Note that attributes set using [`cuFuncSetCacheConfig`] will override the attribute set by this API irrespective of whether the call to [`cuFuncSetCacheConfig`] is made before or after this API call.
    ///
    /// This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
    ///
    /// Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization
    /// point.
    ///
    /// The supported cache configurations are:
    ///
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal sized L1 cache and shared memory
    ///
    /// Note:
    ///
    /// The API has stricter locking requirements in comparison to its legacy counterpart [`cuFuncSetCacheConfig`] due to device-wide semantics. If multiple threads are trying to set a config on the same device simultaneously, the cache
    /// config setting will depend on the interleavings chosen by the OS scheduler and memory consistency.
    ///
    /// **See also:**
    ///
    /// [`cuLibraryLoadData`], [`cuLibraryLoadFromFile`], [`cuLibraryUnload`], [`cuLibraryGetKernel`], [`cuKernelGetFunction`], [`cuLibraryGetModule`], [`cuModuleGetFunction`], [`cuFuncSetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `kernel`: Kernel to configure cache for.
    /// - `config`: Requested cache configuration.
    /// - `dev`: Device to set attribute of.
    pub fn cuKernelSetCacheConfig(
        kernel: CUkernel,
        config: CUfunc_cache,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the function name for a CUkernel handle.
    ///
    /// Returns in \*\*name the function name associated with the kernel handle hfunc . The function name is returned as a null-terminated string. The returned name is only valid when the kernel handle is valid.
    /// If the library is unloaded or reloaded, one must call the API again to get the updated name. This API may return a mangled
    /// name if the function is not declared as having C linkage. If either \*\*name or hfunc is NULL, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// # Parameters
    ///
    /// - `name`: The returned name of the function.
    /// - `hfunc`: The function handle to retrieve the name for.
    pub fn cuKernelGetName(
        name: *mut *const ::core::ffi::c_char,
        hfunc: CUkernel,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the offset and size of a kernel parameter in the device-side parameter layout.
    ///
    /// Queries the kernel parameter at paramIndex into kernel's list of parameters, and returns in paramOffset and paramSize the offset and size, respectively, where the parameter will reside in the device-side parameter layout. This information
    /// can be used to update kernel node parameters from the device via [cudaGraphKernelNodeSetParam()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g0c2bd161eff1e47531eedce282e66d21) and [cudaGraphKernelNodeUpdatesApply()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g2d558cf37c9616365c67447e61ac0d6a). paramIndex must be less than the number of parameters that kernel takes. paramSize can be set to NULL if only the parameter offset is desired.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncGetParamInfo`].
    ///
    /// # Parameters
    ///
    /// - `kernel`: The kernel to query.
    /// - `paramIndex`: The parameter index to query.
    /// - `paramOffset`: Returns the offset into the device-side parameter layout at which the parameter resides.
    /// - `paramSize`: Optionally returns the size of the parameter in the device-side parameter layout.
    pub fn cuKernelGetParamInfo(
        kernel: CUkernel,
        paramIndex: size_t,
        paramOffset: *mut size_t,
        paramSize: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the number of parameters used by the kernel.
    ///
    /// Queries the number of kernel parameters used by kernel and returns it in paramCount.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuKernelGetParamInfo`].
    ///
    /// # Parameters
    ///
    /// - `kernel`: The kernel to query.
    /// - `paramCount`: Returns the number of parameters used by the function.
    pub fn cuKernelGetParamCount(kernel: CUkernel, paramCount: *mut size_t) -> CUresult;
}
unsafe extern "C" {
    /// Gets free and total memory.
    ///
    /// Returns in \*total the total amount of memory available to the current context. Returns in \*free the amount of memory on the device that is free according to the OS. CUDA is not guaranteed to be able to allocate all of
    /// the memory that the OS reports as free. In a multi-tenet situation, free estimate returned is prone to race condition where
    /// a new allocation/free done by a different process or a different thread in the same process between the time when free memory
    /// was estimated and reported, will result in deviation in free value reported and actual free memory.
    ///
    /// The integrated GPU on Tegra shares memory with CPU and other component of the SoC. The free and total values returned by the
    /// API excludes the SWAP memory space maintained by the OS on some platforms. The OS may move some of the memory pages into swap
    /// area as the GPU or CPU allocate or access memory. See Tegra app note on how to calculate total and free memory on Tegra.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemGetInfo](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g376b97f5ab20321ca46f7cfa9511b978).
    ///
    /// # Parameters
    ///
    /// - `free`: Returned free memory in bytes.
    /// - `total`: Returned total memory in bytes.
    pub fn cuMemGetInfo_v2(free: *mut size_t, total: *mut size_t) -> CUresult;
}
unsafe extern "C" {
    /// Allocates device memory.
    ///
    /// Allocates bytesize bytes of linear memory on the device and returns in \*dptr a pointer to the allocated memory. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared.
    /// If bytesize is 0, [`cuMemAlloc_v2`] returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMalloc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g37d37965bfb4803b6d4e59ff26856356).
    ///
    /// # Parameters
    ///
    /// - `dptr`: Returned device pointer.
    /// - `bytesize`: Requested allocation size in bytes.
    pub fn cuMemAlloc_v2(dptr: *mut CUdeviceptr, bytesize: size_t) -> CUresult;
}
unsafe extern "C" {
    /// Allocates pitched device memory.
    ///
    /// Allocates at least WidthInBytes \* Height bytes of linear memory on the device and returns in \*dptr a pointer to the allocated memory. The function may pad the allocation to ensure that corresponding pointers in any given
    /// row will continue to meet the alignment requirements for coalescing as the address is updated from row to row. ElementSizeBytes specifies the size of the largest reads and writes that will be performed on the memory range. ElementSizeBytes may be 4, 8 or 16 (since coalesced memory transactions are not possible on other data sizes). If ElementSizeBytes is smaller than the actual read/write size of a kernel, the kernel will run correctly, but possibly at reduced speed. The
    /// pitch returned in \*pPitch by [`cuMemAllocPitch_v2`] is the width in bytes of the allocation. The intended usage of pitch is as a separate parameter of the allocation, used to
    /// compute addresses within the 2D array. Given the row and column of an array element of type **T**, the address is computed as:
    ///
    /// ```text
    ///    T* pElement = (T*)((char*)BaseAddress + Row * Pitch) + Column;
    /// ```
    ///
    /// The pitch returned by [`cuMemAllocPitch_v2`] is guaranteed to work with [`cuMemcpy2D_v2`] under all circumstances. For allocations of 2D arrays, it is recommended that programmers consider performing pitch allocations
    /// using [`cuMemAllocPitch_v2`]. Due to alignment restrictions in the hardware, this is especially true if the application will be performing 2D memory copies
    /// between different regions of device memory (whether linear memory or CUDA arrays).
    ///
    /// The byte alignment of the pitch returned by [`cuMemAllocPitch_v2`] is guaranteed to match or exceed the alignment requirement for texture binding with [`cuTexRefSetAddress2D_v3`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMallocPitch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g32bd7a39135594788a542ae72217775c).
    ///
    /// # Parameters
    ///
    /// - `dptr`: Returned device pointer.
    /// - `pPitch`: Returned pitch of allocation in bytes.
    /// - `WidthInBytes`: Requested allocation width in bytes.
    /// - `Height`: Requested allocation height in rows.
    /// - `ElementSizeBytes`: Size of largest reads/writes for range.
    pub fn cuMemAllocPitch_v2(
        dptr: *mut CUdeviceptr,
        pPitch: *mut size_t,
        WidthInBytes: size_t,
        Height: size_t,
        ElementSizeBytes: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Frees device memory.
    ///
    /// Frees the memory space pointed to by dptr, which must have been returned by a previous call to one of the following memory allocation APIs - [`cuMemAlloc_v2`], [`cuMemAllocPitch_v2`], [`cuMemAllocManaged`], [`cuMemAllocAsync`], [`cuMemAllocFromPoolAsync`]
    ///
    /// Note - This API will not perform any implict synchronization when the pointer was allocated with [`cuMemAllocAsync`] or [`cuMemAllocFromPoolAsync`]. Callers must ensure that all accesses to these pointer have completed before invoking [`cuMemFree_v2`]. For best performance and memory reuse, users should use [`cuMemFreeAsync`] to free memory allocated via the stream ordered memory allocator. For all other pointers, this API may perform implicit synchronization.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemAllocManaged`], [`cuMemAllocAsync`], [`cuMemAllocFromPoolAsync`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemFreeAsync`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaFree](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1ga042655cbbf3408f01061652a075e094).
    ///
    /// # Parameters
    ///
    /// - `dptr`: Pointer to memory to free.
    pub fn cuMemFree_v2(dptr: CUdeviceptr) -> CUresult;
}
unsafe extern "C" {
    /// Get information on memory allocations.
    ///
    /// Returns the base address in \*pbase and size in \*psize of the allocation that contains the input pointer dptr. Both parameters pbase and psize are optional. If one of them is NULL, it is ignored.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`].
    ///
    /// # Parameters
    ///
    /// - `pbase`: Returned base address.
    /// - `psize`: Returned size of device memory allocation.
    /// - `dptr`: Device pointer to query.
    pub fn cuMemGetAddressRange_v2(
        pbase: *mut CUdeviceptr,
        psize: *mut size_t,
        dptr: CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Allocates page-locked host memory.
    ///
    /// Allocates bytesize bytes of host memory that is page-locked and accessible to the device. The driver tracks the virtual memory ranges allocated
    /// with this function and automatically accelerates calls to functions such as [`cuMemcpy`]. Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable
    /// memory obtained with functions such as malloc().
    ///
    /// On systems where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`] is true, [`cuMemAllocHost_v2`] may not page-lock the allocated memory.
    ///
    /// Page-locking excessive amounts of memory with [`cuMemAllocHost_v2`] may degrade system performance, since it reduces the amount of memory available to the system for paging. As a result, this
    /// function is best used sparingly to allocate staging areas for data exchange between host and device.
    ///
    /// Note all host memory allocated using [`cuMemAllocHost_v2`] will automatically be immediately accessible to all contexts on all devices which support unified addressing (as may be queried
    /// using [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`]). The device pointer that may be used to access this host memory from those contexts is always equal to the returned host
    /// pointer \*pp. See [Unified Addressing](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unified-addressing.html#group__CUDA__UNIFIED) for additional details.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMallocHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gd5c991beb38e2b8419f50285707ae87e).
    ///
    /// # Parameters
    ///
    /// - `pp`: Returned pointer to host memory.
    /// - `bytesize`: Requested allocation size in bytes.
    pub fn cuMemAllocHost_v2(
        pp: *mut *mut ::core::ffi::c_void,
        bytesize: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Frees page-locked host memory.
    ///
    /// Frees the memory space pointed to by p, which must have been returned by a previous call to [`cuMemAllocHost_v2`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaFreeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g71c078689c17627566b2a91989184969).
    ///
    /// # Parameters
    ///
    /// - `p`: Pointer to memory to free.
    pub fn cuMemFreeHost(p: *mut ::core::ffi::c_void) -> CUresult;
}
unsafe extern "C" {
    /// Allocates page-locked host memory.
    ///
    /// Allocates bytesize bytes of host memory that is page-locked and accessible to the device. The driver tracks the virtual memory ranges allocated
    /// with this function and automatically accelerates calls to functions such as [`cuMemcpyHtoD_v2`]. Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable
    /// memory obtained with functions such as malloc().
    ///
    /// On systems where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`] is true, [`cuMemHostAlloc`] may not page-lock the allocated memory.
    ///
    /// Page-locking excessive amounts of memory may degrade system performance, since it reduces the amount of memory available to
    /// the system for paging. As a result, this function is best used sparingly to allocate staging areas for data exchange between
    /// host and device.
    ///
    /// The Flags parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// * [`CU_MEMHOSTALLOC_PORTABLE`]: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed
    ///   the allocation.
    ///
    /// * [`CU_MEMHOSTALLOC_DEVICEMAP`]: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling [`cuMemHostGetDevicePointer_v2`].
    ///
    /// * [`CU_MEMHOSTALLOC_WRITECOMBINED`]: Allocates the memory as write-combined (WC). WC memory can be transferred across the PCI Express bus more quickly on some
    ///   system configurations, but cannot be read efficiently by most CPUs. WC memory is a good option for buffers that will be written
    ///   by the CPU and read by the GPU via mapped pinned memory or host->device transfers.
    ///
    /// All of these flags are orthogonal to one another: a developer may allocate memory that is portable, mapped and/or write-combined
    /// with no restrictions.
    ///
    /// The [`CU_MEMHOSTALLOC_DEVICEMAP`] flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to [`cuMemHostGetDevicePointer_v2`] because the memory may be mapped into other CUDA contexts via the [`CU_MEMHOSTALLOC_PORTABLE`] flag.
    ///
    /// The memory allocated by this function must be freed with [`cuMemFreeHost`].
    ///
    /// Note all host memory allocated using [`cuMemHostAlloc`] will automatically be immediately accessible to all contexts on all devices which support unified addressing (as may be queried
    /// using [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`]). Unless the flag [`CU_MEMHOSTALLOC_WRITECOMBINED`] is specified, the device pointer that may be used to access this host memory from those contexts is always equal to the returned
    /// host pointer \*pp. If the flag [`CU_MEMHOSTALLOC_WRITECOMBINED`] is specified, then the function [`cuMemHostGetDevicePointer_v2`] must be used to query the device pointer, even if the context supports unified addressing. See [Unified Addressing](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unified-addressing.html#group__CUDA__UNIFIED) for additional details.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaHostAlloc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gb65da58f444e7230d3322b6126bb4902).
    ///
    /// # Parameters
    ///
    /// - `pp`: Returned pointer to host memory.
    /// - `bytesize`: Requested allocation size in bytes.
    /// - `Flags`: Flags for allocation request.
    pub fn cuMemHostAlloc(
        pp: *mut *mut ::core::ffi::c_void,
        bytesize: size_t,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Passes back device pointer of mapped pinned memory.
    ///
    /// Passes back the device pointer pdptr corresponding to the mapped, pinned host buffer p allocated by [`cuMemHostAlloc`].
    ///
    /// [`cuMemHostGetDevicePointer_v2`] will fail if the [`CU_MEMHOSTALLOC_DEVICEMAP`] flag was not specified at the time the memory was allocated, or if the function is called on a GPU that does not support
    /// mapped pinned memory.
    ///
    /// For devices that have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`], the memory can also be accessed from the device using the host pointer p. The device pointer returned by [`cuMemHostGetDevicePointer_v2`] may or may not match the original host pointer p and depends on the devices visible to the application. If all devices visible to the application have a non-zero value for
    /// the device attribute, the device pointer returned by [`cuMemHostGetDevicePointer_v2`] will match the original pointer p. If any device visible to the application has a zero value for the device attribute, the device pointer returned by [`cuMemHostGetDevicePointer_v2`] will not match the original host pointer p, but it will be suitable for use on all devices provided Unified Virtual Addressing is enabled. In such systems, it is valid
    /// to access the memory using either pointer on devices that have a non-zero value for the device attribute. Note however that
    /// such devices should access the memory using only one of the two pointers and not both.
    ///
    /// Flags provides for future releases. For now, it must be set to 0.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaHostGetDevicePointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gc00502b44e5f1bdc0b424487ebb08db0).
    ///
    /// # Parameters
    ///
    /// - `pdptr`: Returned device pointer.
    /// - `p`: Host pointer.
    /// - `Flags`: Options (must be 0).
    pub fn cuMemHostGetDevicePointer_v2(
        pdptr: *mut CUdeviceptr,
        p: *mut ::core::ffi::c_void,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Passes back flags that were used for a pinned allocation.
    ///
    /// Passes back the flags pFlags that were specified when allocating the pinned host buffer p allocated by [`cuMemHostAlloc`].
    ///
    /// [`cuMemHostGetFlags`] will fail if the pointer does not reside in an allocation performed by [`cuMemAllocHost_v2`] or [`cuMemHostAlloc`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocHost_v2`], [`cuMemHostAlloc`], [cudaHostGetFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gc470e9220559109f5088d9a01c0aeeda).
    ///
    /// # Parameters
    ///
    /// - `pFlags`: Returned flags word.
    /// - `p`: Host pointer.
    pub fn cuMemHostGetFlags(
        pFlags: *mut ::core::ffi::c_uint,
        p: *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Allocates memory that will be automatically managed by the Unified Memory system.
    ///
    /// Allocates bytesize bytes of managed memory on the device and returns in \*dptr a pointer to the allocated memory. If the device doesn't support allocating managed memory, [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`] is returned. Support for managed memory can be queried using the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY`]. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared. If bytesize is 0, [`cuMemAllocManaged`] returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. The pointer is valid on the CPU and on all GPUs in the system that support managed memory. All accesses to this pointer
    /// must obey the Unified Memory programming model.
    ///
    /// flags specifies the default stream association for this allocation. flags must be one of [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`] or [`CUmemAttach_flags_enum::CU_MEM_ATTACH_HOST`]. If [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`] is specified, then this memory is accessible from any stream on any device. If [`CUmemAttach_flags_enum::CU_MEM_ATTACH_HOST`] is specified, then the allocation should not be accessed from devices that have a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]; an explicit call to [`cuStreamAttachMemAsync`] will be required to enable access on such devices.
    ///
    /// If the association is later changed via [`cuStreamAttachMemAsync`] to a single stream, the default association as specified during [`cuMemAllocManaged`] is restored when that stream is destroyed. For __managed__ variables, the default association is always [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`]. Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won't happen
    /// until all work in the stream has completed.
    ///
    /// Memory allocated with [`cuMemAllocManaged`] should be released with [`cuMemFree_v2`].
    ///
    /// Device memory oversubscription is possible for GPUs that have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Managed memory on such GPUs may be evicted from device memory to host memory at any time by the Unified Memory driver in
    /// order to make room for other allocations.
    ///
    /// In a system where all GPUs have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`], managed memory may not be populated when this API returns and instead may be populated on access. In such systems, managed
    /// memory can migrate to any processor's memory at any time. The Unified Memory driver will employ heuristics to maintain data
    /// locality and prevent excessive page faults to the extent possible. The application can also guide the driver about memory
    /// usage patterns via [`cuMemAdvise_v2`]. The application can also explicitly migrate memory to a desired processor's memory via [`cuMemPrefetchAsync_v2`].
    ///
    /// In a multi-GPU system where all of the GPUs have a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] and all the GPUs have peer-to-peer support with each other, the physical storage for managed memory is created on the GPU
    /// which is active at the time [`cuMemAllocManaged`] is called. All other GPUs will reference the data at reduced bandwidth via peer mappings over the PCIe bus. The Unified Memory
    /// driver does not migrate memory among such GPUs.
    ///
    /// In a multi-GPU system where not all GPUs have peer-to-peer support with each other and where the value of the device attribute
    /// [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] is zero for at least one of those GPUs, the location chosen for physical storage of managed memory is system-dependent.
    ///
    /// * On Linux, the location chosen will be device memory as long as the current set of active contexts are on devices that either
    ///   have peer-to-peer support with each other or have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If there is an active context on a GPU that does not have a non-zero value for that device attribute and it does not have
    ///   peer-to-peer support with the other devices that have active contexts on them, then the location for physical storage will
    ///   be 'zero-copy' or host memory. Note that this means that managed memory that is located in device memory is migrated to host
    ///   memory if a new context is created on a GPU that doesn't have a non-zero value for the device attribute and does not support
    ///   peer-to-peer with at least one of the other devices that has an active context. This in turn implies that context creation
    ///   may fail if there is insufficient host memory to migrate all managed allocations.
    /// * On Windows, the physical storage is always created in 'zero-copy' or host memory. All GPUs will reference the data at reduced
    ///   bandwidth over the PCIe bus. In these circumstances, use of the environment variable CUDA_VISIBLE_DEVICES is recommended to
    ///   restrict CUDA to only use those GPUs that have peer-to-peer support. Alternatively, users can also set CUDA_MANAGED_FORCE_DEVICE_ALLOC
    ///   to a non-zero value to force the driver to always use device memory for physical storage. When this environment variable is
    ///   set to a non-zero value, all contexts created in that process on devices that support managed memory have to be peer-to-peer
    ///   compatible with each other. Context creation will fail if a context is created on a device that supports managed memory and
    ///   is not peer-to-peer compatible with any of the other managed memory supporting devices on which contexts were previously created,
    ///   even if those contexts have been destroyed. These environment variables are described in the CUDA programming guide under
    ///   the "CUDA environment variables" section.
    /// * On ARM, managed memory is not available on discrete gpu with Drive PX-2.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [`cuDeviceGetAttribute`], [`cuStreamAttachMemAsync`], [cudaMallocManaged](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gcf6b9b1019e73c5bc2b39b39fe90816e).
    ///
    /// # Parameters
    ///
    /// - `dptr`: Returned device pointer.
    /// - `bytesize`: Requested allocation size in bytes.
    /// - `flags`: Must be one of [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`] or [`CUmemAttach_flags_enum::CU_MEM_ATTACH_HOST`].
    pub fn cuMemAllocManaged(
        dptr: *mut CUdeviceptr,
        bytesize: size_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Registers a callback function to receive async notifications.
    ///
    /// Registers callbackFunc to receive async notifications.
    ///
    /// The userData parameter is passed to the callback function at async notification time. Likewise, callback is also passed to the callback function to distinguish between multiple registered callbacks.
    ///
    /// The callback function being registered should be designed to return quickly (~10ms). Any long running tasks should be queued
    /// for execution on an application thread.
    ///
    /// Callbacks may not call cuDeviceRegisterAsyncNotification or cuDeviceUnregisterAsyncNotification. Doing so will result in [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`]. Async notification callbacks execute in an undefined order and may be serialized.
    ///
    /// Returns in \*callback a handle representing the registered callback instance.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceUnregisterAsyncNotification`].
    ///
    /// # Parameters
    ///
    /// - `device`: The device on which to register the callback.
    /// - `callbackFunc`: The function to register as a callback.
    /// - `userData`: A generic pointer to user data. This is passed into the callback function.
    /// - `callback`: A handle representing the registered callback instance.
    pub fn cuDeviceRegisterAsyncNotification(
        device: CUdevice,
        callbackFunc: CUasyncCallback,
        userData: *mut ::core::ffi::c_void,
        callback: *mut CUasyncCallbackHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unregisters an async notification callback.
    ///
    /// Unregisters callback so that the corresponding callback function will stop receiving async notifications.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceRegisterAsyncNotification`].
    ///
    /// # Parameters
    ///
    /// - `device`: The device from which to remove callback.
    /// - `callback`: The callback instance to unregister from receiving async notifications.
    pub fn cuDeviceUnregisterAsyncNotification(
        device: CUdevice,
        callback: CUasyncCallbackHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a handle to a compute device.
    ///
    /// Returns in \*device a device handle given a PCI bus ID string.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGet`], [`cuDeviceGetAttribute`], [`cuDeviceGetPCIBusId`], [cudaDeviceGetByPCIBusId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g65f57fb8d0981ca03f6f9b20031c3e5d).
    ///
    /// # Parameters
    ///
    /// - `dev`: Returned device handle.
    /// - `pciBusId`: String in one of the following forms: \[domain\]:\[bus\]:\[device\].\[function\] \[domain\]:\[bus\]:\[device\] \[bus\]:\[device\].\[function\]
    /// where domain, bus, device, and function are all hexadecimal values.
    pub fn cuDeviceGetByPCIBusId(
        dev: *mut CUdevice,
        pciBusId: *const ::core::ffi::c_char,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a PCI Bus Id string for the device.
    ///
    /// Returns an ASCII string identifying the device dev in the NULL-terminated string pointed to by pciBusId. len specifies the maximum length of the string that may be returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGet`], [`cuDeviceGetAttribute`], [`cuDeviceGetByPCIBusId`], [cudaDeviceGetPCIBusId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gea264dad3d8c4898e0b82213c0253def).
    ///
    /// # Parameters
    ///
    /// - `pciBusId`: Returned identifier string for the device in the following format \[domain\]:\[bus\]:\[device\].\[function\] where domain, bus, device, and function are all hexadecimal values. pciBusId should be large enough to store 13 characters including the NULL-terminator.
    /// - `len`: Maximum length of string to store in name.
    /// - `dev`: Device to get identifier string for.
    pub fn cuDeviceGetPCIBusId(
        pciBusId: *mut ::core::ffi::c_char,
        len: ::core::ffi::c_int,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets an interprocess handle for a previously allocated event.
    ///
    /// Takes as input a previously allocated event. This event must have been created with the [`CUevent_flags_enum::CU_EVENT_INTERPROCESS`] and [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flags set. This opaque handle may be copied into other processes and opened with [`cuIpcOpenEventHandle`] to allow efficient hardware synchronization between GPU work in different processes.
    ///
    /// After the event has been opened in the importing process, [`cuEventRecord`], [`cuEventSynchronize`], [`cuStreamWaitEvent`] and [`cuEventQuery`] may be used in either process. Performing operations on the imported event after the exported event has been freed with [`cuEventDestroy_v2`] will result in undefined behavior.
    ///
    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC
    /// functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users
    /// can test their device for IPC functionality by calling [`cuDeviceGetAttribute`] with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`]
    ///
    /// **See also:**
    ///
    /// [`cuEventCreate`], [`cuEventDestroy_v2`], [`cuEventSynchronize`], [`cuEventQuery`], [`cuStreamWaitEvent`], [`cuIpcOpenEventHandle`], [`cuIpcGetMemHandle`], [`cuIpcOpenMemHandle_v2`], [`cuIpcCloseMemHandle`], [cudaIpcGetEventHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g89a3abe1e9a11d08c665176669109784).
    ///
    /// # Parameters
    ///
    /// - `pHandle`: Pointer to a user allocated CUipcEventHandle in which to return the opaque event handle.
    /// - `event`: Event allocated with [`CUevent_flags_enum::CU_EVENT_INTERPROCESS`] and [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flags.
    pub fn cuIpcGetEventHandle(
        pHandle: *mut CUipcEventHandle,
        event: CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Opens an interprocess event handle for use in the current process.
    ///
    /// Opens an interprocess event handle exported from another process with [`cuIpcGetEventHandle`]. This function returns a [`CUevent`] that behaves like a locally created event with the [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flag specified. This event must be freed with [`cuEventDestroy_v2`].
    ///
    /// Performing operations on the imported event after the exported event has been freed with [`cuEventDestroy_v2`] will result in undefined behavior.
    ///
    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC
    /// functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users
    /// can test their device for IPC functionality by calling cuapiDeviceGetAttribute with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`]
    ///
    /// **See also:**
    ///
    /// [`cuEventCreate`], [`cuEventDestroy_v2`], [`cuEventSynchronize`], [`cuEventQuery`], [`cuStreamWaitEvent`], [`cuIpcGetEventHandle`], [`cuIpcGetMemHandle`], [`cuIpcOpenMemHandle_v2`], [`cuIpcCloseMemHandle`], [cudaIpcOpenEventHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g9691446ab0aec1d6e528357387ed87b2).
    ///
    /// # Parameters
    ///
    /// - `phEvent`: Returns the imported event.
    /// - `handle`: Interprocess handle to open.
    pub fn cuIpcOpenEventHandle(
        phEvent: *mut CUevent,
        handle: CUipcEventHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets an interprocess memory handle for an existing device memory allocation.
    ///
    /// Takes a pointer to the base of an existing device memory allocation created with [`cuMemAlloc_v2`] and exports it for use in another process. This is a lightweight operation and may be called multiple times on an allocation
    /// without adverse effects.
    ///
    /// If a region of memory is freed with [`cuMemFree_v2`] and a subsequent call to [`cuMemAlloc_v2`] returns memory with the same device address, [`cuIpcGetMemHandle`] will return a unique handle for the new memory.
    ///
    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC
    /// functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users
    /// can test their device for IPC functionality by calling cuapiDeviceGetAttribute with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`]
    ///
    /// **See also:**
    ///
    /// [`cuMemAlloc_v2`], [`cuMemFree_v2`], [`cuIpcGetEventHandle`], [`cuIpcOpenEventHandle`], [`cuIpcOpenMemHandle_v2`], [`cuIpcCloseMemHandle`], [cudaIpcGetMemHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g8a37f7dfafaca652391d0758b3667539).
    ///
    /// # Parameters
    ///
    /// - `pHandle`: Pointer to user allocated CUipcMemHandle to return the handle in.
    /// - `dptr`: Base pointer to previously allocated device memory.
    pub fn cuIpcGetMemHandle(
        pHandle: *mut CUipcMemHandle,
        dptr: CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Opens an interprocess memory handle exported from another process and returns a device pointer usable in the local process.
    ///
    /// Maps memory exported from another process with [`cuIpcGetMemHandle`] into the current device address space. For contexts on different devices [`cuIpcOpenMemHandle_v2`] can attempt to enable peer access between the devices as if the user called [`cuCtxEnablePeerAccess`]. This behavior is controlled by the [`CUipcMem_flags_enum::CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS`] flag. [`cuDeviceCanAccessPeer`] can determine if a mapping is possible.
    ///
    /// Contexts that may open CUipcMemHandles are restricted in the following way. CUipcMemHandles from each [`CUdevice`] in a given process may only be opened by one [`CUcontext`] per [`CUdevice`] per other process.
    ///
    /// If the memory handle has already been opened by the current context, the reference count on the handle is incremented by 1
    /// and the existing device pointer is returned.
    ///
    /// Memory returned from [`cuIpcOpenMemHandle_v2`] must be freed with [`cuIpcCloseMemHandle`].
    ///
    /// Calling [`cuMemFree_v2`] on an exported memory region before calling [`cuIpcCloseMemHandle`] in the importing context will result in undefined behavior.
    ///
    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC
    /// functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users
    /// can test their device for IPC functionality by calling cuapiDeviceGetAttribute with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`]
    ///
    /// Note:
    ///
    /// No guarantees are made about the address returned in \*pdptr. In particular, multiple processes may not receive the same address for the same handle.
    ///
    /// **See also:**
    ///
    /// [`cuMemAlloc_v2`], [`cuMemFree_v2`], [`cuIpcGetEventHandle`], [`cuIpcOpenEventHandle`], [`cuIpcGetMemHandle`], [`cuIpcCloseMemHandle`], [`cuCtxEnablePeerAccess`], [`cuDeviceCanAccessPeer`], [cudaIpcOpenMemHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g01050a29fefde385b1042081ada4cde9).
    ///
    /// # Parameters
    ///
    /// - `pdptr`: Returned device pointer.
    /// - `handle`: CUipcMemHandle to open.
    /// - `Flags`: Flags for this operation. Must be specified as [`CUipcMem_flags_enum::CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS`].
    pub fn cuIpcOpenMemHandle_v2(
        pdptr: *mut CUdeviceptr,
        handle: CUipcMemHandle,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Attempts to close memory mapped with cuIpcOpenMemHandle.
    ///
    /// Decrements the reference count of the memory returned by [`cuIpcOpenMemHandle_v2`] by 1. When the reference count reaches 0, this API unmaps the memory. The original allocation in the exporting process as
    /// well as imported mappings in other processes will be unaffected.
    ///
    /// Any resources used to enable peer access will be freed if this is the last mapping using them.
    ///
    /// IPC functionality is restricted to devices with support for unified addressing on Linux and Windows operating systems. IPC
    /// functionality on Windows is supported for compatibility purposes but not recommended as it comes with performance cost. Users
    /// can test their device for IPC functionality by calling cuapiDeviceGetAttribute with [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_IPC_EVENT_SUPPORTED`]
    ///
    /// **See also:**
    ///
    /// [`cuMemAlloc_v2`], [`cuMemFree_v2`], [`cuIpcGetEventHandle`], [`cuIpcOpenEventHandle`], [`cuIpcGetMemHandle`], [`cuIpcOpenMemHandle_v2`], [cudaIpcCloseMemHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g02bb3632b5d223db6acae5f8744e2c91).
    ///
    /// # Parameters
    ///
    /// - `dptr`: Device pointer returned by [`cuIpcOpenMemHandle_v2`].
    pub fn cuIpcCloseMemHandle(dptr: CUdeviceptr) -> CUresult;
}
unsafe extern "C" {
    /// Registers an existing host memory range for use by CUDA.
    ///
    /// Page-locks the memory range specified by p and bytesize and maps it for the device(s) as specified by Flags. This memory range also is added to the same tracking mechanism as [`cuMemHostAlloc`] to automatically accelerate calls to functions such as [`cuMemcpyHtoD_v2`]. Since the memory can be accessed directly by the device, it can be read or written with much higher bandwidth than pageable
    /// memory that has not been registered. Page-locking excessive amounts of memory may degrade system performance, since it reduces
    /// the amount of memory available to the system for paging. As a result, this function is best used sparingly to register staging
    /// areas for data exchange between host and device.
    ///
    /// On systems where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`] is true, [`cuMemHostRegister_v2`] will not page-lock the memory range specified by ptr but only populate unpopulated pages.
    ///
    /// The Flags parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// * [`CU_MEMHOSTREGISTER_PORTABLE`]: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed
    ///   the allocation.
    ///
    /// * [`CU_MEMHOSTREGISTER_DEVICEMAP`]: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling [`cuMemHostGetDevicePointer_v2`].
    ///
    /// * [`CU_MEMHOSTREGISTER_IOMEMORY`]: The pointer is treated as pointing to some I/O memory space, e.g. the PCI Express resource of a 3rd party device.
    ///
    /// * [`CU_MEMHOSTREGISTER_READ_ONLY`]: The pointer is treated as pointing to memory that is considered read-only by the device. On platforms without [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], this flag is required in order to register memory mapped to the CPU as read-only. Support for the use of this flag can be
    ///   queried from the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_READ_ONLY_HOST_REGISTER_SUPPORTED`]. Using this flag with a current context associated with a device that does not have this attribute set will cause [`cuMemHostRegister_v2`] to error with [`CUresult::CUDA_ERROR_NOT_SUPPORTED`].
    ///
    /// All of these flags are orthogonal to one another: a developer may page-lock memory that is portable or mapped with no restrictions.
    ///
    /// The [`CU_MEMHOSTREGISTER_DEVICEMAP`] flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to [`cuMemHostGetDevicePointer_v2`] because the memory may be mapped into other CUDA contexts via the [`CU_MEMHOSTREGISTER_PORTABLE`] flag.
    ///
    /// For devices that have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_HOST_POINTER_FOR_REGISTERED_MEM`], the memory can also be accessed from the device using the host pointer p. The device pointer returned by [`cuMemHostGetDevicePointer_v2`] may or may not match the original host pointer ptr and depends on the devices visible to the application. If all devices visible to the application have a non-zero value for
    /// the device attribute, the device pointer returned by [`cuMemHostGetDevicePointer_v2`] will match the original pointer ptr. If any device visible to the application has a zero value for the device attribute, the device pointer returned by [`cuMemHostGetDevicePointer_v2`] will not match the original host pointer ptr, but it will be suitable for use on all devices provided Unified Virtual Addressing is enabled. In such systems, it is valid
    /// to access the memory using either pointer on devices that have a non-zero value for the device attribute. Note however that
    /// such devices should access the memory using only of the two pointers and not both.
    ///
    /// The memory page-locked by this function must be unregistered with [`cuMemHostUnregister`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemHostUnregister`], [`cuMemHostGetFlags`], [`cuMemHostGetDevicePointer_v2`], [cudaHostRegister](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1ge8d5c17670f16ac4fc8fcb4181cb490c).
    ///
    /// # Parameters
    ///
    /// - `p`: Host pointer to memory to page-lock.
    /// - `bytesize`: Size in bytes of the address range to page-lock.
    /// - `Flags`: Flags for allocation request.
    pub fn cuMemHostRegister_v2(
        p: *mut ::core::ffi::c_void,
        bytesize: size_t,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unregisters a memory range that was registered with cuMemHostRegister.
    ///
    /// Unmaps the memory range whose base address is specified by p, and makes it pageable again.
    ///
    /// The base address must be the same one specified to [`cuMemHostRegister_v2`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemHostRegister_v2`], [cudaHostUnregister](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g81fd4101862bbefdb42a62d60e515eea).
    ///
    /// # Parameters
    ///
    /// - `p`: Host pointer to memory to unregister.
    pub fn cuMemHostUnregister(p: *mut ::core::ffi::c_void) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory.
    ///
    /// Copies data between two pointers. dst and src are base pointers of the destination and source, respectively. ByteCount specifies the number of bytes to copy. Note that this function infers the type of the transfer (host to host, host to device,
    /// device to device, or device to host) from the pointer values. This function is only allowed in contexts which support unified
    /// addressing.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gc263dbe6574220cc776b45438fc351e8), [cudaMemcpyToSymbol](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g4561bf9c99d91c92684a91a0bd356bfe), [cudaMemcpyFromSymbol](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g99db510d18d37fbb0f5c075a8caf3b5f).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination unified virtual address space pointer.
    /// - `src`: Source unified virtual address space pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpy(dst: CUdeviceptr, src: CUdeviceptr, ByteCount: size_t) -> CUresult;
}
unsafe extern "C" {
    /// Copies device memory between two contexts.
    ///
    /// Copies from device memory in one context to device memory in another context. dstDevice is the base device pointer of the destination memory and dstContext is the destination context. srcDevice is the base device pointer of the source memory and srcContext is the source pointer. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuMemcpyDtoD_v2`], [`cuMemcpy3DPeer`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyPeerAsync`], [`cuMemcpy3DPeerAsync`], [cudaMemcpyPeer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g88fd1245b2cb10d2d30c74900b7dfb9c).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `dstContext`: Destination context.
    /// - `srcDevice`: Source device pointer.
    /// - `srcContext`: Source context.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyPeer(
        dstDevice: CUdeviceptr,
        dstContext: CUcontext,
        srcDevice: CUdeviceptr,
        srcContext: CUcontext,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Host to Device.
    ///
    /// Copies from host memory to device memory. dstDevice and srcHost are the base addresses of the destination and source, respectively. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gc263dbe6574220cc776b45438fc351e8), [cudaMemcpyToSymbol](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g4561bf9c99d91c92684a91a0bd356bfe).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `srcHost`: Source host pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyHtoD_v2(
        dstDevice: CUdeviceptr,
        srcHost: *const ::core::ffi::c_void,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Device to Host.
    ///
    /// Copies from device to host memory. dstHost and srcDevice specify the base pointers of the destination and source, respectively. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gc263dbe6574220cc776b45438fc351e8), [cudaMemcpyFromSymbol](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g99db510d18d37fbb0f5c075a8caf3b5f).
    ///
    /// # Parameters
    ///
    /// - `dstHost`: Destination host pointer.
    /// - `srcDevice`: Source device pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyDtoH_v2(
        dstHost: *mut ::core::ffi::c_void,
        srcDevice: CUdeviceptr,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Device to Device.
    ///
    /// Copies from device memory to device memory. dstDevice and srcDevice are the base pointers of the destination and source, respectively. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gc263dbe6574220cc776b45438fc351e8), [cudaMemcpyToSymbol](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g4561bf9c99d91c92684a91a0bd356bfe), [cudaMemcpyFromSymbol](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g99db510d18d37fbb0f5c075a8caf3b5f).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `srcDevice`: Source device pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyDtoD_v2(
        dstDevice: CUdeviceptr,
        srcDevice: CUdeviceptr,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Device to Array.
    ///
    /// Copies from device memory to a 1D CUDA array. dstArray and dstOffset specify the CUDA array handle and starting index of the destination data. srcDevice specifies the base pointer of the source. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpyToArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY__DEPRECATED.html#group__CUDART__MEMORY__DEPRECATED_1g15b5d20cedf31dd13801c6015da0e828).
    ///
    /// # Parameters
    ///
    /// - `dstArray`: Destination array.
    /// - `dstOffset`: Offset in bytes of destination array.
    /// - `srcDevice`: Source device pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyDtoA_v2(
        dstArray: CUarray,
        dstOffset: size_t,
        srcDevice: CUdeviceptr,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Array to Device.
    ///
    /// Copies from one 1D CUDA array to device memory. dstDevice specifies the base pointer of the destination and must be naturally aligned with the CUDA array elements. srcArray and srcOffset specify the CUDA array handle and the offset in bytes into the array where the copy is to begin. ByteCount specifies the number of bytes to copy and must be evenly divisible by the array element size.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpyFromArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY__DEPRECATED.html#group__CUDART__MEMORY__DEPRECATED_1g6fbe8ed786061afaeaf79dc17eef15e9).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `srcArray`: Source array.
    /// - `srcOffset`: Offset in bytes of source array.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyAtoD_v2(
        dstDevice: CUdeviceptr,
        srcArray: CUarray,
        srcOffset: size_t,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Host to Array.
    ///
    /// Copies from host memory to a 1D CUDA array. dstArray and dstOffset specify the CUDA array handle and starting offset in bytes of the destination data. pSrc specifies the base address of the source. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpyToArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY__DEPRECATED.html#group__CUDART__MEMORY__DEPRECATED_1g15b5d20cedf31dd13801c6015da0e828).
    ///
    /// # Parameters
    ///
    /// - `dstArray`: Destination array.
    /// - `dstOffset`: Offset in bytes of destination array.
    /// - `srcHost`: Source host pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyHtoA_v2(
        dstArray: CUarray,
        dstOffset: size_t,
        srcHost: *const ::core::ffi::c_void,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Array to Host.
    ///
    /// Copies from one 1D CUDA array to host memory. dstHost specifies the base pointer of the destination. srcArray and srcOffset specify the CUDA array handle and starting offset in bytes of the source data. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpyFromArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY__DEPRECATED.html#group__CUDART__MEMORY__DEPRECATED_1g6fbe8ed786061afaeaf79dc17eef15e9).
    ///
    /// # Parameters
    ///
    /// - `dstHost`: Destination device pointer.
    /// - `srcArray`: Source array.
    /// - `srcOffset`: Offset in bytes of source array.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyAtoH_v2(
        dstHost: *mut ::core::ffi::c_void,
        srcArray: CUarray,
        srcOffset: size_t,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Array to Array.
    ///
    /// Copies from one 1D CUDA array to another. dstArray and srcArray specify the handles of the destination and source CUDA arrays for the copy, respectively. dstOffset and srcOffset specify the destination and source offsets in bytes into the CUDA arrays. ByteCount is the number of bytes to be copied. The size of the elements in the CUDA arrays need not be the same format, but the elements
    /// must be the same size; and count must be evenly divisible by that size.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpyArrayToArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY__DEPRECATED.html#group__CUDART__MEMORY__DEPRECATED_1g5daffa65811c6be7eba1ec3c6c19ddb0).
    ///
    /// # Parameters
    ///
    /// - `dstArray`: Destination array.
    /// - `dstOffset`: Offset in bytes of destination array.
    /// - `srcArray`: Source array.
    /// - `srcOffset`: Offset in bytes of source array.
    /// - `ByteCount`: Size of memory copy in bytes.
    pub fn cuMemcpyAtoA_v2(
        dstArray: CUarray,
        dstOffset: size_t,
        srcArray: CUarray,
        srcOffset: size_t,
        ByteCount: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory for 2D arrays.
    ///
    /// Perform a 2D memory copy according to the parameters specified in pCopy. The CUDA_MEMCPY2D structure is defined as:
    ///
    /// ```text
    ///    typedef struct CUDA_MEMCPY2D_st {
    /// unsigned int srcXInBytes, srcY;
    /// CUmemorytype srcMemoryType;
    /// const void *srcHost;
    /// CUdeviceptr srcDevice;
    /// CUarray srcArray;
    /// unsigned int srcPitch;
    ///
    /// unsigned int dstXInBytes, dstY;
    /// CUmemorytype dstMemoryType;
    /// void *dstHost;
    /// CUdeviceptr dstDevice;
    /// CUarray dstArray;
    /// unsigned int dstPitch;
    ///
    /// unsigned int WidthInBytes;
    /// unsigned int Height;
    /// } CUDA_MEMCPY2D;
    /// ```
    ///
    /// * srcMemoryType and dstMemoryType specify the type of memory of the source and destination, respectively; CUmemorytype_enum
    ///   is defined as:
    ///
    /// ```text
    ///    typedef enum CUmemorytype_enum {
    /// CU_MEMORYTYPE_HOST = 0x01,
    /// CU_MEMORYTYPE_DEVICE = 0x02,
    /// CU_MEMORYTYPE_ARRAY = 0x03,
    /// CU_MEMORYTYPE_UNIFIED = 0x04
    /// } CUmemorytype;
    /// ```
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], srcDevice and srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. srcArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], srcHost and srcPitch specify the (host) base address of the source data and the bytes per row to apply. srcArray is ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], srcDevice and srcPitch specify the (device) base address of the source data and the bytes per row to apply. srcArray is
    /// ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], srcArray specifies the handle of the source data. srcHost, srcDevice and srcPitch are ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], dstHost and dstPitch specify the (host) base address of the destination data and the bytes per row to apply. dstArray is
    /// ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], dstDevice and dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. dstArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], dstDevice and dstPitch specify the (device) base address of the destination data and the bytes per row to apply. dstArray
    /// is ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], dstArray specifies the handle of the destination data. dstHost, dstDevice and dstPitch are ignored.
    ///
    /// * srcXInBytes and srcY specify the base address of the source data for the copy.
    ///
    /// For host pointers, the starting address is
    ///
    /// ```text
    ///   void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes;
    /// ```
    ///
    /// For CUDA arrays, srcXInBytes must be evenly divisible by the array element size.
    ///
    /// * dstXInBytes and dstY specify the base address of the destination data for the copy.
    ///
    /// For host pointers, the base address is
    ///
    /// ```text
    ///   void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes;
    /// ```
    ///
    /// For CUDA arrays, dstXInBytes must be evenly divisible by the array element size.
    ///
    /// * WidthInBytes and Height specify the width (in bytes) and height of the 2D copy being performed.
    /// * If specified, srcPitch must be greater than or equal to WidthInBytes + srcXInBytes, and dstPitch must be greater than or equal
    ///   to WidthInBytes + dstXInBytes.
    ///
    /// [`cuMemcpy2D_v2`] returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]). [`cuMemAllocPitch_v2`] passes back pitches that always work with [`cuMemcpy2D_v2`]. On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), [`cuMemcpy2D_v2`] may fail for pitches not computed by [`cuMemAllocPitch_v2`]. [`cuMemcpy2DUnaligned_v2`] does not have this restriction, but may run significantly slower in the cases where [`cuMemcpy2D_v2`] would have returned an error code.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpy2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g3a58270f6775efe56c65ac47843e7cee), [cudaMemcpy2DToArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g9509226164aaa58baf0c5b8ed165df58), [cudaMemcpy2DFromArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g0f944b3fd3c81edad0a352cf22de24f0).
    ///
    /// # Parameters
    ///
    /// - `pCopy`: Parameters for the memory copy.
    pub fn cuMemcpy2D_v2(pCopy: *const CUDA_MEMCPY2D) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory for 2D arrays.
    ///
    /// Perform a 2D memory copy according to the parameters specified in pCopy. The CUDA_MEMCPY2D structure is defined as:
    ///
    /// ```text
    ///    typedef struct CUDA_MEMCPY2D_st {
    /// unsigned int srcXInBytes, srcY;
    /// CUmemorytype srcMemoryType;
    /// const void *srcHost;
    /// CUdeviceptr srcDevice;
    /// CUarray srcArray;
    /// unsigned int srcPitch;
    /// unsigned int dstXInBytes, dstY;
    /// CUmemorytype dstMemoryType;
    /// void *dstHost;
    /// CUdeviceptr dstDevice;
    /// CUarray dstArray;
    /// unsigned int dstPitch;
    /// unsigned int WidthInBytes;
    /// unsigned int Height;
    /// } CUDA_MEMCPY2D;
    /// ```
    ///
    /// * srcMemoryType and dstMemoryType specify the type of memory of the source and destination, respectively; CUmemorytype_enum
    ///   is defined as:
    ///
    /// ```text
    ///    typedef enum CUmemorytype_enum {
    /// CU_MEMORYTYPE_HOST = 0x01,
    /// CU_MEMORYTYPE_DEVICE = 0x02,
    /// CU_MEMORYTYPE_ARRAY = 0x03,
    /// CU_MEMORYTYPE_UNIFIED = 0x04
    /// } CUmemorytype;
    /// ```
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], srcDevice and srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. srcArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], srcHost and srcPitch specify the (host) base address of the source data and the bytes per row to apply. srcArray is ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], srcDevice and srcPitch specify the (device) base address of the source data and the bytes per row to apply. srcArray is
    /// ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], srcArray specifies the handle of the source data. srcHost, srcDevice and srcPitch are ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], dstDevice and dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. dstArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], dstHost and dstPitch specify the (host) base address of the destination data and the bytes per row to apply. dstArray is
    /// ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], dstDevice and dstPitch specify the (device) base address of the destination data and the bytes per row to apply. dstArray
    /// is ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], dstArray specifies the handle of the destination data. dstHost, dstDevice and dstPitch are ignored.
    ///
    /// * srcXInBytes and srcY specify the base address of the source data for the copy.
    ///
    /// For host pointers, the starting address is
    ///
    /// ```text
    ///   void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes;
    /// ```
    ///
    /// For CUDA arrays, srcXInBytes must be evenly divisible by the array element size.
    ///
    /// * dstXInBytes and dstY specify the base address of the destination data for the copy.
    ///
    /// For host pointers, the base address is
    ///
    /// ```text
    ///   void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes;
    /// ```
    ///
    /// For CUDA arrays, dstXInBytes must be evenly divisible by the array element size.
    ///
    /// * WidthInBytes and Height specify the width (in bytes) and height of the 2D copy being performed.
    /// * If specified, srcPitch must be greater than or equal to WidthInBytes + srcXInBytes, and dstPitch must be greater than or equal
    ///   to WidthInBytes + dstXInBytes.
    ///
    /// [`cuMemcpy2D_v2`] returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]). [`cuMemAllocPitch_v2`] passes back pitches that always work with [`cuMemcpy2D_v2`]. On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), [`cuMemcpy2D_v2`] may fail for pitches not computed by [`cuMemAllocPitch_v2`]. [`cuMemcpy2DUnaligned_v2`] does not have this restriction, but may run significantly slower in the cases where [`cuMemcpy2D_v2`] would have returned an error code.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpy2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g3a58270f6775efe56c65ac47843e7cee), [cudaMemcpy2DToArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g9509226164aaa58baf0c5b8ed165df58), [cudaMemcpy2DFromArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g0f944b3fd3c81edad0a352cf22de24f0).
    ///
    /// # Parameters
    ///
    /// - `pCopy`: Parameters for the memory copy.
    pub fn cuMemcpy2DUnaligned_v2(pCopy: *const CUDA_MEMCPY2D) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory for 3D arrays.
    ///
    /// Perform a 3D memory copy according to the parameters specified in pCopy. The CUDA_MEMCPY3D structure is defined as:
    ///
    /// ```text
    /// typedef struct CUDA_MEMCPY3D_st {
    ///
    /// unsigned int srcXInBytes, srcY, srcZ;
    /// unsigned int srcLOD;
    /// CUmemorytype srcMemoryType;
    /// const void *srcHost;
    /// CUdeviceptr srcDevice;
    /// CUarray srcArray;
    /// unsigned int srcPitch;  // ignored when src is array
    /// unsigned int srcHeight; // ignored when src is array; may be 0 if Depth==1
    ///
    /// unsigned int dstXInBytes, dstY, dstZ;
    /// unsigned int dstLOD;
    /// CUmemorytype dstMemoryType;
    /// void *dstHost;
    /// CUdeviceptr dstDevice;
    /// CUarray dstArray;
    /// unsigned int dstPitch;  // ignored when dst is array
    /// unsigned int dstHeight; // ignored when dst is array; may be 0 if Depth==1
    ///
    /// unsigned int WidthInBytes;
    /// unsigned int Height;
    /// unsigned int Depth;
    /// } CUDA_MEMCPY3D;
    /// ```
    ///
    /// * srcMemoryType and dstMemoryType specify the type of memory of the source and destination, respectively; CUmemorytype_enum
    ///   is defined as:
    ///
    /// ```text
    ///    typedef enum CUmemorytype_enum {
    /// CU_MEMORYTYPE_HOST = 0x01,
    /// CU_MEMORYTYPE_DEVICE = 0x02,
    /// CU_MEMORYTYPE_ARRAY = 0x03,
    /// CU_MEMORYTYPE_UNIFIED = 0x04
    /// } CUmemorytype;
    /// ```
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], srcDevice and srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. srcArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], srcHost, srcPitch and srcHeight specify the (host) base address of the source data, the bytes per row, and the height of
    /// each 2D slice of the 3D array. srcArray is ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], srcDevice, srcPitch and srcHeight specify the (device) base address of the source data, the bytes per row, and the height
    /// of each 2D slice of the 3D array. srcArray is ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], srcArray specifies the handle of the source data. srcHost, srcDevice, srcPitch and srcHeight are ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], dstDevice and dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. dstArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], dstHost and dstPitch specify the (host) base address of the destination data, the bytes per row, and the height of each
    /// 2D slice of the 3D array. dstArray is ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], dstDevice and dstPitch specify the (device) base address of the destination data, the bytes per row, and the height of each
    /// 2D slice of the 3D array. dstArray is ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], dstArray specifies the handle of the destination data. dstHost, dstDevice, dstPitch and dstHeight are ignored.
    ///
    /// * srcXInBytes, srcY and srcZ specify the base address of the source data for the copy.
    ///
    /// For host pointers, the starting address is
    ///
    /// ```text
    ///   void* Start = (void*)((char*)srcHost+(srcZ*srcHeight+srcY)*srcPitch + srcXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr Start = srcDevice+(srcZ*srcHeight+srcY)*srcPitch+srcXInBytes;
    /// ```
    ///
    /// For CUDA arrays, srcXInBytes must be evenly divisible by the array element size.
    ///
    /// * dstXInBytes, dstY and dstZ specify the base address of the destination data for the copy.
    ///
    /// For host pointers, the base address is
    ///
    /// ```text
    ///   void* dstStart = (void*)((char*)dstHost+(dstZ*dstHeight+dstY)*dstPitch + dstXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr dstStart = dstDevice+(dstZ*dstHeight+dstY)*dstPitch+dstXInBytes;
    /// ```
    ///
    /// For CUDA arrays, dstXInBytes must be evenly divisible by the array element size.
    ///
    /// * WidthInBytes, Height and Depth specify the width (in bytes), height and depth of the 3D copy being performed.
    /// * If specified, srcPitch must be greater than or equal to WidthInBytes + srcXInBytes, and dstPitch must be greater than or equal
    ///   to WidthInBytes + dstXInBytes.
    /// * If specified, srcHeight must be greater than or equal to Height + srcY, and dstHeight must be greater than or equal to Height
    ///   + dstY.
    ///
    /// [`cuMemcpy3D_v2`] returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]).
    ///
    /// The srcLOD and dstLOD members of the CUDA_MEMCPY3D structure must be set to 0.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMemcpy3D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gfec7ee5257d48c8528a709ffad48d208).
    ///
    /// # Parameters
    ///
    /// - `pCopy`: Parameters for the memory copy.
    pub fn cuMemcpy3D_v2(pCopy: *const CUDA_MEMCPY3D) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory between contexts.
    ///
    /// Perform a 3D memory copy according to the parameters specified in pCopy. See the definition of the CUDA_MEMCPY3D_PEER structure for documentation of its parameters.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuMemcpyDtoD_v2`], [`cuMemcpyPeer`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyPeerAsync`], [`cuMemcpy3DPeerAsync`], [cudaMemcpy3DPeer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1geeab4601354962a5968eefc8b79ec2dd).
    ///
    /// # Parameters
    ///
    /// - `pCopy`: Parameters for the memory copy.
    pub fn cuMemcpy3DPeer(pCopy: *const CUDA_MEMCPY3D_PEER) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory asynchronously.
    ///
    /// Copies data between two pointers. dst and src are base pointers of the destination and source, respectively. ByteCount specifies the number of bytes to copy. Note that this function infers the type of the transfer (host to host, host to device,
    /// device to device, or device to host) from the pointer values. This function is only allowed in contexts which support unified
    /// addressing.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemcpyAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g82d9453206dce593f007c64e60bae45a), [cudaMemcpyToSymbolAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gd00b41ade29161aafbf6ff8aee3d6eb5), [cudaMemcpyFromSymbolAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g2d9f7a440f1e522555dfe994245a5946).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination unified virtual address space pointer.
    /// - `src`: Source unified virtual address space pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpyAsync(
        dst: CUdeviceptr,
        src: CUdeviceptr,
        ByteCount: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies device memory between two contexts asynchronously.
    ///
    /// Copies from device memory in one context to device memory in another context. dstDevice is the base device pointer of the destination memory and dstContext is the destination context. srcDevice is the base device pointer of the source memory and srcContext is the source pointer. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuMemcpyDtoD_v2`], [`cuMemcpyPeer`], [`cuMemcpy3DPeer`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpy3DPeerAsync`], [cudaMemcpyPeerAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gbfde4ace9ff4823f4ac45e5c6bdcd2ee).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `dstContext`: Destination context.
    /// - `srcDevice`: Source device pointer.
    /// - `srcContext`: Source context.
    /// - `ByteCount`: Size of memory copy in bytes.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpyPeerAsync(
        dstDevice: CUdeviceptr,
        dstContext: CUcontext,
        srcDevice: CUdeviceptr,
        srcContext: CUcontext,
        ByteCount: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Host to Device.
    ///
    /// Copies from host memory to device memory. dstDevice and srcHost are the base addresses of the destination and source, respectively. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemcpyAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g82d9453206dce593f007c64e60bae45a), [cudaMemcpyToSymbolAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gd00b41ade29161aafbf6ff8aee3d6eb5).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `srcHost`: Source host pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpyHtoDAsync_v2(
        dstDevice: CUdeviceptr,
        srcHost: *const ::core::ffi::c_void,
        ByteCount: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Device to Host.
    ///
    /// Copies from device to host memory. dstHost and srcDevice specify the base pointers of the destination and source, respectively. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemcpyAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g82d9453206dce593f007c64e60bae45a), [cudaMemcpyFromSymbolAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g2d9f7a440f1e522555dfe994245a5946).
    ///
    /// # Parameters
    ///
    /// - `dstHost`: Destination host pointer.
    /// - `srcDevice`: Source device pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpyDtoHAsync_v2(
        dstHost: *mut ::core::ffi::c_void,
        srcDevice: CUdeviceptr,
        ByteCount: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Device to Device.
    ///
    /// Copies from device memory to device memory. dstDevice and srcDevice are the base pointers of the destination and source, respectively. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemcpyAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g82d9453206dce593f007c64e60bae45a), [cudaMemcpyToSymbolAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gd00b41ade29161aafbf6ff8aee3d6eb5), [cudaMemcpyFromSymbolAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g2d9f7a440f1e522555dfe994245a5946).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `srcDevice`: Source device pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpyDtoDAsync_v2(
        dstDevice: CUdeviceptr,
        srcDevice: CUdeviceptr,
        ByteCount: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Host to Array.
    ///
    /// Copies from host memory to a 1D CUDA array. dstArray and dstOffset specify the CUDA array handle and starting offset in bytes of the destination data. srcHost specifies the base address of the source. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemcpyToArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY__DEPRECATED.html#group__CUDART__MEMORY__DEPRECATED_1g92f0eaaaa772fd428dfc7c7ba699d272).
    ///
    /// # Parameters
    ///
    /// - `dstArray`: Destination array.
    /// - `dstOffset`: Offset in bytes of destination array.
    /// - `srcHost`: Source host pointer.
    /// - `ByteCount`: Size of memory copy in bytes.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpyHtoAAsync_v2(
        dstArray: CUarray,
        dstOffset: size_t,
        srcHost: *const ::core::ffi::c_void,
        ByteCount: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory from Array to Host.
    ///
    /// Copies from one 1D CUDA array to host memory. dstHost specifies the base pointer of the destination. srcArray and srcOffset specify the CUDA array handle and starting offset in bytes of the source data. ByteCount specifies the number of bytes to copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemcpyFromArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY__DEPRECATED.html#group__CUDART__MEMORY__DEPRECATED_1gfa22cfe6148b4c82593ecf3582f1dc33).
    ///
    /// # Parameters
    ///
    /// - `dstHost`: Destination pointer.
    /// - `srcArray`: Source array.
    /// - `srcOffset`: Offset in bytes of source array.
    /// - `ByteCount`: Size of memory copy in bytes.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpyAtoHAsync_v2(
        dstHost: *mut ::core::ffi::c_void,
        srcArray: CUarray,
        srcOffset: size_t,
        ByteCount: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory for 2D arrays.
    ///
    /// Perform a 2D memory copy according to the parameters specified in pCopy. The CUDA_MEMCPY2D structure is defined as:
    ///
    /// ```text
    ///    typedef struct CUDA_MEMCPY2D_st {
    /// unsigned int srcXInBytes, srcY;
    /// CUmemorytype srcMemoryType;
    /// const void *srcHost;
    /// CUdeviceptr srcDevice;
    /// CUarray srcArray;
    /// unsigned int srcPitch;
    /// unsigned int dstXInBytes, dstY;
    /// CUmemorytype dstMemoryType;
    /// void *dstHost;
    /// CUdeviceptr dstDevice;
    /// CUarray dstArray;
    /// unsigned int dstPitch;
    /// unsigned int WidthInBytes;
    /// unsigned int Height;
    /// } CUDA_MEMCPY2D;
    /// ```
    ///
    /// * srcMemoryType and dstMemoryType specify the type of memory of the source and destination, respectively; CUmemorytype_enum
    ///   is defined as:
    ///
    /// ```text
    ///    typedef enum CUmemorytype_enum {
    /// CU_MEMORYTYPE_HOST = 0x01,
    /// CU_MEMORYTYPE_DEVICE = 0x02,
    /// CU_MEMORYTYPE_ARRAY = 0x03,
    /// CU_MEMORYTYPE_UNIFIED = 0x04
    /// } CUmemorytype;
    /// ```
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], srcHost and srcPitch specify the (host) base address of the source data and the bytes per row to apply. srcArray is ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], srcDevice and srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. srcArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], srcDevice and srcPitch specify the (device) base address of the source data and the bytes per row to apply. srcArray is
    /// ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], srcArray specifies the handle of the source data. srcHost, srcDevice and srcPitch are ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], dstDevice and dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. dstArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], dstHost and dstPitch specify the (host) base address of the destination data and the bytes per row to apply. dstArray is
    /// ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], dstDevice and dstPitch specify the (device) base address of the destination data and the bytes per row to apply. dstArray
    /// is ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], dstArray specifies the handle of the destination data. dstHost, dstDevice and dstPitch are ignored.
    ///
    /// * srcXInBytes and srcY specify the base address of the source data for the copy.
    ///
    /// For host pointers, the starting address is
    ///
    /// ```text
    ///   void* Start = (void*)((char*)srcHost+srcY*srcPitch + srcXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr Start = srcDevice+srcY*srcPitch+srcXInBytes;
    /// ```
    ///
    /// For CUDA arrays, srcXInBytes must be evenly divisible by the array element size.
    ///
    /// * dstXInBytes and dstY specify the base address of the destination data for the copy.
    ///
    /// For host pointers, the base address is
    ///
    /// ```text
    ///   void* dstStart = (void*)((char*)dstHost+dstY*dstPitch + dstXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr dstStart = dstDevice+dstY*dstPitch+dstXInBytes;
    /// ```
    ///
    /// For CUDA arrays, dstXInBytes must be evenly divisible by the array element size.
    ///
    /// * WidthInBytes and Height specify the width (in bytes) and height of the 2D copy being performed.
    /// * If specified, srcPitch must be greater than or equal to WidthInBytes + srcXInBytes, and dstPitch must be greater than or equal
    ///   to WidthInBytes + dstXInBytes.
    /// * If specified, srcPitch must be greater than or equal to WidthInBytes + srcXInBytes, and dstPitch must be greater than or equal
    ///   to WidthInBytes + dstXInBytes.
    /// * If specified, srcHeight must be greater than or equal to Height + srcY, and dstHeight must be greater than or equal to Height
    ///   + dstY.
    ///
    /// [`cuMemcpy2DAsync_v2`] returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]). [`cuMemAllocPitch_v2`] passes back pitches that always work with [`cuMemcpy2D_v2`]. On intra-device memory copies (device to device, CUDA array to device, CUDA array to CUDA array), [`cuMemcpy2DAsync_v2`] may fail for pitches not computed by [`cuMemAllocPitch_v2`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemcpy2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1ge529b926e8fb574c2666a9a1d58b0dc1), [cudaMemcpy2DToArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g217af4b9e2de79d9252418fc661e6a6a), [cudaMemcpy2DFromArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g1c81de45e9ed5e72008a8f28e706b599).
    ///
    /// # Parameters
    ///
    /// - `pCopy`: Parameters for the memory copy.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpy2DAsync_v2(
        pCopy: *const CUDA_MEMCPY2D,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory for 3D arrays.
    ///
    /// Perform a 3D memory copy according to the parameters specified in pCopy. The CUDA_MEMCPY3D structure is defined as:
    ///
    /// ```text
    /// typedef struct CUDA_MEMCPY3D_st {
    ///
    /// unsigned int srcXInBytes, srcY, srcZ;
    /// unsigned int srcLOD;
    /// CUmemorytype srcMemoryType;
    /// const void *srcHost;
    /// CUdeviceptr srcDevice;
    /// CUarray srcArray;
    /// unsigned int srcPitch;  // ignored when src is array
    /// unsigned int srcHeight; // ignored when src is array; may be 0 if Depth==1
    ///
    /// unsigned int dstXInBytes, dstY, dstZ;
    /// unsigned int dstLOD;
    /// CUmemorytype dstMemoryType;
    /// void *dstHost;
    /// CUdeviceptr dstDevice;
    /// CUarray dstArray;
    /// unsigned int dstPitch;  // ignored when dst is array
    /// unsigned int dstHeight; // ignored when dst is array; may be 0 if Depth==1
    ///
    /// unsigned int WidthInBytes;
    /// unsigned int Height;
    /// unsigned int Depth;
    /// } CUDA_MEMCPY3D;
    /// ```
    ///
    /// * srcMemoryType and dstMemoryType specify the type of memory of the source and destination, respectively; CUmemorytype_enum
    ///   is defined as:
    ///
    /// ```text
    ///    typedef enum CUmemorytype_enum {
    /// CU_MEMORYTYPE_HOST = 0x01,
    /// CU_MEMORYTYPE_DEVICE = 0x02,
    /// CU_MEMORYTYPE_ARRAY = 0x03,
    /// CU_MEMORYTYPE_UNIFIED = 0x04
    /// } CUmemorytype;
    /// ```
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], srcDevice and srcPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. srcArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], srcHost, srcPitch and srcHeight specify the (host) base address of the source data, the bytes per row, and the height of
    /// each 2D slice of the 3D array. srcArray is ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], srcDevice, srcPitch and srcHeight specify the (device) base address of the source data, the bytes per row, and the height
    /// of each 2D slice of the 3D array. srcArray is ignored.
    ///
    /// If srcMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], srcArray specifies the handle of the source data. srcHost, srcDevice, srcPitch and srcHeight are ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`], dstDevice and dstPitch specify the (unified virtual address space) base address of the source data and the bytes per row
    /// to apply. dstArray is ignored. This value may be used only if unified addressing is supported in the calling context.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`], dstHost and dstPitch specify the (host) base address of the destination data, the bytes per row, and the height of each
    /// 2D slice of the 3D array. dstArray is ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`], dstDevice and dstPitch specify the (device) base address of the destination data, the bytes per row, and the height of each
    /// 2D slice of the 3D array. dstArray is ignored.
    ///
    /// If dstMemoryType is [`CUmemorytype_enum::CU_MEMORYTYPE_ARRAY`], dstArray specifies the handle of the destination data. dstHost, dstDevice, dstPitch and dstHeight are ignored.
    ///
    /// * srcXInBytes, srcY and srcZ specify the base address of the source data for the copy.
    ///
    /// For host pointers, the starting address is
    ///
    /// ```text
    ///   void* Start = (void*)((char*)srcHost+(srcZ*srcHeight+srcY)*srcPitch + srcXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr Start = srcDevice+(srcZ*srcHeight+srcY)*srcPitch+srcXInBytes;
    /// ```
    ///
    /// For CUDA arrays, srcXInBytes must be evenly divisible by the array element size.
    ///
    /// * dstXInBytes, dstY and dstZ specify the base address of the destination data for the copy.
    ///
    /// For host pointers, the base address is
    ///
    /// ```text
    ///   void* dstStart = (void*)((char*)dstHost+(dstZ*dstHeight+dstY)*dstPitch + dstXInBytes);
    /// ```
    ///
    /// For device pointers, the starting address is
    ///
    /// ```text
    ///   CUdeviceptr dstStart = dstDevice+(dstZ*dstHeight+dstY)*dstPitch+dstXInBytes;
    /// ```
    ///
    /// For CUDA arrays, dstXInBytes must be evenly divisible by the array element size.
    ///
    /// * WidthInBytes, Height and Depth specify the width (in bytes), height and depth of the 3D copy being performed.
    /// * If specified, srcPitch must be greater than or equal to WidthInBytes + srcXInBytes, and dstPitch must be greater than or equal
    ///   to WidthInBytes + dstXInBytes.
    /// * If specified, srcHeight must be greater than or equal to Height + srcY, and dstHeight must be greater than or equal to Height
    ///   + dstY.
    ///
    /// [`cuMemcpy3DAsync_v2`] returns an error if any pitch is greater than the maximum allowed ([`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_PITCH`]).
    ///
    /// The srcLOD and dstLOD members of the CUDA_MEMCPY3D structure must be set to 0.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemcpy3DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g785bd0963e476a740533382a67674641).
    ///
    /// # Parameters
    ///
    /// - `pCopy`: Parameters for the memory copy.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpy3DAsync_v2(
        pCopy: *const CUDA_MEMCPY3D,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies memory between contexts asynchronously.
    ///
    /// Perform a 3D memory copy according to the parameters specified in pCopy. See the definition of the CUDA_MEMCPY3D_PEER structure for documentation of its parameters.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuMemcpyDtoD_v2`], [`cuMemcpyPeer`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyPeerAsync`], [`cuMemcpy3DPeerAsync`], [cudaMemcpy3DPeerAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g7386b2845149b48c87f82ea017690aa8).
    ///
    /// # Parameters
    ///
    /// - `pCopy`: Parameters for the memory copy.
    /// - `hStream`: Stream identifier.
    pub fn cuMemcpy3DPeerAsync(
        pCopy: *const CUDA_MEMCPY3D_PEER,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Performs a batch of memory copies asynchronously.
    ///
    /// Performs a batch of memory copies. The batch as a whole executes in stream order but copies within a batch are not guaranteed
    /// to execute in any specific order. This API only supports pointer-to-pointer copies. For copies involving CUDA arrays, please
    /// see [`cuMemcpy3DBatchAsync_v2`].
    ///
    /// Performs memory copies from source buffers specified in srcs to destination buffers specified in dsts. The size of each copy is specified in sizes. All three arrays must be of the same length as specified by count. Since there are no ordering guarantees for copies within a batch, specifying any dependent copies within a batch will result
    /// in undefined behavior.
    ///
    /// Every copy in the batch has to be associated with a set of attributes specified in the attrs array. Each entry in this array can apply to more than one copy. This can be done by specifying in the attrsIdxs array, the index of the first copy that the corresponding entry in the attrs array applies to. Both attrs and attrsIdxs must be of the same length as specified by numAttrs. For example, if a batch has 10 copies listed in dst/src/sizes, the first 6 of which have one set of attributes and the remaining
    /// 4 another, then numAttrs will be 2, attrsIdxs will be {0, 6} and attrs will contains the two sets of attributes. Note that the first entry in attrsIdxs must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than count. Furthermore, numAttrs must be lesser than or equal to count.
    ///
    /// The [CUmemcpyAttributes::srcAccessOrder](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemcpyAttributes__v1.html#structCUmemcpyAttributes__v1_1d152922b22834808ca5714f688400761) indicates the source access ordering to be observed for copies associated with the attribute. If the source access order
    /// is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_STREAM`], then the source will be accessed in stream order. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL`] then it indicates that access to the source pointer can be out of stream order and all accesses must be complete before the
    /// API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it's known that no prior operations
    /// in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source
    /// variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to
    /// synchronize the stream after the API call. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_ANY`] then it indicates that access to the source pointer can be out of stream order and the accesses can happen even after the
    /// API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior
    /// operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain
    /// platforms. Each memcpy operation in the batch must have a valid CUmemcpyAttributes corresponding to it including the appropriate
    /// srcAccessOrder setting, otherwise the API will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// The [CUmemcpyAttributes::srcLocHint](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemcpyAttributes__v1.html#structCUmemcpyAttributes__v1_12b2ea7d3968f58243d6d94f99bab6a55) and [CUmemcpyAttributes::dstLocHint](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemcpyAttributes__v1.html#structCUmemcpyAttributes__v1_15ef6cafc9e673f19d946cd5517dd05ec) allows applications to specify hint locations for operands of a copy when the operand doesn't have a fixed location. That
    /// is, these hints are only applicable for managed memory pointers on devices where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] is true or system-allocated pageable memory on devices where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`] is true. For other cases, these hints are ignored.
    ///
    /// The [CUmemcpyAttributes::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemcpyAttributes__v1.html#structCUmemcpyAttributes__v1_10c9ad8770c38c992894a6870991127e4) field can be used to specify certain flags for copies. Setting the [`CUmemcpyFlags_enum::CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE`] flag indicates that the associated copies should preferably overlap with any compute work. Note that this flag is a hint
    /// and can be ignored depending on the platform and other parameters of the copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// # Parameters
    ///
    /// - `dsts`: Array of destination pointers.
    /// - `srcs`: Array of memcpy source pointers.
    /// - `sizes`: Array of sizes for memcpy operations.
    /// - `count`: Size of dsts, srcs and sizes arrays.
    /// - `attrs`: Array of memcpy attributes.
    /// - `attrsIdxs`: Array of indices to specify which copies each entry in the attrs array applies to. The attributes specified in attrs\[k\] will be applied to copies starting from attrsIdxs\[k\] through attrsIdxs\[k+1\]
    /// - 1. Also attrs\[numAttrs-1\] will apply to copies starting from attrsIdxs\[numAttrs-1\] through count - 1.
    /// - `numAttrs`: Size of attrs and attrsIdxs arrays.
    /// - `hStream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
    pub fn cuMemcpyBatchAsync_v2(
        dsts: *mut CUdeviceptr,
        srcs: *mut CUdeviceptr,
        sizes: *mut size_t,
        count: size_t,
        attrs: *mut CUmemcpyAttributes,
        attrsIdxs: *mut size_t,
        numAttrs: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Performs a batch of 3D memory copies asynchronously.
    ///
    /// Performs a batch of memory copies. The batch as a whole executes in stream order but copies within a batch are not guaranteed
    /// to execute in any specific order. Note that this means specifying any dependent copies within a batch will result in undefined
    /// behavior.
    ///
    /// Performs memory copies as specified in the opList array. The length of this array is specified in numOps. Each entry in this array describes a copy operation. This includes among other things, the source and destination operands
    /// for the copy as specified in CUDA_MEMCPY3D_BATCH_OP::src and CUDA_MEMCPY3D_BATCH_OP::dst respectively. The source and destination
    /// operands of a copy can either be a pointer or a CUDA array. The width, height and depth of a copy is specified in CUDA_MEMCPY3D_BATCH_OP::extent.
    /// The width, height and depth of a copy are specified in elements and must not be zero. For pointer-to-pointer copies, the element
    /// size is considered to be 1. For pointer to CUDA array or vice versa copies, the element size is determined by the CUDA array.
    /// For CUDA array to CUDA array copies, the element size of the two CUDA arrays must match.
    ///
    /// For a given operand, if CUmemcpy3DOperand::type is specified as [`CUmemcpy3DOperandType_enum::CU_MEMCPY_OPERAND_TYPE_POINTER`], then CUmemcpy3DOperand::op::ptr will be used. The CUmemcpy3DOperand::op::ptr::ptr field must contain the pointer where the
    /// copy should begin. The CUmemcpy3DOperand::op::ptr::rowLength field specifies the length of each row in elements and must either
    /// be zero or be greater than or equal to the width of the copy specified in CUDA_MEMCPY3D_BATCH_OP::extent::width. The CUmemcpy3DOperand::op::ptr::layerHeight
    /// field specifies the height of each layer and must either be zero or be greater than or equal to the height of the copy specified
    /// in CUDA_MEMCPY3D_BATCH_OP::extent::height. When either of these values is zero, that aspect of the operand is considered to
    /// be tightly packed according to the copy extent. For managed memory pointers on devices where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] is true or system-allocated pageable memory on devices where [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`] is true, the CUmemcpy3DOperand::op::ptr::locHint field can be used to hint the location of the operand.
    ///
    /// If an operand's type is specified as [`CUmemcpy3DOperandType_enum::CU_MEMCPY_OPERAND_TYPE_ARRAY`], then CUmemcpy3DOperand::op::array will be used. The CUmemcpy3DOperand::op::array::array field specifies the CUDA array and
    /// CUmemcpy3DOperand::op::array::offset specifies the 3D offset into that array where the copy begins.
    ///
    /// The [CUmemcpyAttributes::srcAccessOrder](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemcpyAttributes__v1.html#structCUmemcpyAttributes__v1_1d152922b22834808ca5714f688400761) indicates the source access ordering to be observed for copies associated with the attribute. If the source access order
    /// is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_STREAM`], then the source will be accessed in stream order. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_DURING_API_CALL`] then it indicates that access to the source pointer can be out of stream order and all accesses must be complete before the
    /// API call returns. This flag is suited for ephemeral sources (ex., stack variables) when it's known that no prior operations
    /// in the stream can be accessing the memory and also that the lifetime of the memory is limited to the scope that the source
    /// variable was declared in. Specifying this flag allows the driver to optimize the copy and removes the need for the user to
    /// synchronize the stream after the API call. If the source access order is set to [`CUmemcpySrcAccessOrder_enum::CU_MEMCPY_SRC_ACCESS_ORDER_ANY`] then it indicates that access to the source pointer can be out of stream order and the accesses can happen even after the
    /// API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it's known that no prior
    /// operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain
    /// platforms. Each memcopy operation in opList must have a valid srcAccessOrder setting, otherwise this API will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// The [CUmemcpyAttributes::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemcpyAttributes__v1.html#structCUmemcpyAttributes__v1_10c9ad8770c38c992894a6870991127e4) field can be used to specify certain flags for copies. Setting the [`CUmemcpyFlags_enum::CU_MEMCPY_FLAG_PREFER_OVERLAP_WITH_COMPUTE`] flag indicates that the associated copies should preferably overlap with any compute work. Note that this flag is a hint
    /// and can be ignored depending on the platform and other parameters of the copy.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// # Parameters
    ///
    /// - `numOps`: Total number of memcpy operations.
    /// - `opList`: Array of size numOps containing the actual memcpy operations.
    /// - `flags`: Flags for future use, must be zero now.
    /// - `hStream`: The stream to enqueue the operations in. Must not be default NULL stream.
    pub fn cuMemcpy3DBatchAsync_v2(
        numOps: size_t,
        opList: *mut CUDA_MEMCPY3D_BATCH_OP,
        flags: ::core::ffi::c_ulonglong,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Performs asynchronous memory copy operation with the specified attributes.
    ///
    /// Performs asynchronous memory copy operation where dst and src are the destination and source pointers respectively. size specifies the number of bytes to copy. attr specifies the attributes for the copy and hStream specifies the stream to enqueue the operation in.
    ///
    /// For more information regarding the attributes, please refer to CUmemcpyAttributes and it's usage desciption [`cuMemcpyBatchAsync_v2`]
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuMemcpyBatchAsync_v2`].
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination device pointer.
    /// - `src`: Source device pointer.
    /// - `size`: Number of bytes to copy.
    /// - `attr`: Attributes for the copy.
    /// - `hStream`: Stream to enqueue the operation in.
    pub fn cuMemcpyWithAttributesAsync(
        dst: CUdeviceptr,
        src: CUdeviceptr,
        size: size_t,
        attr: *mut CUmemcpyAttributes,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Performs 3D memory copy with attributes asynchronously
    ///
    /// Performs the copy operation specified in op. flags specifies the flags for the copy and hStream specifies the stream to enqueue the operation in.
    ///
    /// For more information regarding the operation, please refer to CUDA_MEMCPY3D_BATCH_OP and it's usage desciption [`cuMemcpy3DBatchAsync_v2`]
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * Memory regions requested must be either entirely registered with CUDA, or in the case of host pageable transfers, not registered
    ///   at all. Memory regions spanning over allocations that are both registered and not registered with CUDA are not supported and
    ///   will return [`CUresult::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// **See also:**
    ///
    /// [`cuMemcpy3DBatchAsync_v2`].
    ///
    /// # Parameters
    ///
    /// - `op`: Operation to perform.
    /// - `flags`: Flags for the copy, must be zero now.
    /// - `hStream`: Stream to enqueue the operation in.
    pub fn cuMemcpy3DWithAttributesAsync(
        op: *mut CUDA_MEMCPY3D_BATCH_OP,
        flags: ::core::ffi::c_ulonglong,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Initializes device memory.
    ///
    /// Sets the memory range of N 8-bit values to the specified value uc.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gf7338650f7683c51ee26aadc6973c63a).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `uc`: Value to set.
    /// - `N`: Number of elements.
    pub fn cuMemsetD8_v2(
        dstDevice: CUdeviceptr,
        uc: ::core::ffi::c_uchar,
        N: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Initializes device memory.
    ///
    /// Sets the memory range of N 16-bit values to the specified value us. The dstDevice pointer must be two byte aligned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gf7338650f7683c51ee26aadc6973c63a).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `us`: Value to set.
    /// - `N`: Number of elements.
    pub fn cuMemsetD16_v2(
        dstDevice: CUdeviceptr,
        us: ::core::ffi::c_ushort,
        N: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Initializes device memory.
    ///
    /// Sets the memory range of N 32-bit values to the specified value ui. The dstDevice pointer must be four byte aligned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32Async`], [cudaMemset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1gf7338650f7683c51ee26aadc6973c63a).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `ui`: Value to set.
    /// - `N`: Number of elements.
    pub fn cuMemsetD32_v2(
        dstDevice: CUdeviceptr,
        ui: ::core::ffi::c_uint,
        N: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Initializes device memory.
    ///
    /// Sets the 2D memory range of Width 8-bit values to the specified value uc. Height specifies the number of rows to set, and dstPitch specifies the number of bytes between each row. This function performs fastest when the pitch is one that has been passed
    /// back by [`cuMemAllocPitch_v2`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemset2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g120112b2bd627c7a896390efadc4d2c1).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `dstPitch`: Pitch of destination device pointer(Unused if Height is 1).
    /// - `uc`: Value to set.
    /// - `Width`: Width of row.
    /// - `Height`: Number of rows.
    pub fn cuMemsetD2D8_v2(
        dstDevice: CUdeviceptr,
        dstPitch: size_t,
        uc: ::core::ffi::c_uchar,
        Width: size_t,
        Height: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Initializes device memory.
    ///
    /// Sets the 2D memory range of Width 16-bit values to the specified value us. Height specifies the number of rows to set, and dstPitch specifies the number of bytes between each row. The dstDevice pointer and dstPitch offset must be two byte aligned. This function performs fastest when the pitch is one that has been passed back by [`cuMemAllocPitch_v2`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemset2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g120112b2bd627c7a896390efadc4d2c1).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `dstPitch`: Pitch of destination device pointer(Unused if Height is 1).
    /// - `us`: Value to set.
    /// - `Width`: Width of row.
    /// - `Height`: Number of rows.
    pub fn cuMemsetD2D16_v2(
        dstDevice: CUdeviceptr,
        dstPitch: size_t,
        us: ::core::ffi::c_ushort,
        Width: size_t,
        Height: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Initializes device memory.
    ///
    /// Sets the 2D memory range of Width 32-bit values to the specified value ui. Height specifies the number of rows to set, and dstPitch specifies the number of bytes between each row. The dstDevice pointer and dstPitch offset must be four byte aligned. This function performs fastest when the pitch is one that has been passed back by [`cuMemAllocPitch_v2`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemset2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g120112b2bd627c7a896390efadc4d2c1).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `dstPitch`: Pitch of destination device pointer(Unused if Height is 1).
    /// - `ui`: Value to set.
    /// - `Width`: Width of row.
    /// - `Height`: Number of rows.
    pub fn cuMemsetD2D32_v2(
        dstDevice: CUdeviceptr,
        dstPitch: size_t,
        ui: ::core::ffi::c_uint,
        Width: size_t,
        Height: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets device memory.
    ///
    /// Sets the memory range of N 8-bit values to the specified value uc.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemsetAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g7c9761e21d9f0999fd136c51e7b9b2a0).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `uc`: Value to set.
    /// - `N`: Number of elements.
    /// - `hStream`: Stream identifier.
    pub fn cuMemsetD8Async(
        dstDevice: CUdeviceptr,
        uc: ::core::ffi::c_uchar,
        N: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets device memory.
    ///
    /// Sets the memory range of N 16-bit values to the specified value us. The dstDevice pointer must be two byte aligned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemsetAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g7c9761e21d9f0999fd136c51e7b9b2a0).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `us`: Value to set.
    /// - `N`: Number of elements.
    /// - `hStream`: Stream identifier.
    pub fn cuMemsetD16Async(
        dstDevice: CUdeviceptr,
        us: ::core::ffi::c_ushort,
        N: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets device memory.
    ///
    /// Sets the memory range of N 32-bit values to the specified value ui. The dstDevice pointer must be four byte aligned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [cudaMemsetAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g7c9761e21d9f0999fd136c51e7b9b2a0).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `ui`: Value to set.
    /// - `N`: Number of elements.
    /// - `hStream`: Stream identifier.
    pub fn cuMemsetD32Async(
        dstDevice: CUdeviceptr,
        ui: ::core::ffi::c_uint,
        N: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets device memory.
    ///
    /// Sets the 2D memory range of Width 8-bit values to the specified value uc. Height specifies the number of rows to set, and dstPitch specifies the number of bytes between each row. This function performs fastest when the pitch is one that has been passed
    /// back by [`cuMemAllocPitch_v2`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemset2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g8fdcc53996ff49c570f4b5ead0256ef0).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `dstPitch`: Pitch of destination device pointer(Unused if Height is 1).
    /// - `uc`: Value to set.
    /// - `Width`: Width of row.
    /// - `Height`: Number of rows.
    /// - `hStream`: Stream identifier.
    pub fn cuMemsetD2D8Async(
        dstDevice: CUdeviceptr,
        dstPitch: size_t,
        uc: ::core::ffi::c_uchar,
        Width: size_t,
        Height: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets device memory.
    ///
    /// Sets the 2D memory range of Width 16-bit values to the specified value us. Height specifies the number of rows to set, and dstPitch specifies the number of bytes between each row. The dstDevice pointer and dstPitch offset must be two byte aligned. This function performs fastest when the pitch is one that has been passed back by [`cuMemAllocPitch_v2`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD2D32Async`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemset2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g8fdcc53996ff49c570f4b5ead0256ef0).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `dstPitch`: Pitch of destination device pointer(Unused if Height is 1).
    /// - `us`: Value to set.
    /// - `Width`: Width of row.
    /// - `Height`: Number of rows.
    /// - `hStream`: Stream identifier.
    pub fn cuMemsetD2D16Async(
        dstDevice: CUdeviceptr,
        dstPitch: size_t,
        us: ::core::ffi::c_ushort,
        Width: size_t,
        Height: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets device memory.
    ///
    /// Sets the 2D memory range of Width 32-bit values to the specified value ui. Height specifies the number of rows to set, and dstPitch specifies the number of bytes between each row. The dstDevice pointer and dstPitch offset must be four byte aligned. This function performs fastest when the pitch is one that has been passed back by [`cuMemAllocPitch_v2`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * See also [memset synchronization details](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D8Async`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D16Async`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD8Async`], [`cuMemsetD16_v2`], [`cuMemsetD16Async`], [`cuMemsetD32_v2`], [`cuMemsetD32Async`], [cudaMemset2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g8fdcc53996ff49c570f4b5ead0256ef0).
    ///
    /// # Parameters
    ///
    /// - `dstDevice`: Destination device pointer.
    /// - `dstPitch`: Pitch of destination device pointer(Unused if Height is 1).
    /// - `ui`: Value to set.
    /// - `Width`: Width of row.
    /// - `Height`: Number of rows.
    /// - `hStream`: Stream identifier.
    pub fn cuMemsetD2D32Async(
        dstDevice: CUdeviceptr,
        dstPitch: size_t,
        ui: ::core::ffi::c_uint,
        Width: size_t,
        Height: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a 1D or 2D CUDA array.
    ///
    /// Creates a CUDA array according to the CUDA_ARRAY_DESCRIPTOR structure pAllocateArray and returns a handle to the new CUDA array in \*pHandle. The CUDA_ARRAY_DESCRIPTOR is defined as:
    ///
    /// ```text
    /// typedef struct {
    /// unsigned int Width;
    /// unsigned int Height;
    /// CUarray_format Format;
    /// unsigned int NumChannels;
    /// } CUDA_ARRAY_DESCRIPTOR;
    /// ```
    ///
    /// * Width, and Height are the width, and height of the CUDA array (in elements); the CUDA array is one-dimensional if height is 0, two-dimensional
    ///   otherwise;
    /// * Format specifies the format of the elements; `CUarray_format` is defined as:
    ///
    /// ```text
    /// typedef enum CUarray_format_enum {
    /// CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
    /// CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
    /// CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
    /// CU_AD_FORMAT_SIGNED_INT8 = 0x08,
    /// CU_AD_FORMAT_SIGNED_INT16 = 0x09,
    /// CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
    /// CU_AD_FORMAT_HALF = 0x10,
    /// CU_AD_FORMAT_FLOAT = 0x20,
    /// CU_AD_FORMAT_NV12 = 0xb0,
    /// CU_AD_FORMAT_UNORM_INT8X1 = 0xc0,
    /// CU_AD_FORMAT_UNORM_INT8X2 = 0xc1,
    /// CU_AD_FORMAT_UNORM_INT8X4 = 0xc2,
    /// CU_AD_FORMAT_UNORM_INT16X1 = 0xc3,
    /// CU_AD_FORMAT_UNORM_INT16X2 = 0xc4,
    /// CU_AD_FORMAT_UNORM_INT16X4 = 0xc5,
    /// CU_AD_FORMAT_SNORM_INT8X1 = 0xc6,
    /// CU_AD_FORMAT_SNORM_INT8X2 = 0xc7,
    /// CU_AD_FORMAT_SNORM_INT8X4 = 0xc8,
    /// CU_AD_FORMAT_SNORM_INT16X1 = 0xc9,
    /// CU_AD_FORMAT_SNORM_INT16X2 = 0xca,
    /// CU_AD_FORMAT_SNORM_INT16X4 = 0xcb,
    /// CU_AD_FORMAT_BC1_UNORM = 0x91,
    /// CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92,
    /// CU_AD_FORMAT_BC2_UNORM = 0x93,
    /// CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94,
    /// CU_AD_FORMAT_BC3_UNORM = 0x95,
    /// CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96,
    /// CU_AD_FORMAT_BC4_UNORM = 0x97,
    /// CU_AD_FORMAT_BC4_SNORM = 0x98,
    /// CU_AD_FORMAT_BC5_UNORM = 0x99,
    /// CU_AD_FORMAT_BC5_SNORM = 0x9a,
    /// CU_AD_FORMAT_BC6H_UF16 = 0x9b,
    /// CU_AD_FORMAT_BC6H_SF16 = 0x9c,
    /// CU_AD_FORMAT_BC7_UNORM = 0x9d,
    /// CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e,
    /// CU_AD_FORMAT_P010 = 0x9f,
    /// CU_AD_FORMAT_P016 = 0xa1,
    /// CU_AD_FORMAT_NV16 = 0xa2,
    /// CU_AD_FORMAT_P210 = 0xa3,
    /// CU_AD_FORMAT_P216 = 0xa4,
    /// CU_AD_FORMAT_YUY2 = 0xa5,
    /// CU_AD_FORMAT_Y210 = 0xa6,
    /// CU_AD_FORMAT_Y216 = 0xa7,
    /// CU_AD_FORMAT_AYUV = 0xa8,
    /// CU_AD_FORMAT_Y410 = 0xa9,
    /// CU_AD_FORMAT_Y416 = 0xb1,
    /// CU_AD_FORMAT_Y444_PLANAR8 = 0xb2,
    /// CU_AD_FORMAT_Y444_PLANAR10 = 0xb3,
    /// CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4,
    /// CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5,
    /// CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50,
    /// CU_AD_FORMAT_UINT8_PACKED_422 = 0x51,
    /// CU_AD_FORMAT_UINT8_PACKED_444 = 0x52,
    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_420 = 0x53,
    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_420 = 0x54,
    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_422 = 0x55,
    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_422 = 0x56,
    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_444 = 0x57,
    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_444 = 0x58,
    /// CU_AD_FORMAT_UINT8_PLANAR_420 = 0x59,
    /// CU_AD_FORMAT_UINT16_PLANAR_420 = 0x5a,
    /// CU_AD_FORMAT_UINT8_PLANAR_422 = 0x5b,
    /// CU_AD_FORMAT_UINT16_PLANAR_422 = 0x5c,
    /// CU_AD_FORMAT_UINT8_PLANAR_444 = 0x5d,
    /// CU_AD_FORMAT_UINT16_PLANAR_444 = 0x5e,
    /// } CUarray_format;
    /// ```
    /// * NumChannels specifies the number of packed components per CUDA array element; it may be 1, 2, or 4;
    ///
    /// Here are examples of CUDA array descriptions:
    ///
    /// Description for a CUDA array of 2048 floats:
    ///
    /// ```text
    /// CUDA_ARRAY_DESCRIPTOR desc;
    /// desc.Format = CU_AD_FORMAT_FLOAT;
    /// desc.NumChannels = 1;
    /// desc.Width = 2048;
    /// desc.Height = 1;
    /// ```
    ///
    /// Description for a 64 x 64 CUDA array of floats:
    ///
    /// ```text
    /// CUDA_ARRAY_DESCRIPTOR desc;
    /// desc.Format = CU_AD_FORMAT_FLOAT;
    /// desc.NumChannels = 1;
    /// desc.Width = 64;
    /// desc.Height = 64;
    /// ```
    ///
    /// Description for a width x height CUDA array of 64-bit, 4x16-bit float16's:
    ///
    /// ```text
    /// CUDA_ARRAY_DESCRIPTOR desc;
    /// desc.Format = CU_AD_FORMAT_HALF;
    /// desc.NumChannels = 4;
    /// desc.Width = width;
    /// desc.Height = height;
    /// ```
    ///
    /// Description for a width x height CUDA array of 16-bit elements, each of which is two 8-bit unsigned chars:
    ///
    /// ```text
    /// CUDA_ARRAY_DESCRIPTOR arrayDesc;
    /// desc.Format = CU_AD_FORMAT_UNSIGNED_INT8;
    /// desc.NumChannels = 2;
    /// desc.Width = width;
    /// desc.Height = height;
    /// ```
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMallocArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g6728eb7dc25f332f50bdb16a19620d3d).
    ///
    /// # Parameters
    ///
    /// - `pHandle`: Returned array.
    /// - `pAllocateArray`: Array descriptor.
    pub fn cuArrayCreate_v2(
        pHandle: *mut CUarray,
        pAllocateArray: *const CUDA_ARRAY_DESCRIPTOR,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get a 1D or 2D CUDA array descriptor.
    ///
    /// Returns in \*pArrayDescriptor a descriptor containing information on the format and dimensions of the CUDA array hArray. It is useful for subroutines that have been passed a CUDA array, but need to know the CUDA array parameters for validation
    /// or other purposes.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaArrayGetInfo](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g373dacf191566b0bf5e5b807517b6bf9).
    ///
    /// # Parameters
    ///
    /// - `pArrayDescriptor`: Returned array descriptor.
    /// - `hArray`: Array to get descriptor of.
    pub fn cuArrayGetDescriptor_v2(
        pArrayDescriptor: *mut CUDA_ARRAY_DESCRIPTOR,
        hArray: CUarray,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the layout properties of a sparse CUDA array.
    ///
    /// Returns the layout properties of a sparse CUDA array in sparseProperties If the CUDA array is not allocated with flag [`CUDA_ARRAY3D_SPARSE`] will be returned.
    ///
    /// If the returned value in [CUDA_ARRAY_SPARSE_PROPERTIES::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_10e842bb64091fa47809112c700cb5f0a) contains [`CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`], then [CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_1895ecb42681678271b0edba05bf1dcd9) represents the total size of the array. Otherwise, it will be zero. Also, the returned value in [CUDA_ARRAY_SPARSE_PROPERTIES::miptailFirstLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_1edd0cca8fad1fcbb1789d537edd7e6b6) is always zero. Note that the array must have been allocated using [`cuArrayCreate_v2`] or [`cuArray3DCreate_v2`]. For CUDA arrays obtained using [`cuMipmappedArrayGetLevel`], [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned. Instead, [`cuMipmappedArrayGetSparseProperties`] must be used to obtain the sparse properties of the entire CUDA mipmapped array to which array belongs to.
    ///
    /// **See also:**
    ///
    /// [`cuMipmappedArrayGetSparseProperties`], [`cuMemMapArrayAsync`].
    ///
    /// # Parameters
    ///
    /// - `sparseProperties`: Pointer to CUDA_ARRAY_SPARSE_PROPERTIES.
    /// - `array`: CUDA array to get the sparse properties of.
    pub fn cuArrayGetSparseProperties(
        sparseProperties: *mut CUDA_ARRAY_SPARSE_PROPERTIES,
        array: CUarray,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the layout properties of a sparse CUDA mipmapped array.
    ///
    /// Returns the sparse array layout properties in sparseProperties If the CUDA mipmapped array is not allocated with flag [`CUDA_ARRAY3D_SPARSE`] will be returned.
    ///
    /// For non-layered CUDA mipmapped arrays, [CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_1895ecb42681678271b0edba05bf1dcd9) returns the size of the mip tail region. The mip tail region includes all mip levels whose width, height or depth is less
    /// than that of the tile. For layered CUDA mipmapped arrays, if [CUDA_ARRAY_SPARSE_PROPERTIES::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_10e842bb64091fa47809112c700cb5f0a) contains [`CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`], then [CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_1895ecb42681678271b0edba05bf1dcd9) specifies the size of the mip tail of all layers combined. Otherwise, [CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_1895ecb42681678271b0edba05bf1dcd9) specifies mip tail size per layer. The returned value of [CUDA_ARRAY_SPARSE_PROPERTIES::miptailFirstLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_1edd0cca8fad1fcbb1789d537edd7e6b6) is valid only if [CUDA_ARRAY_SPARSE_PROPERTIES::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_1895ecb42681678271b0edba05bf1dcd9) is non-zero.
    ///
    /// **See also:**
    ///
    /// [`cuArrayGetSparseProperties`], [`cuMemMapArrayAsync`].
    ///
    /// # Parameters
    ///
    /// - `sparseProperties`: Pointer to CUDA_ARRAY_SPARSE_PROPERTIES.
    /// - `mipmap`: CUDA mipmapped array to get the sparse properties of.
    pub fn cuMipmappedArrayGetSparseProperties(
        sparseProperties: *mut CUDA_ARRAY_SPARSE_PROPERTIES,
        mipmap: CUmipmappedArray,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the memory requirements of a CUDA array.
    ///
    /// Returns the memory requirements of a CUDA array in memoryRequirements If the CUDA array is not allocated with flag [`CUDA_ARRAY3D_DEFERRED_MAPPING`] will be returned.
    ///
    /// The returned value in [CUDA_ARRAY_MEMORY_REQUIREMENTS::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__MEMORY__REQUIREMENTS__v1.html#structCUDA__ARRAY__MEMORY__REQUIREMENTS__v1_17a2851735a1d2c11af797f01b1d4969e) represents the total size of the CUDA array. The returned value in [CUDA_ARRAY_MEMORY_REQUIREMENTS::alignment](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__MEMORY__REQUIREMENTS__v1.html#structCUDA__ARRAY__MEMORY__REQUIREMENTS__v1_135c6c8106451b6313d1dffe9a28af755) represents the alignment necessary for mapping the CUDA array.
    ///
    /// **See also:**
    ///
    /// [`cuMipmappedArrayGetMemoryRequirements`], [`cuMemMapArrayAsync`].
    ///
    /// # Parameters
    ///
    /// - `memoryRequirements`: Pointer to CUDA_ARRAY_MEMORY_REQUIREMENTS.
    /// - `array`: CUDA array to get the memory requirements of.
    /// - `device`: Device to get the memory requirements for.
    pub fn cuArrayGetMemoryRequirements(
        memoryRequirements: *mut CUDA_ARRAY_MEMORY_REQUIREMENTS,
        array: CUarray,
        device: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the memory requirements of a CUDA mipmapped array.
    ///
    /// Returns the memory requirements of a CUDA mipmapped array in memoryRequirements If the CUDA mipmapped array is not allocated with flag [`CUDA_ARRAY3D_DEFERRED_MAPPING`] will be returned.
    ///
    /// The returned value in [CUDA_ARRAY_MEMORY_REQUIREMENTS::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__MEMORY__REQUIREMENTS__v1.html#structCUDA__ARRAY__MEMORY__REQUIREMENTS__v1_17a2851735a1d2c11af797f01b1d4969e) represents the total size of the CUDA mipmapped array. The returned value in [CUDA_ARRAY_MEMORY_REQUIREMENTS::alignment](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__MEMORY__REQUIREMENTS__v1.html#structCUDA__ARRAY__MEMORY__REQUIREMENTS__v1_135c6c8106451b6313d1dffe9a28af755) represents the alignment necessary for mapping the CUDA mipmapped array.
    ///
    /// **See also:**
    ///
    /// [`cuArrayGetMemoryRequirements`], [`cuMemMapArrayAsync`].
    ///
    /// # Parameters
    ///
    /// - `memoryRequirements`: Pointer to CUDA_ARRAY_MEMORY_REQUIREMENTS.
    /// - `mipmap`: CUDA mipmapped array to get the memory requirements of.
    /// - `device`: Device to get the memory requirements for.
    pub fn cuMipmappedArrayGetMemoryRequirements(
        memoryRequirements: *mut CUDA_ARRAY_MEMORY_REQUIREMENTS,
        mipmap: CUmipmappedArray,
        device: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets a CUDA array plane from a CUDA array.
    ///
    /// Returns in pPlaneArray a CUDA array that represents a single format plane of the CUDA array hArray.
    ///
    /// If planeIdx is greater than the maximum number of planes in this array or if the array does not have a multi-planar format e.g: [`CUarray_format_enum::CU_AD_FORMAT_NV12`], then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// Note that if the hArray has format [`CUarray_format_enum::CU_AD_FORMAT_NV12`], then passing in 0 for planeIdx returns a CUDA array of the same size as hArray but with one channel and [`CUarray_format_enum::CU_AD_FORMAT_UNSIGNED_INT8`] as its format. If 1 is passed for planeIdx, then the returned CUDA array has half the height and width of hArray with two channels and [`CUarray_format_enum::CU_AD_FORMAT_UNSIGNED_INT8`] as its format.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArrayCreate_v2`], [cudaArrayGetPlane](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g9a851663a2b9f222b549c727adc0e079).
    ///
    /// # Parameters
    ///
    /// - `pPlaneArray`: Returned CUDA array referenced by the planeIdx.
    /// - `hArray`: Multiplanar CUDA array.
    /// - `planeIdx`: Plane index.
    pub fn cuArrayGetPlane(
        pPlaneArray: *mut CUarray,
        hArray: CUarray,
        planeIdx: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys a CUDA array.
    ///
    /// Destroys the CUDA array hArray.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaFreeArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g1b553f5f4806d67525230ac305d50900).
    ///
    /// # Parameters
    ///
    /// - `hArray`: Array to destroy.
    pub fn cuArrayDestroy(hArray: CUarray) -> CUresult;
}
unsafe extern "C" {
    /// Creates a 3D CUDA array.
    ///
    /// Creates a CUDA array according to the CUDA_ARRAY3D_DESCRIPTOR structure pAllocateArray and returns a handle to the new CUDA array in \*pHandle. The CUDA_ARRAY3D_DESCRIPTOR is defined as:
    ///
    /// ```text
    /// typedef struct {
    /// unsigned int Width;
    /// unsigned int Height;
    /// unsigned int Depth;
    /// CUarray_format Format;
    /// unsigned int NumChannels;
    /// unsigned int Flags;
    /// } CUDA_ARRAY3D_DESCRIPTOR;
    /// ```
    ///
    /// * Width, Height, and Depth are the width, height, and depth of the CUDA array (in elements); the following types of CUDA arrays can be allocated:
    ///   + A 1D array is allocated if Height and Depth extents are both zero.
    ///   + A 2D array is allocated if only Depth extent is zero.
    ///   + A 3D array is allocated if all three extents are non-zero.
    ///   + A 1D layered CUDA array is allocated if only Height is zero and the [`CUDA_ARRAY3D_LAYERED`] flag is set. Each layer is a 1D array. The number of layers is determined by the depth extent.
    ///   + A 2D layered CUDA array is allocated if all three extents are non-zero and the [`CUDA_ARRAY3D_LAYERED`] flag is set. Each layer is a 2D array. The number of layers is determined by the depth extent.
    ///   + A cubemap CUDA array is allocated if all three extents are non-zero and the [`CUDA_ARRAY3D_CUBEMAP`] flag is set. Width must be equal to Height, and Depth must be six. A cubemap is a special type of 2D layered CUDA array, where the six layers represent the six faces of a cube.
    /// The order of the six layers in memory is the same as that listed in `CUarray_cubemap_face`.
    ///   + A cubemap layered CUDA array is allocated if all three extents are non-zero, and both, [`CUDA_ARRAY3D_CUBEMAP`] and [`CUDA_ARRAY3D_LAYERED`] flags are set. Width must be equal to Height, and Depth must be a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists of a collection
    /// of cubemaps. The first six layers represent the first cubemap, the next six layers form the second cubemap, and so on.
    ///
    /// * Format specifies the format of the elements; `CUarray_format` is defined as:
    ///
    /// ```text
    /// typedef enum CUarray_format_enum {
    /// CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
    /// CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
    /// CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
    /// CU_AD_FORMAT_SIGNED_INT8 = 0x08,
    /// CU_AD_FORMAT_SIGNED_INT16 = 0x09,
    /// CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
    /// CU_AD_FORMAT_HALF = 0x10,
    /// CU_AD_FORMAT_FLOAT = 0x20,
    /// CU_AD_FORMAT_NV12 = 0xb0,
    /// CU_AD_FORMAT_UNORM_INT8X1 = 0xc0,
    /// CU_AD_FORMAT_UNORM_INT8X2 = 0xc1,
    /// CU_AD_FORMAT_UNORM_INT8X4 = 0xc2,
    /// CU_AD_FORMAT_UNORM_INT16X1 = 0xc3,
    /// CU_AD_FORMAT_UNORM_INT16X2 = 0xc4,
    /// CU_AD_FORMAT_UNORM_INT16X4 = 0xc5,
    /// CU_AD_FORMAT_SNORM_INT8X1 = 0xc6,
    /// CU_AD_FORMAT_SNORM_INT8X2 = 0xc7,
    /// CU_AD_FORMAT_SNORM_INT8X4 = 0xc8,
    /// CU_AD_FORMAT_SNORM_INT16X1 = 0xc9,
    /// CU_AD_FORMAT_SNORM_INT16X2 = 0xca,
    /// CU_AD_FORMAT_SNORM_INT16X4 = 0xcb,
    /// CU_AD_FORMAT_BC1_UNORM = 0x91,
    /// CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92,
    /// CU_AD_FORMAT_BC2_UNORM = 0x93,
    /// CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94,
    /// CU_AD_FORMAT_BC3_UNORM = 0x95,
    /// CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96,
    /// CU_AD_FORMAT_BC4_UNORM = 0x97,
    /// CU_AD_FORMAT_BC4_SNORM = 0x98,
    /// CU_AD_FORMAT_BC5_UNORM = 0x99,
    /// CU_AD_FORMAT_BC5_SNORM = 0x9a,
    /// CU_AD_FORMAT_BC6H_UF16 = 0x9b,
    /// CU_AD_FORMAT_BC6H_SF16 = 0x9c,
    /// CU_AD_FORMAT_BC7_UNORM = 0x9d,
    /// CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e,
    /// CU_AD_FORMAT_P010 = 0x9f,
    /// CU_AD_FORMAT_P016 = 0xa1,
    /// CU_AD_FORMAT_NV16 = 0xa2,
    /// CU_AD_FORMAT_P210 = 0xa3,
    /// CU_AD_FORMAT_P216 = 0xa4,
    /// CU_AD_FORMAT_YUY2 = 0xa5,
    /// CU_AD_FORMAT_Y210 = 0xa6,
    /// CU_AD_FORMAT_Y216 = 0xa7,
    /// CU_AD_FORMAT_AYUV = 0xa8,
    /// CU_AD_FORMAT_Y410 = 0xa9,
    /// CU_AD_FORMAT_Y416 = 0xb1,
    /// CU_AD_FORMAT_Y444_PLANAR8 = 0xb2,
    /// CU_AD_FORMAT_Y444_PLANAR10 = 0xb3,
    /// CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4,
    /// CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5,
    /// CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50,
    /// } CUarray_format;
    /// ```
    ///
    /// * NumChannels specifies the number of packed components per CUDA array element; it may be 1, 2, or 4;
    ///
    /// * Flags may be set to
    ///   + [`CUDA_ARRAY3D_LAYERED`] to enable creation of layered CUDA arrays. If this flag is set, Depth specifies the number of layers, not the depth of a 3D array.
    ///   + [`CUDA_ARRAY3D_SURFACE_LDST`] to enable surface references to be bound to the CUDA array. If this flag is not set, [`cuSurfRefSetArray`] will fail when attempting to bind the CUDA array to a surface reference.
    ///   + [`CUDA_ARRAY3D_CUBEMAP`] to enable creation of cubemaps. If this flag is set, Width must be equal to Height, and Depth must be six. If the [`CUDA_ARRAY3D_LAYERED`] flag is also set, then Depth must be a multiple of six.
    ///   + [`CUDA_ARRAY3D_TEXTURE_GATHER`] to indicate that the CUDA array will be used for texture gather. Texture gather can only be performed on 2D CUDA arrays.
    ///
    /// Width, Height and Depth must meet certain size requirements as listed in the following table. All values are specified in elements. Note that for
    /// brevity's sake, the full name of the device attribute is not specified. For ex., TEXTURE1D_WIDTH refers to the device attribute
    /// [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_WIDTH`].
    ///
    /// Note that 2D CUDA arrays have different size requirements if the [`CUDA_ARRAY3D_TEXTURE_GATHER`] flag is set. Width and Height must not be greater than [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_WIDTH`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_GATHER_HEIGHT`] respectively, in that case.
    ///
    /// |  |  |  |
    /// | --- | --- | --- |
    /// | **CUDA array type** | **Valid extents that must always be met {(width range in elements), (height range), (depth range)}** | **Valid extents with CUDA_ARRAY3D_SURFACE_LDST set {(width range in elements), (height range), (depth range)}** |
    /// | 1D | { (1,TEXTURE1D_WIDTH), 0, 0 } | { (1,SURFACE1D_WIDTH), 0, 0 } |
    /// | 2D | { (1,TEXTURE2D_WIDTH), (1,TEXTURE2D_HEIGHT), 0 } | { (1,SURFACE2D_WIDTH), (1,SURFACE2D_HEIGHT), 0 } |
    /// | 3D | { (1,TEXTURE3D_WIDTH), (1,TEXTURE3D_HEIGHT), (1,TEXTURE3D_DEPTH) } OR { (1,TEXTURE3D_WIDTH_ALTERNATE), (1,TEXTURE3D_HEIGHT_ALTERNATE), (1,TEXTURE3D_DEPTH_ALTERNATE) } | { (1,SURFACE3D_WIDTH), (1,SURFACE3D_HEIGHT), (1,SURFACE3D_DEPTH) } |
    /// | 1D Layered | { (1,TEXTURE1D_LAYERED_WIDTH), 0, (1,TEXTURE1D_LAYERED_LAYERS) } | { (1,SURFACE1D_LAYERED_WIDTH), 0, (1,SURFACE1D_LAYERED_LAYERS) } |
    /// | 2D Layered | { (1,TEXTURE2D_LAYERED_WIDTH), (1,TEXTURE2D_LAYERED_HEIGHT), (1,TEXTURE2D_LAYERED_LAYERS) } | { (1,SURFACE2D_LAYERED_WIDTH), (1,SURFACE2D_LAYERED_HEIGHT), (1,SURFACE2D_LAYERED_LAYERS) } |
    /// | Cubemap | { (1,TEXTURECUBEMAP_WIDTH), (1,TEXTURECUBEMAP_WIDTH), 6 } | { (1,SURFACECUBEMAP_WIDTH), (1,SURFACECUBEMAP_WIDTH), 6 } |
    /// | Cubemap Layered | { (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_LAYERS) } | { (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_LAYERS) } |
    ///
    /// Here are examples of CUDA array descriptions:
    ///
    /// Description for a CUDA array of 2048 floats:
    ///
    /// ```text
    /// CUDA_ARRAY3D_DESCRIPTOR desc;
    /// desc.Format = CU_AD_FORMAT_FLOAT;
    /// desc.NumChannels = 1;
    /// desc.Width = 2048;
    /// desc.Height = 0;
    /// desc.Depth = 0;
    /// ```
    ///
    /// Description for a 64 x 64 CUDA array of floats:
    ///
    /// ```text
    /// CUDA_ARRAY3D_DESCRIPTOR desc;
    /// desc.Format = CU_AD_FORMAT_FLOAT;
    /// desc.NumChannels = 1;
    /// desc.Width = 64;
    /// desc.Height = 64;
    /// desc.Depth = 0;
    /// ```
    ///
    /// Description for a width x height x depth CUDA array of 64-bit, 4x16-bit float16's:
    ///
    /// ```text
    /// CUDA_ARRAY3D_DESCRIPTOR desc;
    /// desc.Format = CU_AD_FORMAT_HALF;
    /// desc.NumChannels = 4;
    /// desc.Width = width;
    /// desc.Height = height;
    /// desc.Depth = depth;
    /// ```
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DGetDescriptor_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaMalloc3DArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g948143cf2423a072ac6a31fb635efd88).
    ///
    /// # Parameters
    ///
    /// - `pHandle`: Returned array.
    /// - `pAllocateArray`: 3D array descriptor.
    pub fn cuArray3DCreate_v2(
        pHandle: *mut CUarray,
        pAllocateArray: *const CUDA_ARRAY3D_DESCRIPTOR,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get a 3D CUDA array descriptor.
    ///
    /// Returns in \*pArrayDescriptor a descriptor containing information on the format and dimensions of the CUDA array hArray. It is useful for subroutines that have been passed a CUDA array, but need to know the CUDA array parameters for validation
    /// or other purposes.
    ///
    /// This function may be called on 1D and 2D arrays, in which case the Height and/or Depth members of the descriptor struct will be set to 0.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuArray3DCreate_v2`], [`cuArrayCreate_v2`], [`cuArrayDestroy`], [`cuArrayGetDescriptor_v2`], [`cuMemAlloc_v2`], [`cuMemAllocHost_v2`], [`cuMemAllocPitch_v2`], [`cuMemcpy2D_v2`], [`cuMemcpy2DAsync_v2`], [`cuMemcpy2DUnaligned_v2`], [`cuMemcpy3D_v2`], [`cuMemcpy3DAsync_v2`], [`cuMemcpyAtoA_v2`], [`cuMemcpyAtoD_v2`], [`cuMemcpyAtoH_v2`], [`cuMemcpyAtoHAsync_v2`], [`cuMemcpyDtoA_v2`], [`cuMemcpyDtoD_v2`], [`cuMemcpyDtoDAsync_v2`], [`cuMemcpyDtoH_v2`], [`cuMemcpyDtoHAsync_v2`], [`cuMemcpyHtoA_v2`], [`cuMemcpyHtoAAsync_v2`], [`cuMemcpyHtoD_v2`], [`cuMemcpyHtoDAsync_v2`], [`cuMemFree_v2`], [`cuMemFreeHost`], [`cuMemGetAddressRange_v2`], [`cuMemGetInfo_v2`], [`cuMemHostAlloc`], [`cuMemHostGetDevicePointer_v2`], [`cuMemsetD2D8_v2`], [`cuMemsetD2D16_v2`], [`cuMemsetD2D32_v2`], [`cuMemsetD8_v2`], [`cuMemsetD16_v2`], [`cuMemsetD32_v2`], [cudaArrayGetInfo](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g373dacf191566b0bf5e5b807517b6bf9).
    ///
    /// # Parameters
    ///
    /// - `pArrayDescriptor`: Returned 3D array descriptor.
    /// - `hArray`: 3D array to get descriptor of.
    pub fn cuArray3DGetDescriptor_v2(
        pArrayDescriptor: *mut CUDA_ARRAY3D_DESCRIPTOR,
        hArray: CUarray,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a CUDA mipmapped array.
    ///
    /// Creates a CUDA mipmapped array according to the CUDA_ARRAY3D_DESCRIPTOR structure pMipmappedArrayDesc and returns a handle to the new CUDA mipmapped array in \*pHandle. numMipmapLevels specifies the number of mipmap levels to be allocated. This value is clamped to the range \[1, 1 + floor(log2(max(width, height,
    /// depth)))\].
    ///
    /// The CUDA_ARRAY3D_DESCRIPTOR is defined as:
    ///
    /// ```text
    /// typedef struct {
    /// unsigned int Width;
    /// unsigned int Height;
    /// unsigned int Depth;
    /// CUarray_format Format;
    /// unsigned int NumChannels;
    /// unsigned int Flags;
    /// } CUDA_ARRAY3D_DESCRIPTOR;
    /// ```
    ///
    /// * Width, Height, and Depth are the width, height, and depth of the CUDA array (in elements); the following types of CUDA arrays can be allocated:
    ///   + A 1D mipmapped array is allocated if Height and Depth extents are both zero.
    ///   + A 2D mipmapped array is allocated if only Depth extent is zero.
    ///   + A 3D mipmapped array is allocated if all three extents are non-zero.
    ///   + A 1D layered CUDA mipmapped array is allocated if only Height is zero and the [`CUDA_ARRAY3D_LAYERED`] flag is set. Each layer is a 1D array. The number of layers is determined by the depth extent.
    ///   + A 2D layered CUDA mipmapped array is allocated if all three extents are non-zero and the [`CUDA_ARRAY3D_LAYERED`] flag is set. Each layer is a 2D array. The number of layers is determined by the depth extent.
    ///   + A cubemap CUDA mipmapped array is allocated if all three extents are non-zero and the [`CUDA_ARRAY3D_CUBEMAP`] flag is set. Width must be equal to Height, and Depth must be six. A cubemap is a special type of 2D layered CUDA array, where the six layers represent the six faces of a cube.
    /// The order of the six layers in memory is the same as that listed in `CUarray_cubemap_face`.
    ///   + A cubemap layered CUDA mipmapped array is allocated if all three extents are non-zero, and both, [`CUDA_ARRAY3D_CUBEMAP`] and [`CUDA_ARRAY3D_LAYERED`] flags are set. Width must be equal to Height, and Depth must be a multiple of six. A cubemap layered CUDA array is a special type of 2D layered CUDA array that consists of a collection
    /// of cubemaps. The first six layers represent the first cubemap, the next six layers form the second cubemap, and so on.
    ///
    /// * Format specifies the format of the elements; `CUarray_format` is defined as:
    ///
    /// ```text
    /// typedef enum CUarray_format_enum {
    /// CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,
    /// CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,
    /// CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,
    /// CU_AD_FORMAT_SIGNED_INT8 = 0x08,
    /// CU_AD_FORMAT_SIGNED_INT16 = 0x09,
    /// CU_AD_FORMAT_SIGNED_INT32 = 0x0a,
    /// CU_AD_FORMAT_HALF = 0x10,
    /// CU_AD_FORMAT_FLOAT = 0x20,
    /// CU_AD_FORMAT_NV12 = 0xb0,
    /// CU_AD_FORMAT_UNORM_INT8X1 = 0xc0,
    /// CU_AD_FORMAT_UNORM_INT8X2 = 0xc1,
    /// CU_AD_FORMAT_UNORM_INT8X4 = 0xc2,
    /// CU_AD_FORMAT_UNORM_INT16X1 = 0xc3,
    /// CU_AD_FORMAT_UNORM_INT16X2 = 0xc4,
    /// CU_AD_FORMAT_UNORM_INT16X4 = 0xc5,
    /// CU_AD_FORMAT_SNORM_INT8X1 = 0xc6,
    /// CU_AD_FORMAT_SNORM_INT8X2 = 0xc7,
    /// CU_AD_FORMAT_SNORM_INT8X4 = 0xc8,
    /// CU_AD_FORMAT_SNORM_INT16X1 = 0xc9,
    /// CU_AD_FORMAT_SNORM_INT16X2 = 0xca,
    /// CU_AD_FORMAT_SNORM_INT16X4 = 0xcb,
    /// CU_AD_FORMAT_BC1_UNORM = 0x91,
    /// CU_AD_FORMAT_BC1_UNORM_SRGB = 0x92,
    /// CU_AD_FORMAT_BC2_UNORM = 0x93,
    /// CU_AD_FORMAT_BC2_UNORM_SRGB = 0x94,
    /// CU_AD_FORMAT_BC3_UNORM = 0x95,
    /// CU_AD_FORMAT_BC3_UNORM_SRGB = 0x96,
    /// CU_AD_FORMAT_BC4_UNORM = 0x97,
    /// CU_AD_FORMAT_BC4_SNORM = 0x98,
    /// CU_AD_FORMAT_BC5_UNORM = 0x99,
    /// CU_AD_FORMAT_BC5_SNORM = 0x9a,
    /// CU_AD_FORMAT_BC6H_UF16 = 0x9b,
    /// CU_AD_FORMAT_BC6H_SF16 = 0x9c,
    /// CU_AD_FORMAT_BC7_UNORM = 0x9d,
    /// CU_AD_FORMAT_BC7_UNORM_SRGB = 0x9e,
    /// CU_AD_FORMAT_P010 = 0x9f,
    /// CU_AD_FORMAT_P016 = 0xa1,
    /// CU_AD_FORMAT_NV16 = 0xa2,
    /// CU_AD_FORMAT_P210 = 0xa3,
    /// CU_AD_FORMAT_P216 = 0xa4,
    /// CU_AD_FORMAT_YUY2 = 0xa5,
    /// CU_AD_FORMAT_Y210 = 0xa6,
    /// CU_AD_FORMAT_Y216 = 0xa7,
    /// CU_AD_FORMAT_AYUV = 0xa8,
    /// CU_AD_FORMAT_Y410 = 0xa9,
    /// CU_AD_FORMAT_Y416 = 0xb1,
    /// CU_AD_FORMAT_Y444_PLANAR8 = 0xb2,
    /// CU_AD_FORMAT_Y444_PLANAR10 = 0xb3,
    /// CU_AD_FORMAT_YUV444_8bit_SemiPlanar = 0xb4,
    /// CU_AD_FORMAT_YUV444_16bit_SemiPlanar = 0xb5,
    /// CU_AD_FORMAT_UNORM_INT_101010_2 = 0x50,
    /// CU_AD_FORMAT_UINT8_PACKED_422 = 0x51,
    /// CU_AD_FORMAT_UINT8_PACKED_444 = 0x52,
    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_420 = 0x53,
    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_420 = 0x54,
    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_422 = 0x55,
    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_422 = 0x56,
    /// CU_AD_FORMAT_UINT8_SEMIPLANAR_444 = 0x57,
    /// CU_AD_FORMAT_UINT16_SEMIPLANAR_444 = 0x58,
    /// CU_AD_FORMAT_UINT8_PLANAR_420 = 0x59,
    /// CU_AD_FORMAT_UINT16_PLANAR_420 = 0x5a,
    /// CU_AD_FORMAT_UINT8_PLANAR_422 = 0x5b,
    /// CU_AD_FORMAT_UINT16_PLANAR_422 = 0x5c,
    /// CU_AD_FORMAT_UINT8_PLANAR_444 = 0x5d,
    /// CU_AD_FORMAT_UINT16_PLANAR_444 = 0x5e,
    /// } CUarray_format;
    /// ```
    ///
    /// * NumChannels specifies the number of packed components per CUDA array element; it may be 1, 2, or 4;
    ///
    /// * Flags may be set to
    ///   + [`CUDA_ARRAY3D_LAYERED`] to enable creation of layered CUDA mipmapped arrays. If this flag is set, Depth specifies the number of layers, not the depth of a 3D array.
    ///   + [`CUDA_ARRAY3D_SURFACE_LDST`] to enable surface references to be bound to individual mipmap levels of the CUDA mipmapped array. If this flag is not set,
    /// [`cuSurfRefSetArray`] will fail when attempting to bind a mipmap level of the CUDA mipmapped array to a surface reference.
    ///   + [`CUDA_ARRAY3D_CUBEMAP`] to enable creation of mipmapped cubemaps. If this flag is set, Width must be equal to Height, and Depth must be six. If the [`CUDA_ARRAY3D_LAYERED`] flag is also set, then Depth must be a multiple of six.
    ///   + [`CUDA_ARRAY3D_TEXTURE_GATHER`] to indicate that the CUDA mipmapped array will be used for texture gather. Texture gather can only be performed on 2D CUDA
    /// mipmapped arrays.
    ///
    /// Width, Height and Depth must meet certain size requirements as listed in the following table. All values are specified in elements. Note that for
    /// brevity's sake, the full name of the device attribute is not specified. For ex., TEXTURE1D_MIPMAPPED_WIDTH refers to the device
    /// attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_MIPMAPPED_WIDTH`].
    ///
    /// |  |  |  |
    /// | --- | --- | --- |
    /// | **CUDA array type** | **Valid extents that must always be met {(width range in elements), (height range), (depth range)}** | **Valid extents with CUDA_ARRAY3D_SURFACE_LDST set {(width range in elements), (height range), (depth range)}** |
    /// | 1D | { (1,TEXTURE1D_MIPMAPPED_WIDTH), 0, 0 } | { (1,SURFACE1D_WIDTH), 0, 0 } |
    /// | 2D | { (1,TEXTURE2D_MIPMAPPED_WIDTH), (1,TEXTURE2D_MIPMAPPED_HEIGHT), 0 } | { (1,SURFACE2D_WIDTH), (1,SURFACE2D_HEIGHT), 0 } |
    /// | 3D | { (1,TEXTURE3D_WIDTH), (1,TEXTURE3D_HEIGHT), (1,TEXTURE3D_DEPTH) } OR { (1,TEXTURE3D_WIDTH_ALTERNATE), (1,TEXTURE3D_HEIGHT_ALTERNATE), (1,TEXTURE3D_DEPTH_ALTERNATE) } | { (1,SURFACE3D_WIDTH), (1,SURFACE3D_HEIGHT), (1,SURFACE3D_DEPTH) } |
    /// | 1D Layered | { (1,TEXTURE1D_LAYERED_WIDTH), 0, (1,TEXTURE1D_LAYERED_LAYERS) } | { (1,SURFACE1D_LAYERED_WIDTH), 0, (1,SURFACE1D_LAYERED_LAYERS) } |
    /// | 2D Layered | { (1,TEXTURE2D_LAYERED_WIDTH), (1,TEXTURE2D_LAYERED_HEIGHT), (1,TEXTURE2D_LAYERED_LAYERS) } | { (1,SURFACE2D_LAYERED_WIDTH), (1,SURFACE2D_LAYERED_HEIGHT), (1,SURFACE2D_LAYERED_LAYERS) } |
    /// | Cubemap | { (1,TEXTURECUBEMAP_WIDTH), (1,TEXTURECUBEMAP_WIDTH), 6 } | { (1,SURFACECUBEMAP_WIDTH), (1,SURFACECUBEMAP_WIDTH), 6 } |
    /// | Cubemap Layered | { (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_WIDTH), (1,TEXTURECUBEMAP_LAYERED_LAYERS) } | { (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_WIDTH), (1,SURFACECUBEMAP_LAYERED_LAYERS) } |
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMipmappedArrayDestroy`], [`cuMipmappedArrayGetLevel`], [`cuArrayCreate_v2`], [cudaMallocMipmappedArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g9abd550dd3f655473d2640dc85be9774).
    ///
    /// # Parameters
    ///
    /// - `pHandle`: Returned mipmapped array.
    /// - `pMipmappedArrayDesc`: mipmapped array descriptor.
    /// - `numMipmapLevels`: Number of mipmap levels.
    pub fn cuMipmappedArrayCreate(
        pHandle: *mut CUmipmappedArray,
        pMipmappedArrayDesc: *const CUDA_ARRAY3D_DESCRIPTOR,
        numMipmapLevels: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets a mipmap level of a CUDA mipmapped array.
    ///
    /// Returns in \*pLevelArray a CUDA array that represents a single mipmap level of the CUDA mipmapped array hMipmappedArray.
    ///
    /// If level is greater than the maximum number of levels in this mipmapped array, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMipmappedArrayCreate`], [`cuMipmappedArrayDestroy`], [`cuArrayCreate_v2`], [cudaGetMipmappedArrayLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g7086e6f81e6dda1ddf4cdb6c1764094a).
    ///
    /// # Parameters
    ///
    /// - `pLevelArray`: Returned mipmap level CUDA array.
    /// - `hMipmappedArray`: CUDA mipmapped array.
    /// - `level`: Mipmap level.
    pub fn cuMipmappedArrayGetLevel(
        pLevelArray: *mut CUarray,
        hMipmappedArray: CUmipmappedArray,
        level: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys a CUDA mipmapped array.
    ///
    /// Destroys the CUDA mipmapped array hMipmappedArray.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMipmappedArrayCreate`], [`cuMipmappedArrayGetLevel`], [`cuArrayCreate_v2`], [cudaFreeMipmappedArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g904669241eac5bdbfb410eb4124e4924).
    ///
    /// # Parameters
    ///
    /// - `hMipmappedArray`: Mipmapped array to destroy.
    pub fn cuMipmappedArrayDestroy(hMipmappedArray: CUmipmappedArray) -> CUresult;
}
unsafe extern "C" {
    /// Retrieve handle for an address range.
    ///
    /// Get a handle of the specified type to an address range. When requesting CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD,
    /// address range obtained by a prior call to either [`cuMemAlloc_v2`] or [`cuMemAddressReserve`] is supported if the [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED`] device attribute returns true. If the address range was obtained via [`cuMemAddressReserve`], it must also be fully mapped via [`cuMemMap`]. Address range obtained by a prior call to either [`cuMemAllocHost_v2`] or [`cuMemHostAlloc`] is supported if the [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED`] device attribute returns true.
    ///
    /// As of CUDA 13.0, querying support for address range obtained by calling [`cuMemAllocHost_v2`] or [`cuMemHostAlloc`] using the [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_DMA_BUF_SUPPORTED`] device attribute is deprecated.
    ///
    /// Users must ensure the dptr and size are aligned to the host page size.
    ///
    /// The handle will be interpreted as a pointer to an integer to store the dma_buf file descriptor. Users must ensure the entire address
    /// range is backed and mapped when the address range is allocated by [`cuMemAddressReserve`]. All the physical allocations backing the address range must be resident on the same device and have identical allocation
    /// properties. Users are also expected to retrieve a new handle every time the underlying physical allocation(s) corresponding
    /// to a previously queried VA range are changed.
    ///
    /// For CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD, users may set flags to [`CUmemRangeFlags_enum::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`]. Which when set on a supported platform, will give a DMA_BUF handle mapped via PCIE BAR1 or will return an error otherwise.
    ///
    /// # Parameters
    ///
    /// - `handle`: Pointer to the location where the returned handle will be stored.
    /// - `dptr`: Pointer to a valid CUDA device allocation. Must be aligned to host page size.
    /// - `size`: Length of the address range. Must be aligned to host page size.
    /// - `handleType`: Type of handle requested (defines type and size of the handle output parameter).
    /// - `flags`: When requesting CUmemRangeHandleType::CU_MEM_RANGE_HANDLE_TYPE_DMA_BUF_FD the value could be [`CUmemRangeFlags_enum::CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE`], otherwise 0.
    pub fn cuMemGetHandleForAddressRange(
        handle: *mut ::core::ffi::c_void,
        dptr: CUdeviceptr,
        size: size_t,
        handleType: CUmemRangeHandleType,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUmemDecompressAlgorithm_enum {
    /// Decompression is unsupported.
    CU_MEM_DECOMPRESS_UNSUPPORTED = 0,
    /// Deflate is supported.
    CU_MEM_DECOMPRESS_ALGORITHM_DEFLATE = 1,
    /// Snappy is supported.
    CU_MEM_DECOMPRESS_ALGORITHM_SNAPPY = 2,
    /// LZ4 is supported.
    CU_MEM_DECOMPRESS_ALGORITHM_LZ4 = 4,
}
pub use self::CUmemDecompressAlgorithm_enum as CUmemDecompressAlgorithm;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUmemDecompressParams_st {
    pub srcNumBytes: size_t,
    pub dstNumBytes: size_t,
    pub dstActBytes: *mut cuuint32_t,
    pub src: *const ::core::ffi::c_void,
    pub dst: *mut ::core::ffi::c_void,
    pub algo: CUmemDecompressAlgorithm,
    pub padding: [::core::ffi::c_uchar; 20usize],
}
impl Default for CUmemDecompressParams_st {
    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()
        }
    }
}
/// Structure describing the parameters that compose a single decompression operation.
pub type CUmemDecompressParams = CUmemDecompressParams_st;
unsafe extern "C" {
    /// Submit a batch of count independent decompression operations.
    ///
    /// Each of the count decompression operations is described by a single entry in the paramsArray array. Once the batch has been submitted, the function will return, and decompression will happen asynchronously with respect to the
    /// CPU. To the work completion tracking mechanisms in the CUDA driver, the batch will be considered a single unit of work and
    /// processed according to stream semantics, i.e., it is not possible to query the completion of individual decompression operations
    /// within a batch.
    ///
    /// The memory pointed to by each of [CUmemDecompressParams.src](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemDecompressParams.html#structCUmemDecompressParams_14d390c15ec5ed068f0912e42077ae0e0), [CUmemDecompressParams.dst](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemDecompressParams.html#structCUmemDecompressParams_139077e823122cfcfab6aeca53093c88c), and [CUmemDecompressParams.dstActBytes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemDecompressParams.html#structCUmemDecompressParams_1df7e9b52dd81aa6c0ed689eeab86d1a7), must be capable of usage with the hardware decompress feature. That is, for each of said pointers, the pointer attribute
    /// [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE`] should give a non-zero value. To ensure this, the memory backing the pointers should have been allocated using one of the
    /// following CUDA memory allocators: \* [`cuMemAlloc_v2`] \* [`cuMemCreate`] with the usage flag [`CU_MEM_CREATE_USAGE_HW_DECOMPRESS`] \* [`cuMemAllocFromPoolAsync`] from a pool that was created with the usage flag [`CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS`] Additionally, [CUmemDecompressParams.src](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemDecompressParams.html#structCUmemDecompressParams_14d390c15ec5ed068f0912e42077ae0e0), [CUmemDecompressParams.dst](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemDecompressParams.html#structCUmemDecompressParams_139077e823122cfcfab6aeca53093c88c), and [CUmemDecompressParams.dstActBytes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemDecompressParams.html#structCUmemDecompressParams_1df7e9b52dd81aa6c0ed689eeab86d1a7), must all be accessible from the device associated with the context where stream was created. For information on how to ensure this, see the documentation for the allocator of interest.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuMemAlloc_v2`], [`cuMemPoolCreate`], [`cuMemAllocFromPoolAsync`].
    ///
    /// # Parameters
    ///
    /// - `paramsArray`: The array of structures describing the independent decompression operations.
    /// - `count`: The number of entries in paramsArray array.
    /// - `flags`: Must be 0.
    /// - `errorIndex`: The index into paramsArray of the decompression operation for which the error returned by this function pertains to. If index is SIZE_MAX and the value returned is not [`cudaError_enum::CUDA_SUCCESS`], then the error returned by this function should be considered a general error that does not pertain to a particular decompression
    /// operation. May be NULL, in which case, no index will be recorded in the event of error.
    /// - `stream`: The stream where the work will be enqueued.
    pub fn cuMemBatchDecompressAsync(
        paramsArray: *mut CUmemDecompressParams,
        count: size_t,
        flags: ::core::ffi::c_uint,
        errorIndex: *mut size_t,
        stream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Allocate an address range reservation.
    ///
    /// Reserves a virtual address range based on the given parameters, giving the starting address of the range in ptr. This API requires a system that supports UVA. The size and address parameters must be a multiple of the host page size and
    /// the alignment must be a power of two or zero for default alignment. If addr is 0, then the driver chooses the address at which to place the start of the reservation whereas when it is non-zero then
    /// the driver treats it as a hint about where to place the reservation.
    ///
    /// **See also:**
    ///
    /// [`cuMemAddressFree`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: Resulting pointer to start of virtual address range allocated.
    /// - `size`: Size of the reserved virtual address range requested.
    /// - `alignment`: Alignment of the reserved virtual address range requested.
    /// - `addr`: Hint address for the start of the address range.
    /// - `flags`: Currently unused, must be zero.
    pub fn cuMemAddressReserve(
        ptr: *mut CUdeviceptr,
        size: size_t,
        alignment: size_t,
        addr: CUdeviceptr,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Free an address range reservation.
    ///
    /// Frees a virtual address range reserved by cuMemAddressReserve. The size must match what was given to memAddressReserve and
    /// the ptr given must match what was returned from memAddressReserve.
    ///
    /// **See also:**
    ///
    /// [`cuMemAddressReserve`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: Starting address of the virtual address range to free.
    /// - `size`: Size of the virtual address region to free.
    pub fn cuMemAddressFree(ptr: CUdeviceptr, size: size_t) -> CUresult;
}
unsafe extern "C" {
    /// Create a CUDA memory handle representing a memory allocation of a given size described by the given properties.
    ///
    /// This creates a memory allocation on the target device specified through the prop structure. The created allocation will not have any device or host mappings. The generic memory handle for the allocation can be mapped to the address space of calling process via [`cuMemMap`]. This handle cannot be transmitted directly to other processes (see [`cuMemExportToShareableHandle`]). On Windows, the caller must also pass an LPSECURITYATTRIBUTE in prop to be associated with this handle which limits or allows access to this handle for a recipient process (see [CUmemAllocationProp::win32HandleMetaData](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemAllocationProp__v1.html#structCUmemAllocationProp__v1_1542262ad88e1d00f02b306c641270168) for more). The size of this allocation must be a multiple of the value given via [`cuMemGetAllocationGranularity`] with the [`CUmemAllocationGranularity_flags_enum::CU_MEM_ALLOC_GRANULARITY_MINIMUM`] flag. To create a CPU allocation that doesn't target any specific NUMA nodes, applications must set CUmemAllocationProp::CUmemLocation::type
    /// to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`]. CUmemAllocationProp::CUmemLocation::id is ignored for HOST allocations. HOST allocations are not IPC capable and [CUmemAllocationProp::requestedHandleTypes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemAllocationProp__v1.html#structCUmemAllocationProp__v1_1e2e852e72e5d2053b771fbac49495efd) must be 0, any other value will result in [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. To create a CPU allocation targeting a specific host NUMA node, applications must set CUmemAllocationProp::CUmemLocation::type
    /// to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] and CUmemAllocationProp::CUmemLocation::id must specify the NUMA ID of the CPU. On systems where NUMA is not available CUmemAllocationProp::CUmemLocation::id
    /// must be set to 0. Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`] as the [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) will result in [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// Applications that intend to use [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`] based memory sharing must ensure: (1) `nvidia-caps-imex-channels` character device is created by the driver and is listed
    /// under /proc/devices (2) have at least one IMEX channel file accessible by the user launching the application.
    ///
    /// When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory.
    ///
    /// The IMEX channel security model works on a per user basis. Which means all processes under a user can share memory if the
    /// user has access to a valid IMEX channel. When multi-user isolation is desired, a separate IMEX channel is required for each
    /// user.
    ///
    /// These channel files exist in /dev/nvidia-caps-imex-channels/channel\* and can be created using standard OS native calls like
    /// mknod on Linux. For example: To create channel0 with the major number from /proc/devices users can execute the following command:
    /// `mknod /dev/nvidia-caps-imex-channels/channel0 c &lt;major number>=""> 0`
    ///
    /// If CUmemAllocationProp::allocFlags::usage contains [`CU_MEM_CREATE_USAGE_TILE_POOL`] flag then the memory allocation is intended only to be used as backing tile pool for sparse CUDA arrays and sparse CUDA mipmapped
    /// arrays. (see [`cuMemMapArrayAsync`]).
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemRelease`], [`cuMemExportToShareableHandle`], [`cuMemImportFromShareableHandle`].
    ///
    /// # Parameters
    ///
    /// - `handle`: Value of handle returned. All operations on this allocation are to be performed using this handle.
    /// - `size`: Size of the allocation requested.
    /// - `prop`: Properties of the allocation to create.
    /// - `flags`: flags for future use, must be zero now.
    pub fn cuMemCreate(
        handle: *mut CUmemGenericAllocationHandle,
        size: size_t,
        prop: *const CUmemAllocationProp,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Release a memory handle representing a memory allocation which was previously allocated through cuMemCreate.
    ///
    /// Frees the memory that was allocated on a device through cuMemCreate.
    ///
    /// The memory allocation will be freed when all outstanding mappings to the memory are unmapped and when all outstanding references
    /// to the handle (including it's shareable counterparts) are also released. The generic memory handle can be freed when there
    /// are still outstanding mappings made with this handle. Each time a recipient process imports a shareable handle, it needs to
    /// pair it with [`cuMemRelease`] for the handle to be freed. If handle is not a valid handle the behavior is undefined.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemCreate`].
    ///
    /// # Parameters
    ///
    /// - `handle`: Value of handle which was returned previously by cuMemCreate.
    pub fn cuMemRelease(handle: CUmemGenericAllocationHandle) -> CUresult;
}
unsafe extern "C" {
    /// Maps an allocation handle to a reserved virtual address range.
    ///
    /// Maps bytes of memory represented by handle starting from byte offset to size to address range \[addr, addr + size\]. This range must be an address reservation previously reserved with [`cuMemAddressReserve`], and offset + size must be less than the size of the memory allocation. Both ptr, size, and offset must be a multiple of the value given via [`cuMemGetAllocationGranularity`] with the [`CUmemAllocationGranularity_flags_enum::CU_MEM_ALLOC_GRANULARITY_MINIMUM`] flag. If handle represents a multicast object, ptr, size and offset must be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag CU_MULTICAST_MINIMUM_GRANULARITY. For best performance however, it is recommended that ptr, size and offset be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag CU_MULTICAST_RECOMMENDED_GRANULARITY.
    ///
    /// When handle represents a multicast object, this call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal
    /// state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and all required
    /// driver daemons are running properly.
    ///
    /// Please note calling [`cuMemMap`] does not make the address accessible, the caller needs to update accessibility of a contiguous mapped VA range by calling
    /// [`cuMemSetAccess`].
    ///
    /// Once a recipient process obtains a shareable memory handle from [`cuMemImportFromShareableHandle`], the process must use [`cuMemMap`] to map the memory into its address ranges before setting accessibility with [`cuMemSetAccess`].
    ///
    /// [`cuMemMap`] can only create mappings on VA range reservations that are not currently mapped.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemUnmap`], [`cuMemSetAccess`], [`cuMemCreate`], [`cuMemAddressReserve`], [`cuMemImportFromShareableHandle`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: Address where memory will be mapped.
    /// - `size`: Size of the memory mapping.
    /// - `offset`: Offset into the memory represented by
    ///
    /// * handle from which to start mapping
    /// * Note: currently must be zero.
    /// - `handle`: Handle to a shareable memory.
    /// - `flags`: flags for future use, must be zero now.
    pub fn cuMemMap(
        ptr: CUdeviceptr,
        size: size_t,
        offset: size_t,
        handle: CUmemGenericAllocationHandle,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Maps or unmaps subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays.
    ///
    /// Performs map or unmap operations on subregions of sparse CUDA arrays and sparse CUDA mipmapped arrays. Each operation is specified
    /// by a CUarrayMapInfo entry in the mapInfoList array of size count. The structure CUarrayMapInfo is defined as follow:
    ///
    /// ```text
    /// typedef struct CUarrayMapInfo_st {
    /// CUresourcetype resourceType;
    /// union {
    /// CUmipmappedArray mipmap;
    /// CUarray array;
    /// } resource;
    ///
    /// CUarraySparseSubresourceType subresourceType;
    /// union {
    /// struct {
    /// unsigned int level;
    /// unsigned int layer;
    /// unsigned int offsetX;
    /// unsigned int offsetY;
    /// unsigned int offsetZ;
    /// unsigned int extentWidth;
    /// unsigned int extentHeight;
    /// unsigned int extentDepth;
    /// } sparseLevel;
    /// struct {
    /// unsigned int layer;
    /// unsigned long long offset;
    /// unsigned long long size;
    /// } miptail;
    /// } subresource;
    ///
    /// CUmemOperationType memOperationType;
    ///
    /// CUmemHandleType memHandleType;
    /// union {
    /// CUmemGenericAllocationHandle memHandle;
    /// } memHandle;
    ///
    /// unsigned long long offset;
    /// unsigned int deviceBitMask;
    /// unsigned int flags;
    /// unsigned int reserved\[2\];
    /// } CUarrayMapInfo;
    /// ```
    ///
    /// where [CUarrayMapInfo::resourceType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_18cf3c7ba97c834ab8b0fcfb50fec578c) specifies the type of resource to be operated on. If [CUarrayMapInfo::resourceType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_18cf3c7ba97c834ab8b0fcfb50fec578c) is set to [`CUresourcetype::CU_RESOURCE_TYPE_ARRAY`] then CUarrayMapInfo::resource::array must be set to a valid sparse CUDA array handle. The CUDA array must be either a 2D,
    /// 2D layered or 3D CUDA array and must have been allocated using [`cuArrayCreate_v2`] or [`cuArray3DCreate_v2`] with the flag [`CUDA_ARRAY3D_SPARSE`] or [`CUDA_ARRAY3D_DEFERRED_MAPPING`]. For CUDA arrays obtained using [`cuMipmappedArrayGetLevel`], [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned. If [CUarrayMapInfo::resourceType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_18cf3c7ba97c834ab8b0fcfb50fec578c) is set to [`CUresourcetype::CU_RESOURCE_TYPE_MIPMAPPED_ARRAY`] then CUarrayMapInfo::resource::mipmap must be set to a valid sparse CUDA mipmapped array handle. The CUDA mipmapped array
    /// must be either a 2D, 2D layered or 3D CUDA mipmapped array and must have been allocated using [`cuMipmappedArrayCreate`] with the flag [`CUDA_ARRAY3D_SPARSE`] or [`CUDA_ARRAY3D_DEFERRED_MAPPING`].
    ///
    /// [CUarrayMapInfo::subresourceType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_17a2fe272bd8e44af2386f1c20c3d3c68) specifies the type of subresource within the resource. CUarraySparseSubresourceType_enum is defined as:
    ///
    /// ```text
    /// typedef enum CUarraySparseSubresourceType_enum {
    /// CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL = 0,
    /// CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL = 1
    /// } CUarraySparseSubresourceType;
    /// ```
    ///
    /// where CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL indicates a sparse-miplevel which spans
    /// at least one tile in every dimension. The remaining miplevels which are too small to span at least one tile in any dimension
    /// constitute the mip tail region as indicated by CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL subresource
    /// type.
    ///
    /// If [CUarrayMapInfo::subresourceType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_17a2fe272bd8e44af2386f1c20c3d3c68) is set to CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_SPARSE_LEVEL then CUarrayMapInfo::subresource::sparseLevel
    /// struct must contain valid array subregion offsets and extents. The CUarrayMapInfo::subresource::sparseLevel::offsetX, CUarrayMapInfo::subresource::sparseLevel::offsetY
    /// and CUarrayMapInfo::subresource::sparseLevel::offsetZ must specify valid X, Y and Z offsets respectively. The CUarrayMapInfo::subresource::sparseLevel::extentWidth,
    /// CUarrayMapInfo::subresource::sparseLevel::extentHeight and CUarrayMapInfo::subresource::sparseLevel::extentDepth must specify
    /// valid width, height and depth extents respectively. These offsets and extents must be aligned to the corresponding tile dimension.
    /// For CUDA mipmapped arrays CUarrayMapInfo::subresource::sparseLevel::level must specify a valid mip level index. Otherwise,
    /// must be zero. For layered CUDA arrays and layered CUDA mipmapped arrays CUarrayMapInfo::subresource::sparseLevel::layer must
    /// specify a valid layer index. Otherwise, must be zero. CUarrayMapInfo::subresource::sparseLevel::offsetZ must be zero and CUarrayMapInfo::subresource::sparseLevel::extentDepth
    /// must be set to 1 for 2D and 2D layered CUDA arrays and CUDA mipmapped arrays. Tile extents can be obtained by calling [`cuArrayGetSparseProperties`] and [`cuMipmappedArrayGetSparseProperties`]
    ///
    /// If [CUarrayMapInfo::subresourceType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_17a2fe272bd8e44af2386f1c20c3d3c68) is set to CUarraySparseSubresourceType::CU_ARRAY_SPARSE_SUBRESOURCE_TYPE_MIPTAIL then CUarrayMapInfo::subresource::miptail
    /// struct must contain valid mip tail offset in CUarrayMapInfo::subresource::miptail::offset and size in CUarrayMapInfo::subresource::miptail::size.
    /// Both, mip tail offset and mip tail size must be aligned to the tile size. For layered CUDA mipmapped arrays which don't have
    /// the flag [`CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL`] set in [CUDA_ARRAY_SPARSE_PROPERTIES::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__ARRAY__SPARSE__PROPERTIES__v1.html#structCUDA__ARRAY__SPARSE__PROPERTIES__v1_10e842bb64091fa47809112c700cb5f0a) as returned by [`cuMipmappedArrayGetSparseProperties`], CUarrayMapInfo::subresource::miptail::layer must specify a valid layer index. Otherwise, must be zero.
    ///
    /// If CUarrayMapInfo::resource::array or CUarrayMapInfo::resource::mipmap was created with [`CUDA_ARRAY3D_DEFERRED_MAPPING`] flag set the [CUarrayMapInfo::subresourceType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_17a2fe272bd8e44af2386f1c20c3d3c68) and the contents of CUarrayMapInfo::subresource will be ignored.
    ///
    /// [CUarrayMapInfo::memOperationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_1dd139e9655407264f2aeb812cec0f19e) specifies the type of operation. `CUmemOperationType` is defined as:
    ///
    /// ```text
    /// typedef enum CUmemOperationType_enum {
    /// CU_MEM_OPERATION_TYPE_MAP = 1,
    /// CU_MEM_OPERATION_TYPE_UNMAP = 2
    /// } CUmemOperationType;
    /// ```
    ///
    /// [CUarrayMapInfo::memOperationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_1dd139e9655407264f2aeb812cec0f19e)
    ///
    /// [CUarrayMapInfo::offset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_14aee5e358272af897aeaf8b44fd15bdb)
    ///
    /// [`CU_MEM_CREATE_USAGE_TILE_POOL`]
    ///
    /// [`cuMemCreate`]
    ///
    /// [CUarrayMapInfo::memHandleType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_1ed15e0aa10304948c68946fe8a5da161)
    ///
    /// If [CUarrayMapInfo::memOperationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_1dd139e9655407264f2aeb812cec0f19e) is set to CUmemOperationType::CU_MEM_OPERATION_TYPE_UNMAP then an unmapping operation is performed. CUarrayMapInfo::memHandle
    /// must be NULL.
    ///
    /// [CUarrayMapInfo::deviceBitMask](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_1f2d14f719018cc1daa786f7fd0652c2c) specifies the list of devices that must map or unmap physical memory. Currently, this mask must have exactly one bit set,
    /// and the corresponding device must match the device associated with the stream. If [CUarrayMapInfo::memOperationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_1dd139e9655407264f2aeb812cec0f19e) is set to CUmemOperationType::CU_MEM_OPERATION_TYPE_MAP, the device must also match the device associated with the tile pool
    /// memory allocation as specified by CUarrayMapInfo::memHandle.
    ///
    /// [CUarrayMapInfo::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_12e36982c16390693a56807d0b8e6380f) and [CUarrayMapInfo::reserved](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUarrayMapInfo__v1.html#structCUarrayMapInfo__v1_1cf7014dc4a157928de12563d0181ceba)[] are unused and must be set to zero.
    ///
    /// **See also:**
    ///
    /// [`cuMipmappedArrayCreate`], [`cuArrayCreate_v2`], [`cuArray3DCreate_v2`], [`cuMemCreate`], [`cuArrayGetSparseProperties`], [`cuMipmappedArrayGetSparseProperties`].
    ///
    /// # Parameters
    ///
    /// - `mapInfoList`: List of CUarrayMapInfo.
    /// - `count`: Count of CUarrayMapInfo in mapInfoList.
    /// - `hStream`: Stream identifier for the stream to use for map or unmap operations.
    pub fn cuMemMapArrayAsync(
        mapInfoList: *mut CUarrayMapInfo,
        count: ::core::ffi::c_uint,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unmap the backing memory of a given address range.
    ///
    /// The range must be the entire contiguous address range that was mapped to. In other words, [`cuMemUnmap`] cannot unmap a sub-range of an address range mapped by [`cuMemCreate`] / [`cuMemMap`]. Any backing memory allocations will be freed if there are no existing mappings and there are no unreleased memory handles.
    ///
    /// When [`cuMemUnmap`] returns successfully the address range is converted to an address reservation and can be used for a future calls to [`cuMemMap`]. Any new mapping to this virtual address will need to have access granted through [`cuMemSetAccess`], as all mappings start with no accessibility setup.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuMemCreate`], [`cuMemAddressReserve`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: Starting address for the virtual address range to unmap.
    /// - `size`: Size of the virtual address range to unmap.
    pub fn cuMemUnmap(ptr: CUdeviceptr, size: size_t) -> CUresult;
}
unsafe extern "C" {
    /// Set the access flags for each location specified in desc for the given virtual address range.
    ///
    /// Given the virtual address range via ptr and size, and the locations in the array given by desc and count, set the access flags for the target locations. The range must be a fully mapped address range containing all allocations
    /// created by [`cuMemMap`] / [`cuMemCreate`]. Users cannot specify [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] accessibility for allocations created on with other location types. Note: When CUmemAccessDesc::CUmemLocation::type is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], CUmemAccessDesc::CUmemLocation::id is ignored. When setting the access flags for a virtual address range mapping a multicast
    /// object, ptr and size must be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag CU_MULTICAST_MINIMUM_GRANULARITY. For best performance however, it is recommended that ptr and size be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag CU_MULTICAST_RECOMMENDED_GRANULARITY.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    ///
    /// **See also:**
    ///
    /// [`cuMemSetAccess`], [`cuMemCreate`], :[`cuMemMap`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: Starting address for the virtual address range.
    /// - `size`: Length of the virtual address range.
    /// - `desc`: Array of CUmemAccessDesc that describe how to change the
    ///
    /// * mapping for each location specified.
    /// - `count`: Number of CUmemAccessDesc in desc.
    pub fn cuMemSetAccess(
        ptr: CUdeviceptr,
        size: size_t,
        desc: *const CUmemAccessDesc,
        count: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get the access flags set for the given location and ptr.
    ///
    /// **See also:**
    ///
    /// [`cuMemSetAccess`].
    ///
    /// # Parameters
    ///
    /// - `flags`: Flags set for this location.
    /// - `location`: Location in which to check the flags for.
    /// - `ptr`: Address in which to check the access flags for.
    pub fn cuMemGetAccess(
        flags: *mut ::core::ffi::c_ulonglong,
        location: *const CUmemLocation,
        ptr: CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Exports an allocation to a requested shareable handle type.
    ///
    /// Given a CUDA memory handle, create a shareable memory allocation handle that can be used to share the memory with other processes.
    /// The recipient process can convert the shareable handle back into a CUDA memory handle using [`cuMemImportFromShareableHandle`] and map it with [`cuMemMap`]. The implementation of what this handle is and how it can be transferred is defined by the requested handle type in handleType
    ///
    /// Once all shareable handles are closed and the allocation is released, the allocated memory referenced will be released back
    /// to the OS and uses of the CUDA handle afterward will lead to undefined behavior.
    ///
    /// This API can also be used in conjunction with other APIs (e.g. Vulkan, OpenGL) that support importing memory from the shareable
    /// type
    ///
    /// **See also:**
    ///
    /// [`cuMemImportFromShareableHandle`].
    ///
    /// # Parameters
    ///
    /// - `shareableHandle`: Pointer to the location in which to store the requested handle type.
    /// - `handle`: CUDA handle for the memory allocation.
    /// - `handleType`: Type of shareable handle requested (defines type and size of the shareableHandle output parameter).
    /// - `flags`: Reserved, must be zero.
    pub fn cuMemExportToShareableHandle(
        shareableHandle: *mut ::core::ffi::c_void,
        handle: CUmemGenericAllocationHandle,
        handleType: CUmemAllocationHandleType,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Imports an allocation from a requested shareable handle type.
    ///
    /// If the current process cannot support the memory described by this shareable handle, this API will error as [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`].
    ///
    /// If shHandleType is [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`] and the importer process has not been granted access to the same IMEX channel as the exporter process, this API will error
    /// as [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`].
    ///
    /// Note:
    ///
    /// Importing shareable handles exported from some graphics APIs(VUlkan, OpenGL, etc) created on devices under an SLI group may
    /// not be supported, and thus this API will return [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]. There is no guarantee that the contents of handle will be the same CUDA memory handle for the same given OS shareable handle, or the same underlying allocation.
    ///
    /// **See also:**
    ///
    /// [`cuMemExportToShareableHandle`], [`cuMemMap`], [`cuMemRelease`].
    ///
    /// # Parameters
    ///
    /// - `handle`: CUDA Memory handle for the memory allocation.
    /// - `osHandle`: Shareable Handle representing the memory allocation that is to be imported.
    /// - `shHandleType`: handle type of the exported handle `CUmemAllocationHandleType`.
    pub fn cuMemImportFromShareableHandle(
        handle: *mut CUmemGenericAllocationHandle,
        osHandle: *mut ::core::ffi::c_void,
        shHandleType: CUmemAllocationHandleType,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Calculates either the minimal or recommended granularity.
    ///
    /// Calculates either the minimal or recommended granularity for a given allocation specification and returns it in granularity.
    /// This granularity can be used as a multiple for alignment, size, or address mapping.
    ///
    /// **See also:**
    ///
    /// [`cuMemCreate`], [`cuMemMap`].
    ///
    /// # Parameters
    ///
    /// - `granularity`: Returned granularity.
    /// - `prop`: Property for which to determine the granularity for.
    /// - `option`: Determines which granularity to return.
    pub fn cuMemGetAllocationGranularity(
        granularity: *mut size_t,
        prop: *const CUmemAllocationProp,
        option: CUmemAllocationGranularity_flags,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Retrieve the contents of the property structure defining properties for this handle.
    ///
    /// **See also:**
    ///
    /// [`cuMemCreate`], [`cuMemImportFromShareableHandle`].
    ///
    /// # Parameters
    ///
    /// - `prop`: Pointer to a properties structure which will hold the information about this handle.
    /// - `handle`: Handle which to perform the query on.
    pub fn cuMemGetAllocationPropertiesFromHandle(
        prop: *mut CUmemAllocationProp,
        handle: CUmemGenericAllocationHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Given an address addr, returns the allocation handle of the backing memory allocation.
    ///
    /// The handle is guaranteed to be the same handle value used to map the memory. If the address requested is not mapped, the function
    /// will fail. The returned handle must be released with corresponding number of calls to [`cuMemRelease`].
    ///
    /// Note:
    ///
    /// The address addr, can be any address in a range previously mapped by [`cuMemMap`], and not necessarily the start address.
    ///
    /// **See also:**
    ///
    /// [`cuMemCreate`], [`cuMemRelease`], [`cuMemMap`].
    ///
    /// # Parameters
    ///
    /// - `handle`: CUDA Memory handle for the backing memory allocation.
    /// - `addr`: Memory address to query, that has been mapped previously.
    pub fn cuMemRetainAllocationHandle(
        handle: *mut CUmemGenericAllocationHandle,
        addr: *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Frees memory with stream ordered semantics.
    ///
    /// Inserts a free operation into hStream. The allocation must not be accessed after stream execution reaches the free. After this API returns, accessing the memory
    /// from any subsequent work launched on the GPU or querying its pointer attributes results in undefined behavior.
    ///
    /// Note:
    ///
    /// During stream capture, this function results in the creation of a free node and must therefore be passed the address of a
    /// graph allocation.
    ///
    /// # Parameters
    ///
    /// - `dptr`: memory to free.
    /// - `hStream`: The stream establishing the stream ordering contract.
    pub fn cuMemFreeAsync(dptr: CUdeviceptr, hStream: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Allocates memory with stream ordered semantics.
    ///
    /// Inserts an allocation operation into hStream. A pointer to the allocated memory is returned immediately in \*dptr. The allocation must not be accessed until the allocation
    /// operation completes. The allocation comes from the memory pool current to the stream's device.
    ///
    /// Note:
    ///
    /// * The default memory pool of a device contains device memory from that device.
    /// * Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize,
    ///   and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream
    ///   runs.
    /// * During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned
    ///   by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocFromPoolAsync`], [`cuMemFreeAsync`], [`cuDeviceSetMemPool`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolSetAccess`], [`cuMemPoolSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `dptr`: Returned device pointer.
    /// - `bytesize`: Number of bytes to allocate.
    /// - `hStream`: The stream establishing the stream ordering contract and the memory pool to allocate from.
    pub fn cuMemAllocAsync(
        dptr: *mut CUdeviceptr,
        bytesize: size_t,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Tries to release memory back to the OS.
    ///
    /// Releases memory back to the OS until the pool contains fewer than minBytesToKeep reserved bytes, or there is no more memory
    /// that the allocator can safely release. The allocator cannot release OS allocations that back outstanding asynchronous allocations.
    /// The OS allocations may happen at different granularity from the user allocations.
    ///
    /// Note:
    ///
    /// * : Allocations that have not been freed count as outstanding.
    /// * : Allocations that have been asynchronously freed but whose completion has not been observed on the host (eg. by a synchronize)
    ///   can count as outstanding.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
    ///
    /// # Parameters
    ///
    /// - `pool`: The memory pool to trim.
    /// - `minBytesToKeep`: If the pool has less than minBytesToKeep reserved, the TrimTo operation is a no-op. Otherwise the pool will be guaranteed
    /// to have at least minBytesToKeep bytes reserved after the operation.
    pub fn cuMemPoolTrimTo(pool: CUmemoryPool, minBytesToKeep: size_t) -> CUresult;
}
unsafe extern "C" {
    /// Sets attributes of a memory pool.
    ///
    /// Supported attributes are:
    ///
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RELEASE_THRESHOLD`]: (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS.
    ///   When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory
    ///   back to the OS on the next call to stream, event or context synchronize. (default 0)
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`]: (value type = int) Allow [`cuMemAllocAsync`] to use memory asynchronously freed in another stream as long as a stream ordering dependency of the allocating stream on
    ///   the free action exists. CUDA events and null stream interactions can create the required stream ordered dependencies. (default
    ///   enabled)
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC`]: (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default
    ///   enabled)
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES`]: (value type = int) Allow [`cuMemAllocAsync`] to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released
    ///   by [`cuMemFreeAsync`] (default enabled).
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH`]: (value type = cuuint64_t) Reset the high watermark that tracks the amount of backing memory that was allocated for the memory
    ///   pool. It is illegal to set this attribute to a non-zero value.
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_USED_MEM_HIGH`]: (value type = cuuint64_t) Reset the high watermark that tracks the amount of used memory that was allocated for the memory
    ///   pool.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
    ///
    /// # Parameters
    ///
    /// - `pool`: The memory pool to modify.
    /// - `attr`: The attribute to modify.
    /// - `value`: Pointer to the value to assign.
    pub fn cuMemPoolSetAttribute(
        pool: CUmemoryPool,
        attr: CUmemPool_attribute,
        value: *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets attributes of a memory pool.
    ///
    /// Supported attributes are:
    ///
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RELEASE_THRESHOLD`]: (value type = cuuint64_t) Amount of reserved memory in bytes to hold onto before trying to release memory back to the OS.
    ///   When more than the release threshold bytes of memory are held by the memory pool, the allocator will try to release memory
    ///   back to the OS on the next call to stream, event or context synchronize. (default 0)
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_FOLLOW_EVENT_DEPENDENCIES`]: (value type = int) Allow [`cuMemAllocAsync`] to use memory asynchronously freed in another stream as long as a stream ordering dependency of the allocating stream on
    ///   the free action exists. CUDA events and null stream interactions can create the required stream ordered dependencies. (default
    ///   enabled)
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_ALLOW_OPPORTUNISTIC`]: (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default
    ///   enabled)
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_REUSE_ALLOW_INTERNAL_DEPENDENCIES`]: (value type = int) Allow [`cuMemAllocAsync`] to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released
    ///   by [`cuMemFreeAsync`] (default enabled).
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT`]: (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH`]: (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset.
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_USED_MEM_CURRENT`]: (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application.
    /// * [`CUmemPool_attribute_enum::CU_MEMPOOL_ATTR_USED_MEM_HIGH`]: (value type = cuuint64_t) High watermark of the amount of memory from the pool that was in use by the application.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
    ///
    /// # Parameters
    ///
    /// - `pool`: The memory pool to get attributes of.
    /// - `attr`: The attribute to get.
    /// - `value`: Retrieved value.
    pub fn cuMemPoolGetAttribute(
        pool: CUmemoryPool,
        attr: CUmemPool_attribute,
        value: *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Controls visibility of pools between devices.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
    ///
    /// # Parameters
    ///
    /// - `pool`: The pool being modified.
    /// - `map`: Array of access descriptors. Each descriptor instructs the access to enable for a single gpu.
    /// - `count`: Number of descriptors in the map array.
    pub fn cuMemPoolSetAccess(
        pool: CUmemoryPool,
        map: *const CUmemAccessDesc,
        count: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the accessibility of a pool from a device.
    ///
    /// Returns the accessibility of the pool's memory from the specified location.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`].
    ///
    /// # Parameters
    ///
    /// - `flags`: the accessibility of the pool from the specified location.
    /// - `memPool`: the pool being queried.
    /// - `location`: the location accessing the pool.
    pub fn cuMemPoolGetAccess(
        flags: *mut CUmemAccess_flags,
        memPool: CUmemoryPool,
        location: *mut CUmemLocation,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a memory pool.
    ///
    /// Creates a CUDA memory pool and returns the handle in pool. The poolProps determines the properties of the pool such as the backing device and IPC capabilities.
    ///
    /// To create a memory pool for HOST memory not targeting a specific NUMA node, applications must set set CUmemPoolProps::CUmemLocation::type
    /// to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`]. CUmemPoolProps::CUmemLocation::id is ignored for such pools. Pools created with the type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] are not IPC capable and [CUmemPoolProps::handleTypes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemPoolProps__v1.html#structCUmemPoolProps__v1_169e75d604b122dbd39a8e3e3eacbe660) must be 0, any other values will result in [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. To create a memory pool targeting a specific host NUMA node, applications must set CUmemPoolProps::CUmemLocation::type to
    /// [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] and CUmemPoolProps::CUmemLocation::id must specify the NUMA ID of the host memory node. Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`] as the CUmemPoolProps::CUmemLocation::type will result in [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]. By default, the pool's memory will be accessible from the device it is allocated on. In the case of pools created with [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`], their default accessibility will be from the host CPU. Applications can control the maximum size of the pool by specifying
    /// a non-zero value for [CUmemPoolProps::maxSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemPoolProps__v1.html#structCUmemPoolProps__v1_10f9278cc88653f1eee70ab6a7a2ad7f3). If set to 0, the maximum size of the pool will default to a system dependent value.
    ///
    /// Applications that intend to use [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`] based memory sharing must ensure: (1) `nvidia-caps-imex-channels` character device is created by the driver and is listed
    /// under /proc/devices (2) have at least one IMEX channel file accessible by the user launching the application.
    ///
    /// When exporter and importer CUDA processes have been granted access to the same IMEX channel, they can securely share memory.
    ///
    /// The IMEX channel security model works on a per user basis. Which means all processes under a user can share memory if the
    /// user has access to a valid IMEX channel. When multi-user isolation is desired, a separate IMEX channel is required for each
    /// user.
    ///
    /// These channel files exist in /dev/nvidia-caps-imex-channels/channel\* and can be created using standard OS native calls like
    /// mknod on Linux. For example: To create channel0 with the major number from /proc/devices users can execute the following command:
    /// `mknod /dev/nvidia-caps-imex-channels/channel0 c &lt;major number>=""> 0`
    ///
    /// To create a managed memory pool, applications must set `CUmemAllocationType` to [`CUmemAllocationType::CU_MEM_ALLOCATION_TYPE_MANAGED`]. `CUmemAllocationHandleType` must also be set to [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] since IPC is not supported. For managed memory pools, CUmemPoolProps::CUmemLocation
    /// will be treated as the preferred location for all allocations created from the pool. An application can also set [`CUmemLocationType::CU_MEM_LOCATION_TYPE_NONE`]
    /// to indicate no preferred location. [CUmemPoolProps::maxSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemPoolProps__v1.html#structCUmemPoolProps__v1_10f9278cc88653f1eee70ab6a7a2ad7f3) must be set to zero for managed memory pools. [CUmemPoolProps::usage](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemPoolProps__v1.html#structCUmemPoolProps__v1_181dcd809a228c4346f8e732bb8e9070b) should be zero as decompress for managed memory is not supported. For managed memory pools, all devices on the system must
    /// have non-zero concurrentManagedAccess. If not, this call returns [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]
    ///
    /// Note:
    ///
    /// Specifying [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`] creates a memory pool that will not support IPC.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceSetMemPool`], [`cuDeviceGetMemPool`], [`cuDeviceGetDefaultMemPool`], [`cuMemAllocFromPoolAsync`], [`cuMemPoolExportToShareableHandle`].
    pub fn cuMemPoolCreate(
        pool: *mut CUmemoryPool,
        poolProps: *const CUmemPoolProps,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys the specified memory pool.
    ///
    /// If any pointers obtained from this pool haven't been freed or the pool has free operations that haven't completed when [`cuMemPoolDestroy`] is invoked, the function will return immediately and the resources associated with the pool will be released automatically
    /// once there are no more outstanding allocations.
    ///
    /// Destroying the current mempool of a device sets the default mempool of that device as the current mempool for that device.
    ///
    /// Note:
    ///
    /// A device's default memory pool cannot be destroyed.
    ///
    /// **See also:**
    ///
    /// [`cuMemFreeAsync`], [`cuDeviceSetMemPool`], [`cuDeviceGetMemPool`], [`cuDeviceGetDefaultMemPool`], [`cuMemPoolCreate`].
    pub fn cuMemPoolDestroy(pool: CUmemoryPool) -> CUresult;
}
unsafe extern "C" {
    /// Returns the default memory pool for a given location and allocation type.
    ///
    /// The memory location can be of one of [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`]. The allocation type can be one of [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_PINNED`] or [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`]. When the allocation type is [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`], the location type can also be [CU_MEM_LOCATION_TYPE_NONE](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/types.html#group__CUDA__TYPES_1gg75cfd5b9fa5c1c6ee2be2547bfbe882ecfc8f2ab14e813f7afe8019052526fa4) to indicate no preferred location for the managed memory pool. In all other cases, the call returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocAsync`], [`cuMemPoolTrimTo`], [`cuMemPoolGetAttribute`], [`cuMemPoolSetAttribute`], [`cuMemPoolSetAccess`], [`cuMemGetMemPool`], [`cuMemPoolCreate`].
    pub fn cuMemGetDefaultMemPool(
        pool_out: *mut CUmemoryPool,
        location: *mut CUmemLocation,
        type_: CUmemAllocationType,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets the current memory pool for a memory location and of a particular allocation type.
    ///
    /// The memory location can be of one of [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`]. The allocation type can be one of [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_PINNED`] or [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`]. When the allocation type is [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`], the location type can also be [CU_MEM_LOCATION_TYPE_NONE](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/types.html#group__CUDA__TYPES_1gg75cfd5b9fa5c1c6ee2be2547bfbe882ecfc8f2ab14e813f7afe8019052526fa4) to indicate no preferred location for the managed memory pool. In all other cases, the call returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]
    ///
    /// Returns the last pool provided to [`cuMemSetMemPool`] or [`cuDeviceSetMemPool`] for this location and allocation type or the location's default memory pool if [`cuMemSetMemPool`] or [`cuDeviceSetMemPool`] for that allocType and location has never been called. By default the current mempool of a location is the default mempool
    /// for a device. Otherwise the returned pool must have been set with [`cuDeviceSetMemPool`].
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetDefaultMemPool`], [`cuMemPoolCreate`], [`cuDeviceSetMemPool`], [`cuMemSetMemPool`].
    pub fn cuMemGetMemPool(
        pool: *mut CUmemoryPool,
        location: *mut CUmemLocation,
        type_: CUmemAllocationType,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the current memory pool for a memory location and allocation type.
    ///
    /// The memory location can be of one of [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`]. The allocation type can be one of [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_PINNED`] or [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`]. When the allocation type is [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_MANAGED`], the location type can also be [CU_MEM_LOCATION_TYPE_NONE](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/types.html#group__CUDA__TYPES_1gg75cfd5b9fa5c1c6ee2be2547bfbe882ecfc8f2ab14e813f7afe8019052526fa4) to indicate no preferred location for the managed memory pool. In all other cases, the call returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// When a memory pool is set as the current memory pool, the location parameter should be the same as the location of the pool.
    /// The location and allocation type specified must match those of the pool otherwise [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned. By default, a memory location's current memory pool is its default memory pool that can be obtained via [`cuMemGetDefaultMemPool`]. If the location type is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] and the allocation type is [`CUmemAllocationType_enum::CU_MEM_ALLOCATION_TYPE_PINNED`], then this API is the equivalent of calling [`cuDeviceSetMemPool`] with the location id as the device. For further details on the implications, please refer to the documentation for [`cuDeviceSetMemPool`].
    ///
    /// Note:
    ///
    /// Use [`cuMemAllocFromPoolAsync`] to specify asynchronous allocations from a device different than the one the stream runs on.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolDestroy`], [`cuMemAllocFromPoolAsync`].
    pub fn cuMemSetMemPool(
        location: *mut CUmemLocation,
        type_: CUmemAllocationType,
        pool: CUmemoryPool,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Allocates memory from a specified pool with stream ordered semantics.
    ///
    /// Inserts an allocation operation into hStream. A pointer to the allocated memory is returned immediately in \*dptr. The allocation must not be accessed until the allocation
    /// operation completes. The allocation comes from the specified memory pool.
    ///
    /// Note:
    ///
    /// * The specified memory pool may be from a device different than that of the specified hStream.
    ///
    /// * Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize,
    ///   and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream
    ///   runs.
    ///
    /// Note:
    ///
    /// During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned
    /// by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters.
    ///
    /// **See also:**
    ///
    /// [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolSetAccess`], [`cuMemPoolSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `dptr`: Returned device pointer.
    /// - `bytesize`: Number of bytes to allocate.
    /// - `pool`: The pool to allocate from.
    /// - `hStream`: The stream establishing the stream ordering semantic.
    pub fn cuMemAllocFromPoolAsync(
        dptr: *mut CUdeviceptr,
        bytesize: size_t,
        pool: CUmemoryPool,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Exports a memory pool to the requested handle type.
    ///
    /// Given an IPC capable mempool, create an OS handle to share the pool with another process. A recipient process can convert
    /// the shareable handle into a mempool with [`cuMemPoolImportFromShareableHandle`]. Individual pointers can then be shared with the [`cuMemPoolExportPointer`] and [`cuMemPoolImportPointer`] APIs. The implementation of what the shareable handle is and how it can be transferred is defined by the requested handle
    /// type.
    ///
    /// Note:
    ///
    /// : To create an IPC capable mempool, create a mempool with a CUmemAllocationHandleType other than [`CUmemAllocationHandleType::CU_MEM_HANDLE_TYPE_NONE`].
    ///
    /// **See also:**
    ///
    /// [`cuMemPoolImportFromShareableHandle`], [`cuMemPoolExportPointer`], [`cuMemPoolImportPointer`], [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuDeviceGetDefaultMemPool`], [`cuDeviceGetMemPool`], [`cuMemPoolCreate`], [`cuMemPoolSetAccess`], [`cuMemPoolSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `handle_out`: Returned OS handle.
    /// - `pool`: pool to export.
    /// - `handleType`: the type of handle to create.
    /// - `flags`: must be 0.
    pub fn cuMemPoolExportToShareableHandle(
        handle_out: *mut ::core::ffi::c_void,
        pool: CUmemoryPool,
        handleType: CUmemAllocationHandleType,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// imports a memory pool from a shared handle.
    ///
    /// Specific allocations can be imported from the imported pool with cuMemPoolImportPointer.
    ///
    /// If handleType is [`CUmemAllocationHandleType_enum::CU_MEM_HANDLE_TYPE_FABRIC`] and the importer process has not been granted access to the same IMEX channel as the exporter process, this API will error
    /// as [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`].
    ///
    /// Note:
    ///
    /// Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in cuDeviceSetMemPool
    /// or [`cuMemAllocFromPoolAsync`] calls.
    ///
    /// **See also:**
    ///
    /// [`cuMemPoolExportToShareableHandle`], [`cuMemPoolExportPointer`], [`cuMemPoolImportPointer`].
    ///
    /// # Parameters
    ///
    /// - `pool_out`: Returned memory pool.
    /// - `handle`: OS handle of the pool to open.
    /// - `handleType`: The type of handle being imported.
    /// - `flags`: must be 0.
    pub fn cuMemPoolImportFromShareableHandle(
        pool_out: *mut CUmemoryPool,
        handle: *mut ::core::ffi::c_void,
        handleType: CUmemAllocationHandleType,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Export data to share a memory pool allocation between processes.
    ///
    /// Constructs shareData_out for sharing a specific allocation from an already shared memory pool. The recipient process can import the allocation with
    /// the [`cuMemPoolImportPointer`] api. The data is not a handle and may be shared through any IPC mechanism.
    ///
    /// **See also:**
    ///
    /// [`cuMemPoolExportToShareableHandle`], [`cuMemPoolImportFromShareableHandle`], [`cuMemPoolImportPointer`].
    ///
    /// # Parameters
    ///
    /// - `shareData_out`: Returned export data.
    /// - `ptr`: pointer to memory being exported.
    pub fn cuMemPoolExportPointer(
        shareData_out: *mut CUmemPoolPtrExportData,
        ptr: CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Import a memory pool allocation from another process.
    ///
    /// Returns in ptr_out a pointer to the imported memory. The imported memory must not be accessed before the allocation operation completes in the
    /// exporting process. The imported memory must be freed from all importing processes before being freed in the exporting process.
    /// The pointer may be freed with cuMemFree or cuMemFreeAsync. If cuMemFreeAsync is used, the free must be completed on the importing
    /// process before the free operation on the exporting process.
    ///
    /// Note:
    ///
    /// The cuMemFreeAsync api may be used in the exporting process before the cuMemFreeAsync operation completes in its stream as
    /// long as the cuMemFreeAsync in the exporting process specifies a stream with a stream dependency on the importing process's
    /// cuMemFreeAsync.
    ///
    /// **See also:**
    ///
    /// [`cuMemPoolExportToShareableHandle`], [`cuMemPoolImportFromShareableHandle`], [`cuMemPoolExportPointer`].
    ///
    /// # Parameters
    ///
    /// - `ptr_out`: pointer to imported memory.
    /// - `pool`: pool from which to import.
    /// - `shareData`: data specifying the memory to import.
    pub fn cuMemPoolImportPointer(
        ptr_out: *mut CUdeviceptr,
        pool: CUmemoryPool,
        shareData: *mut CUmemPoolPtrExportData,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Create a generic allocation handle representing a multicast object described by the given properties.
    ///
    /// This creates a multicast object as described by prop. The number of participating devices is specified by [CUmulticastObjectProp::numDevices](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmulticastObjectProp__v1.html#structCUmulticastObjectProp__v1_1e5d44c9262847a6c74e4ae37acdc7478). Devices can be added to the multicast object via [`cuMulticastAddDevice`]. All participating devices must be added to the multicast object before memory can be bound to it. Memory is bound to the
    /// multicast object via [`cuMulticastBindMem`], [`cuMulticastBindMem_v2`], [`cuMulticastBindAddr`], or [`cuMulticastBindAddr_v2`]. and can be unbound via [`cuMulticastUnbind`]. The total amount of memory that can be bound per device is specified by :[CUmulticastObjectProp::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmulticastObjectProp__v1.html#structCUmulticastObjectProp__v1_1a45dfd715e2e442fcc7e43f5ce2f8a46). This size must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, the size should be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
    ///
    /// After all participating devices have been added, multicast objects can also be mapped to a device's virtual address space
    /// using the virtual memory management APIs (see [`cuMemMap`] and [`cuMemSetAccess`]). Multicast objects can also be shared with other processes by requesting a shareable handle via [`cuMemExportToShareableHandle`]. Note that the desired types of shareable handles must be specified in the bitmask [CUmulticastObjectProp::handleTypes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmulticastObjectProp__v1.html#structCUmulticastObjectProp__v1_1705cc17eda91d960e96982f2fda52d55). Multicast objects can be released using the virtual memory management API [`cuMemRelease`].
    ///
    /// **See also:**
    ///
    /// [`cuMulticastAddDevice`], [`cuMulticastBindMem`], [`cuMulticastBindAddr`], [`cuMulticastUnbind`]
    ///
    /// [`cuMemCreate`], [`cuMemRelease`], [`cuMemExportToShareableHandle`], [`cuMemImportFromShareableHandle`]
    ///
    /// [`cuMulticastBindAddr_v2`], [`cuMulticastBindMem_v2`].
    ///
    /// # Parameters
    ///
    /// - `mcHandle`: Value of handle returned.
    /// - `prop`: Properties of the multicast object to create.
    pub fn cuMulticastCreate(
        mcHandle: *mut CUmemGenericAllocationHandle,
        prop: *const CUmulticastObjectProp,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Associate a device to a multicast object.
    ///
    /// Associates a device to a multicast object. The added device will be a part of the multicast team of size specified by [CUmulticastObjectProp::numDevices](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmulticastObjectProp__v1.html#structCUmulticastObjectProp__v1_1e5d44c9262847a6c74e4ae37acdc7478) during [`cuMulticastCreate`]. The association of the device to the multicast object is permanent during the life time of the multicast object. All devices
    /// must be added to the multicast team before any memory can be bound to any device in the team. Any calls to [`cuMulticastBindMem`], [`cuMulticastBindMem_v2`], [`cuMulticastBindAddr`], or [`cuMulticastBindAddr_v2`] will block until all devices have been added. Similarly all devices must be added to the multicast team before a virtual
    /// address range can be mapped to the multicast object. A call to [`cuMemMap`] will block until all devices have been added.
    ///
    /// **See also:**
    ///
    /// [`cuMulticastCreate`], [`cuMulticastBindMem`], [`cuMulticastBindAddr`].
    ///
    /// # Parameters
    ///
    /// - `mcHandle`: Handle representing a multicast object.
    /// - `dev`: Device that will be associated to the multicast object.
    pub fn cuMulticastAddDevice(
        mcHandle: CUmemGenericAllocationHandle,
        dev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Bind a memory allocation represented by a handle to a multicast object.
    ///
    /// Binds a memory allocation specified by memHandle and created via [`cuMemCreate`] to a multicast object represented by mcHandle and created via [`cuMulticastCreate`]. The intended size of the bind, the offset in the multicast range mcOffset as well as the offset in the memory memOffset must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, size, mcOffset and memOffset should be aligned to the granularity of the memory allocation(see ::cuMemGetAllocationGranularity) or to the value returned
    /// by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
    ///
    /// The size + memOffset cannot be larger than the size of the allocated memory. Similarly the size + mcOffset cannot be larger than the size of the multicast object.
    ///
    /// The memory allocation must have beeen created on one of the devices that was added to the multicast team via [`cuMulticastAddDevice`]. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this
    /// call will return [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may
    /// also return [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running.
    ///
    /// This call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue
    /// using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
    ///
    /// **See also:**
    ///
    /// [`cuMulticastCreate`], [`cuMulticastAddDevice`], [`cuMemCreate`]
    ///
    /// [`cuMulticastBindMem_v2`].
    ///
    /// # Parameters
    ///
    /// - `mcHandle`: Handle representing a multicast object.
    /// - `mcOffset`: Offset into the multicast object for attachment.
    /// - `memHandle`: Handle representing a memory allocation.
    /// - `memOffset`: Offset into the memory for attachment.
    /// - `size`: Size of the memory that will be bound to the multicast object.
    /// - `flags`: Flags for future use, must be zero for now.
    pub fn cuMulticastBindMem(
        mcHandle: CUmemGenericAllocationHandle,
        mcOffset: size_t,
        memHandle: CUmemGenericAllocationHandle,
        memOffset: size_t,
        size: size_t,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Bind a memory allocation represented by a handle to a multicast object.
    ///
    /// Binds a memory allocation specified by memHandle and created via [`cuMemCreate`] to a multicast object represented by mcHandle and created via [`cuMulticastCreate`]. The binding will be applicable for the device dev. The intended size of the bind, the offset in the multicast range mcOffset as well as the offset in the memory memOffset must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, size, mcOffset and memOffset should be aligned to the granularity of the memory allocation(see ::cuMemGetAllocationGranularity) or to the value returned
    /// by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
    ///
    /// The size + memOffset cannot be larger than the size of the allocated memory. Similarly the size + mcOffset cannot be larger than the size of the multicast object.
    ///
    /// The memory allocation must have beeen created on one of the devices that was added to the multicast team via [`cuMulticastAddDevice`]. For device memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], the memory allocation must have been created on the device specified by dev. For host NUMA memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], the memory allocation must have been created on the CPU NUMA node closest to dev. That is, the value returned when querying [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID`] for dev, must be the CPU NUMA node where the memory was allocated. In both cases, the device named by dev must have been added to the multicast team via [`cuMulticastAddDevice`]. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this
    /// call will return [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may
    /// also return [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running.
    ///
    /// This call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue
    /// using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
    ///
    /// **See also:**
    ///
    /// [`cuMulticastCreate`], [`cuMulticastAddDevice`], [`cuMemCreate`].
    ///
    /// # Parameters
    ///
    /// - `mcHandle`: Handle representing a multicast object.
    /// - `dev`: The device that for which the multicast memory binding will be applicable.
    /// - `mcOffset`: Offset into the multicast object for attachment.
    /// - `memHandle`: Handle representing a memory allocation.
    /// - `memOffset`: Offset into the memory for attachment.
    /// - `size`: Size of the memory that will be bound to the multicast object.
    /// - `flags`: Flags for future use, must be zero for now.
    pub fn cuMulticastBindMem_v2(
        mcHandle: CUmemGenericAllocationHandle,
        dev: CUdevice,
        mcOffset: size_t,
        memHandle: CUmemGenericAllocationHandle,
        memOffset: size_t,
        size: size_t,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Bind a memory allocation represented by a virtual address to a multicast object.
    ///
    /// Binds a memory allocation specified by its mapped address memptr to a multicast object represented by mcHandle. The memory must have been allocated via [`cuMemCreate`] or [cudaMallocAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1ga31efcffc48981621feddd98d71a0feb). The intended size of the bind, the offset in the multicast range mcOffset and memptr must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, size, mcOffset and memptr should be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
    ///
    /// The size cannot be larger than the size of the allocated memory. Similarly the size + mcOffset cannot be larger than the total size of the multicast object.
    ///
    /// The memory allocation must have beeen created on one of the devices that was added to the multicast team via [`cuMulticastAddDevice`]. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this
    /// call will return [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may
    /// also return [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running.
    ///
    /// This call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue
    /// using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
    ///
    /// **See also:**
    ///
    /// [`cuMulticastCreate`], [`cuMulticastAddDevice`], [`cuMemCreate`]
    ///
    /// [`cuMulticastBindAddr_v2`].
    ///
    /// # Parameters
    ///
    /// - `mcHandle`: Handle representing a multicast object.
    /// - `mcOffset`: Offset into multicast va range for attachment.
    /// - `memptr`: Virtual address of the memory allocation.
    /// - `size`: Size of memory that will be bound to the multicast object.
    /// - `flags`: Flags for future use, must be zero now.
    pub fn cuMulticastBindAddr(
        mcHandle: CUmemGenericAllocationHandle,
        mcOffset: size_t,
        memptr: CUdeviceptr,
        size: size_t,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Bind a memory allocation represented by a virtual address to a multicast object.
    ///
    /// Binds a memory allocation specified by its mapped address memptr to a multicast object represented by mcHandle. The binding will be applicable for the device dev. The memory must have been allocated via [`cuMemCreate`] or [cudaMallocAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1ga31efcffc48981621feddd98d71a0feb). The intended size of the bind, the offset in the multicast range mcOffset and memptr must be a multiple of the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. For best performance however, size, mcOffset and memptr should be aligned to the value returned by [`cuMulticastGetGranularity`] with the flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_RECOMMENDED`].
    ///
    /// The size cannot be larger than the size of the allocated memory. Similarly the size + mcOffset cannot be larger than the total size of the multicast object.
    ///
    /// For device memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], the memory allocation must have been created on the device specified by dev. For host NUMA memory, i.e., type [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], the memory allocation must have been created on the CPU NUMA node closest to dev. That is, the value returned when querying [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_HOST_NUMA_ID`] for dev, must be the CPU NUMA node where the memory was allocated. In both cases, the device named by dev must have been added to the multicast team via [`cuMulticastAddDevice`]. Externally shareable as well as imported multicast objects can be bound only to externally shareable memory. Note that this
    /// call will return [`CUresult::CUDA_ERROR_OUT_OF_MEMORY`] if there are insufficient resources required to perform the bind. This call may
    /// also return [`CUresult::CUDA_ERROR_SYSTEM_NOT_READY`] if the necessary system software is not initialized or running.
    ///
    /// This call may return [`CUresult::CUDA_ERROR_ILLEGAL_STATE`] if the system configuration is in an illegal state. In such cases, to continue
    /// using multicast, verify that the system configuration is in a valid state and all required driver daemons are running properly.
    ///
    /// **See also:**
    ///
    /// [`cuMulticastCreate`], [`cuMulticastAddDevice`], [`cuMemCreate`].
    ///
    /// # Parameters
    ///
    /// - `mcHandle`: Handle representing a multicast object.
    /// - `dev`: The device that for which the multicast memory binding will be applicable.
    /// - `mcOffset`: Offset into multicast va range for attachment.
    /// - `memptr`: Virtual address of the memory allocation.
    /// - `size`: Size of memory that will be bound to the multicast object.
    /// - `flags`: Flags for future use, must be zero now.
    pub fn cuMulticastBindAddr_v2(
        mcHandle: CUmemGenericAllocationHandle,
        dev: CUdevice,
        mcOffset: size_t,
        memptr: CUdeviceptr,
        size: size_t,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unbind any memory allocations bound to a multicast object at a given offset and upto a given size.
    ///
    /// Unbinds any memory allocations hosted on dev and bound to a multicast object at mcOffset and upto a given size. The intended size of the unbind and the offset in the multicast range ( mcOffset ) must be a multiple of the value returned by [`cuMulticastGetGranularity`] flag [`CUmulticastGranularity_flags_enum::CU_MULTICAST_GRANULARITY_MINIMUM`]. The size + mcOffset cannot be larger than the total size of the multicast object.
    ///
    /// Note:
    ///
    /// Warning: The mcOffset and the size must match the corresponding values specified during the bind call. Any other values may result in undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cuMulticastBindMem`], [`cuMulticastBindAddr`]
    ///
    /// [`cuMulticastBindMem_v2`], [`cuMulticastBindAddr_v2`].
    ///
    /// # Parameters
    ///
    /// - `mcHandle`: Handle representing a multicast object.
    /// - `dev`: Device that hosts the memory allocation.
    /// - `mcOffset`: Offset into the multicast object.
    /// - `size`: Desired size to unbind.
    pub fn cuMulticastUnbind(
        mcHandle: CUmemGenericAllocationHandle,
        dev: CUdevice,
        mcOffset: size_t,
        size: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Calculates either the minimal or recommended granularity for multicast object.
    ///
    /// Calculates either the minimal or recommended granularity for a given set of multicast object properties and returns it in
    /// granularity. This granularity can be used as a multiple for size, bind offsets and address mappings of the multicast object.
    ///
    /// **See also:**
    ///
    /// [`cuMulticastCreate`], [`cuMulticastBindMem`], [`cuMulticastBindAddr`], [`cuMulticastUnbind`]
    ///
    /// [`cuMulticastBindMem_v2`], [`cuMulticastBindAddr_v2`].
    ///
    /// # Parameters
    ///
    /// - `granularity`: Returned granularity.
    /// - `prop`: Properties of the multicast object.
    /// - `option`: Determines which granularity to return.
    pub fn cuMulticastGetGranularity(
        granularity: *mut size_t,
        prop: *const CUmulticastObjectProp,
        option: CUmulticastGranularity_flags,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns information about a pointer.
    ///
    /// The supported attributes are:
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_CONTEXT`]:
    ///
    /// Returns in \*data the [`CUcontext`] in which ptr was allocated or registered. The type of data must be [`CUcontext`] \*.
    ///
    /// If ptr was not allocated by, mapped by, or registered with a [`CUcontext`] which uses unified virtual addressing then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MEMORY_TYPE`]:
    ///
    /// Returns in \*data the physical memory type of the memory that ptr addresses as a `CUmemorytype` enumerated value. The type of data must be unsigned int.
    ///
    /// If ptr addresses device memory then \*data is set to [`CUmemorytype_enum::CU_MEMORYTYPE_DEVICE`]. The particular [`CUdevice`] on which the memory resides is the [`CUdevice`] of the [`CUcontext`] returned by the [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_CONTEXT`] attribute of ptr.
    ///
    /// If ptr addresses host memory then \*data is set to [`CUmemorytype_enum::CU_MEMORYTYPE_HOST`].
    ///
    /// If ptr was not allocated by, mapped by, or registered with a [`CUcontext`] which uses unified virtual addressing then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// If the current [`CUcontext`] does not support unified virtual addressing then [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_POINTER`]:
    ///
    /// Returns in \*data the device pointer value through which ptr may be accessed by kernels running in the current [`CUcontext`]. The type of data must be CUdeviceptr \*.
    ///
    /// If there exists no device pointer value through which kernels running in the current [`CUcontext`] may access ptr then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// If there is no current [`CUcontext`] then [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
    ///
    /// Except in the exceptional disjoint addressing cases discussed below, the value returned in \*data will equal the input value ptr.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_HOST_POINTER`]:
    ///
    /// Returns in \*data the host pointer value through which ptr may be accessed by by the host program. The type of data must be void \*\*. If there exists no host pointer value through which the host program may directly access ptr then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// Except in the exceptional disjoint addressing cases discussed below, the value returned in \*data will equal the input value ptr.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_P2P_TOKENS`]:
    ///
    /// Returns in \*data two tokens for use with the nv-p2p.h Linux kernel interface. data must be a struct of type CUDA_POINTER_ATTRIBUTE_P2P_TOKENS.
    ///
    /// ptr must be a pointer to memory obtained from :[`cuMemAlloc_v2`]. Note that p2pToken and vaSpaceToken are only valid for the lifetime of the source allocation. A subsequent allocation at
    /// the same address may return completely different tokens. Querying this attribute has a side effect of setting the attribute
    /// [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`] for the region of memory that ptr points to.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`]:
    ///
    /// A boolean attribute which when set, ensures that synchronous memory operations initiated on the region of memory that ptr points to will always synchronize. See further documentation in the section titled "API synchronization behavior" to learn
    /// more about cases when synchronous memory operations can exhibit asynchronous behavior.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_BUFFER_ID`]:
    ///
    /// Returns in \*data a buffer ID which is guaranteed to be unique within the process. data must point to an unsigned long long.
    ///
    /// ptr must be a pointer to memory obtained from a CUDA memory allocation API. Every memory allocation from any of the CUDA memory
    /// allocation APIs will have a unique ID over a process lifetime. Subsequent allocations do not reuse IDs from previous freed
    /// allocations. IDs are only unique within a single process.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_MANAGED`]:
    ///
    /// Returns in \*data a boolean that indicates whether the pointer points to managed memory or not.
    ///
    /// If ptr is not a valid CUDA pointer then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL`]:
    ///
    /// Returns in \*data an integer representing a device ordinal of a device against which the memory was allocated or registered.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE`]:
    ///
    /// Returns in \*data a boolean that indicates if this pointer maps to an allocation that is suitable for [cudaIpcGetMemHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1g8a37f7dfafaca652391d0758b3667539).
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_RANGE_START_ADDR`]:
    ///
    /// Returns in \*data the starting address for the allocation referenced by the device pointer ptr. Note that this is not necessarily the address of the mapped region, but the address of the mappable address range ptr references (e.g. from [`cuMemAddressReserve`]).
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_RANGE_SIZE`]:
    ///
    /// Returns in \*data the size for the allocation referenced by the device pointer ptr. Note that this is not necessarily the size of the mapped region, but the size of the mappable address range ptr references (e.g. from [`cuMemAddressReserve`]). To retrieve the size of the mapped region, see [`cuMemGetAddressRange_v2`]
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MAPPED`]:
    ///
    /// Returns in \*data a boolean that indicates if this pointer is in a valid address range that is mapped to a backing allocation.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES`]:
    ///
    /// Returns a bitmask of the allowed handle types for an allocation that may be passed to [`cuMemExportToShareableHandle`].
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE`]:
    ///
    /// Returns in \*data the handle to the mempool that the allocation was obtained from.
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE`]:
    ///
    /// Returns in \*data a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression.
    ///
    /// Note that for most allocations in the unified virtual address space the host and device pointer for accessing the allocation
    /// will be the same. The exceptions to this are
    ///
    /// * user memory registered using [`cuMemHostRegister_v2`]
    /// * host memory allocated using [`cuMemHostAlloc`] with the [`CU_MEMHOSTALLOC_WRITECOMBINED`] flag For these types of allocation there will exist separate, disjoint host and device addresses for accessing the allocation.
    ///   In particular
    /// * The host address will correspond to an invalid unmapped device address (which will result in an exception if accessed from
    ///   the device)
    /// * The device address will correspond to an invalid unmapped host address (which will result in an exception if accessed from
    ///   the host). For these types of allocations, querying [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_HOST_POINTER`] and [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_POINTER`] may be used to retrieve the host and device addresses from either address.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuPointerSetAttribute`], [`cuMemAlloc_v2`], [`cuMemFree_v2`], [`cuMemAllocHost_v2`], [`cuMemFreeHost`], [`cuMemHostAlloc`], [`cuMemHostRegister_v2`], [`cuMemHostUnregister`], [cudaPointerGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__UNIFIED.html#group__CUDART__UNIFIED_1gd89830e17d399c064a2f3c3fa8bb4390).
    ///
    /// # Parameters
    ///
    /// - `data`: Returned pointer attribute value.
    /// - `attribute`: Pointer attribute to query.
    /// - `ptr`: Pointer.
    pub fn cuPointerGetAttribute(
        data: *mut ::core::ffi::c_void,
        attribute: CUpointer_attribute,
        ptr: CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Prefetches memory to the specified destination location.
    ///
    /// Prefetches memory to the specified destination location. devPtr is the base device pointer of the memory to be prefetched and location specifies the destination location. count specifies the number of bytes to copy. hStream is the stream in which the operation is enqueued. The memory range must refer to managed memory allocated via [`cuMemAllocManaged`], via cuMemAllocFromPool from a managed memory pool or declared via __managed__ variables.
    ///
    /// Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] for [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) will prefetch memory to GPU specified by device ordinal CUmemLocation::id which must have non-zero value for the device attribute
    /// [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Additionally, hStream must be associated with a device that has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] as [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) will prefetch data to host memory. Applications can request prefetching memory to a specific host NUMA node by specifying
    /// [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] for [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) and a valid host NUMA node id in CUmemLocation::id Users can also request prefetching memory to the host NUMA node closest
    /// to the current thread's CPU by specifying [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`] for [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b). Note when [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) is etiher [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] OR [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`], CUmemLocation::id will be ignored.
    ///
    /// The start address and end address of the memory range will be rounded down and rounded up respectively to be aligned to CPU
    /// page size before the prefetch operation is enqueued in the stream.
    ///
    /// If no physical memory has been allocated for this region, then this memory region will be populated and mapped on the destination
    /// device. If there's insufficient memory to prefetch the desired region, the Unified Memory driver may evict pages from other
    /// [`cuMemAllocManaged`] allocations to host memory in order to make room. Device memory allocated using [`cuMemAlloc_v2`] or [`cuArrayCreate_v2`] will not be evicted.
    ///
    /// By default, any mappings to the previous location of the migrated pages are removed and mappings for the new location are
    /// only setup on the destination location. The exact behavior however also depends on the settings applied to this memory range
    /// via [`cuMemAdvise_v2`] as described below:
    ///
    /// If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`] was set on any subset of this memory range, then that subset will create a read-only copy of the pages on destination location.
    /// If however the destination location is a host NUMA node, then any pages of that subset that are already in another host NUMA
    /// node will be transferred to the destination.
    ///
    /// If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`] was called on any subset of this memory range, then the pages will be migrated to location even if location is not the preferred location of any pages in the memory range.
    ///
    /// If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`] was called on any subset of this memory range, then mappings to those pages from all the appropriate processors are updated
    /// to refer to the new location if establishing such a mapping is possible. Otherwise, those mappings are cleared.
    ///
    /// Note that this API is not required for functionality and only serves to improve performance by allowing the application to
    /// migrate data to a suitable location before it is accessed. Memory accesses to this range are always coherent and are allowed
    /// even when the data is actively being migrated.
    ///
    /// Note that this function is asynchronous with respect to the host and all work on other devices.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuMemcpy`], [`cuMemcpyPeer`], [`cuMemcpyAsync`], [`cuMemcpy3DPeerAsync`], [`cuMemAdvise_v2`], [cudaMemPrefetchAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g856fa41c8c0d28655e37b778cb9ffc65).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to be prefetched.
    /// - `count`: Size in bytes.
    /// - `location`: Location to prefetch to.
    /// - `flags`: flags for future use, must be zero now.
    /// - `hStream`: Stream to enqueue prefetch operation.
    pub fn cuMemPrefetchAsync_v2(
        devPtr: CUdeviceptr,
        count: size_t,
        location: CUmemLocation,
        flags: ::core::ffi::c_uint,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Advise about the usage of a given memory range.
    ///
    /// Advise the Unified Memory subsystem about the usage pattern for the memory range starting at devPtr with a size of count bytes. The start address and end address of the memory range will be rounded down and rounded up respectively to be aligned
    /// to CPU page size before the advice is applied. The memory range must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via __managed__ variables. The memory range could also refer to system-allocated pageable memory provided it
    /// represents a valid, host-accessible region of memory and all additional constraints imposed by advice as outlined below are also satisfied. Specifying an invalid system-allocated pageable memory range results in an error being
    /// returned.
    ///
    /// The advice parameter can take the following values:
    ///
    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`]: This implies that the data is mostly going to be read from and only occasionally written to. Any read accesses from any
    ///   processor to this region will create a read-only copy of at least the accessed pages in that processor's memory. Additionally,
    ///   if [`cuMemPrefetchAsync_v2`] is called on this region, it will create a read-only copy of the data on the destination processor. If the target location
    ///   for [`cuMemPrefetchAsync_v2`] is a host NUMA node and a read-only copy already exists on another host NUMA node, that copy will be migrated to the targeted
    ///   host NUMA node. If any processor writes to this region, all copies of the corresponding page will be invalidated except for
    ///   the one where the write occurred. If the writing processor is the CPU and the preferred location of the page is a host NUMA
    ///   node, then the page will also be migrated to that host NUMA node. The location argument is ignored for this advice. Note that for a page to be read-duplicated, the accessing processor must either be the
    ///   CPU or a GPU that has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Also, if a context is created on a device that does not have the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] set, then read-duplication will not occur until all such contexts are destroyed. If the memory region refers to valid system-allocated
    ///   pageable memory, then the accessing device must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`] for a read-only copy to be created on that device. Note however that if the accessing device also has a non-zero value for
    ///   the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], then setting this advice will not create a read-only copy when that device accesses this memory region.
    ///
    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_UNSET_READ_MOSTLY`]: Undoes the effect of [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`] and also prevents the Unified Memory driver from attempting heuristic read-duplication on the memory range. Any read-duplicated
    ///   copies of the data will be collapsed into a single copy. The location for the collapsed copy will be the preferred location
    ///   if the page has a preferred location and one of the read-duplicated copies was resident at that location. Otherwise, the location
    ///   chosen is arbitrary. Note: The location argument is ignored for this advice.
    ///
    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`]: This advice sets the preferred location for the data to be the memory belonging to location. When [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`], CUmemLocation::id is ignored and the preferred location is set to be host memory. To set the preferred location to a specific
    ///   host NUMA node, applications must set [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] and CUmemLocation::id must specify the NUMA ID of the host NUMA node. If [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) is set to [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`], CUmemLocation::id will be ignored and the host NUMA node closest to the calling thread's CPU will be used as the preferred
    ///   location. If [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) is a [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], then CUmemLocation::id must be a valid device ordinal and the device must have a non-zero value for the device attribute
    ///   [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. Setting the preferred location does not cause data to migrate to that location immediately. Instead, it guides the migration
    ///   policy when a fault occurs on that memory region. If the data is already in its preferred location and the faulting processor
    ///   can establish a mapping without requiring the data to be migrated, then data migration will be avoided. On the other hand,
    ///   if the data is not in its preferred location or if a direct mapping cannot be established, then it will be migrated to the
    ///   processor accessing it. It is important to note that setting the preferred location does not prevent data prefetching done
    ///   using [`cuMemPrefetchAsync_v2`]. Having a preferred location can override the page thrash detection and resolution logic in the Unified Memory driver. Normally,
    ///   if a page is detected to be constantly thrashing between for example host and device memory, the page may eventually be pinned
    ///   to host memory by the Unified Memory driver. But if the preferred location is set as device memory, then the page will continue
    ///   to thrash indefinitely. If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`] is also set on this memory region or any subset of it, then the policies associated with that advice will override the policies
    ///   of this advice, unless read accesses from location will not result in a read-only copy being created on that procesor as outlined in description for the advice [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`]. If the memory region refers to valid system-allocated pageable memory, and [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) is [`CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE`] then CUmemLocation::id must be a valid device that has a non-zero alue for the device attribute
    ///   [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
    ///
    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_UNSET_PREFERRED_LOCATION`]: Undoes the effect of [`CUmem_advise_enum::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`] and changes the preferred location to none. The location argument is ignored for this advice.
    ///
    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`]: This advice implies that the data will be accessed by processor location. The [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) must be either [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] with CUmemLocation::id representing a valid device ordinal or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] and CUmemLocation::id will be ignored. All other location types are invalid. If CUmemLocation::id is a GPU, then the device
    ///   attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] must be non-zero. This advice does not cause data migration and has no impact on the location of the data per se. Instead,
    ///   it causes the data to always be mapped in the specified processor's page tables, as long as the location of the data permits
    ///   a mapping to be established. If the data gets migrated for any reason, the mappings are updated accordingly. This advice is
    ///   recommended in scenarios where data locality is not important, but avoiding faults is. Consider for example a system containing
    ///   multiple GPUs with peer-to-peer access enabled, where the data located on one GPU is occasionally accessed by peer GPUs. In
    ///   such scenarios, migrating data over to the other GPUs is not as important because the accesses are infrequent and the overhead
    ///   of migration may be too high. But preventing faults can still help improve performance, and so having a mapping set up in
    ///   advance is useful. Note that on CPU access of this data, the data may be migrated to host memory because the CPU typically
    ///   cannot access device memory directly. Any GPU that had the [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`] flag set for this data will now have its mapping updated to point to the page in host memory. If [`CUmem_advise_enum::CU_MEM_ADVISE_SET_READ_MOSTLY`] is also set on this memory region or any subset of it, then the policies associated with that advice will override the policies
    ///   of this advice. Additionally, if the preferred location of this memory region or any subset of it is also location, then the policies associated with [`CUmem_advise_enum::CU_MEM_ADVISE_SET_PREFERRED_LOCATION`] will override the policies of this advice. If the memory region refers to valid system-allocated pageable memory, and [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] then device in CUmemLocation::id must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. Additionally, if CUmemLocation::id has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], then this call has no effect.
    ///
    /// * [`CUmem_advise_enum::CU_MEM_ADVISE_UNSET_ACCESSED_BY`]: Undoes the effect of [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`]. Any mappings to the data from location may be removed at any time causing accesses to result in non-fatal page faults. If the memory region refers to valid system-allocated
    ///   pageable memory, and [CUmemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUmemLocation__v1.html#structCUmemLocation__v1_1a34fc29f2a55d501f00f912d92152d1b) is [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] then device in CUmemLocation::id must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. Additionally, if CUmemLocation::id has a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLES`], then this call has no effect.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuMemcpy`], [`cuMemcpyPeer`], [`cuMemcpyAsync`], [`cuMemcpy3DPeerAsync`], [`cuMemPrefetchAsync_v2`], [cudaMemAdvise](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g5584e2dac446bebc695da3bb1c162607).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to memory to set the advice for.
    /// - `count`: Size in bytes of the memory range.
    /// - `advice`: Advice to be applied for the specified memory range.
    /// - `location`: location to apply the advice for.
    pub fn cuMemAdvise_v2(
        devPtr: CUdeviceptr,
        count: size_t,
        advice: CUmem_advise,
        location: CUmemLocation,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Performs a batch of memory prefetches asynchronously.
    ///
    /// Performs a batch of memory prefetches. The batch as a whole executes in stream order but operations within a batch are not
    /// guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute
    /// [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
    ///
    /// The semantics of the individual prefetch operations are as described in [`cuMemPrefetchAsync_v2`].
    ///
    /// Performs memory prefetch on address ranges specified in dptrs and sizes. Both arrays must be of the same length as specified by count. Each memory range specified must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via __managed__ variables or it may also refer to system-allocated memory when all devices have a non-zero value
    /// for [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. The prefetch location for every operation in the batch is specified in the prefetchLocs array. Each entry in this array can apply to more than one operation. This can be done by specifying in the prefetchLocIdxs array, the index of the first prefetch operation that the corresponding entry in the prefetchLocs array applies to. Both prefetchLocs and prefetchLocIdxs must be of the same length as specified by numPrefetchLocs. For example, if a batch has 10 prefetches listed in dptrs/sizes, the first 4 of which are to be prefetched to one location
    /// and the remaining 6 are to be prefetched to another, then numPrefetchLocs will be 2, prefetchLocIdxs will be {0, 4} and prefetchLocs will contain the two locations. Note the first entry in prefetchLocIdxs must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than count. Furthermore, numPrefetchLocs must be lesser than or equal to count.
    ///
    /// # Parameters
    ///
    /// - `dptrs`: Array of pointers to be prefetched.
    /// - `sizes`: Array of sizes for memory prefetch operations.
    /// - `count`: Size of dptrs and sizes arrays.
    /// - `prefetchLocs`: Array of locations to prefetch to.
    /// - `prefetchLocIdxs`: Array of indices to specify which operands each entry in the prefetchLocs array applies to. The locations specified in prefetchLocs\[k\] will be applied to copies starting from prefetchLocIdxs\[k\] through
    /// prefetchLocIdxs\[k+1\] - 1. Also prefetchLocs\[numPrefetchLocs - 1\] will apply to prefetches starting from prefetchLocIdxs\[numPrefetchLocs
    /// - 1\] through count - 1.
    /// - `numPrefetchLocs`: Size of prefetchLocs and prefetchLocIdxs arrays.
    /// - `flags`: Flags reserved for future use. Must be zero.
    /// - `hStream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
    pub fn cuMemPrefetchBatchAsync(
        dptrs: *mut CUdeviceptr,
        sizes: *mut size_t,
        count: size_t,
        prefetchLocs: *mut CUmemLocation,
        prefetchLocIdxs: *mut size_t,
        numPrefetchLocs: size_t,
        flags: ::core::ffi::c_ulonglong,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Performs a batch of memory discards asynchronously.
    ///
    /// Performs a batch of memory discards. The batch as a whole executes in stream order but operations within a batch are not guaranteed
    /// to execute in any specific order. All devices in the system must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
    ///
    /// Discarding a memory range informs the driver that the contents of that range are no longer useful. Discarding memory ranges
    /// allows the driver to optimize certain data migrations and can also help reduce memory pressure. This operation can be undone
    /// on any part of the range by either writing to it or prefetching it via [`cuMemPrefetchAsync_v2`] or [`cuMemPrefetchBatchAsync`]. Reading from a discarded range, without a subsequent write or prefetch to that part of the range, will return an indeterminate
    /// value. Note that any reads, writes or prefetches to any part of the memory range that occur simultaneously with the discard
    /// operation result in undefined behavior.
    ///
    /// Performs memory discard on address ranges specified in dptrs and sizes. Both arrays must be of the same length as specified by count. Each memory range specified must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via __managed__ variables or it may also refer to system-allocated memory when all devices have a non-zero value
    /// for [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
    ///
    /// # Parameters
    ///
    /// - `dptrs`: Array of pointers to be discarded.
    /// - `sizes`: Array of sizes for memory discard operations.
    /// - `count`: Size of dptrs and sizes arrays.
    /// - `flags`: Flags reserved for future use. Must be zero.
    /// - `hStream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
    pub fn cuMemDiscardBatchAsync(
        dptrs: *mut CUdeviceptr,
        sizes: *mut size_t,
        count: size_t,
        flags: ::core::ffi::c_ulonglong,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Performs a batch of memory discards and prefetches asynchronously.
    ///
    /// Performs a batch of memory discards followed by prefetches. The batch as a whole executes in stream order but operations within
    /// a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the
    /// device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`] otherwise the API will return an error.
    ///
    /// Calling [`cuMemDiscardAndPrefetchBatchAsync`] is semantically equivalent to calling [`cuMemDiscardBatchAsync`] followed by [`cuMemPrefetchBatchAsync`], but is more optimal. For more details on what discarding and prefetching imply, please refer to [`cuMemDiscardBatchAsync`] and [`cuMemPrefetchBatchAsync`] respectively. Note that any reads, writes or prefetches to any part of the memory range that occur simultaneously with this
    /// combined discard+prefetch operation result in undefined behavior.
    ///
    /// Performs memory discard and prefetch on address ranges specified in dptrs and sizes. Both arrays must be of the same length as specified by count. Each memory range specified must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via __managed__ variables or it may also refer to system-allocated memory when all devices have a non-zero value
    /// for [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`]. Every operation in the batch has to be associated with a valid location to prefetch the address range to and specified in
    /// the prefetchLocs array. Each entry in this array can apply to more than one operation. This can be done by specifying in the prefetchLocIdxs array, the index of the first operation that the corresponding entry in the prefetchLocs array applies to. Both prefetchLocs and prefetchLocIdxs must be of the same length as specified by numPrefetchLocs. For example, if a batch has 10 operations listed in dptrs/sizes, the first 6 of which are to be prefetched to one location
    /// and the remaining 4 are to be prefetched to another, then numPrefetchLocs will be 2, prefetchLocIdxs will be {0, 6} and prefetchLocs will contain the two set of locations. Note the first entry in prefetchLocIdxs must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than count. Furthermore, numPrefetchLocs must be lesser than or equal to count.
    ///
    /// # Parameters
    ///
    /// - `dptrs`: Array of pointers to be discarded.
    /// - `sizes`: Array of sizes for memory discard operations.
    /// - `count`: Size of dptrs and sizes arrays.
    /// - `prefetchLocs`: Array of locations to prefetch to.
    /// - `prefetchLocIdxs`: Array of indices to specify which operands each entry in the prefetchLocs array applies to. The locations specified in prefetchLocs\[k\] will be applied to operations starting from prefetchLocIdxs\[k\]
    /// through prefetchLocIdxs\[k+1\] - 1. Also prefetchLocs\[numPrefetchLocs - 1\] will apply to copies starting from prefetchLocIdxs\[numPrefetchLocs
    /// - 1\] through count - 1.
    /// - `numPrefetchLocs`: Size of prefetchLocs and prefetchLocIdxs arrays.
    /// - `flags`: Flags reserved for future use. Must be zero.
    /// - `hStream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
    pub fn cuMemDiscardAndPrefetchBatchAsync(
        dptrs: *mut CUdeviceptr,
        sizes: *mut size_t,
        count: size_t,
        prefetchLocs: *mut CUmemLocation,
        prefetchLocIdxs: *mut size_t,
        numPrefetchLocs: size_t,
        flags: ::core::ffi::c_ulonglong,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Query an attribute of a given memory range.
    ///
    /// Query an attribute about the memory range starting at devPtr with a size of count bytes. The memory range must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via __managed__ variables.
    ///
    /// The attribute parameter can take the following values:
    ///
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY`]: If this attribute is specified, data will be interpreted as a 32-bit integer, and dataSize must be 4. The result returned will be 1 if all pages in the given memory range have read-duplication enabled, or 0 otherwise.
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION`]: If this attribute is specified, data will be interpreted as a 32-bit integer, and dataSize must be 4. The result returned will be a GPU device id if all pages in the memory range have that GPU as their preferred
    ///   location, or it will be CU_DEVICE_CPU if all pages in the memory range have the CPU as their preferred location, or it will
    ///   be CU_DEVICE_INVALID if either all the pages don't have the same preferred location or some of the pages don't have a preferred
    ///   location at all. Note that the actual location of the pages in the memory range at the time of the query may be different
    ///   from the preferred location.
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY`]: If this attribute is specified, data will be interpreted as an array of 32-bit integers, and dataSize must be a non-zero multiple of 4. The result returned will be a list of device ids that had [`CUmem_advise_enum::CU_MEM_ADVISE_SET_ACCESSED_BY`] set for that entire memory range. If any device does not have that advice set for the entire memory range, that device will
    ///   not be included. If data is larger than the number of devices that have that advice set for that memory range, CU_DEVICE_INVALID will be returned
    ///   in all the extra space provided. For ex., if dataSize is 12 (i.e. data has 3 elements) and only device 0 has the advice set, then the result returned will be { 0, CU_DEVICE_INVALID, CU_DEVICE_INVALID
    ///   }. If data is smaller than the number of devices that have that advice set, then only as many devices will be returned as can fit in
    ///   the array. There is no guarantee on which specific devices will be returned, however.
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION`]: If this attribute is specified, data will be interpreted as a 32-bit integer, and dataSize must be 4. The result returned will be the last location to which all pages in the memory range were prefetched explicitly
    ///   via [`cuMemPrefetchAsync_v2`]. This will either be a GPU id or CU_DEVICE_CPU depending on whether the last location for prefetch was a GPU or the CPU respectively.
    ///   If any page in the memory range was never explicitly prefetched or if all pages were not prefetched to the same location,
    ///   CU_DEVICE_INVALID will be returned. Note that this simply returns the last location that the application requested to prefetch
    ///   the memory range to. It gives no indication as to whether the prefetch operation to that location has completed or even begun.
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`]: If this attribute is specified, data will be interpreted as a `CUmemLocationType`, and dataSize must be sizeof(CUmemLocationType). The `CUmemLocationType` returned will be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] if all pages in the memory range have the same GPU as their preferred location, or `CUmemLocationType` will be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] if all pages in the memory range have the CPU as their preferred location, or it will be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] if all the pages in the memory range have the same host NUMA node ID as their preferred location or it will be [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVALID`]
    ///   if either all the pages don't have the same preferred location or some of the pages don't have a preferred location at all.
    ///   Note that the actual location type of the pages in the memory range at the time of the query may be different from the preferred
    ///   location type.
    ///   + [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID`]: If this attribute is specified, data will be interpreted as a 32-bit integer, and dataSize must be 4. If the [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`] query for the same address range returns [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], it will be a valid device ordinal or if it returns [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored.
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`]: If this attribute is specified, data will be interpreted as a `CUmemLocationType`, and dataSize must be sizeof(CUmemLocationType). The result returned will be the last location to which all pages in the memory range were
    ///   prefetched explicitly via [`cuMemPrefetchAsync_v2`]. The `CUmemLocationType` returned will be [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`] if the last prefetch location was a GPU or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST`] if it was the CPU or [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`] if the last prefetch location was a specific host NUMA node. If any page in the memory range was never explicitly prefetched
    ///   or if all pages were not prefetched to the same location, `CUmemLocationType` will be [`CUmemLocationType::CU_MEM_LOCATION_TYPE_INVALID`]. Note that this simply returns the last location type that the application requested
    ///   to prefetch the memory range to. It gives no indication as to whether the prefetch operation to that location has completed
    ///   or even begun.
    ///   + [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID`]: If this attribute is specified, data will be interpreted as a 32-bit integer, and dataSize must be 4. If the [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`] query for the same address range returns [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_DEVICE`], it will be a valid device ordinal or if it returns [`CUmemLocationType_enum::CU_MEM_LOCATION_TYPE_HOST_NUMA`], it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function exhibits [asynchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/api-sync-behavior.html#api-sync-behavior__memcpy-async) behavior for most use cases.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    ///
    /// **See also:**
    ///
    /// [`cuMemRangeGetAttributes`], [`cuMemPrefetchAsync_v2`], [`cuMemAdvise_v2`], [cudaMemRangeGetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g8048f6ea5ad77917444567656c140c5a).
    ///
    /// # Parameters
    ///
    /// - `data`: A pointers to a memory location where the result of each attribute query will be written to.
    /// - `dataSize`: Array containing the size of data.
    /// - `attribute`: The attribute to query.
    /// - `devPtr`: Start of the range to query.
    /// - `count`: Size of the range to query.
    pub fn cuMemRangeGetAttribute(
        data: *mut ::core::ffi::c_void,
        dataSize: size_t,
        attribute: CUmem_range_attribute,
        devPtr: CUdeviceptr,
        count: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Query attributes of a given memory range.
    ///
    /// Query attributes of the memory range starting at devPtr with a size of count bytes. The memory range must refer to managed memory allocated via [`cuMemAllocManaged`] or declared via __managed__ variables. The attributes array will be interpreted to have numAttributes entries. The dataSizes array will also be interpreted to have numAttributes entries. The results of the query will be stored in data.
    ///
    /// The list of supported attributes are given below. Please refer to [`cuMemRangeGetAttribute`] for attribute descriptions and restrictions.
    ///
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_READ_MOSTLY`]
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION`]
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_ACCESSED_BY`]
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION`]
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_TYPE`]
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_PREFERRED_LOCATION_ID`]
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_TYPE`]
    /// * [`CUmem_range_attribute_enum::CU_MEM_RANGE_ATTRIBUTE_LAST_PREFETCH_LOCATION_ID`]
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuMemRangeGetAttribute`], [`cuMemAdvise_v2`], [`cuMemPrefetchAsync_v2`], [cudaMemRangeGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g1a9199e7709c7817d1c715cfbe174d05).
    ///
    /// # Parameters
    ///
    /// - `data`: A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written
    /// ```text
    /// to.
    /// ```
    /// - `dataSizes`: Array containing the sizes of each result.
    /// - `attributes`: An array of attributes to query (numAttributes and the number of attributes in this array should match).
    /// - `numAttributes`: Number of attributes to query.
    /// - `devPtr`: Start of the range to query.
    /// - `count`: Size of the range to query.
    pub fn cuMemRangeGetAttributes(
        data: *mut *mut ::core::ffi::c_void,
        dataSizes: *mut size_t,
        attributes: *mut CUmem_range_attribute,
        numAttributes: size_t,
        devPtr: CUdeviceptr,
        count: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Set attributes on a previously allocated memory region.
    ///
    /// The supported attributes are:
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`]:
    ///
    /// A boolean attribute that can either be set (1) or unset (0). When set, the region of memory that ptr points to is guaranteed to always synchronize memory operations that are synchronous. If there are some previously initiated
    /// synchronous memory operations that are pending when this attribute is set, the function does not return until those memory
    /// operations are complete. See further documentation in the section titled "API synchronization behavior" to learn more about
    /// cases when synchronous memory operations can exhibit asynchronous behavior. value will be considered as a pointer to an unsigned integer to which this attribute is to be set.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuPointerGetAttribute`], [`cuPointerGetAttributes`], [`cuMemAlloc_v2`], [`cuMemFree_v2`], [`cuMemAllocHost_v2`], [`cuMemFreeHost`], [`cuMemHostAlloc`], [`cuMemHostRegister_v2`], [`cuMemHostUnregister`].
    ///
    /// # Parameters
    ///
    /// - `value`: Pointer to memory containing the value to be set.
    /// - `attribute`: Pointer attribute to set.
    /// - `ptr`: Pointer to a memory region allocated using CUDA memory allocation APIs.
    pub fn cuPointerSetAttribute(
        value: *const ::core::ffi::c_void,
        attribute: CUpointer_attribute,
        ptr: CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns information about a pointer.
    ///
    /// The supported attributes are (refer to [`cuPointerGetAttribute`] for attribute descriptions and restrictions):
    ///
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_CONTEXT`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MEMORY_TYPE`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_POINTER`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_HOST_POINTER`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_BUFFER_ID`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_MANAGED`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_DEVICE_ORDINAL`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_RANGE_START_ADDR`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_RANGE_SIZE`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MAPPED`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_LEGACY_CUDA_IPC_CAPABLE`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE`]
    /// * [`CUpointer_attribute_enum::CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE`]
    ///
    /// Unlike [`cuPointerGetAttribute`], this function will not return an error when the ptr encountered is not a valid CUDA pointer. Instead, the attributes are assigned default NULL values and [`CUresult::CUDA_SUCCESS`] is returned.
    ///
    /// If ptr was not allocated by, mapped by, or registered with a [`CUcontext`] which uses UVA (Unified Virtual Addressing), [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuPointerGetAttribute`], [`cuPointerSetAttribute`], [cudaPointerGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__UNIFIED.html#group__CUDART__UNIFIED_1gd89830e17d399c064a2f3c3fa8bb4390).
    ///
    /// # Parameters
    ///
    /// - `numAttributes`: Number of attributes to query.
    /// - `attributes`: An array of attributes to query (numAttributes and the number of attributes in this array should match).
    /// - `data`: A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written
    /// ```text
    /// to.
    /// ```
    /// - `ptr`: Pointer to query.
    pub fn cuPointerGetAttributes(
        numAttributes: ::core::ffi::c_uint,
        attributes: *mut CUpointer_attribute,
        data: *mut *mut ::core::ffi::c_void,
        ptr: CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Create a stream.
    ///
    /// Creates a stream and returns a handle in phStream. The Flags argument determines behaviors of the stream.
    ///
    /// Valid values for Flags are:
    ///
    /// * [`CUstream_flags_enum::CU_STREAM_DEFAULT`]: Default stream creation flag.
    /// * [`CUstream_flags_enum::CU_STREAM_NON_BLOCKING`]: Specifies that work running in the created stream may run concurrently with work in stream 0 (the NULL stream), and that
    ///   the created stream should perform no implicit synchronization with stream 0.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreateWithPriority`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [cudaStreamCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3).
    ///
    /// # Parameters
    ///
    /// - `phStream`: Returned newly created stream.
    /// - `Flags`: Parameters for stream creation.
    pub fn cuStreamCreate(
        phStream: *mut CUstream,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Create a stream with the given priority.
    ///
    /// Creates a stream with the specified priority and returns a handle in phStream. This affects the scheduling priority of work in the stream. Priorities provide a hint to preferentially run work with higher
    /// priority when possible, but do not preempt already-running work or provide any other functional guarantee on execution order.
    ///
    /// priority follows a convention where lower numbers represent higher priorities. '0' represents default priority. The range of meaningful
    /// numerical priorities can be queried using [`cuCtxGetStreamPriorityRange`]. If the specified priority is outside the numerical range returned by [`cuCtxGetStreamPriorityRange`], it will automatically be clamped to the lowest or the highest number in the range.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Stream priorities are supported only on GPUs with compute capability 3.5 or higher.
    /// * In the current implementation, only compute kernels launched in priority streams are affected by the stream's priority. Stream
    ///   priorities have no effect on host-to-device and device-to-host memory operations.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreate`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], [`cuCtxGetStreamPriorityRange`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], [cudaStreamCreateWithPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540).
    ///
    /// # Parameters
    ///
    /// - `phStream`: Returned newly created stream.
    /// - `flags`: Flags for stream creation. See [`cuStreamCreate`] for a list of valid flags.
    /// - `priority`: Stream priority. Lower numbers represent higher priorities. See [`cuCtxGetStreamPriorityRange`] for more information about meaningful stream priorities that can be passed.
    pub fn cuStreamCreateWithPriority(
        phStream: *mut CUstream,
        flags: ::core::ffi::c_uint,
        priority: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Begins capture to CIG on a stream.
    ///
    /// Begin CIG (CUDA in Graphics) capture on hStream for the graphics API as provided in streamCigCaptureParams. When a stream is in CIG capture mode, all operations pushed into the stream will not be executed, but will instead be captured
    /// into a graphics API command list/command buffer. All kernel launches and memory copy/memory set operations on the CIG stream
    /// will be recorded. When the command list is executed by the graphics API, all the stream's operations will execute in order
    /// along with other graphics API commands in the command list.
    ///
    /// CIG stream capture may not be initiated if stream is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if
    /// the stream is not already in CIG capture mode.
    ///
    /// The context must be also created in CIG mode previously, otherwise this operation will fail and [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] will be returned.
    ///
    /// Data from the graphics client can be shared with CUDA via the streamSharedData in streamCigCaptureParams. The format of streamSharedData is dependent on the type of the graphics client. For D3D12, streamSharedData is an ID3D12CommandList object pointer. The command list must be in ready state for recording commands whenever kernels are
    /// launched on the stream. The command list provided must belong to the graphics API device that the CIG context was created
    /// with, otherwise the behavior will be undefined.
    ///
    /// The stream object may not be destroyed until its associated command list has finished executing on the GPU. The command list/command
    /// buffer used for capture may not be submitted for execution before a call to [`cuStreamEndCaptureToCig`] is made on the associated stream.
    ///
    /// Graphics resources to be accessed by work recorded on the CIG stream must use UAV barriers on the command list prior to recording
    /// work that accesses them on the stream.
    ///
    /// Resubmission of the same recorded command list is not allowed. Further more, care must be taken for the order of execution
    /// of the recorded CUDA work with regards to other CUDA work submitted under the same CIG context. Out-of-order execution can
    /// lead to device hangs or exceptions.
    ///
    /// CIG capture mode operates similarly to cuStreamBeginCapture with the [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`] option. There are additional limitations to streams in CIG capture mode. The following functions are not allowed for CIG
    /// streams whether directly or indirectly via a recorded graph launch: [`cuLaunchHostFunc`]cuStreamAddCallback [`cuStreamSynchronize`]cuStreamWaitValue32 [`cuStreamWaitValue64_v2`]cuStreamBatchMemOp [`cuStreamBeginCapture_v2`]cuStreamBeginCaptureToGraph [`cuMemAllocAsync`][`cuMemFreeAsync`]
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamEndCaptureToCig`], [`cuStreamBeginCapture_v2`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream in which to initiate capture to CIG.
    /// - `streamCigCaptureParams`: CIG capture parameters.
    pub fn cuStreamBeginCaptureToCig(
        hStream: CUstream,
        streamCigCaptureParams: *mut CUstreamCigCaptureParams,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Ends CIG capture on a stream.
    ///
    /// End CIG capture on hStream. Capture must have been initiated on hStream via a call to [`cuStreamBeginCaptureToCig`]. Once this function is called, hStream will exit CIG capture mode and return to its original state, thus removing all CIG stream restrictions. Also, the command
    /// list/command buffer that was associated with hStream in the previous call to [`cuStreamBeginCaptureToCig`] is now allowed to be submitted for execution on the graphics API. However, the stream may not be destroyed until execution
    /// of the command list is fully done on the GPU. This requirements extends also to all streams dependent on the CIG stream (e.g.
    /// via event waits).
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamBeginCaptureToCig`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to end CIG capture.
    pub fn cuStreamEndCaptureToCig(hStream: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Query the priority of a given stream.
    ///
    /// Query the priority of a stream created using [`cuStreamCreate`], [`cuStreamCreateWithPriority`] or [`cuGreenCtxStreamCreate`] and return the priority in priority. Note that if the stream was created with a priority outside the numerical range returned by [`cuCtxGetStreamPriorityRange`], this function returns the clamped priority. See [`cuStreamCreateWithPriority`] for details about priority clamping.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreate`], [`cuStreamCreateWithPriority`], [`cuGreenCtxStreamCreate`], [`cuCtxGetStreamPriorityRange`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [cudaStreamGetPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g192bb727d15c4407c119747de7d198a6).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `priority`: Pointer to a signed integer in which the stream's priority is returned.
    pub fn cuStreamGetPriority(
        hStream: CUstream,
        priority: *mut ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the device handle of the stream.
    ///
    /// Returns in \*device the device handle of the stream
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreate`], [`cuGreenCtxStreamCreate`], [`cuStreamGetFlags`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `device`: Returns the device to which a stream belongs.
    pub fn cuStreamGetDevice(hStream: CUstream, device: *mut CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Query the flags of a given stream.
    ///
    /// Query the flags of a stream created using [`cuStreamCreate`], [`cuStreamCreateWithPriority`] or [`cuGreenCtxStreamCreate`] and return the flags in flags.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreate`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], [cudaStreamGetFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1ga7f311f88126d751b9a7d3302ad6d0f8), [`cuStreamGetDevice`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `flags`: Pointer to an unsigned integer in which the stream's flags are returned The value returned in flags is a logical 'OR' of all flags that were used while creating this stream. See [`cuStreamCreate`] for the list of valid flags.
    pub fn cuStreamGetFlags(
        hStream: CUstream,
        flags: *mut ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the unique Id associated with the stream handle supplied.
    ///
    /// Returns in streamId the unique Id which is associated with the given stream handle. The Id is unique for the life of the program.
    ///
    /// The stream handle hStream can refer to any of the following:
    ///
    /// * a stream created via any of the CUDA driver APIs such as [`cuStreamCreate`] and [`cuStreamCreateWithPriority`], or their runtime API equivalents such as [cudaStreamCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da), [cudaStreamCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3) and [cudaStreamCreateWithPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540). Passing an invalid handle will result in undefined behavior.
    /// * any of the special streams such as the NULL stream, `CU_STREAM_LEGACY` and `CU_STREAM_PER_THREAD`. The runtime API equivalents of these are also accepted, which are NULL, [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g4e62d09dde16ba457b0a97f3a5262246) and [cudaStreamPerThread](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g7b7129befd6f52708309acafd1c46197) respectively.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreate`], [`cuStreamGetPriority`], [cudaStreamGetId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g5799ae8dd744e561dfdeda02c53e82df).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `streamId`: Pointer to store the Id of the stream.
    pub fn cuStreamGetId(
        hStream: CUstream,
        streamId: *mut ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Query the context associated with a stream.
    ///
    /// Returns the CUDA context that the stream is associated with.
    ///
    /// If the stream was created via the API [`cuGreenCtxStreamCreate`], the returned context is equivalent to the one returned by [`cuCtxFromGreenCtx`] on the green context associated with the stream at creation time.
    ///
    /// The stream handle hStream can refer to any of the following:
    ///
    /// * a stream created via any of the CUDA driver APIs such as [`cuStreamCreate`] and [`cuStreamCreateWithPriority`], or their runtime API equivalents such as [cudaStreamCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da), [cudaStreamCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3) and [cudaStreamCreateWithPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540). The returned context is the context that was active in the calling thread when the stream was created. Passing an invalid
    ///   handle will result in undefined behavior.
    /// * any of the special streams such as the NULL stream, `CU_STREAM_LEGACY` and `CU_STREAM_PER_THREAD`. The runtime API equivalents of these are also accepted, which are NULL, [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g4e62d09dde16ba457b0a97f3a5262246) and [cudaStreamPerThread](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g7b7129befd6f52708309acafd1c46197) respectively. Specifying any of the special handles will return the context current to the calling thread. If no context
    ///   is current to the calling thread, [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreateWithPriority`], [`cuStreamGetPriority`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [cudaStreamCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `pctx`: Returned context associated with the stream.
    pub fn cuStreamGetCtx(hStream: CUstream, pctx: *mut CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Query the contexts associated with a stream.
    ///
    /// Returns the contexts that the stream is associated with.
    ///
    /// If the stream is associated with a green context, the API returns the green context in pGreenCtx and the primary context of the associated device in pCtx.
    ///
    /// If the stream is associated with a regular context, the API returns the regular context in pCtx and NULL in pGreenCtx.
    ///
    /// The stream handle hStream can refer to any of the following:
    ///
    /// * a stream created via any of the CUDA driver APIs such as [`cuStreamCreate`], [`cuStreamCreateWithPriority`] and [`cuGreenCtxStreamCreate`], or their runtime API equivalents such as [cudaStreamCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da), [cudaStreamCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3) and [cudaStreamCreateWithPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540). Passing an invalid handle will result in undefined behavior.
    /// * any of the special streams such as the NULL stream, `CU_STREAM_LEGACY` and `CU_STREAM_PER_THREAD`. The runtime API equivalents of these are also accepted, which are NULL, [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g4e62d09dde16ba457b0a97f3a5262246) and [cudaStreamPerThread](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g7b7129befd6f52708309acafd1c46197) respectively. If any of the special handles are specified, the API will operate on the context current to the calling thread.
    ///   If a green context (that was converted via [`cuCtxFromGreenCtx`] before setting it current) is current to the calling thread, the API will return the green context in pGreenCtx and the primary context of the associated device in pCtx. If a regular context is current, the API returns the regular context in pCtx and NULL in pGreenCtx. Note that specifying `CU_STREAM_PER_THREAD` or [cudaStreamPerThread](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g7b7129befd6f52708309acafd1c46197) will return [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] if a green context is current to the calling thread. If no context is current to the calling thread, [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreate`], [cudaStreamCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3),.
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `pCtx`: Returned regular context associated with the stream.
    /// - `pGreenCtx`: Returned green context if the stream is associated with a green context or NULL if not.
    pub fn cuStreamGetCtx_v2(
        hStream: CUstream,
        pCtx: *mut CUcontext,
        pGreenCtx: *mut CUgreenCtx,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Make a compute stream wait on an event.
    ///
    /// Makes all future work submitted to hStream wait for all work captured in hEvent. See [`cuEventRecord`] for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable.
    /// hEvent may be from a different context or device than hStream.
    ///
    /// flags include:
    ///
    /// * [`CUevent_wait_flags_enum::CU_EVENT_WAIT_DEFAULT`]: Default event creation flag.
    /// * [`CUevent_wait_flags_enum::CU_EVENT_WAIT_EXTERNAL`]: Event is captured in the graph as an external event node when performing stream capture. This flag is invalid outside of
    ///   stream capture.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuEventRecord`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], [`cuStreamDestroy_v2`], [cudaStreamWaitEvent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g7840e3984799941a61839de40413d1d9).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to wait.
    /// - `hEvent`: Event to wait on (may not be NULL).
    /// - `Flags`: See CUevent_capture_flags.
    pub fn cuStreamWaitEvent(
        hStream: CUstream,
        hEvent: CUevent,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Add a callback to a compute stream.
    ///
    /// Note:
    ///
    /// This function is slated for eventual deprecation and removal. If you do not require the callback to execute in case of a device
    /// error, consider using [`cuLaunchHostFunc`]. Additionally, this function is not supported with [`cuStreamBeginCapture_v2`] and [`cuStreamEndCapture`], unlike [`cuLaunchHostFunc`].
    ///
    /// Adds a callback to be called on the host after all currently enqueued items in the stream have completed. For each cuStreamAddCallback
    /// call, the callback will be executed exactly once. The callback will block later work in the stream until it is finished.
    ///
    /// The callback may be passed [`cudaError_enum::CUDA_SUCCESS`] or an error code. In the event of a device error, all subsequently executed callbacks will receive an appropriate `CUresult`.
    ///
    /// Callbacks must not make any CUDA API calls. Attempting to use a CUDA API will result in [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`]. Callbacks must not perform any synchronization that may depend on outstanding device work or other callbacks that are not
    /// mandated to run earlier. Callbacks without a mandated order (in independent streams) execute in undefined order and may be
    /// serialized.
    ///
    /// For the purposes of Unified Memory, callback execution makes a number of guarantees:
    ///
    /// * The callback stream is considered idle for the duration of the callback. Thus, for example, a callback may always use memory
    ///   attached to the callback stream.
    /// * The start of execution of a callback has the same effect as synchronizing an event recorded in the same stream immediately
    ///   prior to the callback. It thus synchronizes streams which have been "joined" prior to the callback.
    /// * Adding device work to any stream does not have the effect of making the stream active until all preceding host functions and
    ///   stream callbacks have executed. Thus, for example, a callback might use global attached memory even if work has been added
    ///   to another stream, if the work has been ordered behind the callback with an event.
    /// * Completion of a callback does not cause a stream to become active except as described above. The callback stream will remain
    ///   idle if no device work follows the callback, and will remain idle across consecutive callbacks without device work in between.
    ///   Thus, for example, stream synchronization can be done by signaling from a callback at the end of the stream.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamWaitEvent`], [`cuStreamDestroy_v2`], [`cuMemAllocManaged`], [`cuStreamAttachMemAsync`], [`cuLaunchHostFunc`], [cudaStreamAddCallback](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g74aa9f4b1c2f12d994bf13876a5a2498).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to add callback to.
    /// - `callback`: The function to call once preceding stream operations are complete.
    /// - `userData`: User specified data to be passed to the callback function.
    /// - `flags`: Reserved for future use, must be 0.
    pub fn cuStreamAddCallback(
        hStream: CUstream,
        callback: CUstreamCallback,
        userData: *mut ::core::ffi::c_void,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Begins graph capture on a stream.
    ///
    /// Begin graph capture on hStream. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured
    /// into a graph, which will be returned via [`cuStreamEndCapture`]. Capture may not be initiated if stream is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if
    /// the stream is not already in capture mode. The capture mode may be queried via [`cuStreamIsCapturing`]. A unique id representing the capture sequence may be queried via [`cuStreamGetCaptureInfo_v3`].
    ///
    /// If mode is not [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], [`cuStreamEndCapture`] must be called on this stream from the same thread.
    ///
    /// Note:
    ///
    /// Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface
    /// reference is undefined behavior. This restriction does not apply to texture and surface objects.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamIsCapturing`], [`cuStreamEndCapture`], [`cuThreadExchangeStreamCaptureMode`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream in which to initiate capture.
    /// - `mode`: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see
    /// [`cuThreadExchangeStreamCaptureMode`].
    pub fn cuStreamBeginCapture_v2(
        hStream: CUstream,
        mode: CUstreamCaptureMode,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Begins graph capture on a stream to an existing graph.
    ///
    /// Begin graph capture on hStream, placing new nodes into an existing graph. When a stream is in capture mode, all operations pushed into the stream will not
    /// be executed, but will instead be captured into hGraph. The graph will not be instantiable until the user calls [`cuStreamEndCapture`].
    ///
    /// Capture may not be initiated if stream is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if
    /// the stream is not already in capture mode. The capture mode may be queried via [`cuStreamIsCapturing`]. A unique id representing the capture sequence may be queried via [`cuStreamGetCaptureInfo_v3`].
    ///
    /// If mode is not [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], [`cuStreamEndCapture`] must be called on this stream from the same thread.
    ///
    /// Note:
    ///
    /// Kernels captured using this API must not use texture and surface references. Reading or writing through any texture or surface
    /// reference is undefined behavior. This restriction does not apply to texture and surface objects.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamBeginCapture_v2`], [`cuStreamCreate`], [`cuStreamIsCapturing`], [`cuStreamEndCapture`], [`cuThreadExchangeStreamCaptureMode`], [`cuGraphAddNode_v2`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream in which to initiate capture.
    /// - `hGraph`: Graph to capture into.
    /// - `dependencies`: Dependencies of the first node captured in the stream. Can be NULL if numDependencies is 0.
    /// - `dependencyData`: Optional array of data associated with each dependency.
    /// - `numDependencies`: Number of dependencies.
    /// - `mode`: Controls the interaction of this capture sequence with other API calls that are potentially unsafe. For more details see
    /// [`cuThreadExchangeStreamCaptureMode`].
    pub fn cuStreamBeginCaptureToGraph(
        hStream: CUstream,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        dependencyData: *const CUgraphEdgeData,
        numDependencies: size_t,
        mode: CUstreamCaptureMode,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Swaps the stream capture interaction mode for a thread.
    ///
    /// Sets the calling thread's stream capture interaction mode to the value contained in \*mode, and overwrites \*mode with the previous mode for the thread. To facilitate deterministic behavior across function or module boundaries, callers
    /// are encouraged to use this API in a push-pop fashion:
    ///
    /// ```text
    /// CUstreamCaptureMode mode = desiredMode;
    /// cuThreadExchangeStreamCaptureMode(&mode);
    /// ...
    /// cuThreadExchangeStreamCaptureMode(&mode); // restore previous mode
    /// ```
    ///
    /// During stream capture (see [`cuStreamBeginCapture_v2`]), some actions, such as a call to [cudaMalloc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g37d37965bfb4803b6d4e59ff26856356), may be unsafe. In the case of [cudaMalloc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1g37d37965bfb4803b6d4e59ff26856356), the operation is not enqueued asynchronously to a stream, and is not observed by stream capture. Therefore, if the sequence
    /// of operations captured via [`cuStreamBeginCapture_v2`] depended on the allocation being replayed whenever the graph is launched, the captured graph would be invalid.
    ///
    /// Therefore, stream capture places restrictions on API calls that can be made within or concurrently to a [`cuStreamBeginCapture_v2`]-[`cuStreamEndCapture`] sequence. This behavior can be controlled via this API and flags to [`cuStreamBeginCapture_v2`].
    ///
    /// A thread's mode is one of the following:
    ///
    /// * [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_GLOBAL`]: This is the default mode. If the local thread has an ongoing capture sequence that was not initiated with [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`] at cuStreamBeginCapture, or if any other thread has a concurrent capture sequence initiated with [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_GLOBAL`], this thread is prohibited from potentially unsafe API calls.
    /// * [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_THREAD_LOCAL`]: If the local thread has an ongoing capture sequence not initiated with [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], it is prohibited from potentially unsafe API calls. Concurrent capture sequences in other threads are ignored.
    /// * [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`]: The local thread is not prohibited from potentially unsafe API calls. Note that the thread is still prohibited from API calls
    ///   which necessarily conflict with stream capture, for example, attempting [`cuEventQuery`] on an event that was last recorded inside a capture sequence.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamBeginCapture_v2`].
    ///
    /// # Parameters
    ///
    /// - `mode`: Pointer to mode value to swap with the current mode.
    pub fn cuThreadExchangeStreamCaptureMode(mode: *mut CUstreamCaptureMode) -> CUresult;
}
unsafe extern "C" {
    /// Ends capture on a stream, returning the captured graph.
    ///
    /// End capture on hStream, returning the captured graph via phGraph. Capture must have been initiated on hStream via a call to [`cuStreamBeginCapture_v2`]. If capture was invalidated, due to a violation of the rules of stream capture, then a NULL graph will be returned.
    ///
    /// If the mode argument to [`cuStreamBeginCapture_v2`] was not [`CUstreamCaptureMode::CU_STREAM_CAPTURE_MODE_RELAXED`], this call must be from the same thread as [`cuStreamBeginCapture_v2`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamBeginCapture_v2`], [`cuStreamIsCapturing`], [`cuGraphDestroy`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to query.
    /// - `phGraph`: The captured graph.
    pub fn cuStreamEndCapture(hStream: CUstream, phGraph: *mut CUgraph) -> CUresult;
}
unsafe extern "C" {
    /// Returns a stream's capture status.
    ///
    /// Return the capture status of hStream via captureStatus. After a successful call, \*captureStatus will contain one of the following:
    ///
    /// * [`CUstreamCaptureStatus_enum::CU_STREAM_CAPTURE_STATUS_NONE`]: The stream is not capturing.
    /// * [`CUstreamCaptureStatus_enum::CU_STREAM_CAPTURE_STATUS_ACTIVE`]: The stream is capturing.
    /// * [`CUstreamCaptureStatus_enum::CU_STREAM_CAPTURE_STATUS_INVALIDATED`]: The stream was capturing but an error has invalidated the capture sequence. The capture sequence must be terminated with
    ///   [`cuStreamEndCapture`] on the stream where it was initiated in order to continue using hStream.
    ///
    /// Note that, if this is called on `CU_STREAM_LEGACY` (the "null stream") while a blocking stream in the same context is capturing, it will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`] and \*captureStatus is unspecified after the call. The blocking stream capture is not invalidated.
    ///
    /// When a blocking stream is capturing, the legacy stream is in an unusable state until the blocking stream capture is terminated.
    /// The legacy stream is not supported for stream capture, but attempted use would have an implicit dependency on the capturing
    /// stream(s).
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamBeginCapture_v2`], [`cuStreamEndCapture`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to query.
    /// - `captureStatus`: Returns the stream's capture status.
    pub fn cuStreamIsCapturing(
        hStream: CUstream,
        captureStatus: *mut CUstreamCaptureStatus,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Query a stream's capture state.
    ///
    /// Query stream state related to stream capture.
    ///
    /// If called on `CU_STREAM_LEGACY` (the "null stream") while a stream not created with [`CUstream_flags_enum::CU_STREAM_NON_BLOCKING`] is capturing, returns [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_IMPLICIT`].
    ///
    /// Valid data (other than capture status) is returned only if both of the following are true:
    ///
    /// * the call returns [`CUresult::CUDA_SUCCESS`]
    /// * the returned capture status is [`CUstreamCaptureStatus_enum::CU_STREAM_CAPTURE_STATUS_ACTIVE`]
    ///
    /// If edgeData_out is non-NULL then dependencies_out must be as well. If dependencies_out is non-NULL and edgeData_out is NULL, but there is non-zero edge data for one or more of the current stream dependencies, the call will return [`cudaError_enum::CUDA_ERROR_LOSSY_QUERY`].
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamBeginCapture_v2`], [`cuStreamIsCapturing`], [`cuStreamUpdateCaptureDependencies_v2`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: The stream to query.
    /// - `captureStatus_out`: Location to return the capture status of the stream; required.
    /// - `id_out`: Optional location to return an id for the capture sequence, which is unique over the lifetime of the process.
    /// - `graph_out`: Optional location to return the graph being captured into. All operations other than destroy and node removal are permitted
    /// on the graph while the capture sequence is in progress. This API does not transfer ownership of the graph, which is transferred
    /// or destroyed at [`cuStreamEndCapture`]. Note that the graph handle may be invalidated before end of capture for certain errors. Nodes that are or become unreachable
    /// from the original stream at [`cuStreamEndCapture`] due to direct actions on the graph do not trigger [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNJOINED`].
    /// - `dependencies_out`: Optional location to store a pointer to an array of nodes. The next node to be captured in the stream will depend on this
    /// set of nodes, absent operations such as event wait which modify this set. The array pointer is valid until the next API call
    /// which operates on the stream or until the capture is terminated. The node handles may be copied out and are valid until they
    /// or the graph is destroyed. The driver-owned array may also be passed directly to APIs that operate on the graph (not the stream)
    /// without copying.
    /// - `edgeData_out`: Optional location to store a pointer to an array of graph edge data. This array parallels dependencies_out; the next node to be added has an edge to dependencies_out\[i\] with annotation edgeData_out\[i\] for each i. The array pointer is valid until the next API call which operates on the stream or until the capture is terminated.
    /// - `numDependencies_out`: Optional location to store the size of the array returned in dependencies_out.
    pub fn cuStreamGetCaptureInfo_v3(
        hStream: CUstream,
        captureStatus_out: *mut CUstreamCaptureStatus,
        id_out: *mut cuuint64_t,
        graph_out: *mut CUgraph,
        dependencies_out: *mut *const CUgraphNode,
        edgeData_out: *mut *const CUgraphEdgeData,
        numDependencies_out: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Update the set of dependencies in a capturing stream.
    ///
    /// Modifies the dependency set of a capturing stream. The dependency set is the set of nodes that the next captured node in the
    /// stream will depend on along with the edge data for those dependencies.
    ///
    /// Valid flags are [`CUstreamUpdateCaptureDependencies_flags_enum::CU_STREAM_ADD_CAPTURE_DEPENDENCIES`] and [`CUstreamUpdateCaptureDependencies_flags_enum::CU_STREAM_SET_CAPTURE_DEPENDENCIES`]. These control whether the set passed to the API is added to the existing set or replaces it. A flags value of 0 defaults
    /// to [`CUstreamUpdateCaptureDependencies_flags_enum::CU_STREAM_ADD_CAPTURE_DEPENDENCIES`].
    ///
    /// Nodes that are removed from the dependency set via this API do not result in [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNJOINED`] if they are unreachable from the stream at [`cuStreamEndCapture`].
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_ILLEGAL_STATE`] if the stream is not capturing.
    ///
    /// **See also:**
    ///
    /// [`cuStreamBeginCapture_v2`], [`cuStreamGetCaptureInfo_v3`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: The stream to update.
    /// - `dependencies`: The set of dependencies to add.
    /// - `dependencyData`: Optional array of data associated with each dependency.
    /// - `numDependencies`: The size of the dependencies array.
    /// - `flags`: See above.
    pub fn cuStreamUpdateCaptureDependencies_v2(
        hStream: CUstream,
        dependencies: *mut CUgraphNode,
        dependencyData: *const CUgraphEdgeData,
        numDependencies: size_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Attach memory to a stream asynchronously.
    ///
    /// Enqueues an operation in hStream to specify stream association of length bytes of memory starting from dptr. This function is a stream-ordered operation, meaning that it is dependent on, and will only take effect when, previous work
    /// in stream has completed. Any previous association is automatically replaced.
    ///
    /// dptr must point to one of the following types of memories:
    ///
    /// * managed memory declared using the __managed__ keyword or allocated with [`cuMemAllocManaged`].
    /// * a valid host-accessible region of system-allocated pageable memory. This type of memory may only be specified if the device
    ///   associated with the stream reports a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS`].
    ///
    /// For managed allocations, length must be either zero or the entire allocation's size. Both indicate that the entire allocation's stream association is being
    /// changed. Currently, it is not possible to change stream association for a portion of a managed allocation.
    ///
    /// For pageable host allocations, length must be non-zero.
    ///
    /// The stream association is specified using flags which must be one of `CUmemAttach_flags`. If the [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`] flag is specified, the memory can be accessed by any stream on any device. If the [`CUmemAttach_flags_enum::CU_MEM_ATTACH_HOST`] flag is specified, the program makes a guarantee that it won't access the memory on the device from any stream on a device
    /// that has a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If the [`CUmemAttach_flags_enum::CU_MEM_ATTACH_SINGLE`] flag is specified and hStream is associated with a device that has a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`], the program makes a guarantee that it will only access the memory on the device from hStream. It is illegal to attach singly to the NULL stream, because the NULL stream is a virtual global stream and not a specific
    /// stream. An error will be returned in this case.
    ///
    /// When memory is associated with a single stream, the Unified Memory system will allow CPU access to this memory region so long
    /// as all operations in hStream have completed, regardless of whether other streams are active. In effect, this constrains exclusive ownership of the managed
    /// memory region by an active GPU to per-stream activity instead of whole-GPU activity.
    ///
    /// Accessing memory on the device from streams that are not associated with it will produce undefined results. No error checking
    /// is performed by the Unified Memory system to ensure that kernels launched into other streams do not access this region.
    ///
    /// It is a program's responsibility to order calls to [`cuStreamAttachMemAsync`] via events, synchronization or other means to ensure legal access to memory at all times. Data visibility and coherency will
    /// be changed appropriately for all kernels which follow a stream-association change.
    ///
    /// If hStream is destroyed while data is associated with it, the association is removed and the association reverts to the default visibility
    /// of the allocation as specified at [`cuMemAllocManaged`]. For __managed__ variables, the default association is always [`CUmemAttach_flags_enum::CU_MEM_ATTACH_GLOBAL`]. Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won't happen
    /// until all work in the stream has completed.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamWaitEvent`], [`cuStreamDestroy_v2`], [`cuMemAllocManaged`], [cudaStreamAttachMemAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g496353d630c29c44a2e33f531a3944d1).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream in which to enqueue the attach operation.
    /// - `dptr`: Pointer to memory (must be a pointer to managed memory or to a valid host-accessible region of system-allocated pageable
    /// ```text
    /// memory)
    /// ```
    /// - `length`: Length of memory.
    /// - `flags`: Must be one of `CUmemAttach_flags`.
    pub fn cuStreamAttachMemAsync(
        hStream: CUstream,
        dptr: CUdeviceptr,
        length: size_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Determine status of a compute stream.
    ///
    /// Returns [`cudaError_enum::CUDA_SUCCESS`] if all operations in the stream specified by hStream have completed, or [`cudaError_enum::CUDA_ERROR_NOT_READY`] if not.
    ///
    /// For the purposes of Unified Memory, a return value of [`cudaError_enum::CUDA_SUCCESS`] is equivalent to having called [`cuStreamSynchronize`].
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamWaitEvent`], [`cuStreamDestroy_v2`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], [cudaStreamQuery](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to query status of.
    pub fn cuStreamQuery(hStream: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Wait until a stream's tasks are completed.
    ///
    /// Waits until the device has completed all operations in the stream specified by hStream. If the context was created with the [`CUctx_flags_enum::CU_CTX_SCHED_BLOCKING_SYNC`] flag, the CPU thread will block until the stream is finished with all of its tasks.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamDestroy_v2`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamAddCallback`], [cudaStreamSynchronize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g82b5784f674c17c6df64affe618bf45e).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to wait for.
    pub fn cuStreamSynchronize(hStream: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Destroys a stream.
    ///
    /// Destroys the stream specified by hStream.
    ///
    /// In case the device is still doing work in the stream hStream when [`cuStreamDestroy_v2`] is called, the function will return immediately and the resources associated with hStream will be released automatically once the device has completed all work in hStream.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], [cudaStreamDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gfda584f1788ca983cb21c5f4d2033a62).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to destroy.
    pub fn cuStreamDestroy_v2(hStream: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Copies attributes from source stream to destination stream.
    ///
    /// Copies attributes from source stream src to destination stream dst. Both streams must have the same context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`CUaccessPolicyWindow`].
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination stream.
    /// - `src`: Source stream For list of attributes see CUstreamAttrID.
    pub fn cuStreamCopyAttributes(dst: CUstream, src: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Queries stream attribute.
    ///
    /// Queries attribute attr from hStream and stores it in corresponding member of value_out.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`CUaccessPolicyWindow`].
    pub fn cuStreamGetAttribute(
        hStream: CUstream,
        attr: CUstreamAttrID,
        value_out: *mut CUstreamAttrValue,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets stream attribute.
    ///
    /// Sets attribute attr on hStream from corresponding attribute of value. The updated attribute will be applied to subsequent work submitted to the stream. It will not affect previously submitted
    /// work.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`CUaccessPolicyWindow`].
    pub fn cuStreamSetAttribute(
        hStream: CUstream,
        attr: CUstreamAttrID,
        value: *const CUstreamAttrValue,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates an event.
    ///
    /// Creates an event \*phEvent for the current context with the flags specified via Flags. Valid flags include:
    ///
    /// * [`CUevent_flags_enum::CU_EVENT_DEFAULT`]: Default event creation flag.
    /// * [`CUevent_flags_enum::CU_EVENT_BLOCKING_SYNC`]: Specifies that the created event should use blocking synchronization. A CPU thread that uses [`cuEventSynchronize`] to wait on an event created with this flag will block until the event has actually been recorded.
    /// * [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`]: Specifies that the created event does not need to record timing data. Events created with this flag specified and the [`CUevent_flags_enum::CU_EVENT_BLOCKING_SYNC`] flag not specified will provide the best performance when used with [`cuStreamWaitEvent`] and [`cuEventQuery`].
    /// * [`CUevent_flags_enum::CU_EVENT_INTERPROCESS`]: Specifies that the created event may be used as an interprocess event by [`cuIpcGetEventHandle`]. [`CUevent_flags_enum::CU_EVENT_INTERPROCESS`] must be specified along with [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuEventRecord`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuEventDestroy_v2`], [`cuEventElapsedTime_v2`], [cudaEventCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g4b5fdb19d7fb5f6f8862559f9279f6c3), [cudaEventCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EVENT.html#group__CUDART__EVENT_1g7b317e07ff385d85aa656204b971a042).
    ///
    /// # Parameters
    ///
    /// - `phEvent`: Returns newly created event.
    /// - `Flags`: Event creation flags.
    pub fn cuEventCreate(phEvent: *mut CUevent, Flags: ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Records an event.
    ///
    /// Captures in hEvent the contents of hStream at the time of this call. hEvent and hStream must be from the same context otherwise [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. Calls such as [`cuEventQuery`] or [`cuStreamWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of hStream after this call do not modify hEvent. See note on default stream behavior for what is captured in the default case.
    ///
    /// [`cuEventRecord`] can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as [`cuStreamWaitEvent`] use the most recently captured state at the time of the API call, and are not affected by later calls to [`cuEventRecord`]. Before the first call to [`cuEventRecord`], an event represents an empty set of work, so for example [`cuEventQuery`] would return [`cudaError_enum::CUDA_SUCCESS`].
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuEventCreate`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuStreamWaitEvent`], [`cuEventDestroy_v2`], [`cuEventElapsedTime_v2`], [cudaEventRecord](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EVENT.html#group__CUDART__EVENT_1gf4fcb74343aa689f4159791967868446), [`cuEventRecordWithFlags`].
    ///
    /// # Parameters
    ///
    /// - `hEvent`: Event to record.
    /// - `hStream`: Stream to record event for.
    pub fn cuEventRecord(hEvent: CUevent, hStream: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Records an event.
    ///
    /// Captures in hEvent the contents of hStream at the time of this call. hEvent and hStream must be from the same context otherwise [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. Calls such as [`cuEventQuery`] or [`cuStreamWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of hStream after this call do not modify hEvent. See note on default stream behavior for what is captured in the default case.
    ///
    /// [`cuEventRecordWithFlags`] can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as [`cuStreamWaitEvent`] use the most recently captured state at the time of the API call, and are not affected by later calls to [`cuEventRecordWithFlags`]. Before the first call to [`cuEventRecordWithFlags`], an event represents an empty set of work, so for example [`cuEventQuery`] would return [`cudaError_enum::CUDA_SUCCESS`].
    ///
    /// flags include:
    ///
    /// * [`CUevent_record_flags_enum::CU_EVENT_RECORD_DEFAULT`]: Default event creation flag.
    /// * [`CUevent_record_flags_enum::CU_EVENT_RECORD_EXTERNAL`]: Event is captured in the graph as an external event node when performing stream capture. This flag is invalid outside of
    ///   stream capture.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuEventCreate`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuStreamWaitEvent`], [`cuEventDestroy_v2`], [`cuEventElapsedTime_v2`], [`cuEventRecord`], [cudaEventRecord](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EVENT.html#group__CUDART__EVENT_1gf4fcb74343aa689f4159791967868446).
    ///
    /// # Parameters
    ///
    /// - `hEvent`: Event to record.
    /// - `hStream`: Stream to record event for.
    /// - `flags`: See CUevent_capture_flags.
    pub fn cuEventRecordWithFlags(
        hEvent: CUevent,
        hStream: CUstream,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Queries an event's status.
    ///
    /// Queries the status of all work currently captured by hEvent. See [`cuEventRecord`] for details on what is captured by an event.
    ///
    /// Returns [`cudaError_enum::CUDA_SUCCESS`] if all captured work has been completed, or [`cudaError_enum::CUDA_ERROR_NOT_READY`] if any captured work is incomplete.
    ///
    /// For the purposes of Unified Memory, a return value of [`cudaError_enum::CUDA_SUCCESS`] is equivalent to having called [`cuEventSynchronize`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuEventCreate`], [`cuEventRecord`], [`cuEventSynchronize`], [`cuEventDestroy_v2`], [`cuEventElapsedTime_v2`], [cudaEventQuery](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EVENT.html#group__CUDART__EVENT_1g2bf738909b4a059023537eaa29d8a5b7).
    ///
    /// # Parameters
    ///
    /// - `hEvent`: Event to query.
    pub fn cuEventQuery(hEvent: CUevent) -> CUresult;
}
unsafe extern "C" {
    /// Waits for an event to complete.
    ///
    /// Waits until the completion of all work currently captured in hEvent. See [`cuEventRecord`] for details on what is captured by an event.
    ///
    /// Waiting for an event that was created with the [`CUevent_flags_enum::CU_EVENT_BLOCKING_SYNC`] flag will cause the calling CPU thread to block until the event has been completed by the device. If the [`CUevent_flags_enum::CU_EVENT_BLOCKING_SYNC`] flag has not been set, then the CPU thread will busy-wait until the event has been completed by the device.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuEventCreate`], [`cuEventRecord`], [`cuEventQuery`], [`cuEventDestroy_v2`], [`cuEventElapsedTime_v2`], [cudaEventSynchronize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EVENT.html#group__CUDART__EVENT_1g949aa42b30ae9e622f6ba0787129ff22).
    ///
    /// # Parameters
    ///
    /// - `hEvent`: Event to wait for.
    pub fn cuEventSynchronize(hEvent: CUevent) -> CUresult;
}
unsafe extern "C" {
    /// Destroys an event.
    ///
    /// Destroys the event specified by hEvent.
    ///
    /// An event may be destroyed before it is complete (i.e., while [`cuEventQuery`] would return [`cudaError_enum::CUDA_ERROR_NOT_READY`]). In this case, the call does not block on completion of the event, and any associated resources will automatically be released
    /// asynchronously at completion.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuEventCreate`], [`cuEventRecord`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuEventElapsedTime_v2`], [cudaEventDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EVENT.html#group__CUDART__EVENT_1g2cb6baa0830a1cd0bd957bfd8705045b).
    ///
    /// # Parameters
    ///
    /// - `hEvent`: Event to destroy.
    pub fn cuEventDestroy_v2(hEvent: CUevent) -> CUresult;
}
unsafe extern "C" {
    /// Computes the elapsed time between two events.
    ///
    /// Computes the elapsed time between two events (in milliseconds with a resolution of around 0.5 microseconds). Note this API
    /// is not guaranteed to return the latest errors for pending work. As such this API is intended to serve as an elapsed time calculation
    /// only and any polling for completion on the events to be compared should be done with [`cuEventQuery`] instead.
    ///
    /// If either event was last recorded in a non-NULL stream, the resulting time may be greater than expected (even if both used
    /// the same stream handle). This happens because the [`cuEventRecord`] operation takes place asynchronously and there is no guarantee that the measured latency is actually just between the two
    /// events. Any number of other different stream operations could execute in between the two measured events, thus altering the
    /// timing in a significant way.
    ///
    /// If [`cuEventRecord`] has not been called on either event then [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. If [`cuEventRecord`] has been called on both events but one or both of them has not yet been completed (that is, [`cuEventQuery`] would return [`cudaError_enum::CUDA_ERROR_NOT_READY`] on at least one of the events), [`cudaError_enum::CUDA_ERROR_NOT_READY`] is returned. If either event was created with the [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flag, then this function will return [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuEventCreate`], [`cuEventRecord`], [`cuEventQuery`], [`cuEventSynchronize`], [`cuEventDestroy_v2`], [cudaEventElapsedTime](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EVENT.html#group__CUDART__EVENT_1g40159125411db92c835edb46a0989cd6).
    ///
    /// # Parameters
    ///
    /// - `pMilliseconds`: Time between hStart and hEnd in ms.
    /// - `hStart`: Starting event.
    /// - `hEnd`: Ending event.
    pub fn cuEventElapsedTime_v2(
        pMilliseconds: *mut f32,
        hStart: CUevent,
        hEnd: CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Imports an external memory object.
    ///
    /// Imports an externally allocated memory object and returns a handle to that in extMem_out.
    ///
    /// The properties of the handle being imported must be described in memHandleDesc. The CUDA_EXTERNAL_MEMORY_HANDLE_DESC structure is defined as follows:
    ///
    /// ```text
    /// typedef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st {
    /// CUexternalMemoryHandleType type;
    /// union {
    /// int fd;
    /// struct {
    /// void *handle;
    /// const void *name;
    /// } win32;
    /// const void *nvSciBufObject;
    /// } handle;
    /// unsigned long long size;
    /// unsigned int flags;
    /// } CUDA_EXTERNAL_MEMORY_HANDLE_DESC;
    /// ```
    ///
    /// where [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) specifies the type of handle being imported. `CUexternalMemoryHandleType` is defined as:
    ///
    /// ```text
    /// typedef enum CUexternalMemoryHandleType_enum {
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD          = 1,
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32       = 2,
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT   = 3,
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP         = 4,
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE     = 5,
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE     = 6,
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT = 7,
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF           = 8,
    /// CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD          = 9
    /// } CUexternalMemoryHandleType;
    /// ```
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD`], then CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::fd must be a valid file descriptor referencing a memory object. Ownership
    /// of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any operations
    /// on the file descriptor after it is imported results in undefined behavior.
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32`], then exactly one of CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle and CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name
    /// must not be NULL. If CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared
    /// NT handle that references a memory object. Ownership of this handle is not transferred to CUDA after the import operation,
    /// so the application must release the handle using the appropriate system call. If CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name
    /// is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a memory object.
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT`], then CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle must be non-NULL and CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name
    /// must be NULL. The handle specified must be a globally shared KMT handle. This handle does not hold a reference to the underlying
    /// object, and thus will be invalid when all references to the memory object are destroyed.
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP`], then exactly one of CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle and CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name
    /// must not be NULL. If CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared
    /// NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Heap object. This handle holds a
    /// reference to the underlying object. If CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name is not NULL, then it must point
    /// to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Heap object.
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE`], then exactly one of CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle and CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name
    /// must not be NULL. If CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid shared
    /// NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Resource object. This handle holds
    /// a reference to the underlying object. If CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name is not NULL, then it must point
    /// to a NULL-terminated array of UTF-16 characters that refers to a ID3D12Resource object.
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE`], then CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle must represent a valid shared NT handle that is returned by
    /// IDXGIResource1::CreateSharedHandle when referring to a ID3D11Resource object. If CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name
    /// is not NULL, then it must point to a NULL-terminated array of UTF-16 characters that refers to a ID3D11Resource object.
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`], then CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::handle must represent a valid shared KMT handle that is returned by
    /// IDXGIResource::GetSharedHandle when referring to a ID3D11Resource object and CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::win32::name
    /// must be NULL.
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`], then CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::nvSciBufObject must be non-NULL and reference a valid NvSciBuf object. If
    /// the NvSciBuf object imported into CUDA is also mapped by other drivers, then the application must use [`cuWaitExternalSemaphoresAsync`] or [`cuSignalExternalSemaphoresAsync`] as appropriate barriers to maintain coherence between CUDA and the other drivers. See [`CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC`] and [`CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC`] for memory synchronization.
    ///
    /// If [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD`], then CUDA_EXTERNAL_MEMORY_HANDLE_DESC::handle::fd must be a valid file descriptor referencing a dma_buf object and [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_144d7c253f6b6f34e46b8726496e425c9) must be zero. Importing a dma_buf object is supported only on Tegra Jetson platform starting with Thor series. Mapping an
    /// imported dma_buf object as CUDA mipmapped array using [`cuExternalMemoryGetMappedMipmappedArray`] is not supported.
    ///
    /// The size of the memory object must be specified in [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_136570cee9bbfa12b3f34d0d1d98029ce).
    ///
    /// Specifying the flag [`CUDA_EXTERNAL_MEMORY_DEDICATED`] in [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_144d7c253f6b6f34e46b8726496e425c9) indicates that the resource is a dedicated resource. The definition of what a dedicated resource is outside the scope of
    /// this extension. This flag must be set if [CUDA_EXTERNAL_MEMORY_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__HANDLE__DESC__v1_1d4e3663348d28278d066980b422ab70e) is one of the following: [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE`][`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE`][`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_RESOURCE_KMT`]
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * If the Vulkan memory imported into CUDA is mapped on the CPU then the application must use vkInvalidateMappedMemoryRanges/vkFlushMappedMemoryRanges
    ///   as well as appropriate Vulkan pipeline barriers to maintain coherence between CPU and GPU. For more information on these APIs,
    ///   please refer to "Synchronization and Cache Control" chapter from Vulkan specification.
    ///
    /// **See also:**
    ///
    /// [`cuDestroyExternalMemory`], [`cuExternalMemoryGetMappedBuffer`], [`cuExternalMemoryGetMappedMipmappedArray`].
    ///
    /// # Parameters
    ///
    /// - `extMem_out`: Returned handle to an external memory object.
    /// - `memHandleDesc`: Memory import handle descriptor.
    pub fn cuImportExternalMemory(
        extMem_out: *mut CUexternalMemory,
        memHandleDesc: *const CUDA_EXTERNAL_MEMORY_HANDLE_DESC,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Maps a buffer onto an imported memory object.
    ///
    /// Maps a buffer onto an imported memory object and returns a device pointer in devPtr.
    ///
    /// The properties of the buffer being mapped must be described in bufferDesc. The CUDA_EXTERNAL_MEMORY_BUFFER_DESC structure is defined as follows:
    ///
    /// ```text
    /// typedef struct CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st {
    /// unsigned long long offset;
    /// unsigned long long size;
    /// unsigned int flags;
    /// } CUDA_EXTERNAL_MEMORY_BUFFER_DESC;
    /// ```
    ///
    /// where [CUDA_EXTERNAL_MEMORY_BUFFER_DESC::offset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__BUFFER__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__BUFFER__DESC__v1_1734130661fb389658d29d10ed6cf41cd) is the offset in the memory object where the buffer's base address is. [CUDA_EXTERNAL_MEMORY_BUFFER_DESC::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__BUFFER__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__BUFFER__DESC__v1_1b736c75bec5e1461f565e95500c8227f) is the size of the buffer. [CUDA_EXTERNAL_MEMORY_BUFFER_DESC::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__BUFFER__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__BUFFER__DESC__v1_186aad4fc1ddac67d953daddec0a5c94a) must be zero.
    ///
    /// The offset and size have to be suitably aligned to match the requirements of the external API. Mapping two buffers whose ranges
    /// overlap may or may not result in the same virtual address being returned for the overlapped portion. In such cases, the application
    /// must ensure that all accesses to that region from the GPU are volatile. Otherwise writes made via one address are not guaranteed
    /// to be visible via the other address, even if they're issued by the same thread. It is recommended that applications map the
    /// combined range instead of mapping separate buffers and then apply the appropriate offsets to the returned pointer to derive
    /// the individual buffers.
    ///
    /// The returned pointer devPtr must be freed using [`cuMemFree_v2`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuImportExternalMemory`], [`cuDestroyExternalMemory`], [`cuExternalMemoryGetMappedMipmappedArray`].
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Returned device pointer to buffer.
    /// - `extMem`: Handle to external memory object.
    /// - `bufferDesc`: Buffer descriptor.
    pub fn cuExternalMemoryGetMappedBuffer(
        devPtr: *mut CUdeviceptr,
        extMem: CUexternalMemory,
        bufferDesc: *const CUDA_EXTERNAL_MEMORY_BUFFER_DESC,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Maps a CUDA mipmapped array onto an external memory object.
    ///
    /// Maps a CUDA mipmapped array onto an external object and returns a handle to it in mipmap.
    ///
    /// The properties of the CUDA mipmapped array being mapped must be described in mipmapDesc. The structure CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC is defined as follows:
    ///
    /// ```text
    /// typedef struct CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st {
    /// unsigned long long offset;
    /// CUDA_ARRAY3D_DESCRIPTOR arrayDesc;
    /// unsigned int numLevels;
    /// } CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC;
    /// ```
    ///
    /// where [CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::offset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__MIPMAPPED__ARRAY__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__MIPMAPPED__ARRAY__DESC__v1_1c4a2c246eab269279434d8153d6e15aa) is the offset in the memory object where the base level of the mipmap chain is. [CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::arrayDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__MIPMAPPED__ARRAY__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__MIPMAPPED__ARRAY__DESC__v1_17c3e0998380d9922a9fcddadeecd186d) describes the format, dimensions and type of the base level of the mipmap chain. For further details on these parameters,
    /// please refer to the documentation for [`cuMipmappedArrayCreate`]. Note that if the mipmapped array is bound as a color target in the graphics API, then the flag [`CUDA_ARRAY3D_COLOR_ATTACHMENT`] must be specified in CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::arrayDesc::Flags. [CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::numLevels](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__MIPMAPPED__ARRAY__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__MIPMAPPED__ARRAY__DESC__v1_1938185e3178ee0fb5920ac104035b321) specifies the total number of levels in the mipmap chain.
    ///
    /// If extMem was imported from a handle of type [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`], then [CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC::numLevels](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__MEMORY__MIPMAPPED__ARRAY__DESC__v1.html#structCUDA__EXTERNAL__MEMORY__MIPMAPPED__ARRAY__DESC__v1_1938185e3178ee0fb5920ac104035b321) must be equal to 1.
    ///
    /// Mapping extMem imported from a handle of type [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD`], is not supported.
    ///
    /// The returned CUDA mipmapped array must be freed using [`cuMipmappedArrayDestroy`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuImportExternalMemory`], [`cuDestroyExternalMemory`], [`cuExternalMemoryGetMappedBuffer`].
    ///
    /// # Parameters
    ///
    /// - `mipmap`: Returned CUDA mipmapped array.
    /// - `extMem`: Handle to external memory object.
    /// - `mipmapDesc`: CUDA array descriptor.
    pub fn cuExternalMemoryGetMappedMipmappedArray(
        mipmap: *mut CUmipmappedArray,
        extMem: CUexternalMemory,
        mipmapDesc: *const CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys an external memory object.
    ///
    /// Destroys the specified external memory object. Any existing buffers and CUDA mipmapped arrays mapped onto this object must
    /// no longer be used and must be explicitly freed using [`cuMemFree_v2`] and [`cuMipmappedArrayDestroy`] respectively.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuImportExternalMemory`], [`cuExternalMemoryGetMappedBuffer`], [`cuExternalMemoryGetMappedMipmappedArray`].
    ///
    /// # Parameters
    ///
    /// - `extMem`: External memory object to be destroyed.
    pub fn cuDestroyExternalMemory(extMem: CUexternalMemory) -> CUresult;
}
unsafe extern "C" {
    /// Imports an external semaphore.
    ///
    /// Imports an externally allocated synchronization object and returns a handle to that in extSem_out.
    ///
    /// The properties of the handle being imported must be described in semHandleDesc. The CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC is defined as follows:
    ///
    /// ```text
    /// typedef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st {
    /// CUexternalSemaphoreHandleType type;
    /// union {
    /// int fd;
    /// struct {
    /// void *handle;
    /// const void *name;
    /// } win32;
    /// const void* NvSciSyncObj;
    /// } handle;
    /// unsigned int flags;
    /// } CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC;
    /// ```
    ///
    /// where [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) specifies the type of handle being imported. `CUexternalSemaphoreHandleType` is defined as:
    ///
    /// ```text
    /// typedef enum CUexternalSemaphoreHandleType_enum {
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD                = 1,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32             = 2,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT         = 3,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE              = 4,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE              = 5,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC                = 6,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX        = 7,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT    = 8,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD    = 9,
    /// CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32 = 10
    /// } CUexternalSemaphoreHandleType;
    /// ```
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`], then CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::fd must be a valid file descriptor referencing a synchronization object.
    /// Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any
    /// operations on the file descriptor after it is imported results in undefined behavior.
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`], then exactly one of CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle and CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name
    /// must not be NULL. If CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid
    /// shared NT handle that references a synchronization object. Ownership of this handle is not transferred to CUDA after the import
    /// operation, so the application must release the handle using the appropriate system call. If CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name
    /// is not NULL, then it must name a valid synchronization object.
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`], then CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle must be non-NULL and CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name
    /// must be NULL. The handle specified must be a globally shared KMT handle. This handle does not hold a reference to the underlying
    /// object, and thus will be invalid when all references to the synchronization object are destroyed.
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`], then exactly one of CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle and CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name
    /// must not be NULL. If CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid
    /// shared NT handle that is returned by ID3D12Device::CreateSharedHandle when referring to a ID3D12Fence object. This handle
    /// holds a reference to the underlying object. If CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name is not NULL, then
    /// it must name a valid synchronization object that refers to a valid ID3D12Fence object.
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`], then CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle represents a valid shared NT handle that is returned by
    /// ID3D11Fence::CreateSharedHandle. If CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name is not NULL, then it must name
    /// a valid synchronization object that refers to a valid ID3D11Fence object.
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`], then CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::nvSciSyncObj represents a valid NvSciSyncObj.
    ///
    /// [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`], then CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle represents a valid shared NT handle that is returned by
    /// IDXGIResource1::CreateSharedHandle when referring to a IDXGIKeyedMutex object. If CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name
    /// is not NULL, then it must name a valid synchronization object that refers to a valid IDXGIKeyedMutex object.
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`], then CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle represents a valid shared KMT handle that is returned by
    /// IDXGIResource::GetSharedHandle when referring to a IDXGIKeyedMutex object and CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name
    /// must be NULL.
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`], then CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::fd must be a valid file descriptor referencing a synchronization object.
    /// Ownership of the file descriptor is transferred to the CUDA driver when the handle is imported successfully. Performing any
    /// operations on the file descriptor after it is imported results in undefined behavior.
    ///
    /// If [CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1.html#structCUDA__EXTERNAL__SEMAPHORE__HANDLE__DESC__v1_1cf32b96f55beec6f904b2455effed87d) is [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`], then exactly one of CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle and CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name
    /// must not be NULL. If CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::handle is not NULL, then it must represent a valid
    /// shared NT handle that references a synchronization object. Ownership of this handle is not transferred to CUDA after the import
    /// operation, so the application must release the handle using the appropriate system call. If CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC::handle::win32::name
    /// is not NULL, then it must name a valid synchronization object.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDestroyExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `extSem_out`: Returned handle to an external semaphore.
    /// - `semHandleDesc`: Semaphore import handle descriptor.
    pub fn cuImportExternalSemaphore(
        extSem_out: *mut CUexternalSemaphore,
        semHandleDesc: *const CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Signals a set of external semaphore objects.
    ///
    /// Enqueues a signal operation on a set of externally allocated semaphore object in the specified stream. The operations will
    /// be executed when all prior operations in the stream complete.
    ///
    /// The exact semantics of signaling a semaphore depends on the type of the object.
    ///
    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`] then signaling the semaphore will set it to the signaled state.
    ///
    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`] then the semaphore will be set to the value specified in CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::fence::value.
    ///
    /// If the semaphore object is of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`] this API sets CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence to a value that can be used by subsequent waiters
    /// of the same NvSciSync object to order operations with those currently submitted in stream. Such an update will overwrite previous contents of CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence. By default,
    /// signaling such an external semaphore object causes appropriate memory synchronization operations to be performed over all
    /// external memory objects that are imported as [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`]. This ensures that any subsequent accesses made by other importers of the same set of NvSciBuf memory object(s) are coherent.
    /// These operations can be skipped by specifying the flag [`CUDA_EXTERNAL_SEMAPHORE_SIGNAL_SKIP_NVSCIBUF_MEMSYNC`], which can be used as a performance optimization when data coherency is not required. But specifying this flag in scenarios
    /// where data coherency is required results in undefined behavior. Also, for semaphore object of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`], if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in [`cuDeviceGetNvSciSyncAttributes`] to CUDA_NVSCISYNC_ATTR_SIGNAL, this API will return [`CUresult::CUDA_ERROR_NOT_SUPPORTED`]. NvSciSyncFence associated with semaphore object
    /// of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`] can be deterministic. For this the NvSciSyncAttrList used to create the semaphore object must have value of NvSciSyncAttrKey_RequireDeterministicFences
    /// key set to true. Deterministic fences allow users to enqueue a wait over the semaphore object even before corresponding signal
    /// is enqueued. For such a semaphore object, CUDA guarantees that each signal operation will increment the fence value by '1'.
    /// Users are expected to track count of signals enqueued on the semaphore object and insert waits accordingly. When such a semaphore
    /// object is signaled from multiple streams, due to concurrent stream execution, it is possible that the order in which the semaphore
    /// gets signaled is indeterministic. This could lead to waiters of the semaphore getting unblocked incorrectly. Users are expected
    /// to handle such situations, either by not using the same semaphore object with deterministic fence support enabled in different
    /// streams or by adding explicit dependency amongst such streams so that the semaphore is signaled in order. NvSciSyncFence associated
    /// with semaphore object of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`] can be timestamp enabled. For this the NvSciSyncAttrList used to create the object must have the value of NvSciSyncAttrKey_WaiterRequireTimestamps
    /// key set to true. Timestamps are emitted asynchronously by the GPU and CUDA saves the GPU timestamp in the corresponding NvSciSyncFence
    /// at the time of signal on GPU. Users are expected to convert GPU clocks to CPU clocks using appropriate scaling functions.
    /// Users are expected to wait for the completion of the fence before extracting timestamp using appropriate NvSciSync APIs. Users
    /// are expected to ensure that there is only one outstanding timestamp enabled fence per CUDA-NvSciSync object at any point of
    /// time, failing which leads to undefined behavior. Extracting the timestamp before the corresponding fence is signalled could
    /// lead to undefined behavior. Timestamp extracted via appropriate NvSciSync API would be in microseconds.
    ///
    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`] then the keyed mutex will be released with the key specified in CUDA_EXTERNAL_SEMAPHORE_PARAMS::params::keyedmutex::key.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuImportExternalSemaphore`], [`cuDestroyExternalSemaphore`], [`cuWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `extSemArray`: Set of external semaphores to be signaled.
    /// - `paramsArray`: Array of semaphore parameters.
    /// - `numExtSems`: Number of semaphores to signal.
    /// - `stream`: Stream to enqueue the signal operations in.
    pub fn cuSignalExternalSemaphoresAsync(
        extSemArray: *const CUexternalSemaphore,
        paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS,
        numExtSems: ::core::ffi::c_uint,
        stream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Waits on a set of external semaphore objects.
    ///
    /// Enqueues a wait operation on a set of externally allocated semaphore object in the specified stream. The operations will be
    /// executed when all prior operations in the stream complete.
    ///
    /// The exact semantics of waiting on a semaphore depends on the type of the object.
    ///
    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT`] then waiting on the semaphore will wait until the semaphore reaches the signaled state. The semaphore will then be reset
    /// to the unsignaled state. Therefore for every signal operation, there can only be one wait operation.
    ///
    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_FD`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_TIMELINE_SEMAPHORE_WIN32`] then waiting on the semaphore will wait until the value of the semaphore is greater than or equal to CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::fence::value.
    ///
    /// If the semaphore object is of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`] then, waiting on the semaphore will wait until the CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS::params::nvSciSync::fence is signaled
    /// by the signaler of the NvSciSyncObj that was associated with this semaphore object. By default, waiting on such an external
    /// semaphore object causes appropriate memory synchronization operations to be performed over all external memory objects that
    /// are imported as [`CUexternalMemoryHandleType_enum::CU_EXTERNAL_MEMORY_HANDLE_TYPE_NVSCIBUF`]. This ensures that any subsequent accesses made by other importers of the same set of NvSciBuf memory object(s) are coherent.
    /// These operations can be skipped by specifying the flag [`CUDA_EXTERNAL_SEMAPHORE_WAIT_SKIP_NVSCIBUF_MEMSYNC`], which can be used as a performance optimization when data coherency is not required. But specifying this flag in scenarios
    /// where data coherency is required results in undefined behavior. Also, for semaphore object of the type [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_NVSCISYNC`], if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in [`cuDeviceGetNvSciSyncAttributes`] to CUDA_NVSCISYNC_ATTR_WAIT, this API will return [`CUresult::CUDA_ERROR_NOT_SUPPORTED`].
    ///
    /// If the semaphore object is any one of the following types: [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX`], [`CUexternalSemaphoreHandleType_enum::CU_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_KEYED_MUTEX_KMT`] then the keyed mutex will be acquired when it is released with the key specified in CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::keyedmutex::key
    /// or until the timeout specified by CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS::params::keyedmutex::timeoutMs has lapsed. The timeout
    /// interval can either be a finite value specified in milliseconds or an infinite value. In case an infinite value is specified
    /// the timeout never elapses. The windows INFINITE macro must be used to specify infinite timeout.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuImportExternalSemaphore`], [`cuDestroyExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `extSemArray`: External semaphores to be waited on.
    /// - `paramsArray`: Array of semaphore parameters.
    /// - `numExtSems`: Number of semaphores to wait on.
    /// - `stream`: Stream to enqueue the wait operations in.
    pub fn cuWaitExternalSemaphoresAsync(
        extSemArray: *const CUexternalSemaphore,
        paramsArray: *const CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS,
        numExtSems: ::core::ffi::c_uint,
        stream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys an external semaphore.
    ///
    /// Destroys an external semaphore object and releases any references to the underlying resource. Any outstanding signals or waits
    /// must have completed before the semaphore is destroyed.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `extSem`: External semaphore to be destroyed.
    pub fn cuDestroyExternalSemaphore(extSem: CUexternalSemaphore) -> CUresult;
}
unsafe extern "C" {
    /// Wait on a memory location.
    ///
    /// Enqueues a synchronization of the stream on the given memory location. Work ordered after the operation will block until the
    /// given condition on the memory is satisfied. By default, the condition is to wait for (int32_t)(\*addr - value) >= 0, a cyclic
    /// greater-or-equal. Other condition types can be specified via flags.
    ///
    /// If the memory was registered via [`cuMemHostRegister_v2`], the device pointer should be obtained with [`cuMemHostGetDevicePointer_v2`]. This function cannot be used with managed memory ([`cuMemAllocManaged`]).
    ///
    /// Support for [`CUstreamWaitValue_flags::CU_STREAM_WAIT_VALUE_NOR`] can be queried with [`cuDeviceGetAttribute`] and CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR_V2.
    ///
    /// Note:
    ///
    /// Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not
    /// visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible
    /// dependencies such as events. This ensures that the scheduler does not serialize them in an improper order.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamWaitValue64_v2`], [`cuStreamWriteValue32_v2`], [`cuStreamWriteValue64_v2`], [`cuStreamBatchMemOp_v2`], [`cuMemHostRegister_v2`], [`cuStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `stream`: The stream to synchronize on the memory location.
    /// - `addr`: The memory location to wait on.
    /// - `value`: The value to compare with the memory location.
    /// - `flags`: See `CUstreamWaitValue_flags`.
    pub fn cuStreamWaitValue32_v2(
        stream: CUstream,
        addr: CUdeviceptr,
        value: cuuint32_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Wait on a memory location.
    ///
    /// Enqueues a synchronization of the stream on the given memory location. Work ordered after the operation will block until the
    /// given condition on the memory is satisfied. By default, the condition is to wait for (int64_t)(\*addr - value) >= 0, a cyclic
    /// greater-or-equal. Other condition types can be specified via flags.
    ///
    /// If the memory was registered via [`cuMemHostRegister_v2`], the device pointer should be obtained with [`cuMemHostGetDevicePointer_v2`].
    ///
    /// Support for this can be queried with [`cuDeviceGetAttribute`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS`].
    ///
    /// Note:
    ///
    /// Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not
    /// visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible
    /// dependencies such as events. This ensures that the scheduler does not serialize them in an improper order.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamWaitValue32_v2`], [`cuStreamWriteValue32_v2`], [`cuStreamWriteValue64_v2`], [`cuStreamBatchMemOp_v2`], [`cuMemHostRegister_v2`], [`cuStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `stream`: The stream to synchronize on the memory location.
    /// - `addr`: The memory location to wait on.
    /// - `value`: The value to compare with the memory location.
    /// - `flags`: See `CUstreamWaitValue_flags`.
    pub fn cuStreamWaitValue64_v2(
        stream: CUstream,
        addr: CUdeviceptr,
        value: cuuint64_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Write a value to memory.
    ///
    /// Write a value to memory.
    ///
    /// If the memory was registered via [`cuMemHostRegister_v2`], the device pointer should be obtained with [`cuMemHostGetDevicePointer_v2`]. This function cannot be used with managed memory ([`cuMemAllocManaged`]).
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamWriteValue64_v2`], [`cuStreamWaitValue32_v2`], [`cuStreamWaitValue64_v2`], [`cuStreamBatchMemOp_v2`], [`cuMemHostRegister_v2`], [`cuEventRecord`].
    ///
    /// # Parameters
    ///
    /// - `stream`: The stream to do the write in.
    /// - `addr`: The device address to write to.
    /// - `value`: The value to write.
    /// - `flags`: See `CUstreamWriteValue_flags`.
    pub fn cuStreamWriteValue32_v2(
        stream: CUstream,
        addr: CUdeviceptr,
        value: cuuint32_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Write a value to memory.
    ///
    /// Write a value to memory.
    ///
    /// If the memory was registered via [`cuMemHostRegister_v2`], the device pointer should be obtained with [`cuMemHostGetDevicePointer_v2`].
    ///
    /// Support for this can be queried with [`cuDeviceGetAttribute`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CAN_USE_64_BIT_STREAM_MEM_OPS`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamWriteValue32_v2`], [`cuStreamWaitValue32_v2`], [`cuStreamWaitValue64_v2`], [`cuStreamBatchMemOp_v2`], [`cuMemHostRegister_v2`], [`cuEventRecord`].
    ///
    /// # Parameters
    ///
    /// - `stream`: The stream to do the write in.
    /// - `addr`: The device address to write to.
    /// - `value`: The value to write.
    /// - `flags`: See `CUstreamWriteValue_flags`.
    pub fn cuStreamWriteValue64_v2(
        stream: CUstream,
        addr: CUdeviceptr,
        value: cuuint64_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Batch operations to synchronize the stream via memory operations.
    ///
    /// This is a batch version of [`cuStreamWaitValue32_v2`] and [`cuStreamWriteValue32_v2`]. Batching operations may avoid some performance overhead in both the API call and the device execution versus adding them
    /// to the stream in separate API calls. The operations are enqueued in the order they appear in the array.
    ///
    /// See `CUstreamBatchMemOpType` for the full set of supported operations, and [`cuStreamWaitValue32_v2`], [`cuStreamWaitValue64_v2`], [`cuStreamWriteValue32_v2`], and [`cuStreamWriteValue64_v2`] for details of specific operations.
    ///
    /// See related APIs for details on querying support for specific operations.
    ///
    /// Note:
    ///
    /// Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not
    /// visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible
    /// dependencies such as events. This ensures that the scheduler does not serialize them in an improper order.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamWaitValue32_v2`], [`cuStreamWaitValue64_v2`], [`cuStreamWriteValue32_v2`], [`cuStreamWriteValue64_v2`], [`cuMemHostRegister_v2`].
    ///
    /// # Parameters
    ///
    /// - `stream`: The stream to enqueue the operations in.
    /// - `count`: The number of operations in the array. Must be less than 256.
    /// - `paramArray`: The types and parameters of the individual operations.
    /// - `flags`: Reserved for future expansion; must be 0.
    pub fn cuStreamBatchMemOp_v2(
        stream: CUstream,
        count: ::core::ffi::c_uint,
        paramArray: *mut CUstreamBatchMemOpParams,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns information about a function.
    ///
    /// Returns in \*pi the integer value of the attribute attrib on the kernel given by hfunc. The supported attributes are:
    ///
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK`]: The maximum number of threads per block, beyond which a launch of the function would fail. This number depends on both the
    ///   function and the device on which the function is currently loaded.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`]: The size in bytes of statically-allocated shared memory per block required by this function. This does not include dynamically-allocated
    ///   shared memory requested by the user at runtime.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES`]: The size in bytes of user-allocated constant memory required by this function.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_LOCAL_SIZE_BYTES`]: The size in bytes of local memory used by each thread of this function.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NUM_REGS`]: The number of registers used by each thread of this function.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PTX_VERSION`]: The PTX virtual architecture version for which the function was compiled. This value is the major PTX version \* 10 + the
    ///   minor PTX version, so a PTX version 1.3 function would return the value 13. Note that this may return the undefined value
    ///   of 0 for cubins compiled prior to CUDA 3.0.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_BINARY_VERSION`]: The binary architecture version for which the function was compiled. This value is the major binary version \* 10 + the minor
    ///   binary version, so a binary version 1.3 function would return the value 13. Note that this will return a value of 10 for legacy
    ///   cubins that do not have a properly-encoded binary architecture version.
    /// * CU_FUNC_CACHE_MODE_CA: The attribute to indicate whether the function has been compiled with user specified option "-Xptxas
    ///   --dlcm=ca" set .
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]: The maximum size in bytes of dynamically-allocated shared memory.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]: Preferred shared memory-L1 cache split ratio in percent of total shared memory.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET`]: If this attribute is set, the kernel must launch with a valid cluster size specified.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`]: The required cluster width in blocks.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`]: The required cluster height in blocks.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`]: The required cluster depth in blocks.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`]: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed. A non-portable
    ///   cluster size may only function on the specific SKUs the program is tested on. The launch might fail if the program is run
    ///   on a different hardware platform. CUDA API provides cudaOccupancyMaxActiveClusters to assist with checking whether the desired
    ///   size can be launched on the current device. A portable cluster size is guaranteed to be functional on all compute capabilities
    ///   higher than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase
    ///   for future compute capabilities. The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy.
    ///
    /// With a few execeptions, function attributes may also be queried on unloaded function handles returned from [`cuModuleEnumerateFunctions`]. [`cudaError_enum::CUDA_ERROR_FUNCTION_NOT_LOADED`] is returned if the attribute requires a fully loaded function but the function is not loaded. The loading state of a function
    /// may be queried using cuFuncIsloaded. [`cuFuncLoad`] may be called to explicitly load a function before querying the following attributes that require the function to be loaded:
    ///
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK`]
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CONST_SIZE_BYTES`]
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuLaunchKernel`], [cudaFuncGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g0e78e02c6d12ebddd4577ac6ebadf494), [cudaFuncSetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g61085e9f04656b92573af16072bbc78d), [`cuFuncIsLoaded`], [`cuFuncLoad`], [`cuKernelGetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `pi`: Returned attribute value.
    /// - `attrib`: Attribute requested.
    /// - `hfunc`: Function to query attribute of.
    pub fn cuFuncGetAttribute(
        pi: *mut ::core::ffi::c_int,
        attrib: CUfunction_attribute,
        hfunc: CUfunction,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets information about a function.
    ///
    /// This call sets the value of a specified attribute attrib on the kernel given by hfunc to an integer value specified by val This function returns [`CUresult::CUDA_SUCCESS`] if the new value of the attribute could be successfully set. If the set fails, this call
    /// will return an error. Not all attributes can have values set. Attempting to set a value on a read-only attribute will result
    /// in an error ([`CUresult::CUDA_ERROR_INVALID_VALUE`])
    ///
    /// Supported attributes for the cuFuncSetAttribute call are:
    ///
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES`]: This maximum size in bytes of dynamically-allocated shared memory. The value should contain the requested maximum size of
    ///   dynamically-allocated shared memory. The sum of this value and the function attribute [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`] cannot exceed the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`]. The maximal size of requestable dynamic shared memory may differ by GPU architecture.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT`]: On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference,
    ///   in percent of the total shared memory. See [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`] This is only a hint, and the driver can choose a different ratio if required to execute the function.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH`]: The required cluster width in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity
    ///   of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime.
    ///   Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT`]: The required cluster height in blocks. The width, height, and depth values must either all be 0 or all be positive. The
    ///   validity of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at
    ///   runtime. Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH`]: The required cluster depth in blocks. The width, height, and depth values must either all be 0 or all be positive. The validity
    ///   of the cluster dimensions is checked at launch time. If the value is set during compile time, it cannot be set at runtime.
    ///   Setting it at runtime will return [`CUresult::CUDA_ERROR_NOT_PERMITTED`].
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED`]: Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed.
    /// * [`CUfunction_attribute_enum::CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]: The block scheduling policy of a function. The value type is CUclusterSchedulingPolicy.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuLaunchKernel`], [cudaFuncGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g0e78e02c6d12ebddd4577ac6ebadf494), [cudaFuncSetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g61085e9f04656b92573af16072bbc78d), [`cuKernelSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Function to query attribute of.
    /// - `attrib`: Attribute requested.
    /// - `value`: The value to set.
    pub fn cuFuncSetAttribute(
        hfunc: CUfunction,
        attrib: CUfunction_attribute,
        value: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the preferred cache configuration for a device function.
    ///
    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through config the preferred cache configuration for the device function hfunc. This is only a preference. The driver will use the requested configuration if possible, but it is free to choose a different
    /// configuration if required to execute hfunc. Any context-wide preference set via [`cuCtxSetCacheConfig`] will be overridden by this per-function setting unless the per-function setting is [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]. In that case, the current context-wide setting will be used.
    ///
    /// This setting does nothing on devices where the size of the L1 cache and shared memory are fixed.
    ///
    /// Launching a kernel with a different preference than the most recent preference setting may insert a device-side synchronization
    /// point.
    ///
    /// The supported cache configurations are:
    ///
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_NONE`]: no preference for shared memory or L1 (default)
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_SHARED`]: prefer larger shared memory and smaller L1 cache
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_L1`]: prefer larger L1 cache and smaller shared memory
    /// * [`CUfunc_cache_enum::CU_FUNC_CACHE_PREFER_EQUAL`]: prefer equal sized L1 cache and shared memory
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncGetAttribute`], [`cuLaunchKernel`], [cudaFuncSetCacheConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g7d9cc996fe45b6260ebb086caff1c685), [`cuKernelSetCacheConfig`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Kernel to configure cache for.
    /// - `config`: Requested cache configuration.
    pub fn cuFuncSetCacheConfig(hfunc: CUfunction, config: CUfunc_cache) -> CUresult;
}
unsafe extern "C" {
    /// Returns a module handle.
    ///
    /// Returns in \*hmod the handle of the module that function hfunc is located in. The lifetime of the module corresponds to the lifetime of the context it was loaded in or until the module
    /// is explicitly unloaded.
    ///
    /// The CUDA runtime manages its own modules loaded into the primary context. If the handle returned by this API refers to a module
    /// loaded by the CUDA runtime, calling [`cuModuleUnload`] on that module will result in undefined behavior.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// # Parameters
    ///
    /// - `hmod`: Returned module handle.
    /// - `hfunc`: Function to retrieve module for.
    pub fn cuFuncGetModule(hmod: *mut CUmodule, hfunc: CUfunction) -> CUresult;
}
unsafe extern "C" {
    /// Returns the function name for a CUfunction handle.
    ///
    /// Returns in \*\*name the function name associated with the function handle hfunc . The function name is returned as a null-terminated string. The returned name is only valid when the function handle is
    /// valid. If the module is unloaded or reloaded, one must call the API again to get the updated name. This API may return a mangled
    /// name if the function is not declared as having C linkage. If either \*\*name or hfunc is NULL, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// # Parameters
    ///
    /// - `name`: The returned name of the function.
    /// - `hfunc`: The function handle to retrieve the name for.
    pub fn cuFuncGetName(
        name: *mut *const ::core::ffi::c_char,
        hfunc: CUfunction,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the offset and size of a kernel parameter in the device-side parameter layout.
    ///
    /// Queries the kernel parameter at paramIndex into func's list of parameters, and returns in paramOffset and paramSize the offset and size, respectively, where the parameter will reside in the device-side parameter layout. This information
    /// can be used to update kernel node parameters from the device via [cudaGraphKernelNodeSetParam()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g0c2bd161eff1e47531eedce282e66d21) and [cudaGraphKernelNodeUpdatesApply()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g2d558cf37c9616365c67447e61ac0d6a). paramIndex must be less than the number of parameters that func takes. paramSize can be set to NULL if only the parameter offset is desired.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuKernelGetParamInfo`].
    ///
    /// # Parameters
    ///
    /// - `func`: The function to query.
    /// - `paramIndex`: The parameter index to query.
    /// - `paramOffset`: Returns the offset into the device-side parameter layout at which the parameter resides.
    /// - `paramSize`: Optionally returns the size of the parameter in the device-side parameter layout.
    pub fn cuFuncGetParamInfo(
        func: CUfunction,
        paramIndex: size_t,
        paramOffset: *mut size_t,
        paramSize: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the number of parameters used by the function.
    ///
    /// Queries the number of kernel parameters used by func and returns it in paramCount.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncGetParamInfo`].
    ///
    /// # Parameters
    ///
    /// - `func`: The function to query.
    /// - `paramCount`: Returns the number of parameters used by the function.
    pub fn cuFuncGetParamCount(func: CUfunction, paramCount: *mut size_t) -> CUresult;
}
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUfunctionLoadingState_enum {
    CU_FUNCTION_LOADING_STATE_UNLOADED = 0,
    CU_FUNCTION_LOADING_STATE_LOADED = 1,
    CU_FUNCTION_LOADING_STATE_MAX = 2,
}
pub use self::CUfunctionLoadingState_enum as CUfunctionLoadingState;
unsafe extern "C" {
    /// Returns if the function is loaded.
    ///
    /// Returns in state the loading state of function.
    ///
    /// **See also:**
    ///
    /// [`cuFuncLoad`], [`cuModuleEnumerateFunctions`].
    ///
    /// # Parameters
    ///
    /// - `state`: returned loading state.
    /// - `function`: the function to check.
    pub fn cuFuncIsLoaded(
        state: *mut CUfunctionLoadingState,
        function: CUfunction,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Loads a function.
    ///
    /// Finalizes function loading for function. Calling this API with a fully loaded function has no effect.
    ///
    /// **See also:**
    ///
    /// [`cuModuleEnumerateFunctions`], [`cuFuncIsLoaded`].
    ///
    /// # Parameters
    ///
    /// - `function`: the function to load.
    pub fn cuFuncLoad(function: CUfunction) -> CUresult;
}
unsafe extern "C" {
    /// Launches a CUDA function CUfunction or a CUDA kernel CUkernel.
    ///
    /// Invokes the function [`CUfunction`] or the kernel [`CUkernel`]f on a gridDimX x gridDimY x gridDimZ grid of blocks. Each block contains blockDimX x blockDimY x blockDimZ threads.
    ///
    /// sharedMemBytes sets the amount of dynamic shared memory that will be available to each thread block.
    ///
    /// Kernel parameters to f can be specified in one of two ways:
    ///
    /// 1) Kernel parameters can be specified via kernelParams. If f has N parameters, then kernelParams needs to be an array of N pointers. Each of kernelParams\[0\] through kernelParams\[N-1\] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters
    /// and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image.
    ///
    /// 2) Kernel parameters can also be packaged by the application into a single buffer that is passed in via the extra parameter. This places the burden on the application of knowing each kernel parameter's size and alignment/padding within
    /// the buffer. Here is an example of using the extra parameter in this manner:
    ///
    /// ```text
    /// size_t argBufferSize;
    /// char argBuffer\[256\];
    ///
    /// // populate argBuffer and argBufferSize
    ///
    /// void *config[] = {
    /// CU_LAUNCH_PARAM_BUFFER_POINTER, argBuffer,
    /// CU_LAUNCH_PARAM_BUFFER_SIZE,    &argBufferSize,
    /// CU_LAUNCH_PARAM_END
    /// };
    /// status = cuLaunchKernel(f, gx, gy, gz, bx, by, bz, sh, s, NULL, config);
    /// ```
    ///
    /// The extra parameter exists to allow [`cuLaunchKernel`] to take additional less commonly used arguments. extra specifies a list of names of extra settings and their corresponding values. Each extra setting name is immediately followed
    /// by the corresponding value. The list must be terminated with either NULL or `CU_LAUNCH_PARAM_END`.
    ///
    /// * `CU_LAUNCH_PARAM_END`, which indicates the end of the extra array;
    /// * `CU_LAUNCH_PARAM_BUFFER_POINTER`, which specifies that the next value in extra will be a pointer to a buffer containing all the kernel parameters for launching kernel f;
    /// * `CU_LAUNCH_PARAM_BUFFER_SIZE`, which specifies that the next value in extra will be a pointer to a size_t containing the size of the buffer specified with `CU_LAUNCH_PARAM_BUFFER_POINTER`;
    ///
    /// The error [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned if kernel parameters are specified with both kernelParams and extra (i.e. both kernelParams and extra are non-NULL).
    ///
    /// Calling [`cuLaunchKernel`] invalidates the persistent function state set through the following deprecated APIs: [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], [`cuParamSetv`].
    ///
    /// Note that to use [`cuLaunchKernel`], the kernel f must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information,
    /// or have no kernel parameters. If either of these conditions is not met, then [`cuLaunchKernel`] will return [`cudaError_enum::CUDA_ERROR_INVALID_IMAGE`].
    ///
    /// Note that the API can also be used to launch context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to launch the kernel on will either be taken from the specified stream hStream or the current context in case of NULL stream.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [cudaLaunchKernel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g2c91bfe5e072fcd28de6606dd43cd64b), [`cuLibraryGetKernel`], [`cuKernelSetCacheConfig`], [`cuKernelGetAttribute`], [`cuKernelSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `f`: Function [`CUfunction`] or Kernel [`CUkernel`] to launch.
    /// - `gridDimX`: Width of grid in blocks.
    /// - `gridDimY`: Height of grid in blocks.
    /// - `gridDimZ`: Depth of grid in blocks.
    /// - `blockDimX`: X dimension of each thread block.
    /// - `blockDimY`: Y dimension of each thread block.
    /// - `blockDimZ`: Z dimension of each thread block.
    /// - `sharedMemBytes`: Dynamic shared-memory size per thread block in bytes.
    /// - `hStream`: Stream identifier.
    /// - `kernelParams`: Array of pointers to kernel parameters.
    /// - `extra`: Extra options.
    pub fn cuLaunchKernel(
        f: CUfunction,
        gridDimX: ::core::ffi::c_uint,
        gridDimY: ::core::ffi::c_uint,
        gridDimZ: ::core::ffi::c_uint,
        blockDimX: ::core::ffi::c_uint,
        blockDimY: ::core::ffi::c_uint,
        blockDimZ: ::core::ffi::c_uint,
        sharedMemBytes: ::core::ffi::c_uint,
        hStream: CUstream,
        kernelParams: *mut *mut ::core::ffi::c_void,
        extra: *mut *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Launches a CUDA function CUfunction or a CUDA kernel CUkernel with launch-time configuration.
    ///
    /// Invokes the function [`CUfunction`] or the kernel [`CUkernel`]f with the specified launch-time configuration config.
    ///
    /// The [`CUlaunchConfig`] structure is defined as:
    ///
    /// ```text
    /// typedef struct CUlaunchConfig_st {
    /// unsigned int gridDimX;
    /// unsigned int gridDimY;
    /// unsigned int gridDimZ;
    /// unsigned int blockDimX;
    /// unsigned int blockDimY;
    /// unsigned int blockDimZ;
    /// unsigned int sharedMemBytes;
    /// CUstream hStream;
    /// CUlaunchAttribute *attrs;
    /// unsigned int numAttrs;
    /// } CUlaunchConfig;
    /// ```
    ///
    /// where:
    ///
    /// * [CUlaunchConfig::gridDimX](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_1689d9cc16fd423b080ec828b5bc9d885) is the width of the grid in blocks.
    /// * [CUlaunchConfig::gridDimY](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_18c2c6a003a635f55703d3e00873c1a04) is the height of the grid in blocks.
    /// * [CUlaunchConfig::gridDimZ](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_12ee1e4c17d2976638d5c1def7aab2173) is the depth of the grid in blocks.
    /// * [CUlaunchConfig::blockDimX](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_1c6348b2aec5d4cbe883351f0a4ca2404) is the X dimension of each thread block.
    /// * [CUlaunchConfig::blockDimX](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_1c6348b2aec5d4cbe883351f0a4ca2404) is the Y dimension of each thread block.
    /// * [CUlaunchConfig::blockDimZ](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_114969c04364799742f22a4eb97501f75) is the Z dimension of each thread block.
    /// * [CUlaunchConfig::sharedMemBytes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_139281cdd7b80edb790b0fa85b2bca38f) is the dynamic shared-memory size per thread block in bytes.
    /// * [CUlaunchConfig::hStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_18bbdd01ea0d4d380fad9e8be14fb928b) is the handle to the stream to perform the launch in. The CUDA context associated with this stream must match that associated
    ///   with function f.
    /// * [CUlaunchConfig::attrs](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_189bd86e2a9d67c421d5ad9650e57f375) is an array of [CUlaunchConfig::numAttrs](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_1c64a4dd37ff79255de128a5868658e06) continguous [`CUlaunchAttribute`] elements. The value of this pointer is not considered if [CUlaunchConfig::numAttrs](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_1c64a4dd37ff79255de128a5868658e06) is zero. However, in that case, it is recommended to set the pointer to NULL.
    /// * [CUlaunchConfig::numAttrs](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_1c64a4dd37ff79255de128a5868658e06) is the number of attributes populating the first [CUlaunchConfig::numAttrs](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_1c64a4dd37ff79255de128a5868658e06) positions of the [CUlaunchConfig::attrs](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_189bd86e2a9d67c421d5ad9650e57f375) array.
    ///
    /// Launch-time configuration is specified by adding entries to [CUlaunchConfig::attrs](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_189bd86e2a9d67c421d5ad9650e57f375). Each entry is an attribute ID and a corresponding attribute value.
    ///
    /// The [`CUlaunchAttribute`] structure is defined as:
    ///
    /// ```text
    /// typedef struct CUlaunchAttribute_st {
    /// CUlaunchAttributeID id;
    /// CUlaunchAttributeValue value;
    /// } CUlaunchAttribute;
    /// ```
    ///
    /// * [CUlaunchAttribute::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchAttribute.html#structCUlaunchAttribute_132aed095f6c0ffe51ea05d61ee83a5df) is a unique enum identifying the attribute.
    /// * [CUlaunchAttribute::value](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchAttribute.html#structCUlaunchAttribute_1924768cf94d6cf1d94691d30e491fc55) is a union that hold the attribute value.
    ///
    /// An example of using the config parameter:
    ///
    /// ```text
    /// CUlaunchAttribute coopAttr = {.id = CU_LAUNCH_ATTRIBUTE_COOPERATIVE,
    /// .value = 1};
    /// CUlaunchConfig config = {... // set block and grid dimensions
    /// .attrs = &coopAttr,
    /// .numAttrs = 1};
    ///
    /// cuLaunchKernelEx(&config, kernel, NULL, NULL);
    /// ```
    ///
    /// The `CUlaunchAttributeID` enum is defined as:
    ///
    /// ```text
    /// typedef enum CUlaunchAttributeID_enum {
    /// CU_LAUNCH_ATTRIBUTE_IGNORE = 0,
    /// CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW   = 1,
    /// CU_LAUNCH_ATTRIBUTE_COOPERATIVE            = 2,
    /// CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY = 3,
    /// CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION                    = 4,
    /// CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = 5,
    /// CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION    = 6,
    /// CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT                   = 7,
    /// CU_LAUNCH_ATTRIBUTE_PRIORITY               = 8,
    /// CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN_MAP    = 9,
    /// CU_LAUNCH_ATTRIBUTE_MEM_SYNC_DOMAIN        = 10,
    /// CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION = 11,
    /// CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT = 12,
    /// CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE = 13,
    /// } CUlaunchAttributeID;
    /// ```
    ///
    /// and the corresponding [`CUlaunchAttributeValue`] union as :
    ///
    /// ```text
    /// typedef union CUlaunchAttributeValue_union {
    /// CUaccessPolicyWindow accessPolicyWindow;
    /// int cooperative;
    /// CUsynchronizationPolicy syncPolicy;
    /// struct {
    /// unsigned int x;
    /// unsigned int y;
    /// unsigned int z;
    /// } clusterDim;
    /// CUclusterSchedulingPolicy clusterSchedulingPolicyPreference;
    /// int programmaticStreamSerializationAllowed;
    /// struct {
    /// CUevent event;
    /// int flags;
    /// int triggerAtBlockStart;
    /// } programmaticEvent;
    /// int priority;
    /// CUlaunchMemSyncDomainMap memSyncDomainMap;
    /// CUlaunchMemSyncDomain memSyncDomain;
    /// struct {
    /// unsigned int x;
    /// unsigned int y;
    /// unsigned int z;
    /// } preferredClusterDim;
    /// struct {
    /// CUevent event;
    /// int flags;
    /// } launchCompletionEvent;
    /// struct {
    /// int deviceUpdatable;
    /// CUgraphDeviceNode devNode;
    /// } deviceUpdatableKernelNode;
    /// } CUlaunchAttributeValue;
    /// ```
    ///
    /// Setting [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_COOPERATIVE`] to a non-zero value causes the kernel launch to be a cooperative launch, with exactly the same usage and semantics of [`cuLaunchCooperativeKernel`].
    ///
    /// Setting [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_STREAM_SERIALIZATION`] to a non-zero values causes the kernel to use programmatic means to resolve its stream dependency -- enabling the CUDA runtime
    /// to opportunistically allow the grid's execution to overlap with the previous kernel in the stream, if that kernel requests
    /// the overlap.
    ///
    /// [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PROGRAMMATIC_EVENT`] records an event along with the kernel launch. Event recorded through this launch attribute is guaranteed to only trigger
    /// after all block in the associated kernel trigger the event. A block can trigger the event through PTX launchdep.release or
    /// CUDA builtin function [cudaTriggerProgrammaticLaunchCompletion()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EXECUTION.html#group__CUDART__EXECUTION_1ge194af462d927583bed3acf60d450218). A trigger can also be inserted at the beginning of each block's execution if triggerAtBlockStart is set to non-0. Note that
    /// dependents (including the CPU thread calling [`cuEventSynchronize`]) are not guaranteed to observe the release precisely when it is released. For example, [`cuEventSynchronize`] may only observe the event trigger long after the associated kernel has completed. This recording type is primarily meant
    /// for establishing programmatic dependency between device tasks. The event supplied must not be an interprocess or interop event.
    /// The event must disable timing (i.e. created with [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flag set).
    ///
    /// [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_LAUNCH_COMPLETION_EVENT`] records an event along with the kernel launch. Nominally, the event is triggered once all blocks of the kernel have begun
    /// execution. Currently this is a best effort. If a kernel B has a launch completion dependency on a kernel A, B may wait until
    /// A is complete. Alternatively, blocks of B may begin before all blocks of A have begun, for example:
    ///
    /// * If B can claim execution resources unavailable to A, for example if they run on different GPUs.
    /// * If B is a higher priority than A.
    ///
    /// Exercise caution if such an ordering inversion could lead to deadlock. The event supplied must not be an interprocess or interop
    /// event. The event must disable timing (i.e. must be created with the [`CUevent_flags_enum::CU_EVENT_DISABLE_TIMING`] flag set).
    ///
    /// Setting [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_DEVICE_UPDATABLE_KERNEL_NODE`] to 1 on a captured launch causes the resulting kernel node to be device-updatable. This attribute is specific to graphs,
    /// and passing it to a launch in a non-capturing stream results in an error. Passing a value other than 0 or 1 is not allowed.
    ///
    /// On success, a handle will be returned via CUlaunchAttributeValue::deviceUpdatableKernelNode::devNode which can be passed to
    /// the various device-side update functions to update the node's kernel parameters from within another kernel. For more information
    /// on the types of device updates that can be made, as well as the relevant limitations thereof, see [cudaGraphKernelNodeUpdatesApply](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g2d558cf37c9616365c67447e61ac0d6a).
    ///
    /// Kernel nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable
    /// nodes cannot be removed from their graph via [`cuGraphDestroyNode`]. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the attribute to 0 will
    /// result in an error. Graphs containing one or more device-updatable node also do not allow multiple instantiation.
    ///
    /// [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_PREFERRED_CLUSTER_DIMENSION`] allows the kernel launch to specify a preferred substitute cluster dimension. Blocks may be grouped according to either the
    /// dimensions specified with this attribute (grouped into a "preferred substitute cluster"), or the one specified with [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION`] attribute (grouped into a "regular cluster"). The cluster dimensions of a "preferred substitute cluster" shall be an integer
    /// multiple greater than zero of the regular cluster dimensions. The device will attempt - on a best-effort basis - to group
    /// thread blocks into preferred clusters over grouping them into regular clusters. When it deems necessary (primarily when the
    /// device temporarily runs out of physical resources to launch the larger preferred clusters), the device may switch to launch
    /// the regular clusters instead to attempt to utilize as much of the physical device resources as possible.
    ///
    /// Each type of cluster will have its enumeration / coordinate setup as if the grid consists solely of its type of cluster. For
    /// example, if the preferred substitute cluster dimensions double the regular cluster dimensions, there might be simultaneously
    /// a regular cluster indexed at (1,0,0), and a preferred cluster indexed at (1,0,0). In this example, the preferred substitute
    /// cluster (1,0,0) replaces regular clusters (2,0,0) and (3,0,0) and groups their blocks.
    ///
    /// This attribute will only take effect when a regular cluster dimension has been specified. The preferred substitute The preferred
    /// substitute cluster dimension must be an integer multiple greater than zero of the regular cluster dimension and must divide
    /// the grid. It must also be no more than `maxBlocksPerCluster`, if it is set in the kernel's `__launch_bounds__`. Otherwise
    /// it must be less than the maximum value the driver can support. Otherwise, setting this attribute to a value physically unable
    /// to fit on any particular device is permitted.
    ///
    /// The effect of other attributes is consistent with their effect when set via persistent APIs.
    ///
    /// See [`cuStreamSetAttribute`] for
    ///
    /// * [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_ACCESS_POLICY_WINDOW`]
    /// * [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY`]
    ///
    /// See [`cuFuncSetAttribute`] for
    ///
    /// * [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_DIMENSION`]
    /// * [`CUlaunchAttributeID_enum::CU_LAUNCH_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE`]
    ///
    /// Kernel parameters to f can be specified in the same ways that they can be using [`cuLaunchKernel`].
    ///
    /// Note that the API can also be used to launch context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to launch the kernel on will either be taken from the specified stream [CUlaunchConfig::hStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUlaunchConfig.html#structCUlaunchConfig_18bbdd01ea0d4d380fad9e8be14fb928b) or the current context in case of NULL stream.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [cudaLaunchKernel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g2c91bfe5e072fcd28de6606dd43cd64b), [cudaLaunchKernelEx](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g98d60efe48c3400a1c17a1edb698e530), [`cuLibraryGetKernel`], [`cuKernelSetCacheConfig`], [`cuKernelGetAttribute`], [`cuKernelSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `config`: Config to launch.
    /// - `f`: Function [`CUfunction`] or Kernel [`CUkernel`] to launch.
    /// - `kernelParams`: Array of pointers to kernel parameters.
    /// - `extra`: Extra options.
    pub fn cuLaunchKernelEx(
        config: *const CUlaunchConfig,
        f: CUfunction,
        kernelParams: *mut *mut ::core::ffi::c_void,
        extra: *mut *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Launches a CUDA function CUfunction or a CUDA kernel CUkernel where thread blocks can cooperate and synchronize as they execute.
    ///
    /// Invokes the function [`CUfunction`] or the kernel [`CUkernel`]f on a gridDimX x gridDimY x gridDimZ grid of blocks. Each block contains blockDimX x blockDimY x blockDimZ threads.
    ///
    /// sharedMemBytes sets the amount of dynamic shared memory that will be available to each thread block.
    ///
    /// The device on which this kernel is invoked must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH`].
    ///
    /// The total number of blocks launched cannot exceed the maximum number of blocks per multiprocessor as returned by [`cuOccupancyMaxActiveBlocksPerMultiprocessor`] (or [`cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`]) times the number of multiprocessors as specified by the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`].
    ///
    /// The kernel cannot make use of CUDA dynamic parallelism.
    ///
    /// Kernel parameters must be specified via kernelParams. If f has N parameters, then kernelParams needs to be an array of N pointers. Each of kernelParams\[0\] through kernelParams\[N-1\] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters
    /// and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image.
    ///
    /// Calling [`cuLaunchCooperativeKernel`] sets persistent function state that is the same as function state set through [`cuLaunchKernel`] API
    ///
    /// When the kernel f is launched via [`cuLaunchCooperativeKernel`], the previous block shape, shared size and parameter info associated with f is overwritten.
    ///
    /// Note that to use [`cuLaunchCooperativeKernel`], the kernel f must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter information,
    /// or have no kernel parameters. If either of these conditions is not met, then [`cuLaunchCooperativeKernel`] will return [`cudaError_enum::CUDA_ERROR_INVALID_IMAGE`].
    ///
    /// Note that the API can also be used to launch context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to launch the kernel on will either be taken from the specified stream hStream or the current context in case of NULL stream.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [`cuLaunchCooperativeKernelMultiDevice`], [cudaLaunchCooperativeKernel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g7c4cb6c44a6c4608da36c44374499b31), [`cuLibraryGetKernel`], [`cuKernelSetCacheConfig`], [`cuKernelGetAttribute`], [`cuKernelSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `f`: Function [`CUfunction`] or Kernel [`CUkernel`] to launch.
    /// - `gridDimX`: Width of grid in blocks.
    /// - `gridDimY`: Height of grid in blocks.
    /// - `gridDimZ`: Depth of grid in blocks.
    /// - `blockDimX`: X dimension of each thread block.
    /// - `blockDimY`: Y dimension of each thread block.
    /// - `blockDimZ`: Z dimension of each thread block.
    /// - `sharedMemBytes`: Dynamic shared-memory size per thread block in bytes.
    /// - `hStream`: Stream identifier.
    /// - `kernelParams`: Array of pointers to kernel parameters.
    pub fn cuLaunchCooperativeKernel(
        f: CUfunction,
        gridDimX: ::core::ffi::c_uint,
        gridDimY: ::core::ffi::c_uint,
        gridDimZ: ::core::ffi::c_uint,
        blockDimX: ::core::ffi::c_uint,
        blockDimY: ::core::ffi::c_uint,
        blockDimZ: ::core::ffi::c_uint,
        sharedMemBytes: ::core::ffi::c_uint,
        hStream: CUstream,
        kernelParams: *mut *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Launches CUDA functions on multiple devices where thread blocks can cooperate and synchronize as they execute.
    ///
    /// Invokes kernels as specified in the launchParamsList array where each element of the array specifies all the parameters required to perform a single kernel launch. These kernels
    /// can cooperate and synchronize as they execute. The size of the array is specified by numDevices.
    ///
    /// No two kernels can be launched on the same device. All the devices targeted by this multi-device launch must be identical.
    /// All devices must have a non-zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_COOPERATIVE_MULTI_DEVICE_LAUNCH`].
    ///
    /// All kernels launched must be identical with respect to the compiled code. Note that any __device__, __constant__ or __managed__
    /// variables present in the module that owns the kernel launched on each device, are independently instantiated on every device.
    /// It is the application's responsibility to ensure these variables are initialized and used appropriately.
    ///
    /// The size of the grids as specified in blocks, the size of the blocks themselves and the amount of shared memory used by each
    /// thread block must also match across all launched kernels.
    ///
    /// The streams used to launch these kernels must have been created via either [`cuStreamCreate`] or [`cuStreamCreateWithPriority`]. The NULL stream or `CU_STREAM_LEGACY` or `CU_STREAM_PER_THREAD` cannot be used.
    ///
    /// The total number of blocks launched per kernel cannot exceed the maximum number of blocks per multiprocessor as returned by
    /// [`cuOccupancyMaxActiveBlocksPerMultiprocessor`] (or [`cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`]) times the number of multiprocessors as specified by the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT`]. Since the total number of blocks launched per device has to match across all devices, the maximum number of blocks that
    /// can be launched per device will be limited by the device with the least number of multiprocessors.
    ///
    /// The kernels cannot make use of CUDA dynamic parallelism.
    ///
    /// The CUDA_LAUNCH_PARAMS structure is defined as:
    ///
    /// ```text
    /// typedef struct CUDA_LAUNCH_PARAMS_st
    /// {
    /// CUfunction function;
    /// unsigned int gridDimX;
    /// unsigned int gridDimY;
    /// unsigned int gridDimZ;
    /// unsigned int blockDimX;
    /// unsigned int blockDimY;
    /// unsigned int blockDimZ;
    /// unsigned int sharedMemBytes;
    /// CUstream hStream;
    /// void **kernelParams;
    /// } CUDA_LAUNCH_PARAMS;
    /// ```
    ///
    /// * [CUDA_LAUNCH_PARAMS::function](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1ad25005328ba7debf0f5bd2d39a5363c) specifies the kernel to be launched. All functions must be identical with respect to the compiled code. Note that you can
    ///   also specify context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then casting to [`CUfunction`]. In this case, the context to launch the kernel on be taken from the specified stream [CUDA_LAUNCH_PARAMS::hStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1d7b7a742ef397fe918c18bf1f5e63576).
    /// * [CUDA_LAUNCH_PARAMS::gridDimX](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_14328c3a1123bed3c08894d66ae9f0e8f) is the width of the grid in blocks. This must match across all kernels launched.
    /// * [CUDA_LAUNCH_PARAMS::gridDimY](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_175e5d98e55ad9c877acf3511f9e4c6bc) is the height of the grid in blocks. This must match across all kernels launched.
    /// * [CUDA_LAUNCH_PARAMS::gridDimZ](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_16e34c343c3dc355e93f3c47d5c3e3fbe) is the depth of the grid in blocks. This must match across all kernels launched.
    /// * [CUDA_LAUNCH_PARAMS::blockDimX](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1a31d64be7210f4f21404e89ed3c8bc09) is the X dimension of each thread block. This must match across all kernels launched.
    /// * [CUDA_LAUNCH_PARAMS::blockDimX](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1a31d64be7210f4f21404e89ed3c8bc09) is the Y dimension of each thread block. This must match across all kernels launched.
    /// * [CUDA_LAUNCH_PARAMS::blockDimZ](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1e35cc15ae81f10e20fc4c91dbc7356ea) is the Z dimension of each thread block. This must match across all kernels launched.
    /// * [CUDA_LAUNCH_PARAMS::sharedMemBytes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_113811a872234e77c9903dd977f7c7ac3) is the dynamic shared-memory size per thread block in bytes. This must match across all kernels launched.
    /// * [CUDA_LAUNCH_PARAMS::hStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1d7b7a742ef397fe918c18bf1f5e63576) is the handle to the stream to perform the launch in. This cannot be the NULL stream or `CU_STREAM_LEGACY` or `CU_STREAM_PER_THREAD`. The CUDA context associated with this stream must match that associated with [CUDA_LAUNCH_PARAMS::function](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1ad25005328ba7debf0f5bd2d39a5363c).
    /// * [CUDA_LAUNCH_PARAMS::kernelParams](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_16788671fda12351d95398142aa4c3bcd) is an array of pointers to kernel parameters. If [CUDA_LAUNCH_PARAMS::function](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1ad25005328ba7debf0f5bd2d39a5363c) has N parameters, then [CUDA_LAUNCH_PARAMS::kernelParams](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_16788671fda12351d95398142aa4c3bcd) needs to be an array of N pointers. Each of [CUDA_LAUNCH_PARAMS::kernelParams](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_16788671fda12351d95398142aa4c3bcd)\[0\] through [CUDA_LAUNCH_PARAMS::kernelParams](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_16788671fda12351d95398142aa4c3bcd)\[N-1\] must point to a region of memory from which the actual kernel parameter will be copied. The number of kernel parameters
    ///   and their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image.
    ///
    /// By default, the kernel won't begin execution on any GPU until all prior work in all the specified streams has completed. This
    /// behavior can be overridden by specifying the flag [`CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC`]. When this flag is specified, each kernel will only wait for prior work in the stream corresponding to that GPU to complete
    /// before it begins execution.
    ///
    /// Similarly, by default, any subsequent work pushed in any of the specified streams will not begin execution until the kernels
    /// on all GPUs have completed. This behavior can be overridden by specifying the flag [`CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_POST_LAUNCH_SYNC`]. When this flag is specified, any subsequent work pushed in any of the specified streams will only wait for the kernel launched
    /// on the GPU corresponding to that stream to complete before it begins execution.
    ///
    /// Calling [`cuLaunchCooperativeKernelMultiDevice`] sets persistent function state that is the same as function state set through [`cuLaunchKernel`] API when called individually for each element in launchParamsList.
    ///
    /// When kernels are launched via [`cuLaunchCooperativeKernelMultiDevice`], the previous block shape, shared size and parameter info associated with each [CUDA_LAUNCH_PARAMS::function](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__LAUNCH__PARAMS__v1.html#structCUDA__LAUNCH__PARAMS__v1_1ad25005328ba7debf0f5bd2d39a5363c) in launchParamsList is overwritten.
    ///
    /// Note that to use [`cuLaunchCooperativeKernelMultiDevice`], the kernels must either have been compiled with toolchain version 3.2 or later so that it will contain kernel parameter
    /// information, or have no kernel parameters. If either of these conditions is not met, then [`cuLaunchCooperativeKernelMultiDevice`] will return [`cudaError_enum::CUDA_ERROR_INVALID_IMAGE`].
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [`cuLaunchCooperativeKernel`], cudaLaunchCooperativeKernelMultiDevice.
    ///
    /// # Parameters
    ///
    /// - `launchParamsList`: List of launch parameters, one per device.
    /// - `numDevices`: Size of the launchParamsList array.
    /// - `flags`: Flags to control launch behavior.
    #[deprecated]
    pub fn cuLaunchCooperativeKernelMultiDevice(
        launchParamsList: *mut CUDA_LAUNCH_PARAMS,
        numDevices: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Enqueues a host function call in a stream.
    ///
    /// Enqueues a host function to run in a stream. The function will be called after currently enqueued work and will block work
    /// added after it.
    ///
    /// The host function must not make any CUDA API calls. Attempting to use a CUDA API may result in [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`], but this is not required. The host function must not perform any synchronization that may depend on outstanding CUDA work
    /// not mandated to run earlier. Host functions without a mandated order (such as in independent streams) execute in undefined
    /// order and may be serialized.
    ///
    /// For the purposes of Unified Memory, execution makes a number of guarantees:
    ///
    /// * The stream is considered idle for the duration of the function's execution. Thus, for example, the function may always use
    ///   memory attached to the stream it was enqueued in.
    /// * The start of execution of the function has the same effect as synchronizing an event recorded in the same stream immediately
    ///   prior to the function. It thus synchronizes streams which have been "joined" prior to the function.
    /// * Adding device work to any stream does not have the effect of making the stream active until all preceding host functions and
    ///   stream callbacks have executed. Thus, for example, a function might use global attached memory even if work has been added
    ///   to another stream, if the work has been ordered behind the function call with an event.
    /// * Completion of the function does not cause a stream to become active except as described above. The stream will remain idle
    ///   if no device work follows the function, and will remain idle across consecutive host functions or stream callbacks without
    ///   device work in between. Thus, for example, stream synchronization can be done by signaling from a host function at the end
    ///   of the stream.
    ///
    /// Note that, in contrast to [`cuStreamAddCallback`], the function will not be called in the event of an error in the CUDA context.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamWaitEvent`], [`cuStreamDestroy_v2`], [`cuMemAllocManaged`], [`cuStreamAttachMemAsync`], [`cuStreamAddCallback`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to enqueue function call in.
    /// - `userData`: User-specified data to be passed to the function.
    pub fn cuLaunchHostFunc(
        hStream: CUstream,
        fn_: CUhostFn,
        userData: *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Enqueues a host function call in a stream.
    ///
    /// Enqueues a host function to run in a stream. The function will be called after currently enqueued work and will block work
    /// added after it.
    ///
    /// The host function must not make any CUDA API calls. Attempting to use a CUDA API may result in [`cudaError_enum::CUDA_ERROR_NOT_PERMITTED`], but this is not required. The host function must not perform any synchronization that may depend on outstanding CUDA work
    /// not mandated to run earlier. Host functions without a mandated order (such as in independent streams) execute in undefined
    /// order and may be serialized.
    ///
    /// For the purposes of Unified Memory, execution makes a number of guarantees:
    ///
    /// * The stream is considered idle for the duration of the function's execution. Thus, for example, the function may always use
    ///   memory attached to the stream it was enqueued in.
    /// * The start of execution of the function has the same effect as synchronizing an event recorded in the same stream immediately
    ///   prior to the function. It thus synchronizes streams which have been "joined" prior to the function.
    /// * Adding device work to any stream does not have the effect of making the stream active until all preceding host functions and
    ///   stream callbacks have executed. Thus, for example, a function might use global attached memory even if work has been added
    ///   to another stream, if the work has been ordered behind the function call with an event.
    /// * Completion of the function does not cause a stream to become active except as described above. The stream will remain idle
    ///   if no device work follows the function, and will remain idle across consecutive host functions or stream callbacks without
    ///   device work in between. Thus, for example, stream synchronization can be done by signaling from a host function at the end
    ///   of the stream.
    ///
    /// Note that, in contrast to [`cuStreamAddCallback`], the function will not be called in the event of an error in the CUDA context.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamCreate`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamWaitEvent`], [`cuStreamDestroy_v2`], [`cuMemAllocManaged`], [`cuStreamAttachMemAsync`], [`cuStreamAddCallback`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to enqueue function call in.
    /// - `userData`: User-specified data to be passed to the function.
    /// - `syncMode`: Synchronization mode for the host function.
    pub fn cuLaunchHostFunc_v2(
        hStream: CUstream,
        fn_: CUhostFn,
        userData: *mut ::core::ffi::c_void,
        syncMode: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the block-dimensions for the function.
    ///
    /// x
    ///
    /// y
    ///
    /// z
    ///
    /// hfunc
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetSharedSize`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Kernel to specify dimensions of.
    /// - `x`: X dimension.
    /// - `y`: Y dimension.
    /// - `z`: Z dimension.
    #[deprecated]
    pub fn cuFuncSetBlockShape(
        hfunc: CUfunction,
        x: ::core::ffi::c_int,
        y: ::core::ffi::c_int,
        z: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the dynamic shared-memory size for the function.
    ///
    /// bytes
    ///
    /// hfunc
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetBlockShape`], [`cuFuncSetCacheConfig`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Kernel to specify dynamic shared-memory size for.
    /// - `bytes`: Dynamic shared-memory size per thread in bytes.
    #[deprecated]
    pub fn cuFuncSetSharedSize(
        hfunc: CUfunction,
        bytes: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the parameter size for the function.
    ///
    /// numbytes
    ///
    /// hfunc
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetf`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Kernel to set parameter size for.
    /// - `numbytes`: Size of parameter list in bytes.
    #[deprecated]
    pub fn cuParamSetSize(hfunc: CUfunction, numbytes: ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Adds an integer parameter to the function's argument list.
    ///
    /// hfunc
    ///
    /// offset
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Kernel to add parameter to.
    /// - `offset`: Offset to add parameter to argument list.
    /// - `value`: Value of parameter.
    #[deprecated]
    pub fn cuParamSeti(
        hfunc: CUfunction,
        offset: ::core::ffi::c_int,
        value: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Adds a floating-point parameter to the function's argument list.
    ///
    /// hfunc
    ///
    /// offset
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Kernel to add parameter to.
    /// - `offset`: Offset to add parameter to argument list.
    /// - `value`: Value of parameter.
    #[deprecated]
    pub fn cuParamSetf(
        hfunc: CUfunction,
        offset: ::core::ffi::c_int,
        value: f32,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Adds arbitrary data to the function's argument list.
    ///
    /// numbytes
    ///
    /// ptr
    ///
    /// hfunc
    ///
    /// offset
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSeti`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Kernel to add data to.
    /// - `offset`: Offset to add data to argument list.
    /// - `ptr`: Pointer to arbitrary data.
    /// - `numbytes`: Size of data to copy in bytes.
    #[deprecated]
    pub fn cuParamSetv(
        hfunc: CUfunction,
        offset: ::core::ffi::c_int,
        ptr: *mut ::core::ffi::c_void,
        numbytes: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Launches a CUDA function.
    ///
    /// f
    ///
    /// [`cuFuncSetBlockShape`]
    ///
    /// The block shape, dynamic shared memory size, and parameter information must be set using [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], and [`cuParamSetv`] prior to calling this function.
    ///
    /// Launching a function via [`cuLaunchKernel`] invalidates the function's block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel,
    /// this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunchGrid`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `f`: Kernel to launch.
    #[deprecated]
    pub fn cuLaunch(f: CUfunction) -> CUresult;
}
unsafe extern "C" {
    /// Launches a CUDA function.
    ///
    /// f
    ///
    /// grid_width
    ///
    /// grid_height
    ///
    /// [`cuFuncSetBlockShape`]
    ///
    /// The block shape, dynamic shared memory size, and parameter information must be set using [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], and [`cuParamSetv`] prior to calling this function.
    ///
    /// Launching a function via [`cuLaunchKernel`] invalidates the function's block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel,
    /// this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGridAsync`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `f`: Kernel to launch.
    /// - `grid_width`: Width of grid in blocks.
    /// - `grid_height`: Height of grid in blocks.
    #[deprecated]
    pub fn cuLaunchGrid(
        f: CUfunction,
        grid_width: ::core::ffi::c_int,
        grid_height: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Launches a CUDA function.
    ///
    /// f
    ///
    /// grid_width
    ///
    /// grid_height
    ///
    /// [`cuFuncSetBlockShape`]
    ///
    /// The block shape, dynamic shared memory size, and parameter information must be set using [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuParamSetSize`], [`cuParamSeti`], [`cuParamSetf`], and [`cuParamSetv`] prior to calling this function.
    ///
    /// Launching a function via [`cuLaunchKernel`] invalidates the function's block shape, dynamic shared memory size, and parameter information. After launching via cuLaunchKernel,
    /// this state must be re-initialized prior to calling this function. Failure to do so results in undefined behavior.
    ///
    /// Note:
    ///
    /// * In certain cases where cubins are created with no ABI (i.e., using ptxas--abi-compileno), this function may serialize kernel launches. The CUDA driver retains asynchronous behavior by growing the per-thread stack
    ///   as needed per launch and not shrinking it afterwards.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuFuncSetBlockShape`], [`cuFuncSetSharedSize`], [`cuFuncGetAttribute`], [`cuParamSetSize`], [`cuParamSetf`], [`cuParamSeti`], [`cuParamSetv`], [`cuLaunch`], [`cuLaunchGrid`], [`cuLaunchKernel`].
    ///
    /// # Parameters
    ///
    /// - `f`: Kernel to launch.
    /// - `grid_width`: Width of grid in blocks.
    /// - `grid_height`: Height of grid in blocks.
    /// - `hStream`: Stream identifier.
    #[deprecated]
    pub fn cuLaunchGridAsync(
        f: CUfunction,
        grid_width: ::core::ffi::c_int,
        grid_height: ::core::ffi::c_int,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Adds a texture-reference to the function's argument list.
    ///
    /// hTexRef
    ///
    /// [`cuModuleGetTexRef`]
    ///
    /// texunit
    ///
    /// [`CU_PARAM_TR_DEFAULT`]
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// # Parameters
    ///
    /// - `hfunc`: Kernel to add texture-reference to.
    /// - `texunit`: Texture unit (must be [`CU_PARAM_TR_DEFAULT`]).
    /// - `hTexRef`: Texture-reference to add to argument list.
    #[deprecated]
    pub fn cuParamSetTexRef(
        hfunc: CUfunction,
        texunit: ::core::ffi::c_int,
        hTexRef: CUtexref,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the shared memory configuration for a device function.
    ///
    /// Any per-function setting of shared memory bank size set via [`cuFuncSetSharedMemConfig`] will override the context wide setting set with [`cuCtxSetSharedMemConfig`].
    ///
    /// Changing the shared memory bank size will not increase shared memory usage or affect occupancy of kernels, but may have major
    /// effects on performance. Larger bank sizes will allow for greater potential bandwidth to shared memory, but will change what
    /// kinds of accesses to shared memory will result in bank conflicts.
    ///
    /// This function will do nothing on devices with fixed shared memory bank size.
    ///
    /// The supported bank configurations are:
    ///
    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_DEFAULT_BANK_SIZE`]: use the context's shared memory configuration when launching this function.
    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_FOUR_BYTE_BANK_SIZE`]: set shared memory bank width to be natively four bytes when launching this function.
    /// * [`CUsharedconfig_enum::CU_SHARED_MEM_CONFIG_EIGHT_BYTE_BANK_SIZE`]: set shared memory bank width to be natively eight bytes when launching this function.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxGetCacheConfig`], [`cuCtxSetCacheConfig`], [`cuCtxGetSharedMemConfig`], [`cuCtxSetSharedMemConfig`], [`cuFuncGetAttribute`], [`cuLaunchKernel`], [cudaFuncSetSharedMemConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EXECUTION__DEPRECATED.html#group__CUDART__EXECUTION__DEPRECATED_1gbd189716def6fdb5f819dae77452d30b).
    ///
    /// # Parameters
    ///
    /// - `hfunc`: kernel to be given a shared memory config.
    /// - `config`: requested shared memory configuration.
    #[deprecated]
    pub fn cuFuncSetSharedMemConfig(
        hfunc: CUfunction,
        config: CUsharedconfig,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a graph.
    ///
    /// Creates an empty graph, which is returned via phGraph.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`], `cuGraphInstantiate`, [`cuGraphDestroy`], [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphGetEdges_v2`], [`cuGraphClone`].
    ///
    /// # Parameters
    ///
    /// - `phGraph`: Returns newly created graph.
    /// - `flags`: Graph creation flags, must be 0.
    pub fn cuGraphCreate(phGraph: *mut CUgraph, flags: ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Creates a kernel execution node and adds it to a graph.
    ///
    /// Creates a new kernel execution node and adds it to hGraph with numDependencies dependencies specified via dependencies and arguments specified in nodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// The CUDA_KERNEL_NODE_PARAMS structure is defined as:
    ///
    /// ```text
    ///   typedef struct CUDA_KERNEL_NODE_PARAMS_st {
    /// CUfunction func;
    /// unsigned int gridDimX;
    /// unsigned int gridDimY;
    /// unsigned int gridDimZ;
    /// unsigned int blockDimX;
    /// unsigned int blockDimY;
    /// unsigned int blockDimZ;
    /// unsigned int sharedMemBytes;
    /// void **kernelParams;
    /// void **extra;
    /// CUkernel kern;
    /// CUcontext ctx;
    /// } CUDA_KERNEL_NODE_PARAMS;
    /// ```
    ///
    /// When the graph is launched, the node will invoke kernel func on a (gridDimX x gridDimY x gridDimZ) grid of blocks. Each block contains (blockDimX x blockDimY x blockDimZ) threads.
    ///
    /// sharedMemBytes sets the amount of dynamic shared memory that will be available to each thread block.
    ///
    /// Kernel parameters to func can be specified in one of two ways:
    ///
    /// 1) Kernel parameters can be specified via kernelParams. If the kernel has N parameters, then kernelParams needs to be an array of N pointers. Each pointer, from kernelParams\[0\] to kernelParams\[N-1\], points to the region of memory from which the actual parameter will be copied. The number of kernel parameters and
    /// their offsets and sizes do not need to be specified as that information is retrieved directly from the kernel's image.
    ///
    /// 2) Kernel parameters for non-cooperative kernels can also be packaged by the application into a single buffer that is passed
    /// in via extra. This places the burden on the application of knowing each kernel parameter's size and alignment/padding within the buffer.
    /// The extra parameter exists to allow this function to take additional less commonly used arguments. extra specifies a list of names of extra settings and their corresponding values. Each extra setting name is immediately followed
    /// by the corresponding value. The list must be terminated with either NULL or CU_LAUNCH_PARAM_END.
    ///
    /// * `CU_LAUNCH_PARAM_END`, which indicates the end of the extra array;
    /// * `CU_LAUNCH_PARAM_BUFFER_POINTER`, which specifies that the next value in extra will be a pointer to a buffer containing all the kernel parameters for launching kernel func;
    /// * `CU_LAUNCH_PARAM_BUFFER_SIZE`, which specifies that the next value in extra will be a pointer to a size_t containing the size of the buffer specified with `CU_LAUNCH_PARAM_BUFFER_POINTER`;
    ///
    /// The error [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned if kernel parameters are specified with both kernelParams and extra (i.e. both kernelParams and extra are non-NULL). [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] will be returned if extra is used for a cooperative kernel.
    ///
    /// The kernelParams or extra array, as well as the argument values it points to, are copied during this call.
    ///
    /// Note:
    ///
    /// Kernels launched using graphs must not use texture and surface references. Reading or writing through any texture or surface
    /// reference is undefined behavior. This restriction does not apply to texture and surface objects.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuLaunchKernel`], [`cuLaunchCooperativeKernel`], [`cuGraphKernelNodeGetParams_v2`], [`cuGraphKernelNodeSetParams_v2`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the GPU execution node.
    pub fn cuGraphAddKernelNode_v2(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        nodeParams: *const CUDA_KERNEL_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a kernel node's parameters.
    ///
    /// Returns the parameters of kernel node hNode in nodeParams. The kernelParams or extra array returned in nodeParams, as well as the argument values it points to, are owned by the node. This memory remains valid until the node is destroyed
    /// or its parameters are modified, and should not be modified directly. Use [`cuGraphKernelNodeSetParams_v2`] to update the parameters of this node.
    ///
    /// The params will contain either kernelParams or extra, according to which of these was most recently set on the node.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuLaunchKernel`], [`cuGraphAddKernelNode_v2`], [`cuGraphKernelNodeSetParams_v2`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `nodeParams`: Pointer to return the parameters.
    pub fn cuGraphKernelNodeGetParams_v2(
        hNode: CUgraphNode,
        nodeParams: *mut CUDA_KERNEL_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets a kernel node's parameters.
    ///
    /// Sets the parameters of kernel node hNode to nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuLaunchKernel`], [`cuGraphAddKernelNode_v2`], [`cuGraphKernelNodeGetParams_v2`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cuGraphKernelNodeSetParams_v2(
        hNode: CUgraphNode,
        nodeParams: *const CUDA_KERNEL_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a memcpy node and adds it to a graph.
    ///
    /// Creates a new memcpy node and adds it to hGraph with numDependencies dependencies specified via dependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// When the graph is launched, the node will perform the memcpy described by copyParams. See [`cuMemcpy3D_v2`] for a description of the structure and its restrictions.
    ///
    /// Memcpy nodes have some additional restrictions with regards to managed memory, if the system contains at least one device
    /// which has a zero value for the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`]. If one or more of the operands refer to managed memory, then using the memory type [`CUmemorytype_enum::CU_MEMORYTYPE_UNIFIED`] is disallowed for those operand(s). The managed memory will be treated as residing on either the host or the device, depending
    /// on which memory type is specified.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuMemcpy3D_v2`], [`cuGraphMemcpyNodeGetParams`], [`cuGraphMemcpyNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddHostNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `copyParams`: Parameters for the memory copy.
    /// - `ctx`: Context on which to run the node.
    pub fn cuGraphAddMemcpyNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        copyParams: *const CUDA_MEMCPY3D,
        ctx: CUcontext,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a memcpy node's parameters.
    ///
    /// Returns the parameters of memcpy node hNode in nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuMemcpy3D_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphMemcpyNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `nodeParams`: Pointer to return the parameters.
    pub fn cuGraphMemcpyNodeGetParams(
        hNode: CUgraphNode,
        nodeParams: *mut CUDA_MEMCPY3D,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets a memcpy node's parameters.
    ///
    /// Sets the parameters of memcpy node hNode to nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuMemcpy3D_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphMemcpyNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cuGraphMemcpyNodeSetParams(
        hNode: CUgraphNode,
        nodeParams: *const CUDA_MEMCPY3D,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a memset node and adds it to a graph.
    ///
    /// Creates a new memset node and adds it to hGraph with numDependencies dependencies specified via dependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// The element size must be 1, 2, or 4 bytes. When the graph is launched, the node will perform the memset described by memsetParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuMemsetD2D32_v2`], [`cuGraphMemsetNodeGetParams`], [`cuGraphMemsetNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `memsetParams`: Parameters for the memory set.
    /// - `ctx`: Context on which to run the node.
    pub fn cuGraphAddMemsetNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        memsetParams: *const CUDA_MEMSET_NODE_PARAMS,
        ctx: CUcontext,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a memset node's parameters.
    ///
    /// Returns the parameters of memset node hNode in nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuMemsetD2D32_v2`], [`cuGraphAddMemsetNode`], [`cuGraphMemsetNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `nodeParams`: Pointer to return the parameters.
    pub fn cuGraphMemsetNodeGetParams(
        hNode: CUgraphNode,
        nodeParams: *mut CUDA_MEMSET_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets a memset node's parameters.
    ///
    /// Sets the parameters of memset node hNode to nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuMemsetD2D32_v2`], [`cuGraphAddMemsetNode`], [`cuGraphMemsetNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cuGraphMemsetNodeSetParams(
        hNode: CUgraphNode,
        nodeParams: *const CUDA_MEMSET_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a host execution node and adds it to a graph.
    ///
    /// Creates a new CPU execution node and adds it to hGraph with numDependencies dependencies specified via dependencies and arguments specified in nodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// When the graph is launched, the node will invoke the specified CPU function. Host nodes are not supported under MPS with pre-Volta
    /// GPUs.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuLaunchHostFunc`], [`cuGraphHostNodeGetParams`], [`cuGraphHostNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the host node.
    pub fn cuGraphAddHostNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        nodeParams: *const CUDA_HOST_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a host node's parameters.
    ///
    /// Returns the parameters of host node hNode in nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuLaunchHostFunc`], [`cuGraphAddHostNode`], [`cuGraphHostNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `nodeParams`: Pointer to return the parameters.
    pub fn cuGraphHostNodeGetParams(
        hNode: CUgraphNode,
        nodeParams: *mut CUDA_HOST_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets a host node's parameters.
    ///
    /// Sets the parameters of host node hNode to nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuLaunchHostFunc`], [`cuGraphAddHostNode`], [`cuGraphHostNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cuGraphHostNodeSetParams(
        hNode: CUgraphNode,
        nodeParams: *const CUDA_HOST_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a child graph node and adds it to a graph.
    ///
    /// Creates a new node which executes an embedded graph, and adds it to hGraph with numDependencies dependencies specified via dependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// If childGraph contains allocation nodes, free nodes, or conditional nodes, this call will return an error.
    ///
    /// The node executes an embedded child graph. The child graph is cloned in this call.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphChildGraphNodeGetGraph`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`], [`cuGraphClone`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `childGraph`: The graph to clone into this node.
    pub fn cuGraphAddChildGraphNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        childGraph: CUgraph,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets a handle to the embedded graph of a child graph node.
    ///
    /// Gets a handle to the embedded graph in a child graph node. This call does not clone the graph. Changes to the graph will be
    /// reflected in the node, and the node retains ownership of the graph.
    ///
    /// Allocation and free nodes cannot be added to the returned graph. Attempting to do so will return an error.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddChildGraphNode`], [`cuGraphNodeFindInClone`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the embedded graph for.
    /// - `phGraph`: Location to store a handle to the graph.
    pub fn cuGraphChildGraphNodeGetGraph(
        hNode: CUgraphNode,
        phGraph: *mut CUgraph,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates an empty node and adds it to a graph.
    ///
    /// Creates a new node which performs no operation, and adds it to hGraph with numDependencies dependencies specified via dependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// An empty node performs no operation during execution, but can be used for transitive ordering. For example, a phased execution
    /// graph with 2 groups of n nodes with a barrier between them can be represented using an empty node and 2\*n dependency edges,
    /// rather than no empty node and n^2 dependency edges.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    pub fn cuGraphAddEmptyNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates an event record node and adds it to a graph.
    ///
    /// Creates a new event record node and adds it to hGraph with numDependencies dependencies specified via dependencies and event specified in event. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// Each launch of the graph will record event to capture execution of the node's dependencies.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphAddEventWaitNode`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `event`: Event for the node.
    pub fn cuGraphAddEventRecordNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        event: CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the event associated with an event record node.
    ///
    /// Returns the event of event record node hNode in event_out.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddEventRecordNode`], [`cuGraphEventRecordNodeSetEvent`], [`cuGraphEventWaitNodeGetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the event for.
    /// - `event_out`: Pointer to return the event.
    pub fn cuGraphEventRecordNodeGetEvent(
        hNode: CUgraphNode,
        event_out: *mut CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets an event record node's event.
    ///
    /// Sets the event of event record node hNode to event.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuGraphAddEventRecordNode`], [`cuGraphEventRecordNodeGetEvent`], [`cuGraphEventWaitNodeSetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the event for.
    /// - `event`: Event to use.
    pub fn cuGraphEventRecordNodeSetEvent(
        hNode: CUgraphNode,
        event: CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates an event wait node and adds it to a graph.
    ///
    /// Creates a new event wait node and adds it to hGraph with numDependencies dependencies specified via dependencies and event specified in event. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// The graph node will wait for all work captured in event. See [`cuEventRecord`] for details on what is captured by an event. event may be from a different context or device than the launch stream.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphAddEventRecordNode`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `event`: Event for the node.
    pub fn cuGraphAddEventWaitNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        event: CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the event associated with an event wait node.
    ///
    /// Returns the event of event wait node hNode in event_out.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddEventWaitNode`], [`cuGraphEventWaitNodeSetEvent`], [`cuGraphEventRecordNodeGetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the event for.
    /// - `event_out`: Pointer to return the event.
    pub fn cuGraphEventWaitNodeGetEvent(
        hNode: CUgraphNode,
        event_out: *mut CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets an event wait node's event.
    ///
    /// Sets the event of event wait node hNode to event.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuGraphAddEventWaitNode`], [`cuGraphEventWaitNodeGetEvent`], [`cuGraphEventRecordNodeSetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the event for.
    /// - `event`: Event to use.
    pub fn cuGraphEventWaitNodeSetEvent(hNode: CUgraphNode, event: CUevent) -> CUresult;
}
unsafe extern "C" {
    /// Creates an external semaphore signal node and adds it to a graph.
    ///
    /// Creates a new external semaphore signal node and adds it to hGraph with numDependencies dependencies specified via dependencies and arguments specified in nodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// Performs a signal operation on a set of externally allocated semaphore objects when the node is launched. The operation(s)
    /// will occur after all of the node's dependencies have completed.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphExternalSemaphoresSignalNodeGetParams`], [`cuGraphExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddEventRecordNode`], [`cuGraphAddEventWaitNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the node.
    pub fn cuGraphAddExternalSemaphoresSignalNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns an external semaphore signal node's parameters.
    ///
    /// Returns the parameters of an external semaphore signal node hNode in params_out. The extSemArray and paramsArray returned in params_out, are owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should
    /// not be modified directly. Use [`cuGraphExternalSemaphoresSignalNodeSetParams`] to update the parameters of this node.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuLaunchKernel`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuGraphExternalSemaphoresSignalNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `params_out`: Pointer to return the parameters.
    pub fn cuGraphExternalSemaphoresSignalNodeGetParams(
        hNode: CUgraphNode,
        params_out: *mut CUDA_EXT_SEM_SIGNAL_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets an external semaphore signal node's parameters.
    ///
    /// Sets the parameters of an external semaphore signal node hNode to nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuGraphExternalSemaphoresSignalNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cuGraphExternalSemaphoresSignalNodeSetParams(
        hNode: CUgraphNode,
        nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates an external semaphore wait node and adds it to a graph.
    ///
    /// Creates a new external semaphore wait node and adds it to hGraph with numDependencies dependencies specified via dependencies and arguments specified in nodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// Performs a wait operation on a set of externally allocated semaphore objects when the node is launched. The node's dependencies
    /// will not be launched until the wait operation has completed.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphExternalSemaphoresWaitNodeGetParams`], [`cuGraphExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddEventRecordNode`], [`cuGraphAddEventWaitNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the node.
    pub fn cuGraphAddExternalSemaphoresWaitNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns an external semaphore wait node's parameters.
    ///
    /// Returns the parameters of an external semaphore wait node hNode in params_out. The extSemArray and paramsArray returned in params_out, are owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should
    /// not be modified directly. Use [`cuGraphExternalSemaphoresSignalNodeSetParams`] to update the parameters of this node.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuLaunchKernel`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuGraphExternalSemaphoresWaitNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `params_out`: Pointer to return the parameters.
    pub fn cuGraphExternalSemaphoresWaitNodeGetParams(
        hNode: CUgraphNode,
        params_out: *mut CUDA_EXT_SEM_WAIT_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets an external semaphore wait node's parameters.
    ///
    /// Sets the parameters of an external semaphore wait node hNode to nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuGraphExternalSemaphoresWaitNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cuGraphExternalSemaphoresWaitNodeSetParams(
        hNode: CUgraphNode,
        nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a batch memory operation node and adds it to a graph.
    ///
    /// Creates a new batch memory operation node and adds it to hGraph with numDependencies dependencies specified via dependencies and arguments specified in nodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// When the node is added, the paramArray inside nodeParams is copied and therefore it can be freed after the call returns.
    ///
    /// Note:
    ///
    /// Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not
    /// visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible
    /// dependencies such as events. This ensures that the scheduler does not serialize them in an improper order.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuStreamBatchMemOp_v2`], [`cuStreamWaitValue32_v2`], [`cuStreamWriteValue32_v2`], [`cuStreamWaitValue64_v2`], [`cuStreamWriteValue64_v2`], [`cuGraphBatchMemOpNodeGetParams`], [`cuGraphBatchMemOpNodeSetParams`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the node.
    pub fn cuGraphAddBatchMemOpNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        nodeParams: *const CUDA_BATCH_MEM_OP_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a batch mem op node's parameters.
    ///
    /// Returns the parameters of batch mem op node hNode in nodeParams_out. The paramArray returned in nodeParams_out is owned by the node. This memory remains valid until the node is destroyed or its parameters are modified, and should not
    /// be modified directly. Use [`cuGraphBatchMemOpNodeSetParams`] to update the parameters of this node.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuStreamBatchMemOp_v2`], [`cuGraphAddBatchMemOpNode`], [`cuGraphBatchMemOpNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `nodeParams_out`: Pointer to return the parameters.
    pub fn cuGraphBatchMemOpNodeGetParams(
        hNode: CUgraphNode,
        nodeParams_out: *mut CUDA_BATCH_MEM_OP_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets a batch mem op node's parameters.
    ///
    /// Sets the parameters of batch mem op node hNode to nodeParams.
    ///
    /// The paramArray inside nodeParams is copied and therefore it can be freed after the call returns.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuStreamBatchMemOp_v2`], [`cuGraphAddBatchMemOpNode`], [`cuGraphBatchMemOpNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cuGraphBatchMemOpNodeSetParams(
        hNode: CUgraphNode,
        nodeParams: *const CUDA_BATCH_MEM_OP_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the parameters for a batch mem op node in the given graphExec.
    ///
    /// Sets the parameters of a batch mem op node in an executable graph hGraphExec. The node is identified by the corresponding node hNode in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// The following fields on operations may be modified on an executable graph:
    ///
    /// op.waitValue.address op.waitValue.value\[64\] op.waitValue.flags bits corresponding to wait type (i.e. [`CUstreamWaitValue_flags::CU_STREAM_WAIT_VALUE_FLUSH`]
    /// bit cannot be modified) op.writeValue.address op.writeValue.value\[64\]
    ///
    /// Other fields, such as the context, count or type of operations, and other types of operations such as membars, may not be
    /// modified.
    ///
    /// hNode must not have been removed from the original graph.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// The paramArray inside nodeParams is copied and therefore it can be freed after the call returns.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuStreamBatchMemOp_v2`], [`cuGraphAddBatchMemOpNode`], [`cuGraphBatchMemOpNodeGetParams`], [`cuGraphBatchMemOpNodeSetParams`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: Batch mem op node from the graph from which graphExec was instantiated.
    /// - `nodeParams`: Updated Parameters to set.
    pub fn cuGraphExecBatchMemOpNodeSetParams(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        nodeParams: *const CUDA_BATCH_MEM_OP_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates an allocation node and adds it to a graph.
    ///
    /// Creates a new allocation node and adds it to hGraph with numDependencies dependencies specified via dependencies and arguments specified in nodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// When [`cuGraphAddMemAllocNode`] creates an allocation node, it returns the address of the allocation in nodeParams.dptr. The allocation's address remains fixed across instantiations and launches.
    ///
    /// If the allocation is freed in the same graph, by creating a free node using [`cuGraphAddMemFreeNode`], the allocation can be accessed by nodes ordered after the allocation node but before the free node. These allocations cannot
    /// be freed outside the owning graph, and they can only be freed once in the owning graph.
    ///
    /// If the allocation is not freed in the same graph, then it can be accessed not only by nodes in the graph which are ordered
    /// after the allocation node, but also by stream operations ordered after the graph's execution but before the allocation is
    /// freed.
    ///
    /// Allocations which are not freed in the same graph can be freed by:
    ///
    /// * passing the allocation to [`cuMemFreeAsync`] or [`cuMemFree_v2`];
    /// * launching a graph with a free node for that allocation; or
    /// * specifying [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`] during instantiation, which makes each launch behave as though it called [`cuMemFreeAsync`] for every unfreed allocation.
    ///
    /// It is not possible to free an allocation in both the owning graph and another graph. If the allocation is freed in the same
    /// graph, a free node cannot be added to another graph. If the allocation is freed in another graph, a free node can no longer
    /// be added to the owning graph.
    ///
    /// The following restrictions apply to graphs which contain allocation and/or memory free nodes:
    ///
    /// * Nodes and edges of the graph cannot be deleted.
    /// * The graph can only be used in a child node if the ownership is moved to the parent.
    /// * Only one instantiation of the graph may exist at any point in time.
    /// * The graph cannot be cloned.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphAddMemFreeNode`], [`cuGraphMemAllocNodeGetParams`], [`cuDeviceGraphMemTrim`], [`cuDeviceGetGraphMemAttribute`], [`cuDeviceSetGraphMemAttribute`], [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddEventRecordNode`], [`cuGraphAddEventWaitNode`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the node.
    pub fn cuGraphAddMemAllocNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        nodeParams: *mut CUDA_MEM_ALLOC_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a memory alloc node's parameters.
    ///
    /// Returns the parameters of a memory alloc node hNode in params_out. The poolProps and accessDescs returned in params_out, are owned by the node. This memory remains valid until the node is destroyed. The returned parameters must not be modified.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuGraphAddMemAllocNode`], [`cuGraphMemFreeNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `params_out`: Pointer to return the parameters.
    pub fn cuGraphMemAllocNodeGetParams(
        hNode: CUgraphNode,
        params_out: *mut CUDA_MEM_ALLOC_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a memory free node and adds it to a graph.
    ///
    /// Creates a new memory free node and adds it to hGraph with numDependencies dependencies specified via dependencies and arguments specified in nodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. dependencies may not have any duplicate entries. A handle to the new node will be returned in phGraphNode.
    ///
    /// [`cuGraphAddMemFreeNode`] will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if the user attempts to free:
    ///
    /// * an allocation twice in the same graph.
    /// * an address that was not returned by an allocation node.
    /// * an invalid address.
    ///
    /// The following restrictions apply to graphs which contain allocation and/or memory free nodes:
    ///
    /// * Nodes and edges of the graph cannot be deleted.
    /// * The graph can only be used in a child node if the ownership is moved to the parent.
    /// * Only one instantiation of the graph may exist at any point in time.
    /// * The graph cannot be cloned.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphAddMemAllocNode`], [`cuGraphMemFreeNodeGetParams`], [`cuDeviceGraphMemTrim`], [`cuDeviceGetGraphMemAttribute`], [`cuDeviceSetGraphMemAttribute`], [`cuMemAllocAsync`], [`cuMemFreeAsync`], [`cuGraphCreate`], [`cuGraphDestroyNode`], [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddEventRecordNode`], [`cuGraphAddEventWaitNode`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `dptr`: Address of memory to free.
    pub fn cuGraphAddMemFreeNode(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        numDependencies: size_t,
        dptr: CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a memory free node's parameters.
    ///
    /// Returns the address of a memory free node hNode in dptr_out.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetParams`], [`cuGraphAddMemFreeNode`], [`cuGraphMemAllocNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `dptr_out`: Pointer to return the device address.
    pub fn cuGraphMemFreeNodeGetParams(
        hNode: CUgraphNode,
        dptr_out: *mut CUdeviceptr,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Free unused memory that was cached on the specified device for use with graphs back to the OS.
    ///
    /// Blocks which are not in use by a graph that is either currently executing or scheduled to execute are freed back to the operating
    /// system.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddMemAllocNode`], [`cuGraphAddMemFreeNode`], [`cuDeviceSetGraphMemAttribute`], [`cuDeviceGetGraphMemAttribute`].
    ///
    /// # Parameters
    ///
    /// - `device`: The device for which cached memory should be freed.
    pub fn cuDeviceGraphMemTrim(device: CUdevice) -> CUresult;
}
unsafe extern "C" {
    /// Query asynchronous allocation attributes related to graphs.
    ///
    /// Valid attributes are:
    ///
    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_USED_MEM_CURRENT`]: Amount of memory, in bytes, currently associated with graphs
    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_USED_MEM_HIGH`]: High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be
    ///   reset to zero.
    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_RESERVED_MEM_CURRENT`]: Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`]: High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceSetGraphMemAttribute`], [`cuGraphAddMemAllocNode`], [`cuGraphAddMemFreeNode`].
    ///
    /// # Parameters
    ///
    /// - `device`: Specifies the scope of the query.
    /// - `attr`: attribute to get.
    /// - `value`: retrieved value.
    pub fn cuDeviceGetGraphMemAttribute(
        device: CUdevice,
        attr: CUgraphMem_attribute,
        value: *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Set asynchronous allocation attributes related to graphs.
    ///
    /// Valid attributes are:
    ///
    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_USED_MEM_HIGH`]: High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be
    ///   reset to zero.
    /// * [`CUgraphMem_attribute_enum::CU_GRAPH_MEM_ATTR_RESERVED_MEM_HIGH`]: High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetGraphMemAttribute`], [`cuGraphAddMemAllocNode`], [`cuGraphAddMemFreeNode`].
    ///
    /// # Parameters
    ///
    /// - `device`: Specifies the scope of the query.
    /// - `attr`: attribute to get.
    /// - `value`: pointer to value to set.
    pub fn cuDeviceSetGraphMemAttribute(
        device: CUdevice,
        attr: CUgraphMem_attribute,
        value: *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Clones a graph.
    ///
    /// This function creates a copy of originalGraph and returns it in phGraphClone. All parameters are copied into the cloned graph. The original graph may be modified after this call without affecting the
    /// clone.
    ///
    /// Child graph nodes in the original graph are recursively copied into the clone.
    ///
    /// Note:
    ///
    /// : Cloning is not supported for graphs which contain memory allocation nodes, memory free nodes, or conditional nodes.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphCreate`], [`cuGraphNodeFindInClone`].
    ///
    /// # Parameters
    ///
    /// - `phGraphClone`: Returns newly created cloned graph.
    /// - `originalGraph`: Graph to clone.
    pub fn cuGraphClone(phGraphClone: *mut CUgraph, originalGraph: CUgraph) -> CUresult;
}
unsafe extern "C" {
    /// Finds a cloned version of a node.
    ///
    /// This function returns the node in hClonedGraph corresponding to hOriginalNode in the original graph.
    ///
    /// hClonedGraph must have been cloned from hOriginalGraph via [`cuGraphClone`]. hOriginalNode must have been in hOriginalGraph at the time of the call to [`cuGraphClone`], and the corresponding cloned node in hClonedGraph must not have been removed. The cloned node is then returned via phClonedNode.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphClone`].
    ///
    /// # Parameters
    ///
    /// - `phNode`: Returns handle to the cloned node.
    /// - `hOriginalNode`: Handle to the original node.
    /// - `hClonedGraph`: Cloned graph to query.
    pub fn cuGraphNodeFindInClone(
        phNode: *mut CUgraphNode,
        hOriginalNode: CUgraphNode,
        hClonedGraph: CUgraph,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a node's type.
    ///
    /// Returns the node type of hNode in type.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphChildGraphNodeGetGraph`], [`cuGraphKernelNodeGetParams_v2`], [`cuGraphKernelNodeSetParams_v2`], [`cuGraphHostNodeGetParams`], [`cuGraphHostNodeSetParams`], [`cuGraphMemcpyNodeGetParams`], [`cuGraphMemcpyNodeSetParams`], [`cuGraphMemsetNodeGetParams`], [`cuGraphMemsetNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    pub fn cuGraphNodeGetType(
        hNode: CUgraphNode,
        type_: *mut CUgraphNodeType,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the graph that contains a given graph node.
    ///
    /// Returns the graph that contains hNode in \*phGraph. If hNode is in a child graph, the child graph it is in is returned.
    ///
    /// **See also:**
    ///
    /// [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`]cuGraphNodeGetLocalId [`cuGraphNodeGetToolsId`]cuGraphGetId [`cuGraphExecGetId`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    pub fn cuGraphNodeGetContainingGraph(
        hNode: CUgraphNode,
        phGraph: *mut CUgraph,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the local node id of a given graph node.
    ///
    /// Returns the node id of hNode in \*nodeId. The nodeId matches that referenced by [`cuGraphDebugDotPrint`]. The local nodeId and graphId together can uniquely identify the node.
    ///
    /// **See also:**
    ///
    /// [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`]cuGraphNodeGetContainingGraph [`cuGraphNodeGetToolsId`]cuGraphGetId [`cuGraphExecGetId`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    /// - `nodeId`: Pointer to return the nodeId.
    pub fn cuGraphNodeGetLocalId(
        hNode: CUgraphNode,
        nodeId: *mut ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns an id used by tools to identify a given node.
    ///
    /// **See also:**
    ///
    /// [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`]cuGraphNodeGetContainingGraph [`cuGraphNodeGetLocalId`]cuGraphGetId [`cuGraphExecGetId`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    pub fn cuGraphNodeGetToolsId(
        hNode: CUgraphNode,
        toolsNodeId: *mut ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the id of a given graph.
    ///
    /// Returns the id of hGraph in \*graphId. The value in \*graphId will match that referenced by [`cuGraphDebugDotPrint`].
    ///
    /// **See also:**
    ///
    /// [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`]cuGraphNodeGetContainingGraph [`cuGraphNodeGetLocalId`]cuGraphNodeGetToolsId [`cuGraphExecGetId`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph to query.
    pub fn cuGraphGetId(hGraph: CUgraph, graphId: *mut ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Returns the id of a given graph exec.
    ///
    /// Returns the id of hGraphExec in \*graphId. The value in \*graphId will match that referenced by [`cuGraphDebugDotPrint`].
    ///
    /// **See also:**
    ///
    /// [`cuGraphGetNodes`], [`cuGraphDebugDotPrint`]cuGraphNodeGetContainingGraph [`cuGraphNodeGetLocalId`]cuGraphNodeGetToolsId [`cuGraphGetId`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: Graph to query.
    pub fn cuGraphExecGetId(
        hGraphExec: CUgraphExec,
        graphId: *mut ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a graph's nodes.
    ///
    /// Returns a list of hGraph's nodes. nodes may be NULL, in which case this function will return the number of nodes in numNodes. Otherwise, numNodes entries will be filled in. If numNodes is higher than the actual number of nodes, the remaining entries in nodes will be set to NULL, and the number of nodes actually obtained will be returned in numNodes.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphCreate`], [`cuGraphGetRootNodes`], [`cuGraphGetEdges_v2`], [`cuGraphNodeGetType`], [`cuGraphNodeGetDependencies_v2`], [`cuGraphNodeGetDependentNodes_v2`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph to query.
    /// - `nodes`: Pointer to return the nodes.
    /// - `numNodes`: See description.
    pub fn cuGraphGetNodes(
        hGraph: CUgraph,
        nodes: *mut CUgraphNode,
        numNodes: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a graph's root nodes.
    ///
    /// Returns a list of hGraph's root nodes. rootNodes may be NULL, in which case this function will return the number of root nodes in numRootNodes. Otherwise, numRootNodes entries will be filled in. If numRootNodes is higher than the actual number of root nodes, the remaining entries in rootNodes will be set to NULL, and the number of nodes actually obtained will be returned in numRootNodes.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphCreate`], [`cuGraphGetNodes`], [`cuGraphGetEdges_v2`], [`cuGraphNodeGetType`], [`cuGraphNodeGetDependencies_v2`], [`cuGraphNodeGetDependentNodes_v2`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph to query.
    /// - `rootNodes`: Pointer to return the root nodes.
    /// - `numRootNodes`: See description.
    pub fn cuGraphGetRootNodes(
        hGraph: CUgraph,
        rootNodes: *mut CUgraphNode,
        numRootNodes: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a graph's dependency edges.
    ///
    /// Returns a list of hGraph's dependency edges. Edges are returned via corresponding indices in from, to and edgeData; that is, the node in to\[i\] has a dependency on the node in from\[i\] with data edgeData\[i\]. from and to may both be NULL, in which case this function only returns the number of edges in numEdges. Otherwise, numEdges entries will be filled in. If numEdges is higher than the actual number of edges, the remaining entries in from and to will be set to NULL, and the number of edges actually returned will be written to numEdges. edgeData may alone be NULL, in which case the edges must all have default (zeroed) edge data. Attempting a lossy query via NULL edgeData will result in [`cudaError_enum::CUDA_ERROR_LOSSY_QUERY`]. If edgeData is non-NULL then from and to must be as well.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphAddDependencies_v2`], [`cuGraphRemoveDependencies_v2`], [`cuGraphNodeGetDependencies_v2`], [`cuGraphNodeGetDependentNodes_v2`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph to get the edges from.
    /// - `from`: Location to return edge endpoints.
    /// - `to`: Location to return edge endpoints.
    /// - `edgeData`: Optional location to return edge data.
    /// - `numEdges`: See description.
    pub fn cuGraphGetEdges_v2(
        hGraph: CUgraph,
        from: *mut CUgraphNode,
        to: *mut CUgraphNode,
        edgeData: *mut CUgraphEdgeData,
        numEdges: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a node's dependencies.
    ///
    /// Returns a list of node's dependencies. dependencies may be NULL, in which case this function will return the number of dependencies in numDependencies. Otherwise, numDependencies entries will be filled in. If numDependencies is higher than the actual number of dependencies, the remaining entries in dependencies will be set to NULL, and the number of nodes actually obtained will be returned in numDependencies.
    ///
    /// Note that if an edge has non-zero (non-default) edge data and edgeData is NULL, this API will return [`cudaError_enum::CUDA_ERROR_LOSSY_QUERY`]. If edgeData is non-NULL, then dependencies must be as well.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetDependentNodes_v2`], [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphGetEdges_v2`], [`cuGraphAddDependencies_v2`], [`cuGraphRemoveDependencies_v2`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    /// - `dependencies`: Pointer to return the dependencies.
    /// - `edgeData`: Optional array to return edge data for each dependency.
    /// - `numDependencies`: See description.
    pub fn cuGraphNodeGetDependencies_v2(
        hNode: CUgraphNode,
        dependencies: *mut CUgraphNode,
        edgeData: *mut CUgraphEdgeData,
        numDependencies: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a node's dependent nodes.
    ///
    /// Returns a list of node's dependent nodes. dependentNodes may be NULL, in which case this function will return the number of dependent nodes in numDependentNodes. Otherwise, numDependentNodes entries will be filled in. If numDependentNodes is higher than the actual number of dependent nodes, the remaining entries in dependentNodes will be set to NULL, and the number of nodes actually obtained will be returned in numDependentNodes.
    ///
    /// Note that if an edge has non-zero (non-default) edge data and edgeData is NULL, this API will return [`cudaError_enum::CUDA_ERROR_LOSSY_QUERY`]. If edgeData is non-NULL, then dependentNodes must be as well.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetDependencies_v2`], [`cuGraphGetNodes`], [`cuGraphGetRootNodes`], [`cuGraphGetEdges_v2`], [`cuGraphAddDependencies_v2`], [`cuGraphRemoveDependencies_v2`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    /// - `dependentNodes`: Pointer to return the dependent nodes.
    /// - `edgeData`: Optional pointer to return edge data for dependent nodes.
    /// - `numDependentNodes`: See description.
    pub fn cuGraphNodeGetDependentNodes_v2(
        hNode: CUgraphNode,
        dependentNodes: *mut CUgraphNode,
        edgeData: *mut CUgraphEdgeData,
        numDependentNodes: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Adds dependency edges to a graph.
    ///
    /// The number of dependencies to be added is defined by numDependencies Elements in from and to at corresponding indices define a dependency. Each node in from and to must belong to hGraph.
    ///
    /// If numDependencies is 0, elements in from and to will be ignored. Specifying an existing dependency will return an error.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphRemoveDependencies_v2`], [`cuGraphGetEdges_v2`], [`cuGraphNodeGetDependencies_v2`], [`cuGraphNodeGetDependentNodes_v2`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph to which dependencies are added.
    /// - `from`: Array of nodes that provide the dependencies.
    /// - `to`: Array of dependent nodes.
    /// - `edgeData`: Optional array of edge data. If NULL, default (zeroed) edge data is assumed.
    /// - `numDependencies`: Number of dependencies to be added.
    pub fn cuGraphAddDependencies_v2(
        hGraph: CUgraph,
        from: *const CUgraphNode,
        to: *const CUgraphNode,
        edgeData: *const CUgraphEdgeData,
        numDependencies: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Removes dependency edges from a graph.
    ///
    /// The number of dependencies to be removed is defined by numDependencies. Elements in from and to at corresponding indices define a dependency. Each node in from and to must belong to hGraph.
    ///
    /// If numDependencies is 0, elements in from and to will be ignored. Specifying an edge that does not exist in the graph, with data matching edgeData, results in an error. edgeData is nullable, which is equivalent to passing default (zeroed) data for each edge.
    ///
    /// Dependencies cannot be removed from graphs which contain allocation or free nodes. Any attempt to do so will return an error.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddDependencies_v2`], [`cuGraphGetEdges_v2`], [`cuGraphNodeGetDependencies_v2`], [`cuGraphNodeGetDependentNodes_v2`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph from which to remove dependencies.
    /// - `from`: Array of nodes that provide the dependencies.
    /// - `to`: Array of dependent nodes.
    /// - `edgeData`: Optional array of edge data. If NULL, edge data is assumed to be default (zeroed).
    /// - `numDependencies`: Number of dependencies to be removed.
    pub fn cuGraphRemoveDependencies_v2(
        hGraph: CUgraph,
        from: *const CUgraphNode,
        to: *const CUgraphNode,
        edgeData: *const CUgraphEdgeData,
        numDependencies: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Remove a node from the graph.
    ///
    /// Removes hNode from its graph. This operation also severs any dependencies of other nodes on hNode and vice versa.
    ///
    /// Nodes which belong to a graph which contains allocation or free nodes cannot be destroyed. Any attempt to do so will return
    /// an error.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddChildGraphNode`], [`cuGraphAddEmptyNode`], [`cuGraphAddKernelNode_v2`], [`cuGraphAddHostNode`], [`cuGraphAddMemcpyNode`], [`cuGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to remove.
    pub fn cuGraphDestroyNode(hNode: CUgraphNode) -> CUresult;
}
unsafe extern "C" {
    pub fn cuGraphInstantiateWithFlags(
        phGraphExec: *mut CUgraphExec,
        hGraph: CUgraph,
        flags: ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates an executable graph from a graph.
    ///
    /// Instantiates hGraph as an executable graph according to the instantiateParams structure. The graph is validated for any structural constraints or intra-node constraints which were not previously validated.
    /// If instantiation is successful, a handle to the instantiated graph is returned in phGraphExec.
    ///
    /// instantiateParams controls the behavior of instantiation and subsequent graph launches, as well as returning more detailed information in the
    /// event of an error. [`CUDA_GRAPH_INSTANTIATE_PARAMS`] is defined as:
    ///
    /// ```text
    /// typedef struct {
    /// cuuint64_t flags;
    /// CUstream hUploadStream;
    /// CUgraphNode hErrNode_out;
    /// CUgraphInstantiateResult result_out;
    /// } CUDA_GRAPH_INSTANTIATE_PARAMS;
    /// ```
    ///
    /// The flags field controls the behavior of instantiation and subsequent graph launches. Valid flags are:
    ///
    /// * [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`], which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before
    ///   the graph is relaunched.
    ///
    /// * [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD`], which will perform an upload of the graph into hUploadStream once the graph has been instantiated.
    ///
    /// * [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_DEVICE_LAUNCH`], which configures the graph for launch from the device. If this flag is passed, the executable graph handle returned can
    ///   be used to launch the graph from both the host and device. This flag can only be used on platforms which support unified addressing.
    ///   This flag cannot be used in conjunction with [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`].
    ///
    /// * [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY`], which causes the graph to use the priorities from the per-node attributes rather than the priority of the launch stream
    ///   during execution. Note that priorities are only available on kernel nodes, and are copied from stream priority during stream
    ///   capture.
    ///
    /// If hGraph contains any allocation or free nodes, there can be at most one executable graph in existence for that graph at a time. An
    /// attempt to instantiate a second executable graph before destroying the first with [`cuGraphExecDestroy`] will result in an error. The same also applies if hGraph contains any device-updatable kernel nodes.
    ///
    /// If hGraph contains kernels which call device-side [cudaGraphLaunch()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g1920584881db959c8c74130d79019b73) from multiple contexts, this will result in an error.
    ///
    /// Graphs instantiated for launch on the device have additional restrictions which do not apply to host graphs:
    ///
    /// * The graph's nodes must reside on a single context.
    /// * The graph can only contain kernel nodes, memcpy nodes, memset nodes, and child graph nodes.
    /// * The graph cannot be empty and must contain at least one kernel, memcpy, or memset node. Operation-specific restrictions are
    ///   outlined below.
    /// * Kernel nodes:
    ///   + Use of CUDA Dynamic Parallelism is not permitted.
    ///   + Cooperative launches are permitted as long as MPS is not in use.
    /// * Memcpy nodes:
    ///   + Only copies involving device memory and/or pinned device-mapped host memory are permitted.
    ///   + Copies involving CUDA arrays are not permitted.
    ///   + Both operands must be accessible from the current context, and the current context must match the context of other nodes in
    /// the graph.
    ///
    /// In the event of an error, the result_out and hErrNode_out fields will contain more information about the nature of the error. Possible error reporting includes:
    ///
    /// * [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_ERROR`], if passed an invalid value or if an unexpected error occurred which is described by the return value of the function. hErrNode_out will be set to NULL.
    /// * [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_INVALID_STRUCTURE`], if the graph structure is invalid. hErrNode_out will be set to one of the offending nodes.
    /// * [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_NODE_OPERATION_NOT_SUPPORTED`], if the graph is instantiated for device launch but contains a node of an unsupported node type, or a node which performs
    ///   unsupported operations, such as use of CUDA dynamic parallelism within a kernel node. hErrNode_out will be set to this node.
    /// * [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_MULTIPLE_CTXS_NOT_SUPPORTED`], if the graph is instantiated for device launch but a node’s context differs from that of another node. This error can also
    ///   be returned if a graph is not instantiated for device launch and it contains kernels which call device-side [cudaGraphLaunch()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g1920584881db959c8c74130d79019b73) from multiple contexts. hErrNode_out will be set to this node.
    ///
    /// If instantiation is successful, result_out will be set to [`CUgraphInstantiateResult_enum::CUDA_GRAPH_INSTANTIATE_SUCCESS`], and hErrNode_out will be set to NULL.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphCreate`], `cuGraphInstantiate`, [`cuGraphExecDestroy`].
    ///
    /// # Parameters
    ///
    /// - `phGraphExec`: Returns instantiated graph.
    /// - `hGraph`: Graph to instantiate.
    /// - `instantiateParams`: Instantiation parameters.
    pub fn cuGraphInstantiateWithParams(
        phGraphExec: *mut CUgraphExec,
        hGraph: CUgraph,
        instantiateParams: *mut CUDA_GRAPH_INSTANTIATE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Query the instantiation flags of an executable graph.
    ///
    /// Returns the flags that were passed to instantiation for the given executable graph. [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_UPLOAD`] will not be returned by this API as it does not affect the resulting executable graph.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// `cuGraphInstantiate`, [`cuGraphInstantiateWithParams`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph to query.
    /// - `flags`: Returns the instantiation flags.
    pub fn cuGraphExecGetFlags(
        hGraphExec: CUgraphExec,
        flags: *mut cuuint64_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the parameters for a kernel node in the given graphExec.
    ///
    /// Sets the parameters of a kernel node in an executable graph hGraphExec. The node is identified by the corresponding node hNode in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// hNode must not have been removed from the original graph. All nodeParams fields may change, but the following restrictions apply to func updates:
    ///
    /// * The owning context of the function cannot change.
    /// * A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP
    /// * A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side
    ///   update calls.
    /// * If hGraphExec was not instantiated for device launch, a node whose function originally did not use device-side [cudaGraphLaunch()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g1920584881db959c8c74130d79019b73) cannot be updated to a function which uses device-side [cudaGraphLaunch()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g1920584881db959c8c74130d79019b73) unless the node resides on the same context as nodes which contained such calls at instantiate-time. If no such calls were
    ///   present at instantiation, these updates cannot be performed at all.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// If hNode is a device-updatable kernel node, the next upload/launch of hGraphExec will overwrite any previous device-side updates. Additionally, applying host updates to a device-updatable kernel node while
    /// it is being updated from the device will result in undefined behavior.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddKernelNode_v2`], [`cuGraphKernelNodeSetParams_v2`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: kernel node from the graph from which graphExec was instantiated.
    /// - `nodeParams`: Updated Parameters to set.
    pub fn cuGraphExecKernelNodeSetParams_v2(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        nodeParams: *const CUDA_KERNEL_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the parameters for a memcpy node in the given graphExec.
    ///
    /// Updates the work represented by hNode in hGraphExec as though hNode had contained copyParams at instantiation. hNode must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from hNode are ignored.
    ///
    /// The source and destination memory in copyParams must be allocated from the same contexts as the original source and destination memory. Both the instantiation-time memory
    /// operands and the memory operands in copyParams must be 1-dimensional. Zero-length operations are not supported.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// Returns [`CUresult::CUDA_ERROR_INVALID_VALUE`] if the memory operands' mappings changed or either the original or new memory operands are
    /// multidimensional.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddMemcpyNode`], [`cuGraphMemcpyNodeSetParams`], [`cuGraphExecKernelNodeSetParams_v2`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: Memcpy node from the graph which was used to instantiate graphExec.
    /// - `copyParams`: The updated parameters to set.
    /// - `ctx`: Context on which to run the node.
    pub fn cuGraphExecMemcpyNodeSetParams(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        copyParams: *const CUDA_MEMCPY3D,
        ctx: CUcontext,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the parameters for a memset node in the given graphExec.
    ///
    /// Updates the work represented by hNode in hGraphExec as though hNode had contained memsetParams at instantiation. hNode must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from hNode are ignored.
    ///
    /// Zero sized operations are not supported.
    ///
    /// The new destination pointer in memsetParams must be to the same kind of allocation as the original destination pointer and
    /// have the same context association and device mapping as the original destination pointer.
    ///
    /// Both the value and pointer address may be updated. Changing other aspects of the memset (width, height, element size or pitch)
    /// may cause the update to be rejected. Specifically, for 2d memsets, all dimension changes are rejected. For 1d memsets, changes
    /// in height are explicitly rejected and other changes are opportunistically allowed if the resulting work maps onto the work
    /// resources already allocated for the node.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddMemsetNode`], [`cuGraphMemsetNodeSetParams`], [`cuGraphExecKernelNodeSetParams_v2`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: Memset node from the graph which was used to instantiate graphExec.
    /// - `memsetParams`: The updated parameters to set.
    /// - `ctx`: Context on which to run the node.
    pub fn cuGraphExecMemsetNodeSetParams(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        memsetParams: *const CUDA_MEMSET_NODE_PARAMS,
        ctx: CUcontext,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the parameters for a host node in the given graphExec.
    ///
    /// Updates the work represented by hNode in hGraphExec as though hNode had contained nodeParams at instantiation. hNode must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from hNode are ignored.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddHostNode`], [`cuGraphHostNodeSetParams`], [`cuGraphExecKernelNodeSetParams_v2`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: Host node from the graph which was used to instantiate graphExec.
    /// - `nodeParams`: The updated parameters to set.
    pub fn cuGraphExecHostNodeSetParams(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        nodeParams: *const CUDA_HOST_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Updates node parameters in the child graph node in the given graphExec.
    ///
    /// Updates the work represented by hNode in hGraphExec as though the nodes contained in hNode's graph had the parameters contained in childGraph's nodes at instantiation. hNode must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from hNode are ignored.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// The topology of childGraph, as well as the node insertion order, must match that of the graph contained in hNode. See [`cuGraphExecUpdate_v2`] for a list of restrictions on what can be updated in an instantiated graph. The update is recursive, so child graph nodes
    /// contained within the top level child graph will also be updated.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddChildGraphNode`], [`cuGraphChildGraphNodeGetGraph`], [`cuGraphExecKernelNodeSetParams_v2`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: Host node from the graph which was used to instantiate graphExec.
    /// - `childGraph`: The graph supplying the updated parameters.
    pub fn cuGraphExecChildGraphNodeSetParams(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        childGraph: CUgraph,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the event for an event record node in the given graphExec.
    ///
    /// Sets the event of an event record node in an executable graph hGraphExec. The node is identified by the corresponding node hNode in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddEventRecordNode`], [`cuGraphEventRecordNodeGetEvent`], [`cuGraphEventWaitNodeSetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`], [`cuGraphExecKernelNodeSetParams_v2`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: event record node from the graph from which graphExec was instantiated.
    /// - `event`: Updated event to use.
    pub fn cuGraphExecEventRecordNodeSetEvent(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        event: CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the event for an event wait node in the given graphExec.
    ///
    /// Sets the event of an event wait node in an executable graph hGraphExec. The node is identified by the corresponding node hNode in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddEventWaitNode`], [`cuGraphEventWaitNodeGetEvent`], [`cuGraphEventRecordNodeSetEvent`], [`cuEventRecordWithFlags`], [`cuStreamWaitEvent`], [`cuGraphExecKernelNodeSetParams_v2`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: event wait node from the graph from which graphExec was instantiated.
    /// - `event`: Updated event to use.
    pub fn cuGraphExecEventWaitNodeSetEvent(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        event: CUevent,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the parameters for an external semaphore signal node in the given graphExec.
    ///
    /// Sets the parameters of an external semaphore signal node in an executable graph hGraphExec. The node is identified by the corresponding node hNode in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// hNode must not have been removed from the original graph.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// Changing nodeParams->numExtSems is not supported.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddExternalSemaphoresSignalNode`], [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`], [`cuGraphExecKernelNodeSetParams_v2`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresWaitNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: semaphore signal node from the graph from which graphExec was instantiated.
    /// - `nodeParams`: Updated Parameters to set.
    pub fn cuGraphExecExternalSemaphoresSignalNodeSetParams(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        nodeParams: *const CUDA_EXT_SEM_SIGNAL_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the parameters for an external semaphore wait node in the given graphExec.
    ///
    /// Sets the parameters of an external semaphore wait node in an executable graph hGraphExec. The node is identified by the corresponding node hNode in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// hNode must not have been removed from the original graph.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// Changing nodeParams->numExtSems is not supported.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphExecNodeSetParams`], [`cuGraphAddExternalSemaphoresWaitNode`], [`cuImportExternalSemaphore`], [`cuSignalExternalSemaphoresAsync`], [`cuWaitExternalSemaphoresAsync`], [`cuGraphExecKernelNodeSetParams_v2`], [`cuGraphExecMemcpyNodeSetParams`], [`cuGraphExecMemsetNodeSetParams`], [`cuGraphExecHostNodeSetParams`], [`cuGraphExecChildGraphNodeSetParams`], [`cuGraphExecEventRecordNodeSetEvent`], [`cuGraphExecEventWaitNodeSetEvent`], [`cuGraphExecExternalSemaphoresSignalNodeSetParams`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: semaphore wait node from the graph from which graphExec was instantiated.
    /// - `nodeParams`: Updated Parameters to set.
    pub fn cuGraphExecExternalSemaphoresWaitNodeSetParams(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        nodeParams: *const CUDA_EXT_SEM_WAIT_NODE_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Enables or disables the specified node in the given graphExec.
    ///
    /// Sets hNode to be either enabled or disabled. Disabled nodes are functionally equivalent to empty nodes until they are reenabled. Existing
    /// node parameters are not affected by disabling/enabling the node.
    ///
    /// The node is identified by the corresponding node hNode in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// hNode must not have been removed from the original graph.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// If hNode is a device-updatable kernel node, the next upload/launch of hGraphExec will overwrite any previous device-side updates. Additionally, applying host updates to a device-updatable kernel node while
    /// it is being updated from the device will result in undefined behavior.
    ///
    /// Note:
    ///
    /// Currently only kernel, memset and memcpy nodes are supported.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeGetEnabled`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate `[`cuGraphLaunch`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: Node from the graph from which graphExec was instantiated.
    /// - `isEnabled`: Node is enabled if != 0, otherwise the node is disabled.
    pub fn cuGraphNodeSetEnabled(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        isEnabled: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Query whether a node in the given graphExec is enabled.
    ///
    /// Sets isEnabled to 1 if hNode is enabled, or 0 if hNode is disabled.
    ///
    /// The node is identified by the corresponding node hNode in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// hNode must not have been removed from the original graph.
    ///
    /// Note:
    ///
    /// * Currently only kernel, memset and memcpy nodes are supported.
    /// * This function will not reflect device-side updates for device-updatable kernel nodes.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetEnabled`], [`cuGraphExecUpdate_v2`], `cuGraphInstantiate `[`cuGraphLaunch`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `hNode`: Node from the graph from which graphExec was instantiated.
    /// - `isEnabled`: Location to return the enabled status of the node.
    pub fn cuGraphNodeGetEnabled(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        isEnabled: *mut ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Uploads an executable graph in a stream.
    ///
    /// Uploads hGraphExec to the device in hStream without executing it. Uploads of the same hGraphExec will be serialized. Each upload is ordered behind both any previous work in hStream and any previous launches of hGraphExec. Uses memory cached by stream to back the allocations owned by hGraphExec.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// `cuGraphInstantiate`, [`cuGraphLaunch`], [`cuGraphExecDestroy`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: Executable graph to upload.
    /// - `hStream`: Stream in which to upload the graph.
    pub fn cuGraphUpload(hGraphExec: CUgraphExec, hStream: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Launches an executable graph in a stream.
    ///
    /// Executes hGraphExec in hStream. Only one instance of hGraphExec may be executing at a time. Each launch is ordered behind both any previous work in hStream and any previous launches of hGraphExec. To execute a graph concurrently, it must be instantiated multiple times into multiple executable graphs.
    ///
    /// If any allocations created by hGraphExec remain unfreed (from a previous launch) and hGraphExec was not instantiated with [`CUgraphInstantiate_flags_enum::CUDA_GRAPH_INSTANTIATE_FLAG_AUTO_FREE_ON_LAUNCH`], the launch will fail with [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// `cuGraphInstantiate`, [`cuGraphUpload`], [`cuGraphExecDestroy`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: Executable graph to launch.
    /// - `hStream`: Stream in which to launch the graph.
    pub fn cuGraphLaunch(hGraphExec: CUgraphExec, hStream: CUstream) -> CUresult;
}
unsafe extern "C" {
    /// Destroys an executable graph.
    ///
    /// Destroys the executable graph specified by hGraphExec, as well as all of its executable nodes. If the executable graph is in-flight, it will not be terminated, but rather freed
    /// asynchronously on completion.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// `cuGraphInstantiate`, [`cuGraphUpload`], [`cuGraphLaunch`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: Executable graph to destroy.
    pub fn cuGraphExecDestroy(hGraphExec: CUgraphExec) -> CUresult;
}
unsafe extern "C" {
    /// Destroys a graph.
    ///
    /// Destroys the graph specified by hGraph, as well as all of its nodes.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphCreate`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph to destroy.
    pub fn cuGraphDestroy(hGraph: CUgraph) -> CUresult;
}
unsafe extern "C" {
    /// Check whether an executable graph can be updated with a graph and perform the update if possible.
    ///
    /// Updates the node parameters in the instantiated graph specified by hGraphExec with the node parameters in a topologically identical graph specified by hGraph.
    ///
    /// Limitations:
    ///
    /// * Kernel nodes:
    ///   + The owning context of the function cannot change.
    ///   + A node whose function originally did not use CUDA dynamic parallelism cannot be updated to a function which uses CDP.
    ///   + A node whose function originally did not make device-side update calls cannot be updated to a function which makes device-side
    /// update calls.
    ///   + A cooperative node cannot be updated to a non-cooperative node, and vice-versa.
    ///   + If the graph was instantiated with [`CUgraphInstantiate_flags::CUDA_GRAPH_INSTANTIATE_FLAG_USE_NODE_PRIORITY`], the priority attribute cannot change. Equality
    /// is checked on the originally requested priority values, before they are clamped to the device's supported range.
    ///   + If hGraphExec was not instantiated for device launch, a node whose function originally did not use device-side [cudaGraphLaunch()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g1920584881db959c8c74130d79019b73) cannot be updated to a function which uses device-side [cudaGraphLaunch()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__GRAPH.html#group__CUDART__GRAPH_1g1920584881db959c8c74130d79019b73) unless the node resides on the same context as nodes which contained such calls at instantiate-time. If no such calls were
    /// present at instantiation, these updates cannot be performed at all.
    ///   + Neither hGraph nor hGraphExec may contain device-updatable kernel nodes.
    /// * Memset and memcpy nodes:
    ///   + The CUDA device(s) to which the operand(s) was allocated/mapped cannot change.
    ///   + The source/destination memory must be allocated from the same contexts as the original source/destination memory.
    ///   + For 2d memsets, only address and assigned value may be updated.
    ///   + For 1d memsets, updating dimensions is also allowed, but may fail if the resulting operation doesn't map onto the work resources
    /// already allocated for the node.
    /// * Additional memcpy node restrictions:
    ///   + Changing either the source or destination memory type(i.e. [`CUmemorytype::CU_MEMORYTYPE_DEVICE`], [`CUmemorytype::CU_MEMORYTYPE_ARRAY`], etc.) is not supported.
    /// * External semaphore wait nodes and record nodes:
    ///   + Changing the number of semaphores is not supported.
    /// * Conditional nodes:
    ///   + Changing node parameters is not supported.
    ///   + Changing parameters of nodes within the conditional body graph is subject to the rules above.
    ///   + Conditional handle flags and default values are updated as part of the graph update.
    ///
    /// Note: The API may add further restrictions in future releases. The return code should always be checked.
    ///
    /// cuGraphExecUpdate sets the result member of resultInfo to [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED`] under the following conditions:
    ///
    /// * The count of nodes directly in hGraphExec and hGraph differ, in which case resultInfo->errorNode is set to NULL.
    /// * hGraph has more exit nodes than hGraph, in which case resultInfo->errorNode is set to one of the exit nodes in hGraph.
    /// * A node in hGraph has a different number of dependencies than the node from hGraphExec it is paired with, in which case resultInfo->errorNode is set to the node from hGraph.
    /// * A node in hGraph has a dependency that does not match with the corresponding dependency of the paired node from hGraphExec. resultInfo->errorNode will be set to the node from hGraph. resultInfo->errorFromNode will be set to the mismatched dependency. The dependencies are paired based on edge order and
    ///   a dependency does not match when the nodes are already paired based on other edges examined in the graph.
    ///
    /// cuGraphExecUpdate sets the result member of resultInfo to:
    ///
    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR`] if passed an invalid value.
    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_TOPOLOGY_CHANGED`] if the graph topology changed
    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_NODE_TYPE_CHANGED`] if the type of a node changed, in which case hErrorNode_out is set to the node from hGraph.
    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_UNSUPPORTED_FUNCTION_CHANGE`] if the function changed in an unsupported way(see note above), in which
    ///   case hErrorNode_out is set to the node from hGraph
    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_PARAMETERS_CHANGED`] if any parameters to a node changed in a way that is not supported, in which
    ///   case hErrorNode_out is set to the node from hGraph.
    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_ATTRIBUTES_CHANGED`] if any attributes of a node changed in a way that is not supported, in which
    ///   case hErrorNode_out is set to the node from hGraph.
    /// * [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR_NOT_SUPPORTED`] if something about a node is unsupported, like the node's type or configuration,
    ///   in which case hErrorNode_out is set to the node from hGraph
    ///
    /// If the update fails for a reason not listed above, the result member of resultInfo will be set to [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_ERROR`]. If the update succeeds, the result member will be set to [`CUgraphExecUpdateResult::CU_GRAPH_EXEC_UPDATE_SUCCESS`].
    ///
    /// cuGraphExecUpdate returns [`CUresult::CUDA_SUCCESS`] when the updated was performed successfully. It returns [`CUresult::CUDA_ERROR_GRAPH_EXEC_UPDATE_FAILURE`]
    /// if the graph update was not performed because it included changes which violated constraints specific to instantiated graph
    /// update.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The instantiated graph to be updated.
    /// - `hGraph`: The graph containing the updated parameters.
    /// - `resultInfo`: the error info structure.
    pub fn cuGraphExecUpdate_v2(
        hGraphExec: CUgraphExec,
        hGraph: CUgraph,
        resultInfo: *mut CUgraphExecUpdateResultInfo,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Copies attributes from source node to destination node.
    ///
    /// Copies attributes from source node src to destination node dst. Both node must have the same context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`CUaccessPolicyWindow`].
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination node.
    /// - `src`: Source node For list of attributes see CUkernelNodeAttrID.
    pub fn cuGraphKernelNodeCopyAttributes(
        dst: CUgraphNode,
        src: CUgraphNode,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Queries node attribute.
    ///
    /// Queries attribute attr from node hNode and stores it in corresponding member of value_out.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`CUaccessPolicyWindow`].
    pub fn cuGraphKernelNodeGetAttribute(
        hNode: CUgraphNode,
        attr: CUkernelNodeAttrID,
        value_out: *mut CUkernelNodeAttrValue,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets node attribute.
    ///
    /// Sets attribute attr on node hNode from corresponding attribute of value.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`CUaccessPolicyWindow`].
    pub fn cuGraphKernelNodeSetAttribute(
        hNode: CUgraphNode,
        attr: CUkernelNodeAttrID,
        value: *const CUkernelNodeAttrValue,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Write a DOT file describing graph structure.
    ///
    /// Using the provided hGraph, write to path a DOT formatted description of the graph. By default this includes the graph topology, node types, node id, kernel names
    /// and memcpy direction. flags can be specified to write more detailed information about each node type such as parameter values, kernel attributes, node
    /// and function handles.
    ///
    /// # Parameters
    ///
    /// - `hGraph`: The graph to create a DOT file from.
    /// - `path`: The path to write the DOT file to.
    /// - `flags`: Flags from CUgraphDebugDot_flags for specifying which additional node information to write.
    pub fn cuGraphDebugDotPrint(
        hGraph: CUgraph,
        path: *const ::core::ffi::c_char,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Create a user object.
    ///
    /// Create a user object with the specified destructor callback and initial reference count. The initial references are owned
    /// by the caller.
    ///
    /// Destructor callbacks cannot make CUDA API calls and should avoid blocking behavior, as they are executed by a shared internal
    /// thread. Another thread may be signaled to perform such actions, if it does not block forward progress of tasks scheduled through
    /// CUDA.
    ///
    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
    ///
    /// **See also:**
    ///
    /// [`cuUserObjectRetain`], [`cuUserObjectRelease`], [`cuGraphRetainUserObject`], [`cuGraphReleaseUserObject`], [`cuGraphCreate`].
    ///
    /// # Parameters
    ///
    /// - `object_out`: Location to return the user object handle.
    /// - `ptr`: The pointer to pass to the destroy function.
    /// - `destroy`: Callback to free the user object when it is no longer in use.
    /// - `initialRefcount`: The initial refcount to create the object with, typically 1. The initial references are owned by the calling thread.
    /// - `flags`: Currently it is required to pass [`CUuserObject_flags_enum::CU_USER_OBJECT_NO_DESTRUCTOR_SYNC`], which is the only defined flag. This indicates that the destroy callback cannot be waited on by any CUDA API. Users requiring
    /// synchronization of the callback should signal its completion manually.
    pub fn cuUserObjectCreate(
        object_out: *mut CUuserObject,
        ptr: *mut ::core::ffi::c_void,
        destroy: CUhostFn,
        initialRefcount: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Retain a reference to a user object.
    ///
    /// Retains new references to a user object. The new references are owned by the caller.
    ///
    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
    ///
    /// **See also:**
    ///
    /// [`cuUserObjectCreate`], [`cuUserObjectRelease`], [`cuGraphRetainUserObject`], [`cuGraphReleaseUserObject`], [`cuGraphCreate`].
    ///
    /// # Parameters
    ///
    /// - `object`: The object to retain.
    /// - `count`: The number of references to retain, typically 1. Must be nonzero and not larger than INT_MAX.
    pub fn cuUserObjectRetain(
        object: CUuserObject,
        count: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Release a reference to a user object.
    ///
    /// Releases user object references owned by the caller. The object's destructor is invoked if the reference count reaches zero.
    ///
    /// It is undefined behavior to release references not owned by the caller, or to use a user object handle after all references
    /// are released.
    ///
    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
    ///
    /// **See also:**
    ///
    /// [`cuUserObjectCreate`], [`cuUserObjectRetain`], [`cuGraphRetainUserObject`], [`cuGraphReleaseUserObject`], [`cuGraphCreate`].
    ///
    /// # Parameters
    ///
    /// - `object`: The object to release.
    /// - `count`: The number of references to release, typically 1. Must be nonzero and not larger than INT_MAX.
    pub fn cuUserObjectRelease(
        object: CUuserObject,
        count: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Retain a reference to a user object from a graph.
    ///
    /// Creates or moves user object references that will be owned by a CUDA graph.
    ///
    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
    ///
    /// **See also:**
    ///
    /// [`cuUserObjectCreate`], [`cuUserObjectRetain`], [`cuUserObjectRelease`], [`cuGraphReleaseUserObject`], [`cuGraphCreate`].
    ///
    /// # Parameters
    ///
    /// - `graph`: The graph to associate the reference with.
    /// - `object`: The user object to retain a reference for.
    /// - `count`: The number of references to add to the graph, typically 1. Must be nonzero and not larger than INT_MAX.
    /// - `flags`: The optional flag [`CUuserObjectRetain_flags_enum::CU_GRAPH_USER_OBJECT_MOVE`] transfers references from the calling thread, rather than create new references. Pass 0 to create new references.
    pub fn cuGraphRetainUserObject(
        graph: CUgraph,
        object: CUuserObject,
        count: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Release a user object reference from a graph.
    ///
    /// Releases user object references owned by a graph.
    ///
    /// See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.
    ///
    /// **See also:**
    ///
    /// [`cuUserObjectCreate`], [`cuUserObjectRetain`], [`cuUserObjectRelease`], [`cuGraphRetainUserObject`], [`cuGraphCreate`].
    ///
    /// # Parameters
    ///
    /// - `graph`: The graph that will release the reference.
    /// - `object`: The user object to release a reference for.
    /// - `count`: The number of references to release, typically 1. Must be nonzero and not larger than INT_MAX.
    pub fn cuGraphReleaseUserObject(
        graph: CUgraph,
        object: CUuserObject,
        count: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Adds a node of arbitrary type to a graph.
    ///
    /// Creates a new node in hGraph described by nodeParams with numDependencies dependencies specified via dependencies. numDependencies may be 0. dependencies may be null if numDependencies is 0. dependencies may not have any duplicate entries.
    ///
    /// nodeParams is a tagged union. The node type should be specified in the type field, and type-specific parameters in the corresponding union member. All unused bytes - that is, reserved0 and all bytes past the utilized union member - must be set to zero. It is recommended to use brace initialization or memset
    /// to ensure all bytes are initialized.
    ///
    /// Note that for some node types, nodeParams may contain "out parameters" which are modified during the call, such as nodeParams->alloc.dptr.
    ///
    /// A handle to the new node will be returned in phGraphNode.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphCreate`], [`cuGraphNodeSetParams`], [`cuGraphExecNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `phGraphNode`: Returns newly created node.
    /// - `hGraph`: Graph to which to add the node.
    /// - `dependencies`: Dependencies of the node.
    /// - `dependencyData`: Optional edge data for the dependencies. If NULL, the data is assumed to be default (zeroed) for all dependencies.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Specification of the node.
    pub fn cuGraphAddNode_v2(
        phGraphNode: *mut CUgraphNode,
        hGraph: CUgraph,
        dependencies: *const CUgraphNode,
        dependencyData: *const CUgraphEdgeData,
        numDependencies: size_t,
        nodeParams: *mut CUgraphNodeParams,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Update a graph node's parameters.
    ///
    /// Sets the parameters of graph node hNode to nodeParams. The node type specified by nodeParams->type must match the type of hNode. nodeParams must be fully initialized and all unused bytes (reserved, padding) zeroed.
    ///
    /// Modifying parameters is not supported for node types [`CUgraphNodeType::CU_GRAPH_NODE_TYPE_MEM_ALLOC`] and [`CUgraphNodeType::CU_GRAPH_NODE_TYPE_MEM_FREE`].
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphNodeGetParams`], [`cuGraphExecNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cuGraphNodeSetParams(
        hNode: CUgraphNode,
        nodeParams: *mut CUgraphNodeParams,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Return a graph node's parameters.
    ///
    /// Returns the parameters of graph node hNode in \*nodeParams.
    ///
    /// Any pointers returned in \*nodeParams point to driver-owned memory associated with the node. This memory remains valid until the node is destroyed. Any memory
    /// pointed to from \*nodeParams must not be modified.
    ///
    /// The returned parameters are a description of the node, but may not be identical to the struct provided at creation and may
    /// not be suitable for direct creation of identical nodes. This is because parameters may be partially unspecified and filled
    /// in by the driver at creation, may reference non-copyable handles, or may describe ownership semantics or other parameters
    /// that govern behavior of node creation but are not part of the final functional descriptor.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphNodeSetParams`], [`cuGraphAddNode_v2`], [`cuGraphExecNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `nodeParams`: Pointer to return the parameters.
    pub fn cuGraphNodeGetParams(
        hNode: CUgraphNode,
        nodeParams: *mut CUgraphNodeParams,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Update a graph node's parameters in an instantiated graph.
    ///
    /// Sets the parameters of a node in an executable graph hGraphExec. The node is identified by the corresponding node hNode in the non-executable graph from which the executable graph was instantiated. hNode must not have been removed from the original graph.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. hNode is also not modified by this call.
    ///
    /// Allowed changes to parameters on executable graphs are as follows:
    ///
    /// | Node type | Allowed changes |
    /// | --- | --- |
    /// | kernel | See [`cuGraphExecKernelNodeSetParams_v2`] |
    /// | memcpy | Addresses for 1-dimensional copies if allocated in same context; see [`cuGraphExecMemcpyNodeSetParams`] |
    /// | memset | Addresses for 1-dimensional memsets if allocated in same context; see [`cuGraphExecMemsetNodeSetParams`] |
    /// | host | Unrestricted |
    /// | child graph | Topology must match and restrictions apply recursively; see [`cuGraphExecUpdate_v2`] |
    /// | event wait | Unrestricted |
    /// | event record | Unrestricted |
    /// | external semaphore signal | Number of semaphore operations cannot change |
    /// | external semaphore wait | Number of semaphore operations cannot change |
    /// | memory allocation | API unsupported |
    /// | memory free | API unsupported |
    /// | batch memops | Addresses, values, and operation type for wait operations; see [`cuGraphExecBatchMemOpNodeSetParams`] |
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`], [`cuGraphNodeSetParams`][`cuGraphExecUpdate_v2`], `cuGraphInstantiate`.
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to update the specified node.
    /// - `hNode`: Corresponding node from the graph from which graphExec was instantiated.
    /// - `nodeParams`: Updated Parameters to set.
    pub fn cuGraphExecNodeSetParams(
        hGraphExec: CUgraphExec,
        hNode: CUgraphNode,
        nodeParams: *mut CUgraphNodeParams,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Create a conditional handle.
    ///
    /// Creates a conditional handle associated with hGraph.
    ///
    /// The conditional handle must be associated with a conditional node in this graph or one of its children.
    ///
    /// Handles not associated with a conditional node may cause graph instantiation to fail.
    ///
    /// Handles can only be set from the context with which they are associated.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphAddNode_v2`].
    ///
    /// # Parameters
    ///
    /// - `pHandle_out`: Pointer used to return the handle to the caller.
    /// - `hGraph`: Graph which will contain the conditional node using this handle.
    /// - `ctx`: Context for the handle and associated conditional node.
    /// - `defaultLaunchValue`: Optional initial value for the conditional variable. Applied at the beginning of each graph execution if CU_GRAPH_COND_ASSIGN_DEFAULT
    /// is set in flags.
    /// - `flags`: Currently must be CU_GRAPH_COND_ASSIGN_DEFAULT or 0.
    pub fn cuGraphConditionalHandleCreate(
        pHandle_out: *mut CUgraphConditionalHandle,
        hGraph: CUgraph,
        ctx: CUcontext,
        defaultLaunchValue: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns occupancy of a function.
    ///
    /// Returns in \*numBlocks the number of the maximum active blocks per streaming multiprocessor.
    ///
    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cudaOccupancyMaxActiveBlocksPerMultiprocessor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g5a5d67a3c907371559ba692195e8a38c).
    ///
    /// # Parameters
    ///
    /// - `numBlocks`: Returned occupancy.
    /// - `func`: Kernel for which occupancy is calculated.
    /// - `blockSize`: Block size the kernel is intended to be launched with.
    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
    pub fn cuOccupancyMaxActiveBlocksPerMultiprocessor(
        numBlocks: *mut ::core::ffi::c_int,
        func: CUfunction,
        blockSize: ::core::ffi::c_int,
        dynamicSMemSize: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns occupancy of a function.
    ///
    /// Returns in \*numBlocks the number of the maximum active blocks per streaming multiprocessor.
    ///
    /// The Flags parameter controls how special cases are handled. The valid flags are:
    ///
    /// * [`CUoccupancy_flags_enum::CU_OCCUPANCY_DEFAULT`], which maintains the default behavior as [`cuOccupancyMaxActiveBlocksPerMultiprocessor`];
    ///
    /// * [`CUoccupancy_flags_enum::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`], which suppresses the default behavior on platform where global caching affects occupancy. On such platforms, if caching
    ///   is enabled, but per-block SM resource usage would result in zero occupancy, the occupancy calculator will calculate the occupancy
    ///   as if caching is disabled. Setting [`CUoccupancy_flags_enum::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`] makes the occupancy calculator to return 0 in such cases. More information can be found about this feature in the "Unified
    ///   L1/Texture Cache" section of the Maxwell tuning guide.
    ///
    /// Note that the API can also be with launch context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g603b86b20b37823253ff89fe8688ba83).
    ///
    /// # Parameters
    ///
    /// - `numBlocks`: Returned occupancy.
    /// - `func`: Kernel for which occupancy is calculated.
    /// - `blockSize`: Block size the kernel is intended to be launched with.
    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
    /// - `flags`: Requested behavior for the occupancy calculator.
    pub fn cuOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
        numBlocks: *mut ::core::ffi::c_int,
        func: CUfunction,
        blockSize: ::core::ffi::c_int,
        dynamicSMemSize: size_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Suggest a launch configuration with reasonable occupancy.
    ///
    /// Returns in \*blockSize a reasonable block size that can achieve the maximum occupancy (or, the maximum number of active warps with the fewest blocks
    /// per multiprocessor), and in \*minGridSize the minimum grid size to achieve the maximum occupancy.
    ///
    /// If blockSizeLimit is 0, the configurator will use the maximum block size permitted by the device / function instead.
    ///
    /// If per-block dynamic shared memory allocation is not needed, the user should leave both blockSizeToDynamicSMemSize and dynamicSMemSize as 0.
    ///
    /// If per-block dynamic shared memory allocation is needed, then if the dynamic shared memory size is constant regardless of
    /// block size, the size should be passed through dynamicSMemSize, and blockSizeToDynamicSMemSize should be NULL.
    ///
    /// Otherwise, if the per-block dynamic shared memory size varies with different block sizes, the user needs to provide a unary
    /// function through blockSizeToDynamicSMemSize that computes the dynamic shared memory needed by func for any given block size. dynamicSMemSize is ignored. An example signature is:
    ///
    /// ```text
    /// // Take block size, returns dynamic shared memory needed
    /// size_t blockToSmem(int blockSize);
    /// ```
    ///
    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cudaOccupancyMaxPotentialBlockSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gee5334618ed4bb0871e4559a77643fc1).
    ///
    /// # Parameters
    ///
    /// - `minGridSize`: Returned minimum grid size needed to achieve the maximum occupancy.
    /// - `blockSize`: Returned maximum block size that can achieve the maximum occupancy.
    /// - `func`: Kernel for which launch configuration is calculated.
    /// - `blockSizeToDynamicSMemSize`: A function that calculates how much per-block dynamic shared memory func uses based on the block size.
    /// - `dynamicSMemSize`: Dynamic shared memory usage intended, in bytes.
    /// - `blockSizeLimit`: The maximum block size func is designed to handle.
    pub fn cuOccupancyMaxPotentialBlockSize(
        minGridSize: *mut ::core::ffi::c_int,
        blockSize: *mut ::core::ffi::c_int,
        func: CUfunction,
        blockSizeToDynamicSMemSize: CUoccupancyB2DSize,
        dynamicSMemSize: size_t,
        blockSizeLimit: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Suggest a launch configuration with reasonable occupancy.
    ///
    /// An extended version of [`cuOccupancyMaxPotentialBlockSize`]. In addition to arguments passed to [`cuOccupancyMaxPotentialBlockSize`], [`cuOccupancyMaxPotentialBlockSizeWithFlags`] also takes a Flags parameter.
    ///
    /// The Flags parameter controls how special cases are handled. The valid flags are:
    ///
    /// * [`CUoccupancy_flags_enum::CU_OCCUPANCY_DEFAULT`], which maintains the default behavior as [`cuOccupancyMaxPotentialBlockSize`];
    ///
    /// * [`CUoccupancy_flags_enum::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`], which suppresses the default behavior on platform where global caching affects occupancy. On such platforms, the launch
    ///   configurations that produces maximal occupancy might not support global caching. Setting [`CUoccupancy_flags_enum::CU_OCCUPANCY_DISABLE_CACHING_OVERRIDE`] guarantees that the produced launch configuration is global caching compatible at a potential cost of occupancy. More
    ///   information can be found about this feature in the "Unified L1/Texture Cache" section of the Maxwell tuning guide.
    ///
    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cudaOccupancyMaxPotentialBlockSizeWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1gd0524825c5c01bbc9a5e29e890745800).
    ///
    /// # Parameters
    ///
    /// - `minGridSize`: Returned minimum grid size needed to achieve the maximum occupancy.
    /// - `blockSize`: Returned maximum block size that can achieve the maximum occupancy.
    /// - `func`: Kernel for which launch configuration is calculated.
    /// - `blockSizeToDynamicSMemSize`: A function that calculates how much per-block dynamic shared memory func uses based on the block size.
    /// - `dynamicSMemSize`: Dynamic shared memory usage intended, in bytes.
    /// - `blockSizeLimit`: The maximum block size func is designed to handle.
    /// - `flags`: Options.
    pub fn cuOccupancyMaxPotentialBlockSizeWithFlags(
        minGridSize: *mut ::core::ffi::c_int,
        blockSize: *mut ::core::ffi::c_int,
        func: CUfunction,
        blockSizeToDynamicSMemSize: CUoccupancyB2DSize,
        dynamicSMemSize: size_t,
        blockSizeLimit: ::core::ffi::c_int,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns dynamic shared memory available per block when launching numBlocks blocks on SM.
    ///
    /// Returns in \*dynamicSmemSize the maximum size of dynamic shared memory to allow numBlocks blocks per SM.
    ///
    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will be the current context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// # Parameters
    ///
    /// - `dynamicSmemSize`: Returned maximum dynamic shared memory.
    /// - `func`: Kernel function for which occupancy is calculated.
    /// - `numBlocks`: Number of blocks to fit on SM.
    /// - `blockSize`: Size of the blocks.
    pub fn cuOccupancyAvailableDynamicSMemPerBlock(
        dynamicSmemSize: *mut size_t,
        func: CUfunction,
        numBlocks: ::core::ffi::c_int,
        blockSize: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Given the kernel function (func) and launch configuration (config), return the maximum cluster size in \*clusterSize.
    ///
    /// The cluster dimensions in config are ignored. If func has a required cluster size set (see [cudaFuncGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g0e78e02c6d12ebddd4577ac6ebadf494) / [`cuFuncGetAttribute`]),\*clusterSize will reflect the required cluster size.
    ///
    /// By default this function will always return a value that's portable on future hardware. A higher value may be returned if
    /// the kernel function allows non-portable cluster sizes.
    ///
    /// This function will respect the compile time launch bounds.
    ///
    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will either be taken from the specified stream config->hStream or the current context in case of NULL stream.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cudaFuncGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g0e78e02c6d12ebddd4577ac6ebadf494), [`cuFuncGetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `clusterSize`: Returned maximum cluster size that can be launched for the given kernel function and launch configuration.
    /// - `func`: Kernel function for which maximum cluster size is calculated.
    /// - `config`: Launch configuration for the given kernel function.
    pub fn cuOccupancyMaxPotentialClusterSize(
        clusterSize: *mut ::core::ffi::c_int,
        func: CUfunction,
        config: *const CUlaunchConfig,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Given the kernel function (func) and launch configuration (config), return the maximum number of clusters that could co-exist on the target device in \*numClusters.
    ///
    /// If the function has required cluster size already set (see [cudaFuncGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g0e78e02c6d12ebddd4577ac6ebadf494) / [`cuFuncGetAttribute`]), the cluster size from config must either be unspecified or match the required size. Without required sizes, the cluster
    /// size must be specified in config, else the function will return an error.
    ///
    /// Note that various attributes of the kernel function may affect occupancy calculation. Runtime environment may affect how the
    /// hardware schedules the clusters, so the calculated occupancy is not guaranteed to be achievable.
    ///
    /// Note that the API can also be used with context-less kernel [`CUkernel`] by querying the handle using [`cuLibraryGetKernel`] and then passing it to the API by casting to [`CUfunction`]. Here, the context to use for calculations will either be taken from the specified stream config->hStream or the current context in case of NULL stream.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cudaFuncGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g0e78e02c6d12ebddd4577ac6ebadf494), [`cuFuncGetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `numClusters`: Returned maximum number of clusters that could co-exist on the target device.
    /// - `func`: Kernel function for which maximum number of clusters are calculated.
    /// - `config`: Launch configuration for the given kernel function.
    pub fn cuOccupancyMaxActiveClusters(
        numClusters: *mut ::core::ffi::c_int,
        func: CUfunction,
        config: *const CUlaunchConfig,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Binds an array as a texture reference.
    ///
    /// hArray
    ///
    /// hTexRef
    ///
    /// Flags
    ///
    /// [`CU_TRSA_OVERRIDE_FORMAT`]
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference to bind.
    /// - `hArray`: Array to bind.
    /// - `Flags`: Options (must be [`CU_TRSA_OVERRIDE_FORMAT`]).
    #[deprecated]
    pub fn cuTexRefSetArray(
        hTexRef: CUtexref,
        hArray: CUarray,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Binds a mipmapped array to a texture reference.
    ///
    /// hMipmappedArray
    ///
    /// hTexRef
    ///
    /// Flags
    ///
    /// [`CU_TRSA_OVERRIDE_FORMAT`]
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference to bind.
    /// - `hMipmappedArray`: Mipmapped array to bind.
    /// - `Flags`: Options (must be [`CU_TRSA_OVERRIDE_FORMAT`]).
    #[deprecated]
    pub fn cuTexRefSetMipmappedArray(
        hTexRef: CUtexref,
        hMipmappedArray: CUmipmappedArray,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Binds an address as a texture reference.
    ///
    /// hTexRef
    ///
    /// hTexRef
    ///
    /// Since the hardware enforces an alignment requirement on texture base addresses, [`cuTexRefSetAddress_v2`] passes back a byte offset in \*ByteOffset that must be applied to texture fetches in order to read from the desired memory. This offset must be divided by the texel
    /// size and passed to kernels that read from the texture so they can be applied to the tex1Dfetch() function.
    ///
    /// If the device memory pointer was returned from [`cuMemAlloc_v2`], the offset is guaranteed to be 0 and NULL may be passed as the ByteOffset parameter.
    ///
    /// The total number of elements (or texels) in the linear address range cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH`]. The number of elements is computed as (bytes / bytesPerElement), where bytesPerElement is determined from the data format and number of components set using [`cuTexRefSetFormat`].
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `ByteOffset`: Returned byte offset.
    /// - `hTexRef`: Texture reference to bind.
    /// - `dptr`: Device pointer to bind.
    /// - `bytes`: Size of memory to bind in bytes.
    #[deprecated]
    pub fn cuTexRefSetAddress_v2(
        ByteOffset: *mut size_t,
        hTexRef: CUtexref,
        dptr: CUdeviceptr,
        bytes: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Binds an address as a 2D texture reference.
    ///
    /// hTexRef
    ///
    /// hTexRef
    ///
    /// Using a tex2D() function inside a kernel requires a call to either [`cuTexRefSetArray`] to bind the corresponding texture reference to an array, or [`cuTexRefSetAddress2D_v3`] to bind the texture reference to linear memory.
    ///
    /// Function calls to [`cuTexRefSetFormat`] cannot follow calls to [`cuTexRefSetAddress2D_v3`] for the same texture reference.
    ///
    /// It is required that dptr be aligned to the appropriate hardware-specific texture alignment. You can query this value using the device attribute [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`]. If an unaligned dptr is supplied, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// Pitch has to be aligned to the hardware-specific texture pitch alignment. This value can be queried using the device attribute
    /// [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`]. If an unaligned Pitch is supplied, [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// Width and Height, which are specified in elements (or texels), cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT`] respectively. Pitch, which is specified in bytes, cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`].
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference to bind.
    /// - `desc`: Descriptor of CUDA array.
    /// - `dptr`: Device pointer to bind.
    /// - `Pitch`: Line pitch in bytes.
    #[deprecated]
    pub fn cuTexRefSetAddress2D_v3(
        hTexRef: CUtexref,
        desc: *const CUDA_ARRAY_DESCRIPTOR,
        dptr: CUdeviceptr,
        Pitch: size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the format for a texture reference.
    ///
    /// hTexRef
    ///
    /// fmt
    ///
    /// NumPackedComponents
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`], [cudaCreateChannelDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__HIGHLEVEL.html#group__CUDART__HIGHLEVEL_1g655725c27d8ffe75accb9b531ecf2d15).
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `fmt`: Format to set.
    /// - `NumPackedComponents`: Number of components per array element.
    #[deprecated]
    pub fn cuTexRefSetFormat(
        hTexRef: CUtexref,
        fmt: CUarray_format,
        NumPackedComponents: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the addressing mode for a texture reference.
    ///
    /// am
    ///
    /// dim
    ///
    /// hTexRef
    ///
    /// dim
    ///
    /// dim
    ///
    /// `CUaddress_mode`
    ///
    /// ```text
    ///    typedef enum CUaddress_mode_enum {
    /// CU_TR_ADDRESS_MODE_WRAP = 0,
    /// CU_TR_ADDRESS_MODE_CLAMP = 1,
    /// CU_TR_ADDRESS_MODE_MIRROR = 2,
    /// CU_TR_ADDRESS_MODE_BORDER = 3
    /// } CUaddress_mode;
    /// ```
    ///
    /// Note that this call has no effect if hTexRef is bound to linear memory. Also, if the flag, [`CU_TRSF_NORMALIZED_COORDINATES`], is not set, the only supported address mode is [`CUaddress_mode_enum::CU_TR_ADDRESS_MODE_CLAMP`].
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `dim`: Dimension.
    /// - `am`: Addressing mode to set.
    #[deprecated]
    pub fn cuTexRefSetAddressMode(
        hTexRef: CUtexref,
        dim: ::core::ffi::c_int,
        am: CUaddress_mode,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the filtering mode for a texture reference.
    ///
    /// fm
    ///
    /// hTexRef
    ///
    /// ```text
    ///    typedef enum CUfilter_mode_enum {
    /// CU_TR_FILTER_MODE_POINT = 0,
    /// CU_TR_FILTER_MODE_LINEAR = 1
    /// } CUfilter_mode;
    /// ```
    ///
    /// Note that this call has no effect if hTexRef is bound to linear memory.
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `fm`: Filtering mode to set.
    #[deprecated]
    pub fn cuTexRefSetFilterMode(hTexRef: CUtexref, fm: CUfilter_mode) -> CUresult;
}
unsafe extern "C" {
    /// Sets the mipmap filtering mode for a texture reference.
    ///
    /// fm
    ///
    /// hTexRef
    ///
    /// ```text
    ///    typedef enum CUfilter_mode_enum {
    /// CU_TR_FILTER_MODE_POINT = 0,
    /// CU_TR_FILTER_MODE_LINEAR = 1
    /// } CUfilter_mode;
    /// ```
    ///
    /// Note that this call has no effect if hTexRef is not bound to a mipmapped array.
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `fm`: Filtering mode to set.
    #[deprecated]
    pub fn cuTexRefSetMipmapFilterMode(hTexRef: CUtexref, fm: CUfilter_mode) -> CUresult;
}
unsafe extern "C" {
    /// Sets the mipmap level bias for a texture reference.
    ///
    /// bias
    ///
    /// hTexRef
    ///
    /// Note that this call has no effect if hTexRef is not bound to a mipmapped array.
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `bias`: Mipmap level bias.
    #[deprecated]
    pub fn cuTexRefSetMipmapLevelBias(hTexRef: CUtexref, bias: f32) -> CUresult;
}
unsafe extern "C" {
    /// Sets the mipmap min/max mipmap level clamps for a texture reference.
    ///
    /// minMipmapLevelClamp
    ///
    /// maxMipmapLevelClamp
    ///
    /// hTexRef
    ///
    /// Note that this call has no effect if hTexRef is not bound to a mipmapped array.
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `minMipmapLevelClamp`: Mipmap min level clamp.
    /// - `maxMipmapLevelClamp`: Mipmap max level clamp.
    #[deprecated]
    pub fn cuTexRefSetMipmapLevelClamp(
        hTexRef: CUtexref,
        minMipmapLevelClamp: f32,
        maxMipmapLevelClamp: f32,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the maximum anisotropy for a texture reference.
    ///
    /// maxAniso
    ///
    /// hTexRef
    ///
    /// Note that this call has no effect if hTexRef is bound to linear memory.
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `maxAniso`: Maximum anisotropy.
    #[deprecated]
    pub fn cuTexRefSetMaxAnisotropy(
        hTexRef: CUtexref,
        maxAniso: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Sets the border color for a texture reference.
    ///
    /// pBorderColor
    ///
    /// hTexRef
    ///
    /// Note that the color values can be set only when the Address mode is set to [`CUaddress_mode::CU_TR_ADDRESS_MODE_BORDER`] using [`cuTexRefSetAddressMode`]. Applications using integer border color values have to "reinterpret_cast" their values to float.
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddressMode`], [`cuTexRefGetAddressMode`], [`cuTexRefGetBorderColor`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `pBorderColor`: RGBA color.
    #[deprecated]
    pub fn cuTexRefSetBorderColor(hTexRef: CUtexref, pBorderColor: *mut f32) -> CUresult;
}
unsafe extern "C" {
    /// Sets the flags for a texture reference.
    ///
    /// Flags
    ///
    /// hTexRef
    ///
    /// * [`CU_TRSF_READ_AS_INTEGER`], which suppresses the default behavior of having the texture promote integer data to floating point data in the range \[0,
    ///   1\]. Note that texture with 32-bit integer format would not be promoted, regardless of whether or not this flag is specified;
    /// * [`CU_TRSF_NORMALIZED_COORDINATES`], which suppresses the default behavior of having the texture coordinates range from 0, Dim) where Dim is the width or height
    ///   of the CUDA array. Instead, the texture coordinates [0, 1.0) reference the entire breadth of the array dimension;
    /// * [CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION, which disables any trilinear filtering optimizations. Trilinear optimizations improve texture filtering performance by allowing
    ///   bilinear filtering on textures in scenarios where it can closely approximate the expected results.
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference.
    /// - `Flags`: Optional flags to set.
    #[deprecated]
    pub fn cuTexRefSetFlags(hTexRef: CUtexref, Flags: ::core::ffi::c_uint) -> CUresult;
}
unsafe extern "C" {
    /// Gets the address associated with a texture reference.
    ///
    /// \*pdptr
    ///
    /// hTexRef
    ///
    /// [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `pdptr`: Returned device address.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetAddress_v2(pdptr: *mut CUdeviceptr, hTexRef: CUtexref) -> CUresult;
}
unsafe extern "C" {
    /// Gets the array bound to a texture reference.
    ///
    /// \*phArray
    ///
    /// hTexRef
    ///
    /// [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `phArray`: Returned array.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetArray(phArray: *mut CUarray, hTexRef: CUtexref) -> CUresult;
}
unsafe extern "C" {
    /// Gets the mipmapped array bound to a texture reference.
    ///
    /// \*phMipmappedArray
    ///
    /// hTexRef
    ///
    /// [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `phMipmappedArray`: Returned mipmapped array.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetMipmappedArray(
        phMipmappedArray: *mut CUmipmappedArray,
        hTexRef: CUtexref,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets the addressing mode used by a texture reference.
    ///
    /// \*pam
    ///
    /// dim
    ///
    /// hTexRef
    ///
    /// dim
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `pam`: Returned addressing mode.
    /// - `hTexRef`: Texture reference.
    /// - `dim`: Dimension.
    #[deprecated]
    pub fn cuTexRefGetAddressMode(
        pam: *mut CUaddress_mode,
        hTexRef: CUtexref,
        dim: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets the filter-mode used by a texture reference.
    ///
    /// \*pfm
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `pfm`: Returned filtering mode.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetFilterMode(pfm: *mut CUfilter_mode, hTexRef: CUtexref) -> CUresult;
}
unsafe extern "C" {
    /// Gets the format used by a texture reference.
    ///
    /// \*pFormat
    ///
    /// \*pNumChannels
    ///
    /// hTexRef
    ///
    /// pFormat
    ///
    /// pNumChannels
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`].
    ///
    /// # Parameters
    ///
    /// - `pFormat`: Returned format.
    /// - `pNumChannels`: Returned number of components.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetFormat(
        pFormat: *mut CUarray_format,
        pNumChannels: *mut ::core::ffi::c_int,
        hTexRef: CUtexref,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets the mipmap filtering mode for a texture reference.
    ///
    /// pfm
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `pfm`: Returned mipmap filtering mode.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetMipmapFilterMode(
        pfm: *mut CUfilter_mode,
        hTexRef: CUtexref,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets the mipmap level bias for a texture reference.
    ///
    /// pBias
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `pbias`: Returned mipmap level bias.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetMipmapLevelBias(pbias: *mut f32, hTexRef: CUtexref) -> CUresult;
}
unsafe extern "C" {
    /// Gets the min/max mipmap level clamps for a texture reference.
    ///
    /// pminMipmapLevelClamp
    ///
    /// pmaxMipmapLevelClamp
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `pminMipmapLevelClamp`: Returned mipmap min level clamp.
    /// - `pmaxMipmapLevelClamp`: Returned mipmap max level clamp.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetMipmapLevelClamp(
        pminMipmapLevelClamp: *mut f32,
        pmaxMipmapLevelClamp: *mut f32,
        hTexRef: CUtexref,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets the maximum anisotropy for a texture reference.
    ///
    /// pmaxAniso
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFlags`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `pmaxAniso`: Returned maximum anisotropy.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetMaxAnisotropy(
        pmaxAniso: *mut ::core::ffi::c_int,
        hTexRef: CUtexref,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Gets the border color used by a texture reference.
    ///
    /// pBorderColor
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddressMode`], [`cuTexRefSetAddressMode`], [`cuTexRefSetBorderColor`].
    ///
    /// # Parameters
    ///
    /// - `pBorderColor`: Returned Type and Value of RGBA color.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetBorderColor(pBorderColor: *mut f32, hTexRef: CUtexref) -> CUresult;
}
unsafe extern "C" {
    /// Gets the flags used by a texture reference.
    ///
    /// \*pFlags
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefSetAddress_v2`], [`cuTexRefSetAddress2D_v3`], [`cuTexRefSetAddressMode`], [`cuTexRefSetArray`], [`cuTexRefSetFilterMode`], [`cuTexRefSetFlags`], [`cuTexRefSetFormat`], [`cuTexRefGetAddress_v2`], [`cuTexRefGetAddressMode`], [`cuTexRefGetArray`], [`cuTexRefGetFilterMode`], [`cuTexRefGetFormat`].
    ///
    /// # Parameters
    ///
    /// - `pFlags`: Returned flags.
    /// - `hTexRef`: Texture reference.
    #[deprecated]
    pub fn cuTexRefGetFlags(
        pFlags: *mut ::core::ffi::c_uint,
        hTexRef: CUtexref,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a texture reference.
    ///
    /// \*pTexRef
    ///
    /// [`cuTexRefSetArray`]
    ///
    /// [`cuTexRefSetAddress_v2`]
    ///
    /// **See also:**
    ///
    /// [`cuTexRefDestroy`].
    ///
    /// # Parameters
    ///
    /// - `pTexRef`: Returned texture reference.
    #[deprecated]
    pub fn cuTexRefCreate(pTexRef: *mut CUtexref) -> CUresult;
}
unsafe extern "C" {
    /// Destroys a texture reference.
    ///
    /// hTexRef
    ///
    /// **See also:**
    ///
    /// [`cuTexRefCreate`].
    ///
    /// # Parameters
    ///
    /// - `hTexRef`: Texture reference to destroy.
    #[deprecated]
    pub fn cuTexRefDestroy(hTexRef: CUtexref) -> CUresult;
}
unsafe extern "C" {
    /// Sets the CUDA array for a surface reference.
    ///
    /// hArray
    ///
    /// hSurfRef
    ///
    /// Flags
    ///
    /// [`CUDA_ARRAY3D_SURFACE_LDST`]
    ///
    /// hSurfRef
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetSurfRef`], [`cuSurfRefGetArray`].
    ///
    /// # Parameters
    ///
    /// - `hSurfRef`: Surface reference handle.
    /// - `hArray`: CUDA array handle.
    /// - `Flags`: set to 0.
    #[deprecated]
    pub fn cuSurfRefSetArray(
        hSurfRef: CUsurfref,
        hArray: CUarray,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Passes back the CUDA array bound to a surface reference.
    ///
    /// \*phArray
    ///
    /// hSurfRef
    ///
    /// [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`]
    ///
    /// **See also:**
    ///
    /// [`cuModuleGetSurfRef`], [`cuSurfRefSetArray`].
    ///
    /// # Parameters
    ///
    /// - `phArray`: Surface reference handle.
    /// - `hSurfRef`: Surface reference handle.
    #[deprecated]
    pub fn cuSurfRefGetArray(phArray: *mut CUarray, hSurfRef: CUsurfref) -> CUresult;
}
unsafe extern "C" {
    /// Creates a texture object.
    ///
    /// Creates a texture object and returns it in pTexObject. pResDesc describes the data to texture from. pTexDesc describes how the data should be sampled. pResViewDesc is an optional argument that specifies an alternate format for the data described by pResDesc, and also describes the subresource region to restrict access to when texturing. pResViewDesc can only be specified if the type of resource is a CUDA array or a CUDA mipmapped array not in a block compressed format.
    ///
    /// Texture objects are only supported on devices of compute capability 3.0 or higher. Additionally, a texture object is an opaque
    /// value, and, as such, should only be accessed through CUDA API calls.
    ///
    /// The CUDA_RESOURCE_DESC structure is defined as:
    ///
    /// ```text
    /// typedef struct CUDA_RESOURCE_DESC_st
    /// {
    /// CUresourcetype resType;
    ///
    /// union {
    /// struct {
    /// CUarray hArray;
    /// } array;
    /// struct {
    /// CUmipmappedArray hMipmappedArray;
    /// } mipmap;
    /// struct {
    /// CUdeviceptr devPtr;
    /// CUarray_format format;
    /// unsigned int numChannels;
    /// size_t sizeInBytes;
    /// } linear;
    /// struct {
    /// CUdeviceptr devPtr;
    /// CUarray_format format;
    /// unsigned int numChannels;
    /// size_t width;
    /// size_t height;
    /// size_t pitchInBytes;
    /// } pitch2D;
    /// } res;
    ///
    /// unsigned int flags;
    /// } CUDA_RESOURCE_DESC;
    /// ```
    ///
    /// * [CUDA_RESOURCE_DESC::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1fe341889f4a57165e7acc0efcfc38b64) specifies the type of resource to texture from. CUresourceType is defined as:
    ///
    /// ```text
    /// typedef enum CUresourcetype_enum {
    /// CU_RESOURCE_TYPE_ARRAY           = 0x00,
    /// CU_RESOURCE_TYPE_MIPMAPPED_ARRAY = 0x01,
    /// CU_RESOURCE_TYPE_LINEAR          = 0x02,
    /// CU_RESOURCE_TYPE_PITCH2D         = 0x03
    /// } CUresourcetype;
    /// ```
    ///
    /// If [CUDA_RESOURCE_DESC::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1fe341889f4a57165e7acc0efcfc38b64) is set to [`CUresourcetype_enum::CU_RESOURCE_TYPE_ARRAY`], CUDA_RESOURCE_DESC::res::array::hArray must be set to a valid CUDA array handle.
    ///
    /// If [CUDA_RESOURCE_DESC::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1fe341889f4a57165e7acc0efcfc38b64) is set to [`CUresourcetype_enum::CU_RESOURCE_TYPE_MIPMAPPED_ARRAY`], CUDA_RESOURCE_DESC::res::mipmap::hMipmappedArray must be set to a valid CUDA mipmapped array handle.
    ///
    /// If [CUDA_RESOURCE_DESC::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1fe341889f4a57165e7acc0efcfc38b64) is set to [`CUresourcetype_enum::CU_RESOURCE_TYPE_LINEAR`], CUDA_RESOURCE_DESC::res::linear::devPtr must be set to a valid device pointer, that is aligned to [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`]. CUDA_RESOURCE_DESC::res::linear::format and CUDA_RESOURCE_DESC::res::linear::numChannels describe the format of each component
    /// and the number of components per array element. CUDA_RESOURCE_DESC::res::linear::sizeInBytes specifies the size of the array
    /// in bytes. The total number of elements in the linear address range cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE1D_LINEAR_WIDTH`]. The number of elements is computed as (sizeInBytes / (sizeof(format) \* numChannels)).
    ///
    /// If [CUDA_RESOURCE_DESC::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1fe341889f4a57165e7acc0efcfc38b64) is set to [`CUresourcetype_enum::CU_RESOURCE_TYPE_PITCH2D`], CUDA_RESOURCE_DESC::res::pitch2D::devPtr must be set to a valid device pointer, that is aligned to [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_ALIGNMENT`]. CUDA_RESOURCE_DESC::res::pitch2D::format and CUDA_RESOURCE_DESC::res::pitch2D::numChannels describe the format of each component
    /// and the number of components per array element. CUDA_RESOURCE_DESC::res::pitch2D::width and CUDA_RESOURCE_DESC::res::pitch2D::height
    /// specify the width and height of the array in elements, and cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_WIDTH`] and [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_HEIGHT`] respectively. CUDA_RESOURCE_DESC::res::pitch2D::pitchInBytes specifies the pitch between two rows in bytes and has to be
    /// aligned to [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_TEXTURE_PITCH_ALIGNMENT`]. Pitch cannot exceed [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LINEAR_PITCH`].
    ///
    /// * flags must be set to zero.
    ///
    /// The CUDA_TEXTURE_DESC struct is defined as
    ///
    /// ```text
    /// typedef struct CUDA_TEXTURE_DESC_st {
    /// CUaddress_mode addressMode\[3\];
    /// CUfilter_mode filterMode;
    /// unsigned int flags;
    /// unsigned int maxAnisotropy;
    /// CUfilter_mode mipmapFilterMode;
    /// float mipmapLevelBias;
    /// float minMipmapLevelClamp;
    /// float maxMipmapLevelClamp;
    /// } CUDA_TEXTURE_DESC;
    /// ```
    ///
    /// * [CUDA_TEXTURE_DESC::addressMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_1aeb3f6fa73835433a7700b80eea8d49b) specifies the addressing mode for each dimension of the texture data. `CUaddress_mode` is defined as:
    ///
    /// ```text
    /// typedef enum CUaddress_mode_enum {
    /// CU_TR_ADDRESS_MODE_WRAP = 0,
    /// CU_TR_ADDRESS_MODE_CLAMP = 1,
    /// CU_TR_ADDRESS_MODE_MIRROR = 2,
    /// CU_TR_ADDRESS_MODE_BORDER = 3
    /// } CUaddress_mode;
    /// ```
    ///
    ///   This is ignored if [CUDA_RESOURCE_DESC::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1fe341889f4a57165e7acc0efcfc38b64) is [`CUresourcetype_enum::CU_RESOURCE_TYPE_LINEAR`]. Also, if the flag, [`CU_TRSF_NORMALIZED_COORDINATES`] is not set, the only supported address mode is [`CUaddress_mode_enum::CU_TR_ADDRESS_MODE_CLAMP`].
    ///
    /// * [CUDA_TEXTURE_DESC::filterMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_182e92599f2f13422d8cc6cfe947e6b17) specifies the filtering mode to be used when fetching from the texture. CUfilter_mode is defined as:
    ///
    /// ```text
    /// typedef enum CUfilter_mode_enum {
    /// CU_TR_FILTER_MODE_POINT = 0,
    /// CU_TR_FILTER_MODE_LINEAR = 1
    /// } CUfilter_mode;
    /// ```
    ///
    ///   This is ignored if [CUDA_RESOURCE_DESC::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1fe341889f4a57165e7acc0efcfc38b64) is [`CUresourcetype_enum::CU_RESOURCE_TYPE_LINEAR`].
    ///
    /// * [CUDA_TEXTURE_DESC::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_1f50575c45ea8767561db54f4e785cabd) can be any combination of the following:
    ///   + [`CU_TRSF_READ_AS_INTEGER`], which suppresses the default behavior of having the texture promote integer data to floating point data in the range [0,
    /// ```text
    /// 1]. Note that texture with 32-bit integer format would not be promoted, regardless of whether or not this flag is specified.
    /// ```
    ///   + [`CU_TRSF_NORMALIZED_COORDINATES`], which suppresses the default behavior of having the texture coordinates range from 0, Dim) where Dim is the width or height
    /// ```text
    /// of the CUDA array. Instead, the texture coordinates [0, 1.0) reference the entire breadth of the array dimension; Note that
    /// for CUDA mipmapped arrays, this flag has to be set.
    /// ```
    ///   + [CU_TRSF_DISABLE_TRILINEAR_OPTIMIZATION, which disables any trilinear filtering optimizations. Trilinear optimizations improve texture filtering performance by allowing
    /// bilinear filtering on textures in scenarios where it can closely approximate the expected results.
    ///   + [`CU_TRSF_SEAMLESS_CUBEMAP`], which enables seamless cube map filtering. This flag can only be specified if the underlying resource is a CUDA array or
    /// a CUDA mipmapped array that was created with the flag [`CUDA_ARRAY3D_CUBEMAP`]. When seamless cube map filtering is enabled, texture address modes specified by [CUDA_TEXTURE_DESC::addressMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_1aeb3f6fa73835433a7700b80eea8d49b) are ignored. Instead, if the [CUDA_TEXTURE_DESC::filterMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_182e92599f2f13422d8cc6cfe947e6b17) is set to [`CUfilter_mode_enum::CU_TR_FILTER_MODE_POINT`] the address mode [`CUaddress_mode_enum::CU_TR_ADDRESS_MODE_CLAMP`] will be applied for all dimensions. If the [CUDA_TEXTURE_DESC::filterMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_182e92599f2f13422d8cc6cfe947e6b17) is set to [`CUfilter_mode_enum::CU_TR_FILTER_MODE_LINEAR`] seamless cube map filtering will be performed when sampling along the cube face borders.
    ///
    /// * [CUDA_TEXTURE_DESC::maxAnisotropy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_139035372a07e031d233445673427f34a) specifies the maximum anisotropy ratio to be used when doing anisotropic filtering. This value will be clamped to the range
    ///   \[1,16\].
    ///
    /// * [CUDA_TEXTURE_DESC::mipmapFilterMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_117333d832def1d97420ddd0bce8c73ce) specifies the filter mode when the calculated mipmap level lies between two defined mipmap levels.
    ///
    /// * [CUDA_TEXTURE_DESC::mipmapLevelBias](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_10b1c10e7f1eedc4a8ab547da5741ce2d) specifies the offset to be applied to the calculated mipmap level.
    ///
    /// * [CUDA_TEXTURE_DESC::minMipmapLevelClamp](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_1bf7da8359ccf52ba8afcd28c31b48be8) specifies the lower end of the mipmap level range to clamp access to.
    ///
    /// * [CUDA_TEXTURE_DESC::maxMipmapLevelClamp](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_1149eca11ac6059979a1754bffcc6c210) specifies the upper end of the mipmap level range to clamp access to.
    ///
    /// The CUDA_RESOURCE_VIEW_DESC struct is defined as
    ///
    /// ```text
    /// typedef struct CUDA_RESOURCE_VIEW_DESC_st
    /// {
    /// CUresourceViewFormat format;
    /// size_t width;
    /// size_t height;
    /// size_t depth;
    /// unsigned int firstMipmapLevel;
    /// unsigned int lastMipmapLevel;
    /// unsigned int firstLayer;
    /// unsigned int lastLayer;
    /// } CUDA_RESOURCE_VIEW_DESC;
    /// ```
    ///
    /// * [CUDA_RESOURCE_VIEW_DESC::format](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__VIEW__DESC__v1.html#structCUDA__RESOURCE__VIEW__DESC__v1_17ee307ae64bba468ea89bb502d3f8386) specifies how the data contained in the CUDA array or CUDA mipmapped array should be interpreted. Note that this can incur
    ///   a change in size of the texture data. If the resource view format is a block compressed format, then the underlying CUDA array
    ///   or CUDA mipmapped array has to have a base of format [`CUarray_format_enum::CU_AD_FORMAT_UNSIGNED_INT32`]. with 2 or 4 channels, depending on the block compressed format. For ex., BC1 and BC4 require the underlying CUDA array to
    ///   have a format of [`CUarray_format_enum::CU_AD_FORMAT_UNSIGNED_INT32`] with 2 channels. The other BC formats require the underlying resource to have the same base format but with 4 channels.
    ///
    /// * [CUDA_RESOURCE_VIEW_DESC::width](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__VIEW__DESC__v1.html#structCUDA__RESOURCE__VIEW__DESC__v1_17a74f483b2af8a73d2a1876688926e63) specifies the new width of the texture data. If the resource view format is a block compressed format, this value has to
    ///   be 4 times the original width of the resource. For non block compressed formats, this value has to be equal to that of the
    ///   original resource.
    ///
    /// * [CUDA_RESOURCE_VIEW_DESC::height](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__VIEW__DESC__v1.html#structCUDA__RESOURCE__VIEW__DESC__v1_1a2737a7f88568199ab94d7c3f696bed3) specifies the new height of the texture data. If the resource view format is a block compressed format, this value has to
    ///   be 4 times the original height of the resource. For non block compressed formats, this value has to be equal to that of the
    ///   original resource.
    ///
    /// * [CUDA_RESOURCE_VIEW_DESC::depth](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__VIEW__DESC__v1.html#structCUDA__RESOURCE__VIEW__DESC__v1_164ca74e2623b821d8dfbbabbc5c839f6) specifies the new depth of the texture data. This value has to be equal to that of the original resource.
    ///
    /// * [CUDA_RESOURCE_VIEW_DESC::firstMipmapLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__VIEW__DESC__v1.html#structCUDA__RESOURCE__VIEW__DESC__v1_134105380b4498ef2a7b6f9898f983df3) specifies the most detailed mipmap level. This will be the new mipmap level zero. For non-mipmapped resources, this value
    ///   has to be zero.[CUDA_TEXTURE_DESC::minMipmapLevelClamp](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_1bf7da8359ccf52ba8afcd28c31b48be8) and [CUDA_TEXTURE_DESC::maxMipmapLevelClamp](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__TEXTURE__DESC__v1.html#structCUDA__TEXTURE__DESC__v1_1149eca11ac6059979a1754bffcc6c210) will be relative to this value. For ex., if the firstMipmapLevel is set to 2, and a minMipmapLevelClamp of 1.2 is specified,
    ///   then the actual minimum mipmap level clamp will be 3.2.
    ///
    /// * [CUDA_RESOURCE_VIEW_DESC::lastMipmapLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__VIEW__DESC__v1.html#structCUDA__RESOURCE__VIEW__DESC__v1_16e0dc4da9bcf7518fc66aee8f0dd928e) specifies the least detailed mipmap level. For non-mipmapped resources, this value has to be zero.
    ///
    /// * [CUDA_RESOURCE_VIEW_DESC::firstLayer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__VIEW__DESC__v1.html#structCUDA__RESOURCE__VIEW__DESC__v1_154262bb560a5c52aa73dfe97077334f9) specifies the first layer index for layered textures. This will be the new layer zero. For non-layered resources, this value
    ///   has to be zero.
    ///
    /// * [CUDA_RESOURCE_VIEW_DESC::lastLayer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__VIEW__DESC__v1.html#structCUDA__RESOURCE__VIEW__DESC__v1_14f2845ad9438911320a33e3fb1017964) specifies the last layer index for layered textures. For non-layered resources, this value has to be zero.
    ///
    /// **See also:**
    ///
    /// [`cuTexObjectDestroy`], [cudaCreateTextureObject](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TEXTURE__OBJECT.html#group__CUDART__TEXTURE__OBJECT_1g16ac75814780c3a16e4c63869feb9ad3).
    ///
    /// # Parameters
    ///
    /// - `pTexObject`: Texture object to create.
    /// - `pResDesc`: Resource descriptor.
    /// - `pTexDesc`: Texture descriptor.
    /// - `pResViewDesc`: Resource view descriptor.
    pub fn cuTexObjectCreate(
        pTexObject: *mut CUtexObject,
        pResDesc: *const CUDA_RESOURCE_DESC,
        pTexDesc: *const CUDA_TEXTURE_DESC,
        pResViewDesc: *const CUDA_RESOURCE_VIEW_DESC,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys a texture object.
    ///
    /// Destroys the texture object specified by texObject.
    ///
    /// **See also:**
    ///
    /// [`cuTexObjectCreate`], [cudaDestroyTextureObject](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TEXTURE__OBJECT.html#group__CUDART__TEXTURE__OBJECT_1g27be12e215f162cc877be94390da75bb).
    ///
    /// # Parameters
    ///
    /// - `texObject`: Texture object to destroy.
    pub fn cuTexObjectDestroy(texObject: CUtexObject) -> CUresult;
}
unsafe extern "C" {
    /// Returns a texture object's resource descriptor.
    ///
    /// Returns the resource descriptor for the texture object specified by texObject.
    ///
    /// **See also:**
    ///
    /// [`cuTexObjectCreate`], [cudaGetTextureObjectResourceDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TEXTURE__OBJECT.html#group__CUDART__TEXTURE__OBJECT_1g4ac6e3f033c356ecc4ab6fb85154f066),.
    ///
    /// # Parameters
    ///
    /// - `pResDesc`: Resource descriptor.
    /// - `texObject`: Texture object.
    pub fn cuTexObjectGetResourceDesc(
        pResDesc: *mut CUDA_RESOURCE_DESC,
        texObject: CUtexObject,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a texture object's texture descriptor.
    ///
    /// Returns the texture descriptor for the texture object specified by texObject.
    ///
    /// **See also:**
    ///
    /// [`cuTexObjectCreate`], [cudaGetTextureObjectTextureDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TEXTURE__OBJECT.html#group__CUDART__TEXTURE__OBJECT_1g152565714ff9dce6867b6099afc05e50).
    ///
    /// # Parameters
    ///
    /// - `pTexDesc`: Texture descriptor.
    /// - `texObject`: Texture object.
    pub fn cuTexObjectGetTextureDesc(
        pTexDesc: *mut CUDA_TEXTURE_DESC,
        texObject: CUtexObject,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns a texture object's resource view descriptor.
    ///
    /// Returns the resource view descriptor for the texture object specified by texObject. If no resource view was set for texObject, the [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// **See also:**
    ///
    /// [`cuTexObjectCreate`], [cudaGetTextureObjectResourceViewDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__TEXTURE__OBJECT.html#group__CUDART__TEXTURE__OBJECT_1g0332bef8105771003c64d7f09d6163fe).
    ///
    /// # Parameters
    ///
    /// - `pResViewDesc`: Resource view descriptor.
    /// - `texObject`: Texture object.
    pub fn cuTexObjectGetResourceViewDesc(
        pResViewDesc: *mut CUDA_RESOURCE_VIEW_DESC,
        texObject: CUtexObject,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Creates a surface object.
    ///
    /// Creates a surface object and returns it in pSurfObject. pResDesc describes the data to perform surface load/stores on. [CUDA_RESOURCE_DESC::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1fe341889f4a57165e7acc0efcfc38b64) must be [`CUresourcetype_enum::CU_RESOURCE_TYPE_ARRAY`] and CUDA_RESOURCE_DESC::res::array::hArray must be set to a valid CUDA array handle. [CUDA_RESOURCE_DESC::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/structCUDA__RESOURCE__DESC__v1.html#structCUDA__RESOURCE__DESC__v1_1857d9251dec54700bd8cd071accc3bdf) must be set to zero.
    ///
    /// Surface objects are only supported on devices of compute capability 3.0 or higher. Additionally, a surface object is an opaque
    /// value, and, as such, should only be accessed through CUDA API calls.
    ///
    /// **See also:**
    ///
    /// [`cuSurfObjectDestroy`], [cudaCreateSurfaceObject](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__SURFACE__OBJECT.html#group__CUDART__SURFACE__OBJECT_1g958899474ab2c5f40d233b524d6c5a01).
    ///
    /// # Parameters
    ///
    /// - `pSurfObject`: Surface object to create.
    /// - `pResDesc`: Resource descriptor.
    pub fn cuSurfObjectCreate(
        pSurfObject: *mut CUsurfObject,
        pResDesc: *const CUDA_RESOURCE_DESC,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys a surface object.
    ///
    /// Destroys the surface object specified by surfObject.
    ///
    /// **See also:**
    ///
    /// [`cuSurfObjectCreate`], [cudaDestroySurfaceObject](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__SURFACE__OBJECT.html#group__CUDART__SURFACE__OBJECT_1g9fab66c3a39b9f8f52b718eea794ad60).
    ///
    /// # Parameters
    ///
    /// - `surfObject`: Surface object to destroy.
    pub fn cuSurfObjectDestroy(surfObject: CUsurfObject) -> CUresult;
}
unsafe extern "C" {
    /// Returns a surface object's resource descriptor.
    ///
    /// Returns the resource descriptor for the surface object specified by surfObject.
    ///
    /// **See also:**
    ///
    /// [`cuSurfObjectCreate`], [cudaGetSurfaceObjectResourceDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__SURFACE__OBJECT.html#group__CUDART__SURFACE__OBJECT_1gd7087318f73ae605645d6721d51486bd).
    ///
    /// # Parameters
    ///
    /// - `pResDesc`: Resource descriptor.
    /// - `surfObject`: Surface object.
    pub fn cuSurfObjectGetResourceDesc(
        pResDesc: *mut CUDA_RESOURCE_DESC,
        surfObject: CUsurfObject,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Create a tensor map descriptor object representing tiled memory region.
    ///
    /// Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a tiled region and returns
    /// it in tensorMap.
    ///
    /// Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is
    /// an opaque value, and, as such, should only be accessed through CUDA APIs and PTX.
    ///
    /// The parameters passed are bound to the following requirements:
    ///
    /// * tensorMap address must be aligned to 64 bytes.
    ///
    /// * tensorDataType has to be an enum from `CUtensorMapDataType` which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapDataType_enum {
    /// CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0,       // 1 byte
    /// CU_TENSOR_MAP_DATA_TYPE_UINT16,          // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_UINT32,          // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_INT32,           // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_UINT64,          // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_INT64,           // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT16,         // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32,         // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT64,         // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_BFLOAT16,        // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ,     // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32,        // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ,    // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B,    // 4 bits
    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B,   // 4 bits
    /// CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B    // 6 bits
    /// } CUtensorMapDataType;
    /// ```
    ///
    ///   [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`] copies '16 x U4' packed values to memory aligned as 8 bytes. There are no gaps between
    ///   packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`] copies '16 x U4' packed values to memory aligned as 16 bytes. There are
    ///   8 byte gaps between every 8 byte chunk of packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] copies '16 x U6' packed values
    ///   to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values.
    ///
    /// * tensorRank must be non-zero and less than or equal to the maximum supported dimensionality of 5. If interleave is not [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], then tensorRank must additionally be greater than or equal to 3.
    ///
    /// * globalAddress, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements
    ///   need to also be met:
    ///   + When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], globalAddress must be 32 byte aligned.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalAddress must be 32 byte aligned.
    ///
    /// * globalDim array, which specifies tensor size of each of the tensorRank dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for
    ///   the packed data types:
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalDim\[0\] must be a multiple of 128.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], globalDim\[0\] must be a multiple of 2.
    ///   + Dimension for the packed data types must reflect the number of individual U# values.
    ///
    /// * globalStrides array, which specifies tensor stride of each of the lower tensorRank - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be
    ///   met:
    ///   + When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], the strides must be a multiple of 32.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], the strides must be a multiple of 32.
    /// Each following dimension specified includes previous dimension stride:
    ///
    /// ```text
    /// globalStrides\[0\] = globalDim\[0\] * elementSizeInBytes(tensorDataType) + padding\[0\];
    /// for (i = 1; i &lt; tensorRank - 1; i++)
    /// globalStrides\[i\] = globalStrides\[i – 1\] * (globalDim\[i\] + padding\[i\]);
    /// assert(globalStrides\[i\] >= globalDim\[i\]);
    /// ```
    ///
    /// * boxDim array, which specifies number of elements to be traversed along each of the tensorRank dimensions, must be non-zero and less than or equal to 256. Additionally, the following requirements need to be met:
    ///   + When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], { boxDim\[0\] \* elementSizeInBytes( tensorDataType ) } must be a multiple of 16 bytes.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], boxDim\[0\] must be 128.
    ///
    /// * elementStrides array, which specifies the iteration step along each of the tensorRank dimensions, must be non-zero and less than or equal to 8. Note that when interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], the first element of this array is ignored since TMA doesn’t support the stride for dimension
    ///   zero. When all elements of elementStrides array is one, boxDim specifies the number of elements to load. However, if the elementStrides\[i\] is not equal to one, then TMA loads ceil( boxDim\[i\] / elementStrides\[i\]) number of elements along i-th dimension. To load N elements along i-th dimension, boxDim\[i\] must be set to N \* elementStrides\[i\].
    ///
    /// * interleave specifies the interleaved layout of type `CUtensorMapInterleave`, which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapInterleave_enum {
    /// CU_TENSOR_MAP_INTERLEAVE_NONE = 0,
    /// CU_TENSOR_MAP_INTERLEAVE_16B,
    /// CU_TENSOR_MAP_INTERLEAVE_32B
    /// } CUtensorMapInterleave;
    /// ```
    ///
    ///   TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16
    ///   where C16 uses 32 bytes. When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`] and swizzle is not [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`], the bounding box inner dimension (computed as boxDim\[0\] multiplied by element size derived from tensorDataType) must be less than or equal to the swizzle size.
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_32B`] requires the bounding box inner dimension to be &lt;= 32.
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_64B`] requires the bounding box inner dimension to be &lt;= 64.
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`]\* require the bounding box inner dimension to be &lt;= 128. Additionally, tensorDataType of [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] requires interleave to be [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`].
    ///
    /// * swizzle, which specifies the shared memory bank swizzling pattern, has to be of type `CUtensorMapSwizzle` which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapSwizzle_enum {
    /// CU_TENSOR_MAP_SWIZZLE_NONE = 0,
    /// CU_TENSOR_MAP_SWIZZLE_32B,                   // Swizzle 16B chunks within 32B  span
    /// CU_TENSOR_MAP_SWIZZLE_64B,                   // Swizzle 16B chunks within 64B  span
    /// CU_TENSOR_MAP_SWIZZLE_128B,                  // Swizzle 16B chunks within 128B span
    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B,         // Swizzle 32B chunks within 128B span
    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B, // Swizzle 32B chunks within 128B span, additionally swap lower 8B with upper 8B within each 16B for every alternate row
    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B,         // Swizzle 64B chunks within 128B span
    /// } CUtensorMapSwizzle;
    /// ```
    ///
    ///   Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses
    ///   data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order
    ///   to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], swizzle must be [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_32B`]. Other interleave modes can have any swizzling pattern. When the tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`], only the following swizzle modes are supported:
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`] (Load & Store)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load & Store)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load & Store)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B`] (Store only) When the tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], only the following swizzle modes are supported:
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`] (Load only)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load only)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load only)
    ///
    /// * l2Promotion specifies L2 fetch size which indicates the byte granurality at which L2 requests is filled from DRAM. It must be of type
    ///   `CUtensorMapL2promotion`, which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapL2promotion_enum {
    /// CU_TENSOR_MAP_L2_PROMOTION_NONE = 0,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_64B,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_128B,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_256B
    /// } CUtensorMapL2promotion;
    /// ```
    ///
    /// * oobFill, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type `CUtensorMapFloatOOBfill` which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapFloatOOBfill_enum {
    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0,
    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA
    /// } CUtensorMapFloatOOBfill;
    /// ```
    ///
    ///   Note that [`CUtensorMapFloatOOBfill::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA`] can only be used when tensorDataType represents a floating-point data type, and when tensorDataType is not [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], and [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`].
    ///
    /// **See also:**
    ///
    /// [`cuTensorMapEncodeIm2col`], [`cuTensorMapEncodeIm2colWide`], [`cuTensorMapReplaceAddress`].
    ///
    /// # Parameters
    ///
    /// - `tensorMap`: Tensor map object to create.
    /// - `tensorDataType`: Tensor data type.
    /// - `tensorRank`: Dimensionality of tensor.
    /// - `globalAddress`: Starting address of memory region described by tensor.
    /// - `globalDim`: Array containing tensor size (number of elements) along each of the tensorRank dimensions.
    /// - `globalStrides`: Array containing stride size (in bytes) along each of the tensorRank - 1 dimensions.
    /// - `boxDim`: Array containing traversal box size (number of elments) along each of the tensorRank dimensions. Specifies how many elements to be traversed along each tensor dimension.
    /// - `elementStrides`: Array containing traversal stride in each of the tensorRank dimensions.
    /// - `interleave`: Type of interleaved layout the tensor addresses.
    /// - `swizzle`: Bank swizzling pattern inside shared memory.
    /// - `l2Promotion`: L2 promotion size.
    /// - `oobFill`: Indicate whether zero or special NaN constant must be used to fill out-of-bound elements.
    pub fn cuTensorMapEncodeTiled(
        tensorMap: *mut CUtensorMap,
        tensorDataType: CUtensorMapDataType,
        tensorRank: cuuint32_t,
        globalAddress: *mut ::core::ffi::c_void,
        globalDim: *const cuuint64_t,
        globalStrides: *const cuuint64_t,
        boxDim: *const cuuint32_t,
        elementStrides: *const cuuint32_t,
        interleave: CUtensorMapInterleave,
        swizzle: CUtensorMapSwizzle,
        l2Promotion: CUtensorMapL2promotion,
        oobFill: CUtensorMapFloatOOBfill,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Create a tensor map descriptor object representing im2col memory region.
    ///
    /// Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a im2col memory layout and
    /// returns it in tensorMap.
    ///
    /// Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is
    /// an opaque value, and, as such, should only be accessed through CUDA APIs and PTX.
    ///
    /// The parameters passed are bound to the following requirements:
    ///
    /// * tensorMap address must be aligned to 64 bytes.
    ///
    /// * tensorDataType has to be an enum from `CUtensorMapDataType` which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapDataType_enum {
    /// CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0,       // 1 byte
    /// CU_TENSOR_MAP_DATA_TYPE_UINT16,          // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_UINT32,          // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_INT32,           // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_UINT64,          // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_INT64,           // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT16,         // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32,         // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT64,         // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_BFLOAT16,        // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ,     // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32,        // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ     // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B,    // 4 bits
    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B,   // 4 bits
    /// CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B    // 6 bits
    /// } CUtensorMapDataType;
    /// ```
    ///
    ///   [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`] copies '16 x U4' packed values to memory aligned as 8 bytes. There are no gaps between
    ///   packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`] copies '16 x U4' packed values to memory aligned as 16 bytes. There are
    ///   8 byte gaps between every 8 byte chunk of packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] copies '16 x U6' packed values
    ///   to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values.
    ///
    /// * tensorRank, which specifies the number of tensor dimensions, must be 3, 4, or 5.
    ///
    /// * globalAddress, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements
    ///   need to also be met:
    ///   + When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], globalAddress must be 32 byte aligned.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalAddress must be 32 byte aligned.
    ///
    /// * globalDim array, which specifies tensor size of each of the tensorRank dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for
    ///   the packed data types:
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalDim\[0\] must be a multiple of 128.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], globalDim\[0\] must be a multiple of 2.
    ///   + Dimension for the packed data types must reflect the number of individual U# values.
    ///
    /// * globalStrides array, which specifies tensor stride of each of the lower tensorRank - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be
    ///   met:
    ///   + When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], the strides must be a multiple of 32.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], the strides must be a multiple of 32.
    /// Each following dimension specified includes previous dimension stride:
    ///
    /// ```text
    /// globalStrides\[0\] = globalDim\[0\] * elementSizeInBytes(tensorDataType) + padding\[0\];
    /// for (i = 1; i &lt; tensorRank - 1; i++)
    /// globalStrides\[i\] = globalStrides\[i – 1\] * (globalDim\[i\] + padding\[i\]);
    /// assert(globalStrides\[i\] >= globalDim\[i\]);
    /// ```
    ///
    /// * pixelBoxLowerCorner array specifies the coordinate offsets {D, H, W} of the bounding box from top/left/front corner. The number of offsets and
    ///   their precision depend on the tensor dimensionality:
    ///   + When tensorRank is 3, one signed offset within range \[-32768, 32767\] is supported.
    ///   + When tensorRank is 4, two signed offsets each within range \[-128, 127\] are supported.
    ///   + When tensorRank is 5, three offsets each within range \[-16, 15\] are supported.
    ///
    /// * pixelBoxUpperCorner array specifies the coordinate offsets {D, H, W} of the bounding box from bottom/right/back corner. The number of offsets
    ///   and their precision depend on the tensor dimensionality:
    ///   + When tensorRank is 3, one signed offset within range \[-32768, 32767\] is supported.
    ///   + When tensorRank is 4, two signed offsets each within range \[-128, 127\] are supported.
    ///   + When tensorRank is 5, three offsets each within range \[-16, 15\] are supported. The bounding box specified by pixelBoxLowerCorner and pixelBoxUpperCorner must have non-zero area.
    ///
    /// * channelsPerPixel, which specifies the number of elements which must be accessed along C dimension, must be less than or equal to 256. Additionally,
    ///   when tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], channelsPerPixel must be 128.
    ///
    /// * pixelsPerColumn, which specifies the number of elements that must be accessed along the {N, D, H, W} dimensions, must be less than or equal
    ///   to 1024.
    ///
    /// * elementStrides array, which specifies the iteration step along each of the tensorRank dimensions, must be non-zero and less than or equal to 8. Note that when interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], the first element of this array is ignored since TMA doesn’t support the stride for dimension
    ///   zero. When all elements of the elementStrides array are one, boxDim specifies the number of elements to load. However, if elementStrides\[i\] is not equal to one for some i, then TMA loads ceil( boxDim\[i\] / elementStrides\[i\]) number of elements along i-th dimension. To load N elements along i-th dimension, boxDim\[i\] must be set to N \* elementStrides\[i\].
    ///
    /// * interleave specifies the interleaved layout of type `CUtensorMapInterleave`, which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapInterleave_enum {
    /// CU_TENSOR_MAP_INTERLEAVE_NONE = 0,
    /// CU_TENSOR_MAP_INTERLEAVE_16B,
    /// CU_TENSOR_MAP_INTERLEAVE_32B
    /// } CUtensorMapInterleave;
    /// ```
    ///
    ///   TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16
    ///   where C16 uses 32 bytes. When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`] and swizzle is not [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`], the bounding box inner dimension (computed as channelsPerPixel multiplied by element size in bytes derived from tensorDataType) must be less than or equal to the swizzle size.
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_32B`] requires the bounding box inner dimension to be &lt;= 32.
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_64B`] requires the bounding box inner dimension to be &lt;= 64.
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`]\* require the bounding box inner dimension to be &lt;= 128. Additionally, tensorDataType of [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] requires interleave to be [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`].
    ///
    /// * swizzle, which specifies the shared memory bank swizzling pattern, has to be of type `CUtensorMapSwizzle` which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapSwizzle_enum {
    /// CU_TENSOR_MAP_SWIZZLE_NONE = 0,
    /// CU_TENSOR_MAP_SWIZZLE_32B,                   // Swizzle 16B chunks within 32B  span
    /// CU_TENSOR_MAP_SWIZZLE_64B,                   // Swizzle 16B chunks within 64B  span
    /// CU_TENSOR_MAP_SWIZZLE_128B,                  // Swizzle 16B chunks within 128B span
    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B,         // Swizzle 32B chunks within 128B span
    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B_FLIP_8B, // Swizzle 32B chunks within 128B span, additionally swap lower 8B with upper 8B within each 16B for every alternate row
    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B,         // Swizzle 64B chunks within 128B span
    /// } CUtensorMapSwizzle;
    /// ```
    ///
    ///   Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses
    ///   data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order
    ///   to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], swizzle must be [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_32B`]. Other interleave modes can have any swizzling pattern. When the tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`], only the following swizzle modes are supported:
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`] (Load & Store)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load & Store)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load & Store)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_64B`] (Store only) When the tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], only the following swizzle modes are supported:
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_NONE`] (Load only)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load only)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load only)
    ///
    /// * l2Promotion specifies L2 fetch size which indicates the byte granularity at which L2 requests are filled from DRAM. It must be of type
    ///   `CUtensorMapL2promotion`, which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapL2promotion_enum {
    /// CU_TENSOR_MAP_L2_PROMOTION_NONE = 0,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_64B,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_128B,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_256B
    /// } CUtensorMapL2promotion;
    /// ```
    ///
    /// * oobFill, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type `CUtensorMapFloatOOBfill` which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapFloatOOBfill_enum {
    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0,
    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA
    /// } CUtensorMapFloatOOBfill;
    /// ```
    ///
    ///   Note that [`CUtensorMapFloatOOBfill::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA`] can only be used when tensorDataType represents a floating-point data type, and when tensorDataType is not [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], and [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`].
    ///
    /// **See also:**
    ///
    /// [`cuTensorMapEncodeTiled`], [`cuTensorMapEncodeIm2colWide`], [`cuTensorMapReplaceAddress`].
    ///
    /// # Parameters
    ///
    /// - `tensorMap`: Tensor map object to create.
    /// - `tensorDataType`: Tensor data type.
    /// - `tensorRank`: Dimensionality of tensor; must be at least 3.
    /// - `globalAddress`: Starting address of memory region described by tensor.
    /// - `globalDim`: Array containing tensor size (number of elements) along each of the tensorRank dimensions.
    /// - `globalStrides`: Array containing stride size (in bytes) along each of the tensorRank - 1 dimensions.
    /// - `pixelBoxLowerCorner`: Array containing DHW dimensions of lower box corner.
    /// - `pixelBoxUpperCorner`: Array containing DHW dimensions of upper box corner.
    /// - `channelsPerPixel`: Number of channels per pixel.
    /// - `pixelsPerColumn`: Number of pixels per column.
    /// - `elementStrides`: Array containing traversal stride in each of the tensorRank dimensions.
    /// - `interleave`: Type of interleaved layout the tensor addresses.
    /// - `swizzle`: Bank swizzling pattern inside shared memory.
    /// - `l2Promotion`: L2 promotion size.
    /// - `oobFill`: Indicate whether zero or special NaN constant will be used to fill out-of-bound elements.
    pub fn cuTensorMapEncodeIm2col(
        tensorMap: *mut CUtensorMap,
        tensorDataType: CUtensorMapDataType,
        tensorRank: cuuint32_t,
        globalAddress: *mut ::core::ffi::c_void,
        globalDim: *const cuuint64_t,
        globalStrides: *const cuuint64_t,
        pixelBoxLowerCorner: *const ::core::ffi::c_int,
        pixelBoxUpperCorner: *const ::core::ffi::c_int,
        channelsPerPixel: cuuint32_t,
        pixelsPerColumn: cuuint32_t,
        elementStrides: *const cuuint32_t,
        interleave: CUtensorMapInterleave,
        swizzle: CUtensorMapSwizzle,
        l2Promotion: CUtensorMapL2promotion,
        oobFill: CUtensorMapFloatOOBfill,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along
    /// the W dimension.
    ///
    /// Creates a descriptor for Tensor Memory Access (TMA) object specified by the parameters describing a im2col memory layout and
    /// where the row is always loaded along the W dimensuin and returns it in tensorMap. This assumes the tensor layout in memory is either NDHWC, NHWC, or NWC.
    ///
    /// This API is only supported on devices of compute capability 10.0 or higher. Additionally, a tensor map object is an opaque
    /// value, and, as such, should only be accessed through CUDA APIs and PTX.
    ///
    /// The parameters passed are bound to the following requirements:
    ///
    /// * tensorMap address must be aligned to 64 bytes.
    ///
    /// * tensorDataType has to be an enum from `CUtensorMapDataType` which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapDataType_enum {
    /// CU_TENSOR_MAP_DATA_TYPE_UINT8 = 0,       // 1 byte
    /// CU_TENSOR_MAP_DATA_TYPE_UINT16,          // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_UINT32,          // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_INT32,           // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_UINT64,          // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_INT64,           // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT16,         // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32,         // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT64,         // 8 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_BFLOAT16,        // 2 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_FLOAT32_FTZ,     // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32,        // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_TFLOAT32_FTZ     // 4 bytes
    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B,    // 4 bits
    /// CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B,   // 4 bits
    /// CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B    // 6 bits
    /// } CUtensorMapDataType;
    /// ```
    ///
    ///   [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`] copies '16 x U4' packed values to memory aligned as 8 bytes. There are no gaps between
    ///   packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`] copies '16 x U4' packed values to memory aligned as 16 bytes. There are
    ///   8 byte gaps between every 8 byte chunk of packed values. [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] copies '16 x U6' packed values
    ///   to memory aligned as 16 bytes. There are 4 byte gaps between every 12 byte chunk of packed values.
    ///
    /// * tensorRank, which specifies the number of tensor dimensions, must be 3, 4, or 5.
    ///
    /// * globalAddress, which specifies the starting address of the memory region described, must be 16 byte aligned. The following requirements
    ///   need to also be met:
    ///   + When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], globalAddress must be 32 byte aligned.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalAddress must be 32 byte aligned.
    ///
    /// * globalDim array, which specifies tensor size of each of the tensorRank dimensions, must be non-zero and less than or equal to 2^32. Additionally, the following requirements need to be met for
    ///   the packed data types:
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], globalDim\[0\] must be a multiple of 128.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], globalDim\[0\] must be a multiple of 2.
    ///   + Dimension for the packed data types must reflect the number of individual U# values.
    ///
    /// * globalStrides array, which specifies tensor stride of each of the lower tensorRank - 1 dimensions in bytes, must be a multiple of 16 and less than 2^40. Additionally, the following requirements need to be
    ///   met:
    ///   + When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_32B`], the strides must be a multiple of 32.
    ///   + When tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], the strides must be a multiple of 32.
    /// Each following dimension specified includes previous dimension stride:
    ///
    /// ```text
    /// globalStrides\[0\] = globalDim\[0\] * elementSizeInBytes(tensorDataType) + padding\[0\];
    /// for (i = 1; i &lt; tensorRank - 1; i++)
    /// globalStrides\[i\] = globalStrides\[i – 1\] * (globalDim\[i\] + padding\[i\]);
    /// assert(globalStrides\[i\] >= globalDim\[i\]);
    /// ```
    ///
    /// * pixelBoxLowerCornerWidth specifies the coordinate offset W of the bounding box from left corner. The offset must be within range \[-32768, 32767\].
    ///
    /// * pixelBoxUpperCornerWidth specifies the coordinate offset W of the bounding box from right corner. The offset must be within range \[-32768, 32767\].
    ///
    /// The bounding box specified by pixelBoxLowerCornerWidth and pixelBoxUpperCornerWidth must have non-zero area. Note that the size of the box along D and H dimensions is always equal to one.
    ///
    /// * channelsPerPixel, which specifies the number of elements which must be accessed along C dimension, must be less than or equal to 256. Additionally,
    ///   when tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] or [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], channelsPerPixel must be 128.
    ///
    /// * pixelsPerColumn, which specifies the number of elements that must be accessed along the W dimension, must be less than or equal to 1024.
    ///   This field is ignored when mode is [`CUtensorMapIm2ColWideMode::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128`].
    ///
    /// * elementStrides array, which specifies the iteration step along each of the tensorRank dimensions, must be non-zero and less than or equal to 8. Note that when interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], the first element of this array is ignored since TMA doesn’t support the stride for dimension
    ///   zero. When all elements of the elementStrides array are one, boxDim specifies the number of elements to load. However, if elementStrides\[i\] is not equal to one for some i, then TMA loads ceil( boxDim\[i\] / elementStrides\[i\]) number of elements along i-th dimension. To load N elements along i-th dimension, boxDim\[i\] must be set to N \* elementStrides\[i\].
    ///
    /// * interleave specifies the interleaved layout of type `CUtensorMapInterleave`, which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapInterleave_enum {
    /// CU_TENSOR_MAP_INTERLEAVE_NONE = 0,
    /// CU_TENSOR_MAP_INTERLEAVE_16B,
    /// CU_TENSOR_MAP_INTERLEAVE_32B
    /// } CUtensorMapInterleave;
    /// ```
    ///
    ///   TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 bytes in memory assuming 2 byte per channel or NC/16HWC16
    ///   where C16 uses 32 bytes. When interleave is [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`], the bounding box inner dimension (computed as channelsPerPixel multiplied by element size in bytes derived from tensorDataType) must be less than or equal to the swizzle size.
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_64B`] requires the bounding box inner dimension to be &lt;= 64.
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`]\* require the bounding box inner dimension to be &lt;= 128. Additionally, tensorDataType of [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`] requires interleave to be [`CUtensorMapInterleave::CU_TENSOR_MAP_INTERLEAVE_NONE`].
    ///
    /// * mode, which describes loading of elements loaded along the W dimension, has to be one of the following `CUtensorMapIm2ColWideMode` types:
    ///
    /// ```text
    /// CU_TENSOR_MAP_IM2COL_WIDE_MODE_W,
    /// CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128
    /// ```
    ///
    ///   [`CUtensorMapIm2ColWideMode::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W`] allows the number of elements loaded along the W dimension to be specified via the pixelsPerColumn field.
    ///
    /// * swizzle, which specifies the shared memory bank swizzling pattern, must be one of the following `CUtensorMapSwizzle` modes (other swizzle modes are not supported):
    ///
    /// ```text
    /// typedef enum CUtensorMapSwizzle_enum {
    /// CU_TENSOR_MAP_SWIZZLE_64B,                   // Swizzle 16B chunks within 64B  span
    /// CU_TENSOR_MAP_SWIZZLE_128B,                  // Swizzle 16B chunks within 128B span
    /// CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B,         // Swizzle 32B chunks within 128B span
    /// } CUtensorMapSwizzle;
    /// ```
    ///
    ///   Data are organized in a specific order in global memory; however, this may not match the order in which the application accesses
    ///   data in shared memory. This difference in data organization may cause bank conflicts when shared memory is accessed. In order
    ///   to avoid this problem, data can be loaded to shared memory with shuffling across shared memory banks. When the tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`], only the following swizzle modes are supported:
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_64B`] (Store only)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load & Store)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load & Store) When the tensorDataType is [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], only the following swizzle modes are supported:
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B`] (Load only)
    ///   + [`CUtensorMapSwizzle::CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B`] (Load only)
    ///
    /// Additionally, CU_TENSOR_MAP_SWIZZLE_96B is supported only when mode is [`CUtensorMapIm2ColWideMode::CU_TENSOR_MAP_IM2COL_WIDE_MODE_W`].
    ///
    /// * l2Promotion specifies L2 fetch size which indicates the byte granularity at which L2 requests are filled from DRAM. It must be of type
    ///   `CUtensorMapL2promotion`, which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapL2promotion_enum {
    /// CU_TENSOR_MAP_L2_PROMOTION_NONE = 0,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_64B,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_128B,
    /// CU_TENSOR_MAP_L2_PROMOTION_L2_256B
    /// } CUtensorMapL2promotion;
    /// ```
    ///
    /// * oobFill, which indicates whether zero or a special NaN constant should be used to fill out-of-bound elements, must be of type `CUtensorMapFloatOOBfill` which is defined as:
    ///
    /// ```text
    /// typedef enum CUtensorMapFloatOOBfill_enum {
    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NONE = 0,
    /// CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA
    /// } CUtensorMapFloatOOBfill;
    /// ```
    ///
    ///   Note that [`CUtensorMapFloatOOBfill::CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA`] can only be used when tensorDataType represents a floating-point data type, and when tensorDataType is not [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`], [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`], and [`CUtensorMapDataType::CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`].
    ///
    /// **See also:**
    ///
    /// [`cuTensorMapEncodeTiled`], [`cuTensorMapEncodeIm2col`], [`cuTensorMapReplaceAddress`].
    ///
    /// # Parameters
    ///
    /// - `tensorMap`: Tensor map object to create.
    /// - `tensorDataType`: Tensor data type.
    /// - `tensorRank`: Dimensionality of tensor; must be at least 3.
    /// - `globalAddress`: Starting address of memory region described by tensor.
    /// - `globalDim`: Array containing tensor size (number of elements) along each of the tensorRank dimensions.
    /// - `globalStrides`: Array containing stride size (in bytes) along each of the tensorRank - 1 dimensions.
    /// - `pixelBoxLowerCornerWidth`: Width offset of left box corner.
    /// - `pixelBoxUpperCornerWidth`: Width offset of right box corner.
    /// - `channelsPerPixel`: Number of channels per pixel.
    /// - `pixelsPerColumn`: Number of pixels per column.
    /// - `elementStrides`: Array containing traversal stride in each of the tensorRank dimensions.
    /// - `interleave`: Type of interleaved layout the tensor addresses.
    /// - `mode`: W or W128 mode.
    /// - `swizzle`: Bank swizzling pattern inside shared memory.
    /// - `l2Promotion`: L2 promotion size.
    /// - `oobFill`: Indicate whether zero or special NaN constant will be used to fill out-of-bound elements.
    pub fn cuTensorMapEncodeIm2colWide(
        tensorMap: *mut CUtensorMap,
        tensorDataType: CUtensorMapDataType,
        tensorRank: cuuint32_t,
        globalAddress: *mut ::core::ffi::c_void,
        globalDim: *const cuuint64_t,
        globalStrides: *const cuuint64_t,
        pixelBoxLowerCornerWidth: ::core::ffi::c_int,
        pixelBoxUpperCornerWidth: ::core::ffi::c_int,
        channelsPerPixel: cuuint32_t,
        pixelsPerColumn: cuuint32_t,
        elementStrides: *const cuuint32_t,
        interleave: CUtensorMapInterleave,
        mode: CUtensorMapIm2ColWideMode,
        swizzle: CUtensorMapSwizzle,
        l2Promotion: CUtensorMapL2promotion,
        oobFill: CUtensorMapFloatOOBfill,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Modify an existing tensor map descriptor with an updated global address.
    ///
    /// Modifies the descriptor for Tensor Memory Access (TMA) object passed in tensorMap with an updated globalAddress.
    ///
    /// Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is
    /// an opaque value, and, as such, should only be accessed through CUDA API calls.
    ///
    /// **See also:**
    ///
    /// [`cuTensorMapEncodeTiled`], [`cuTensorMapEncodeIm2col`], [`cuTensorMapEncodeIm2colWide`].
    ///
    /// # Parameters
    ///
    /// - `tensorMap`: Tensor map object to modify.
    /// - `globalAddress`: Starting address of memory region described by tensor, must follow previous alignment requirements.
    pub fn cuTensorMapReplaceAddress(
        tensorMap: *mut CUtensorMap,
        globalAddress: *mut ::core::ffi::c_void,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Queries if a device may directly access a peer device's memory.
    ///
    /// Returns in \*canAccessPeer a value of 1 if contexts on dev are capable of directly accessing memory from contexts on peerDev and 0 otherwise. If direct access of peerDev from dev is possible, then access may be enabled on two specific contexts by calling [`cuCtxEnablePeerAccess`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxEnablePeerAccess`], [`cuCtxDisablePeerAccess`], [cudaDeviceCanAccessPeer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__PEER.html#group__CUDART__PEER_1g4db0d04e44995d5c1c34be4ecc863f22).
    ///
    /// # Parameters
    ///
    /// - `canAccessPeer`: Returned access capability.
    /// - `dev`: Device from which allocations on peerDev are to be directly accessed.
    /// - `peerDev`: Device on which the allocations to be directly accessed by dev reside.
    pub fn cuDeviceCanAccessPeer(
        canAccessPeer: *mut ::core::ffi::c_int,
        dev: CUdevice,
        peerDev: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Enables direct access to memory allocations in a peer context.
    ///
    /// If both the current context and peerContext are on devices which support unified addressing (as may be queried using [`CUdevice_attribute_enum::CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING`]) and same major compute capability, then on success all allocations from peerContext will immediately be accessible by the current context. See [Unified Addressing](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/unified-addressing.html#group__CUDA__UNIFIED) for additional details.
    ///
    /// Note that access granted by this call is unidirectional and that in order to access memory from the current context in peerContext, a separate symmetric call to [`cuCtxEnablePeerAccess`] is required.
    ///
    /// Note that there are both device-wide and system-wide limitations per system configuration, as noted in the CUDA Programming
    /// Guide under the section "Peer-to-Peer Memory Access".
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_PEER_ACCESS_UNSUPPORTED`] if [`cuDeviceCanAccessPeer`] indicates that the [`CUdevice`] of the current context cannot directly access memory from the [`CUdevice`] of peerContext.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED`] if direct access of peerContext from the current context has already been enabled.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_TOO_MANY_PEERS`] if direct peer access is not possible because hardware resources required for peer access have been exhausted.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] if there is no current context, peerContext is not a valid context, or if the current context is peerContext.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if Flags is not 0.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceCanAccessPeer`], [`cuCtxDisablePeerAccess`], [cudaDeviceEnablePeerAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__PEER.html#group__CUDART__PEER_1g2b0adabf90db37e5cfddc92cbb2589f3).
    ///
    /// # Parameters
    ///
    /// - `peerContext`: Peer context to enable direct access to from the current context.
    /// - `Flags`: Reserved for future use and must be set to 0.
    pub fn cuCtxEnablePeerAccess(
        peerContext: CUcontext,
        Flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Disables direct access to memory allocations in a peer context and unregisters any registered allocations.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_PEER_ACCESS_NOT_ENABLED`] if direct peer access has not yet been enabled from peerContext to the current context.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`] if there is no current context, or if peerContext is not a valid context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceCanAccessPeer`], [`cuCtxEnablePeerAccess`], [cudaDeviceDisablePeerAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__PEER.html#group__CUDART__PEER_1g9663734ad02653207ad6836053bf572e).
    ///
    /// # Parameters
    ///
    /// - `peerContext`: Peer context to disable direct access to.
    pub fn cuCtxDisablePeerAccess(peerContext: CUcontext) -> CUresult;
}
unsafe extern "C" {
    /// Queries attributes of the link between two devices.
    ///
    /// Returns in \*value the value of the requested attribute attrib of the link between srcDevice and dstDevice. The supported attributes are:
    ///
    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_PERFORMANCE_RANK`]: A relative value indicating the performance of the link between two devices.
    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_ACCESS_SUPPORTED`] P2P: 1 if P2P Access is enable.
    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_NATIVE_ATOMIC_SUPPORTED`]: 1 if all CUDA-valid atomic operations over the link are supported.
    /// * [CU_DEVICE_P2P_ATTRIBUTE_CUDA_ARRAY_ACCESS_SUPPORTED](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/types.html#group__CUDA__TYPES_1gg578d7cf687ce20f7e99468e8c14e22de83a83eb1e8d535b6b8ecf00f509f4097): 1 if cudaArray can be accessed over the link.
    /// * [`CUdevice_P2PAttribute_enum::CU_DEVICE_P2P_ATTRIBUTE_ONLY_PARTIAL_NATIVE_ATOMIC_SUPPORTED`]: 1 if some CUDA-valid atomic operations over the link are supported. Information about specific operations can be retrieved
    ///   with [`cuDeviceGetP2PAtomicCapabilities`].
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`] if srcDevice or dstDevice are not valid or if they represent the same device.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if attrib is not valid or if value is a null pointer.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuCtxEnablePeerAccess`], [`cuCtxDisablePeerAccess`], [`cuDeviceCanAccessPeer`], [`cuDeviceGetP2PAtomicCapabilities`], [cudaDeviceGetP2PAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gc63e5bf168e53b2daf71904eab048fa9).
    ///
    /// # Parameters
    ///
    /// - `value`: Returned value of the requested attribute.
    /// - `attrib`: The requested attribute of the link between srcDevice and dstDevice.
    /// - `srcDevice`: The source device of the target link.
    /// - `dstDevice`: The destination device of the target link.
    pub fn cuDeviceGetP2PAttribute(
        value: *mut ::core::ffi::c_int,
        attrib: CUdevice_P2PAttribute,
        srcDevice: CUdevice,
        dstDevice: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Queries details about atomic operations supported between two devices.
    ///
    /// Returns in \*capabilities the details about requested atomic \*operations over the link between srcDevice and dstDevice. The allocated size of \*operations and \*capabilities must be count.
    ///
    /// For each `CUatomicOperation` in \*operations, the corresponding result in \*capabilities will be a bitmask indicating which of `CUatomicOperationCapability` the link supports natively.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_DEVICE`] if srcDevice or dstDevice are not valid or if they represent the same device.
    ///
    /// Returns [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] if \*capabilities or \*operations is NULL, if count is 0, or if any of \*operations is not valid.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuDeviceGetP2PAttribute`], [cudaDeviceGetP2PAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1gc63e5bf168e53b2daf71904eab048fa9), [cudaDeviceGetP2PAtomicCapabilities](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DEVICE.html#group__CUDART__DEVICE_1ga608cadee2598ca942b362db73267c2b).
    ///
    /// # Parameters
    ///
    /// - `capabilities`: Returned capability details of each requested operation.
    /// - `operations`: Requested operations.
    /// - `count`: Count of requested operations and size of capabilities.
    /// - `srcDevice`: The source device of the target link.
    /// - `dstDevice`: The destination device of the target link.
    pub fn cuDeviceGetP2PAtomicCapabilities(
        capabilities: *mut ::core::ffi::c_uint,
        operations: *const CUatomicOperation,
        count: ::core::ffi::c_uint,
        srcDevice: CUdevice,
        dstDevice: CUdevice,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unregisters a graphics resource for access by CUDA.
    ///
    /// Unregisters the graphics resource resource so it is not accessible by CUDA unless registered again.
    ///
    /// If resource is invalid then [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// `cuGraphicsD3D9RegisterResource`, `cuGraphicsD3D10RegisterResource`, `cuGraphicsD3D11RegisterResource`, `cuGraphicsGLRegisterBuffer`, `cuGraphicsGLRegisterImage`, [cudaGraphicsUnregisterResource](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__INTEROP.html#group__CUDART__INTEROP_1gc65d1f2900086747de1e57301d709940).
    ///
    /// # Parameters
    ///
    /// - `resource`: Resource to unregister.
    pub fn cuGraphicsUnregisterResource(resource: CUgraphicsResource) -> CUresult;
}
unsafe extern "C" {
    /// Get an array through which to access a subresource of a mapped graphics resource.
    ///
    /// Returns in \*pArray an array through which the subresource of the mapped graphics resource resource which corresponds to array index arrayIndex and mipmap level mipLevel may be accessed. The value set in \*pArray may change every time that resource is mapped.
    ///
    /// If resource is not a texture then it cannot be accessed via an array and [`cudaError_enum::CUDA_ERROR_NOT_MAPPED_AS_ARRAY`] is returned. If arrayIndex is not a valid array index for resource then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned. If mipLevel is not a valid mipmap level for resource then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned. If resource is not mapped then [`cudaError_enum::CUDA_ERROR_NOT_MAPPED`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphicsResourceGetMappedPointer_v2`], [cudaGraphicsSubResourceGetMappedArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__INTEROP.html#group__CUDART__INTEROP_1g0dd6b5f024dfdcff5c28a08ef9958031).
    ///
    /// # Parameters
    ///
    /// - `pArray`: Returned array through which a subresource of resource may be accessed.
    /// - `resource`: Mapped resource to access.
    /// - `arrayIndex`: Array index for array textures or cubemap face index as defined by `CUarray_cubemap_face` for cubemap textures for the subresource to access.
    /// - `mipLevel`: Mipmap level for the subresource to access.
    pub fn cuGraphicsSubResourceGetMappedArray(
        pArray: *mut CUarray,
        resource: CUgraphicsResource,
        arrayIndex: ::core::ffi::c_uint,
        mipLevel: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get a mipmapped array through which to access a mapped graphics resource.
    ///
    /// Returns in \*pMipmappedArray a mipmapped array through which the mapped graphics resource resource. The value set in \*pMipmappedArray may change every time that resource is mapped.
    ///
    /// If resource is not a texture then it cannot be accessed via a mipmapped array and [`cudaError_enum::CUDA_ERROR_NOT_MAPPED_AS_ARRAY`] is returned. If resource is not mapped then [`cudaError_enum::CUDA_ERROR_NOT_MAPPED`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphicsResourceGetMappedPointer_v2`], [cudaGraphicsResourceGetMappedMipmappedArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__INTEROP.html#group__CUDART__INTEROP_1g84c3772d2ed06cda8c92bc43cdc893d0).
    ///
    /// # Parameters
    ///
    /// - `pMipmappedArray`: Returned mipmapped array through which resource may be accessed.
    /// - `resource`: Mapped resource to access.
    pub fn cuGraphicsResourceGetMappedMipmappedArray(
        pMipmappedArray: *mut CUmipmappedArray,
        resource: CUgraphicsResource,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get a device pointer through which to access a mapped graphics resource.
    ///
    /// Returns in \*pDevPtr a pointer through which the mapped graphics resource resource may be accessed. Returns in pSize the size of the memory in bytes which may be accessed from that pointer. The value set in pPointer may change every time that resource is mapped.
    ///
    /// If resource is not a buffer then it cannot be accessed via a pointer and [`cudaError_enum::CUDA_ERROR_NOT_MAPPED_AS_POINTER`] is returned. If resource is not mapped then [`cudaError_enum::CUDA_ERROR_NOT_MAPPED`] is returned. \*
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphicsMapResources`], [`cuGraphicsSubResourceGetMappedArray`], [cudaGraphicsResourceGetMappedPointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__INTEROP.html#group__CUDART__INTEROP_1ga36881081c8deb4df25c256158e1ac99).
    ///
    /// # Parameters
    ///
    /// - `pDevPtr`: Returned pointer through which resource may be accessed.
    /// - `pSize`: Returned size of the buffer accessible starting at \*pPointer.
    /// - `resource`: Mapped resource to access.
    pub fn cuGraphicsResourceGetMappedPointer_v2(
        pDevPtr: *mut CUdeviceptr,
        pSize: *mut size_t,
        resource: CUgraphicsResource,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Set usage flags for mapping a graphics resource.
    ///
    /// Set flags for mapping the graphics resource resource.
    ///
    /// Changes to flags will take effect the next time resource is mapped. The flags argument may be any of the following:
    ///
    /// * [`CUgraphicsMapResourceFlags::CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE`]: Specifies no hints about how this resource will be used. It is therefore assumed that
    ///   this resource will be read from and written to by CUDA kernels. This is the default value.
    /// * CU_GRAPHICS_MAP_RESOURCE_FLAGS_READONLY: Specifies that CUDA kernels which access this resource will not write to this resource.
    /// * CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITEDISCARD: Specifies that CUDA kernels which access this resource will not read from this
    ///   resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will
    ///   be preserved.
    ///
    /// If resource is presently mapped for access by CUDA then [`cudaError_enum::CUDA_ERROR_ALREADY_MAPPED`] is returned. If flags is not one of the above values then [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`] is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphicsMapResources`], [cudaGraphicsResourceSetMapFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__INTEROP.html#group__CUDART__INTEROP_1g5f94a0043909fddc100ab5f0c2476b9f).
    ///
    /// # Parameters
    ///
    /// - `resource`: Registered resource to set flags for.
    /// - `flags`: Parameters for resource mapping.
    pub fn cuGraphicsResourceSetMapFlags_v2(
        resource: CUgraphicsResource,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Map graphics resources for access by CUDA.
    ///
    /// Maps the count graphics resources in resources for access by CUDA.
    ///
    /// The resources in resources may be accessed by CUDA until they are unmapped. The graphics API from which resources were registered should not access any resources while they are mapped by CUDA. If an application does so, the results are
    /// undefined.
    ///
    /// This function provides the synchronization guarantee that any graphics calls issued before [`cuGraphicsMapResources`] will complete before any subsequent CUDA work issued in stream begins.
    ///
    /// If resources includes any duplicate entries then [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. If any of resources are presently mapped for access by CUDA then [`cudaError_enum::CUDA_ERROR_ALREADY_MAPPED`] is returned.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphicsResourceGetMappedPointer_v2`], [`cuGraphicsSubResourceGetMappedArray`], [`cuGraphicsUnmapResources`], [cudaGraphicsMapResources](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__INTEROP.html#group__CUDART__INTEROP_1gad8fbe74d02adefb8e7efb4971ee6322).
    ///
    /// # Parameters
    ///
    /// - `count`: Number of resources to map.
    /// - `resources`: Resources to map for CUDA usage.
    /// - `hStream`: Stream with which to synchronize.
    pub fn cuGraphicsMapResources(
        count: ::core::ffi::c_uint,
        resources: *mut CUgraphicsResource,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unmap graphics resources.
    ///
    /// Unmaps the count graphics resources in resources.
    ///
    /// Once unmapped, the resources in resources may not be accessed by CUDA until they are mapped again.
    ///
    /// This function provides the synchronization guarantee that any CUDA work issued in stream before [`cuGraphicsUnmapResources`] will complete before any subsequently issued graphics work begins.
    ///
    /// If resources includes any duplicate entries then [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. If any of resources are not presently mapped for access by CUDA then [`cudaError_enum::CUDA_ERROR_NOT_MAPPED`] is returned.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGraphicsMapResources`], [cudaGraphicsUnmapResources](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__INTEROP.html#group__CUDART__INTEROP_1g11988ab4431b11ddb7cbde7aedb60491).
    ///
    /// # Parameters
    ///
    /// - `count`: Number of resources to unmap.
    /// - `resources`: Resources to unmap.
    /// - `hStream`: Stream with which to synchronize.
    pub fn cuGraphicsUnmapResources(
        count: ::core::ffi::c_uint,
        resources: *mut CUgraphicsResource,
        hStream: CUstream,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the requested driver API function pointer.
    ///
    /// Returns in \*\*pfn the address of the CUDA driver function for the requested CUDA version and flags.
    ///
    /// The CUDA version is specified as (1000 \* major + 10 \* minor), so CUDA 11.2 should be specified as 11020. For a requested driver
    /// symbol, if the specified CUDA version is greater than or equal to the CUDA version in which the driver symbol was introduced,
    /// this API will return the function pointer to the corresponding versioned function. If the specified CUDA version is greater
    /// than the driver version, the API will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// The pointer returned by the API should be cast to a function pointer matching the requested driver function's definition in
    /// the API header file. The function pointer typedef can be picked up from the corresponding typedefs header file. For example,
    /// cudaTypedefs.h consists of function pointer typedefs for driver APIs defined in cuda.h.
    ///
    /// The API will return [`cudaError_enum::CUDA_SUCCESS`] and set the returned pfn to NULL if the requested driver function is not supported on the platform, no ABI compatible driver function exists for the
    /// specified cudaVersion or if the driver symbol is invalid.
    ///
    /// It will also set the optional symbolStatus to one of the values in `CUdriverProcAddressQueryResult` with the following meanings:
    ///
    /// * [`CUdriverProcAddressQueryResult_enum::CU_GET_PROC_ADDRESS_SUCCESS`] - The requested symbol was succesfully found based on input arguments and pfn is valid
    /// * [`CUdriverProcAddressQueryResult_enum::CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND`] - The requested symbol was not found
    /// * [`CUdriverProcAddressQueryResult_enum::CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT`] - The requested symbol was found but is not supported by cudaVersion specified
    ///
    /// The requested flags can be:
    ///
    /// * [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_DEFAULT`]: This is the default mode. This is equivalent to [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM`] if the code is compiled with --default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM
    ///   is defined; [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_LEGACY_STREAM`] otherwise.
    /// * [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_LEGACY_STREAM`]: This will enable the search for all driver symbols that match the requested driver symbol name except the corresponding
    ///   per-thread versions.
    /// * [`CUdriverProcAddress_flags_enum::CU_GET_PROC_ADDRESS_PER_THREAD_DEFAULT_STREAM`]: This will enable the search for all driver symbols that match the requested driver symbol name including the per-thread
    ///   versions. If a per-thread version is not found, the API will return the legacy version of the driver function.
    ///
    /// Note:
    ///
    /// Version mixing among CUDA-defined types and driver API versions is strongly discouraged and doing so can result in an undefined
    /// behavior. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/version-mixing-rules.html#version-mixing-rules).
    ///
    /// **See also:**
    ///
    /// [cudaGetDriverEntryPointByVersion](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__DRIVER__ENTRY__POINT.html#group__CUDART__DRIVER__ENTRY__POINT_1gda6c90a43afbe8043128285afbaf8c04).
    ///
    /// # Parameters
    ///
    /// - `symbol`: The base name of the driver API function to look for. As an example, for the driver API cuMemAlloc_v2, symbol would be cuMemAlloc and cudaVersion would be the ABI compatible CUDA version for the _v2 variant.
    /// - `pfn`: Location to return the function pointer to the requested driver function.
    /// - `cudaVersion`: The CUDA version to look for the requested driver symbol.
    /// - `flags`: Flags to specify search options.
    /// - `symbolStatus`: Optional location to store the status of the search for symbol based on cudaVersion. See `CUdriverProcAddressQueryResult` for possible values.
    pub fn cuGetProcAddress_v2(
        symbol: *const ::core::ffi::c_char,
        pfn: *mut *mut ::core::ffi::c_void,
        cudaVersion: ::core::ffi::c_int,
        flags: cuuint64_t,
        symbolStatus: *mut CUdriverProcAddressQueryResult,
    ) -> CUresult;
}
/// Flags for choosing a coredump attribute to get/set.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUcoredumpSettings_enum {
    CU_COREDUMP_ENABLE_ON_EXCEPTION = 1,
    CU_COREDUMP_TRIGGER_HOST = 2,
    CU_COREDUMP_LIGHTWEIGHT = 3,
    CU_COREDUMP_ENABLE_USER_TRIGGER = 4,
    CU_COREDUMP_FILE = 5,
    CU_COREDUMP_PIPE = 6,
    CU_COREDUMP_GENERATION_FLAGS = 7,
    CU_COREDUMP_MAX = 8,
}
pub use self::CUcoredumpSettings_enum as CUcoredumpSettings;
/// Flags for controlling coredump contents.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUCoredumpGenerationFlags {
    CU_COREDUMP_DEFAULT_FLAGS = 0,
    CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES = 1,
    CU_COREDUMP_SKIP_GLOBAL_MEMORY = 2,
    CU_COREDUMP_SKIP_SHARED_MEMORY = 4,
    CU_COREDUMP_SKIP_LOCAL_MEMORY = 8,
    CU_COREDUMP_SKIP_ABORT = 16,
    CU_COREDUMP_SKIP_CONSTBANK_MEMORY = 32,
    CU_COREDUMP_GZIP_COMPRESS = 64,
    CU_COREDUMP_LIGHTWEIGHT_FLAGS = 47,
}
unsafe extern "C" {
    /// Allows caller to fetch a coredump attribute value for the current context.
    ///
    /// Returns in \*value the requested value specified by attrib. It is up to the caller to ensure that the data type and size of \*value matches the request.
    ///
    /// If the caller calls this function with \*value equal to NULL, the size of the memory region (in bytes) expected for attrib will be placed in size.
    ///
    /// The supported attributes are:
    ///
    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`]: Bool where true means that GPU exceptions from this context will create a coredump at the
    ///   location specified by [`CUcoredumpSettings::CU_COREDUMP_FILE`]. The default value is false unless set to true globally or locally, or the [`CUctx_flags::CU_CTX_USER_COREDUMP_ENABLE`]
    ///   flag was set during context creation.
    /// * [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`]: Bool where true means that the host CPU will also create a coredump. The default value is true unless
    ///   set to false globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable
    ///   host device abort() if needed.
    /// * [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]: Bool where true means that any resulting coredumps will not have a dump of GPU memory or non-reloc
    ///   ELF images. The default value is false unless set to true globally or locally. This attribute is deprecated as of CUDA 12.5,
    ///   please use [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`] instead.
    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`]: Bool where true means that a coredump can be created by writing to the system pipe specified
    ///   by [`CUcoredumpSettings::CU_COREDUMP_PIPE`]. The default value is false unless set to true globally or locally.
    /// * [`CUcoredumpSettings::CU_COREDUMP_FILE`]: String of up to 1023 characters that defines the location where any coredumps generated by this context
    ///   will be written. The default value is core.cuda.HOSTNAME.PID where HOSTNAME is the host name of the machine running the CUDA
    ///   applications and PID is the process ID of the CUDA application.
    /// * [`CUcoredumpSettings::CU_COREDUMP_PIPE`]: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered
    ///   coredumps are enabled. The default value is corepipe.cuda.HOSTNAME.PID where HOSTNAME is the host name of the machine running
    ///   the CUDA application and PID is the process ID of the CUDA application.
    /// * [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]: An integer with values to allow granular control the data contained in a coredump specified
    ///   as a bitwise OR combination of the following values: + [`CUCoredumpGenerationFlags::CU_COREDUMP_DEFAULT_FLAGS`] - if set by itself, coredump generation returns
    ///   to its default settings of including all memory regions that it is able to access + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES`]
    ///   - Coredump will not include the data from CUDA source modules that are not relocated at runtime. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_GLOBAL_MEMORY`]
    ///   - Coredump will not include device-side global data that does not belong to any context. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_SHARED_MEMORY`]
    ///   - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_LOCAL_MEMORY`]
    ///   - Coredump will not include local memory from the kernel. + [`CUCoredumpGenerationFlags::CU_COREDUMP_LIGHTWEIGHT_FLAGS`] - Enables all of the above options.
    ///   Equiavlent to setting the [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`] attribute to true. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] - If set, GPU exceptions will
    ///   not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default
    ///   behavior.
    ///
    /// **See also:**
    ///
    /// [`cuCoredumpGetAttributeGlobal`], [`cuCoredumpSetAttribute`], [`cuCoredumpSetAttributeGlobal`].
    ///
    /// # Parameters
    ///
    /// - `attrib`: The enum defining which value to fetch.
    /// - `value`: void\* containing the requested data.
    /// - `size`: The size of the memory region value points to.
    pub fn cuCoredumpGetAttribute(
        attrib: CUcoredumpSettings,
        value: *mut ::core::ffi::c_void,
        size: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Allows caller to fetch a coredump attribute value for the entire application.
    ///
    /// Returns in \*value the requested value specified by attrib. It is up to the caller to ensure that the data type and size of \*value matches the request.
    ///
    /// If the caller calls this function with \*value equal to NULL, the size of the memory region (in bytes) expected for attrib will be placed in size.
    ///
    /// The supported attributes are:
    ///
    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`]: Bool where true means that GPU exceptions from this context will create a coredump at the
    ///   location specified by [`CUcoredumpSettings::CU_COREDUMP_FILE`]. The default value is false.
    /// * [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`]: Bool where true means that the host CPU will also create a coredump. The default value is true unless
    ///   set to false globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable
    ///   host device abort() if needed.
    /// * [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]: Bool where true means that any resulting coredumps will not have a dump of GPU memory or non-reloc
    ///   ELF images. The default value is false. This attribute is deprecated as of CUDA 12.5, please use [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]
    ///   instead.
    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`]: Bool where true means that a coredump can be created by writing to the system pipe specified
    ///   by [`CUcoredumpSettings::CU_COREDUMP_PIPE`]. The default value is false.
    /// * [`CUcoredumpSettings::CU_COREDUMP_FILE`]: String of up to 1023 characters that defines the location where any coredumps generated by this context
    ///   will be written. The default value is core.cuda.HOSTNAME.PID where HOSTNAME is the host name of the machine running the CUDA
    ///   applications and PID is the process ID of the CUDA application.
    /// * [`CUcoredumpSettings::CU_COREDUMP_PIPE`]: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered
    ///   coredumps are enabled. The default value is corepipe.cuda.HOSTNAME.PID where HOSTNAME is the host name of the machine running
    ///   the CUDA application and PID is the process ID of the CUDA application.
    /// * [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]: An integer with values to allow granular control the data contained in a coredump specified
    ///   as a bitwise OR combination of the following values: + [`CUCoredumpGenerationFlags::CU_COREDUMP_DEFAULT_FLAGS`] - if set by itself, coredump generation returns
    ///   to its default settings of including all memory regions that it is able to access + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES`]
    ///   - Coredump will not include the data from CUDA source modules that are not relocated at runtime. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_GLOBAL_MEMORY`]
    ///   - Coredump will not include device-side global data that does not belong to any context. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_SHARED_MEMORY`]
    ///   - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_LOCAL_MEMORY`]
    ///   - Coredump will not include local memory from the kernel. + [`CUCoredumpGenerationFlags::CU_COREDUMP_LIGHTWEIGHT_FLAGS`] - Enables all of the above options.
    ///   Equiavlent to setting the [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`] attribute to true. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] - If set, GPU exceptions will
    ///   not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default
    ///   behavior.
    ///
    /// **See also:**
    ///
    /// [`cuCoredumpGetAttribute`], [`cuCoredumpSetAttribute`], [`cuCoredumpSetAttributeGlobal`].
    ///
    /// # Parameters
    ///
    /// - `attrib`: The enum defining which value to fetch.
    /// - `value`: void\* containing the requested data.
    /// - `size`: The size of the memory region value points to.
    pub fn cuCoredumpGetAttributeGlobal(
        attrib: CUcoredumpSettings,
        value: *mut ::core::ffi::c_void,
        size: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Allows caller to set a coredump attribute value for the current context.
    ///
    /// This function should be considered an alternate interface to the CUDA-GDB environment variables defined in this document:
    /// <https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump>
    ///
    /// An important design decision to note is that any coredump environment variable values set before CUDA initializes will take
    /// permanent precedence over any values set with this function. This decision was made to ensure no change in behavior for any
    /// users that may be currently using these variables to get coredumps.
    ///
    /// \*value shall contain the requested value specified by set. It is up to the caller to ensure that the data type and size of \*value matches the request.
    ///
    /// If the caller calls this function with \*value equal to NULL, the size of the memory region (in bytes) expected for set will be placed in size.
    ///
    /// /note This function will return [`cudaError_enum::CUDA_ERROR_NOT_SUPPORTED`] if the caller attempts to set [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`] on a GPU of with Compute Capability &lt; 6.0. [`cuCoredumpSetAttributeGlobal`] works on those platforms as an alternative.
    ///
    /// /note [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`] and [`CUcoredumpSettings::CU_COREDUMP_PIPE`] cannot be set on a per-context basis.
    ///
    /// The supported attributes are:
    ///
    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`]: Bool where true means that GPU exceptions from this context will create a coredump at the
    ///   location specified by [`CUcoredumpSettings::CU_COREDUMP_FILE`]. The default value is false.
    /// * [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`]: Bool where true means that the host CPU will also create a coredump. The default value is true unless
    ///   set to false globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable
    ///   host device abort() if needed.
    /// * [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]: Bool where true means that any resulting coredumps will not have a dump of GPU memory or non-reloc
    ///   ELF images. The default value is false. This attribute is deprecated as of CUDA 12.5, please use [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]
    ///   instead.
    /// * [`CUcoredumpSettings::CU_COREDUMP_FILE`]: String of up to 1023 characters that defines the location where any coredumps generated by this context
    ///   will be written. The default value is core.cuda.HOSTNAME.PID where HOSTNAME is the host name of the machine running the CUDA
    ///   applications and PID is the process ID of the CUDA application.
    /// * [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]: An integer with values to allow granular control the data contained in a coredump specified
    ///   as a bitwise OR combination of the following values: + [`CUCoredumpGenerationFlags::CU_COREDUMP_DEFAULT_FLAGS`] - if set by itself, coredump generation returns
    ///   to its default settings of including all memory regions that it is able to access + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES`]
    ///   - Coredump will not include the data from CUDA source modules that are not relocated at runtime. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_GLOBAL_MEMORY`]
    ///   - Coredump will not include device-side global data that does not belong to any context. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_SHARED_MEMORY`]
    ///   - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_LOCAL_MEMORY`]
    ///   - Coredump will not include local memory from the kernel. + [`CUCoredumpGenerationFlags::CU_COREDUMP_LIGHTWEIGHT_FLAGS`] - Enables all of the above options.
    ///   Equiavlent to setting the [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`] attribute to true. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] - If set, GPU exceptions will
    ///   not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default
    ///   behavior.
    ///
    /// **See also:**
    ///
    /// [`cuCoredumpGetAttributeGlobal`], [`cuCoredumpGetAttribute`], [`cuCoredumpSetAttributeGlobal`].
    ///
    /// # Parameters
    ///
    /// - `attrib`: The enum defining which value to set.
    /// - `value`: void\* containing the requested data.
    /// - `size`: The size of the memory region value points to.
    pub fn cuCoredumpSetAttribute(
        attrib: CUcoredumpSettings,
        value: *mut ::core::ffi::c_void,
        size: *mut size_t,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Allows caller to set a coredump attribute value globally.
    ///
    /// This function should be considered an alternate interface to the CUDA-GDB environment variables defined in this document:
    /// <https://docs.nvidia.com/cuda/cuda-gdb/index.html#gpu-coredump>
    ///
    /// An important design decision to note is that any coredump environment variable values set before CUDA initializes will take
    /// permanent precedence over any values set with this function. This decision was made to ensure no change in behavior for any
    /// users that may be currently using these variables to get coredumps.
    ///
    /// \*value shall contain the requested value specified by set. It is up to the caller to ensure that the data type and size of \*value matches the request.
    ///
    /// If the caller calls this function with \*value equal to NULL, the size of the memory region (in bytes) expected for set will be placed in size.
    ///
    /// The supported attributes are:
    ///
    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_ON_EXCEPTION`]: Bool where true means that GPU exceptions from this context will create a coredump at the
    ///   location specified by [`CUcoredumpSettings::CU_COREDUMP_FILE`]. The default value is false.
    /// * [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`]: Bool where true means that the host CPU will also create a coredump. The default value is true unless
    ///   set to false globally or or locally. This value is deprecated as of CUDA 12.5 - raise the [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] flag to disable
    ///   host device abort() if needed.
    /// * [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`]: Bool where true means that any resulting coredumps will not have a dump of GPU memory or non-reloc
    ///   ELF images. The default value is false. This attribute is deprecated as of CUDA 12.5, please use [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]
    ///   instead.
    /// * [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`]: Bool where true means that a coredump can be created by writing to the system pipe specified
    ///   by [`CUcoredumpSettings::CU_COREDUMP_PIPE`]. The default value is false.
    /// * [`CUcoredumpSettings::CU_COREDUMP_FILE`]: String of up to 1023 characters that defines the location where any coredumps generated by this context
    ///   will be written. The default value is core.cuda.HOSTNAME.PID where HOSTNAME is the host name of the machine running the CUDA
    ///   applications and PID is the process ID of the CUDA application.
    /// * [`CUcoredumpSettings::CU_COREDUMP_PIPE`]: String of up to 1023 characters that defines the name of the pipe that will be monitored if user-triggered
    ///   coredumps are enabled. This value may not be changed after [`CUcoredumpSettings::CU_COREDUMP_ENABLE_USER_TRIGGER`] is set to true. The default value
    ///   is corepipe.cuda.HOSTNAME.PID where HOSTNAME is the host name of the machine running the CUDA application and PID is the process
    ///   ID of the CUDA application.
    /// * [`CUcoredumpSettings::CU_COREDUMP_GENERATION_FLAGS`]: An integer with values to allow granular control the data contained in a coredump specified
    ///   as a bitwise OR combination of the following values: + [`CUCoredumpGenerationFlags::CU_COREDUMP_DEFAULT_FLAGS`] - if set by itself, coredump generation returns
    ///   to its default settings of including all memory regions that it is able to access + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_NONRELOCATED_ELF_IMAGES`]
    ///   - Coredump will not include the data from CUDA source modules that are not relocated at runtime. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_GLOBAL_MEMORY`]
    ///   - Coredump will not include device-side global data that does not belong to any context. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_SHARED_MEMORY`]
    ///   - Coredump will not include grid-scale shared memory for the warp that the dumped kernel belonged to. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_LOCAL_MEMORY`]
    ///   - Coredump will not include local memory from the kernel. + [`CUCoredumpGenerationFlags::CU_COREDUMP_LIGHTWEIGHT_FLAGS`] - Enables all of the above options.
    ///   Equiavlent to setting the [`CUcoredumpSettings::CU_COREDUMP_LIGHTWEIGHT`] attribute to true. + [`CUCoredumpGenerationFlags::CU_COREDUMP_SKIP_ABORT`] - If set, GPU exceptions will
    ///   not raise an abort() in the host CPU process. Same functional goal as [`CUcoredumpSettings::CU_COREDUMP_TRIGGER_HOST`] but better reflects the default
    ///   behavior.
    ///
    /// **See also:**
    ///
    /// [`cuCoredumpGetAttribute`], [`cuCoredumpGetAttributeGlobal`], [`cuCoredumpSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `attrib`: The enum defining which value to set.
    /// - `value`: void\* containing the requested data.
    /// - `size`: The size of the memory region value points to.
    pub fn cuCoredumpSetAttributeGlobal(
        attrib: CUcoredumpSettings,
        value: *mut ::core::ffi::c_void,
        size: *mut size_t,
    ) -> CUresult;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUcoredumpCallbackEntry_st {
    _unused: [u8; 0],
}
/// Opaque handle representing a registered coredump status callback. This handle is returned when registering a callback and
/// must be provided when deregistering the callback.
pub type CUcoredumpCallbackHandle = *mut CUcoredumpCallbackEntry_st;
/// Callback function prototype for GPU coredump status notifications. This callback will be invoked when a GPU coredump begins
/// or completes, depending on which registration function was used. The callback executes synchronously during the coredump process.
pub type CUcoredumpStatusCallback = ::core::option::Option<
    unsafe extern "C" fn(
        userData: *mut ::core::ffi::c_void,
        pid: ::core::ffi::c_int,
        dev: CUdevice,
    ),
>;
unsafe extern "C" {
    /// Register a callback to be invoked when a GPU coredump begins.
    ///
    /// This function registers a callback that will be called when a GPU coredump is initiated, before any coredump data is collected.
    /// Callbacks are executed in the order they were registered. The same callback function can be registered multiple times with
    /// different userData, and each registration will receive a unique handle.
    ///
    /// Note:
    ///
    /// Callbacks execute synchronously during the coredump process and will block coredump progress while running.
    ///
    /// **See also:**
    ///
    /// [`cuCoredumpDeregisterStartCallback`], [`cuCoredumpRegisterCompleteCallback`].
    ///
    /// # Parameters
    ///
    /// - `callback`: The callback function to register.
    /// - `userData`: User data pointer to pass to the callback.
    /// - `callbackOut`: Location to store the callback handle (optional, may be NULL).
    pub fn cuCoredumpRegisterStartCallback(
        callback: CUcoredumpStatusCallback,
        userData: *mut ::core::ffi::c_void,
        callbackOut: *mut CUcoredumpCallbackHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Register a callback to be invoked when a GPU coredump completes.
    ///
    /// This function registers a callback that will be called when a GPU coredump has been fully collected and written to disk. Callbacks
    /// are executed in the order they were registered. The same callback function can be registered multiple times with different
    /// userData, and each registration will receive a unique handle.
    ///
    /// Note:
    ///
    /// Callbacks execute synchronously during the coredump process and will block coredump progress while running.
    ///
    /// **See also:**
    ///
    /// [`cuCoredumpDeregisterCompleteCallback`], [`cuCoredumpRegisterStartCallback`].
    ///
    /// # Parameters
    ///
    /// - `callback`: The callback function to register.
    /// - `userData`: User data pointer to pass to the callback.
    /// - `callbackOut`: Location to store the callback handle (optional, may be NULL).
    pub fn cuCoredumpRegisterCompleteCallback(
        callback: CUcoredumpStatusCallback,
        userData: *mut ::core::ffi::c_void,
        callbackOut: *mut CUcoredumpCallbackHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Deregister a previously registered coredump start callback.
    ///
    /// This function removes a callback that was registered with [`cuCoredumpRegisterStartCallback`]. The callback handle becomes invalid after this call.
    ///
    /// Note:
    ///
    /// It is the caller's responsibility to deregister callbacks before they go out of scope.
    ///
    /// **See also:**
    ///
    /// [`cuCoredumpRegisterStartCallback`].
    ///
    /// # Parameters
    ///
    /// - `callback`: The callback handle to deregister.
    pub fn cuCoredumpDeregisterStartCallback(
        callback: CUcoredumpCallbackHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Deregister a previously registered coredump complete callback.
    ///
    /// This function removes a callback that was registered with [`cuCoredumpRegisterCompleteCallback`]. The callback handle becomes invalid after this call.
    ///
    /// Note:
    ///
    /// It is the caller's responsibility to deregister callbacks before they go out of scope.
    ///
    /// **See also:**
    ///
    /// [`cuCoredumpRegisterCompleteCallback`].
    ///
    /// # Parameters
    ///
    /// - `callback`: The callback handle to deregister.
    pub fn cuCoredumpDeregisterCompleteCallback(
        callback: CUcoredumpCallbackHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    pub fn cuGetExportTable(
        ppExportTable: *mut *const ::core::ffi::c_void,
        pExportTableId: *const CUuuid,
    ) -> CUresult;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUdevResourceDesc_st {
    _unused: [u8; 0],
}
/// An opaque descriptor handle. The descriptor encapsulates multiple created and configured resources. Created via [`cuDevResourceGenerateDesc`].
pub type CUdevResourceDesc = *mut CUdevResourceDesc_st;
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUgreenCtxCreate_flags {
    CU_GREEN_CTX_DEFAULT_STREAM = 1,
}
/// Flags for a [`CUdevSmResource`] group.
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUdevSmResourceGroup_flags {
    CU_DEV_SM_RESOURCE_GROUP_DEFAULT = 0,
    CU_DEV_SM_RESOURCE_GROUP_BACKFILL = 1,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUdevSmResourceSplitByCount_flags {
    CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING = 1,
    CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE = 2,
}
/// Type of resource.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum CUdevResourceType {
    CU_DEV_RESOURCE_TYPE_INVALID = 0,
    /// Streaming multiprocessors related information.
    CU_DEV_RESOURCE_TYPE_SM = 1,
    /// Workqueue configuration related information.
    CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG = 1000,
    /// Pre-existing workqueue related information.
    CU_DEV_RESOURCE_TYPE_WORKQUEUE = 10000,
}
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUdevSmResource_st {
    pub smCount: ::core::ffi::c_uint,
    pub minSmPartitionSize: ::core::ffi::c_uint,
    pub smCoscheduledAlignment: ::core::ffi::c_uint,
    pub flags: ::core::ffi::c_uint,
}
/// Data for SM-related resources All parameters in this structure are OUTPUT only. Do not write to any of the fields in this
/// structure.
pub type CUdevSmResource = CUdevSmResource_st;
/// Sharing scope for workqueues.
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUdevWorkqueueConfigScope {
    /// Use all shared workqueue resources across all contexts. Default driver behavior.
    CU_WORKQUEUE_SCOPE_DEVICE_CTX = 0,
    /// When possible, use non-overlapping workqueue resources with other balanced green contexts.
    CU_WORKQUEUE_SCOPE_GREEN_CTX_BALANCED = 1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUdevWorkqueueConfigResource_st {
    pub device: CUdevice,
    pub wqConcurrencyLimit: ::core::ffi::c_uint,
    pub sharingScope: CUdevWorkqueueConfigScope,
}
impl Default for CUdevWorkqueueConfigResource_st {
    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()
        }
    }
}
/// Data for workqueue configuration related resources.
pub type CUdevWorkqueueConfigResource = CUdevWorkqueueConfigResource_st;
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CUdevWorkqueueResource_st {
    pub reserved: [::core::ffi::c_uchar; 40usize],
}
impl Default for CUdevWorkqueueResource_st {
    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()
        }
    }
}
/// Handle to a pre-existing workqueue related resource.
pub type CUdevWorkqueueResource = CUdevWorkqueueResource_st;
#[repr(C)]
#[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct CU_DEV_SM_RESOURCE_GROUP_PARAMS_st {
    pub smCount: ::core::ffi::c_uint,
    pub coscheduledSmCount: ::core::ffi::c_uint,
    pub preferredCoscheduledSmCount: ::core::ffi::c_uint,
    pub flags: ::core::ffi::c_uint,
    pub reserved: [::core::ffi::c_uint; 12usize],
}
/// Input data for splitting SMs.
pub type CU_DEV_SM_RESOURCE_GROUP_PARAMS = CU_DEV_SM_RESOURCE_GROUP_PARAMS_st;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct CUdevResource_st {
    pub type_: CUdevResourceType,
    pub _internal_padding: [::core::ffi::c_uchar; 92usize],
    pub __bindgen_anon_1: CUdevResource_st__bindgen_ty_1,
    pub nextResource: *mut CUdevResource_st,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union CUdevResource_st__bindgen_ty_1 {
    pub sm: CUdevSmResource,
    pub wqConfig: CUdevWorkqueueConfigResource,
    pub wq: CUdevWorkqueueResource,
    pub _oversize: [::core::ffi::c_uchar; 40usize],
}
impl Default for CUdevResource_st__bindgen_ty_1 {
    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 CUdevResource_st {
    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 CUdevResource_v1 = CUdevResource_st;
/// A tagged union describing different resources identified by the type field. This structure should not be directly modified
/// outside of the API that created it.
///
/// ```text
///  struct {
/// CUdevResourceType type;
/// union {
/// CUdevSmResource sm;
/// CUdevWorkqueueConfigResource wqConfig;
/// CUdevWorkqueueResource wq;
/// };
/// };
/// ```
///
/// * If type is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_INVALID`], this resource is not valid and cannot be further accessed.
/// * If type is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`], the [`CUdevSmResource`] structure sm is filled in. For example, sm.smCount will reflect the amount of streaming multiprocessors available in this resource.
/// * If type is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG`], the [`CUdevWorkqueueConfigResource`] structure wqConfig is filled in.
/// * If type is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE`], the [`CUdevWorkqueueResource`] structure wq is filled in.
pub type CUdevResource = CUdevResource_v1;
unsafe extern "C" {
    /// Creates a green context with a specified set of resources.
    ///
    /// This API creates a green context with the resources specified in the descriptor desc and returns it in the handle represented by phCtx. This API will retain the primary context on device dev, which will is released when the green context is destroyed. It is advised to have the primary context active before calling
    /// this API to avoid the heavy cost of triggering primary context initialization and deinitialization multiple times.
    ///
    /// The API does not set the green context current. In order to set it current, you need to explicitly set it current by first
    /// converting the green context to a CUcontext using [`cuCtxFromGreenCtx`] and subsequently calling [`cuCtxSetCurrent`] / [`cuCtxPushCurrent_v2`]. It should be noted that a green context can be current to only one thread at a time. There is no internal synchronization
    /// to make API calls accessing the same green context from multiple threads work.
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// The supported flags are:
    ///
    /// * CU_GREEN_CTX_DEFAULT_STREAM : Creates a default stream to use inside the green context. Required.
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxDestroy`], [`cuCtxFromGreenCtx`], [`cuCtxSetCurrent`], [`cuCtxPushCurrent_v2`], [`cuDevResourceGenerateDesc`], [`cuDevicePrimaryCtxRetain`], [`cuCtxCreate_v4`].
    ///
    /// # Parameters
    ///
    /// - `phCtx`: Pointer for the output handle to the green context.
    /// - `desc`: Descriptor generated via [`cuDevResourceGenerateDesc`] which contains the set of resources to be used.
    /// - `dev`: Device on which to create the green context.
    /// - `flags`: One of the supported green context creation flags. CU_GREEN_CTX_DEFAULT_STREAM is required.
    pub fn cuGreenCtxCreate(
        phCtx: *mut CUgreenCtx,
        desc: CUdevResourceDesc,
        dev: CUdevice,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Destroys a green context.
    ///
    /// Destroys the green context, releasing the primary context of the device that this green context was created for. Any resources
    /// provisioned for this green context (that were initially available via the resource descriptor) are released as well. The API
    /// does not destroy streams created via [`cuGreenCtxStreamCreate`], [`cuStreamCreate`], or [`cuStreamCreateWithPriority`]. Users are expected to destroy these streams explicitly using [`cuStreamDestroy_v2`] to avoid resource leaks. Once the green context is destroyed, any subsequent API calls involving these streams will return
    /// [`cudaError_enum::CUDA_ERROR_STREAM_DETACHED`] with the exception of the following APIs:
    ///
    /// * [`cuStreamDestroy_v2`].
    ///
    /// Additionally, the API will invalidate all active captures on these streams.
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxCreate`], [`cuCtxDestroy_v2`].
    ///
    /// # Parameters
    ///
    /// - `hCtx`: Green context to be destroyed.
    pub fn cuGreenCtxDestroy(hCtx: CUgreenCtx) -> CUresult;
}
unsafe extern "C" {
    /// Converts a green context into the primary context.
    ///
    /// The API converts a green context into the primary context returned in pContext. It is important to note that the converted context pContext is a normal primary context but with the resources of the specified green context hCtx. Once converted, it can then be used to set the context current with [`cuCtxSetCurrent`] or with any of the CUDA APIs that accept a CUcontext parameter.
    ///
    /// Users are expected to call this API before calling any CUDA APIs that accept a CUcontext. Failing to do so will result in
    /// the APIs returning [`cudaError_enum::CUDA_ERROR_INVALID_CONTEXT`].
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxCreate`].
    ///
    /// # Parameters
    ///
    /// - `pContext`: Returned primary context with green context resources.
    /// - `hCtx`: Green context to convert.
    pub fn cuCtxFromGreenCtx(pContext: *mut CUcontext, hCtx: CUgreenCtx) -> CUresult;
}
unsafe extern "C" {
    /// Get device resources.
    ///
    /// Get the type resources available to the device. This may often be the starting point for further partitioning or configuring of resources.
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// **See also:**
    ///
    /// [`cuDevResourceGenerateDesc`].
    ///
    /// # Parameters
    ///
    /// - `device`: Device to get resource for.
    /// - `resource`: Output pointer to a [`CUdevResource`] structure.
    pub fn cuDeviceGetDevResource(
        device: CUdevice,
        resource: *mut CUdevResource,
        type_: CUdevResourceType,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get context resources.
    ///
    /// Get the type resources available to the context represented by hCtx
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// **See also:**
    ///
    /// [`cuDevResourceGenerateDesc`].
    ///
    /// # Parameters
    ///
    /// - `hCtx`: Context to get resource for.
    /// - `resource`: Output pointer to a [`CUdevResource`] structure.
    pub fn cuCtxGetDevResource(
        hCtx: CUcontext,
        resource: *mut CUdevResource,
        type_: CUdevResourceType,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get green context resources.
    ///
    /// Get the type resources available to the green context represented by hCtx
    ///
    /// **See also:**
    ///
    /// [`cuDevResourceGenerateDesc`].
    ///
    /// # Parameters
    ///
    /// - `hCtx`: Green context to get resource for.
    /// - `resource`: Output pointer to a [`CUdevResource`] structure.
    pub fn cuGreenCtxGetDevResource(
        hCtx: CUgreenCtx,
        resource: *mut CUdevResource,
        type_: CUdevResourceType,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Splits [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resources.
    ///
    /// Splits [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resources into nbGroups, adhering to the minimum SM count specified in minCount and the usage flags in flags. If result is NULL, the API simulates a split and provides the amount of groups that would be created in nbGroups. Otherwise, nbGroups must point to the amount of elements in result and on return, the API will overwrite nbGroups with the amount actually created. The groups are written to the array in result. nbGroups can be less than the total amount if a smaller number of groups is needed.
    ///
    /// This API is used to spatially partition the input resource. The input resource needs to come from one of [`cuDeviceGetDevResource`], [`cuCtxGetDevResource`], or [`cuGreenCtxGetDevResource`]. A limitation of the API is that the output results cannot be split again without first creating a descriptor and a green
    /// context with that descriptor.
    ///
    /// When creating the groups, the API will take into account the performance and functional characteristics of the input resource,
    /// and guarantee a split that will create a disjoint set of symmetrical partitions. This may lead to fewer groups created than
    /// purely dividing the total SM count by the minCount due to cluster requirements or alignment and granularity requirements for the minCount. These requirements can be queried
    /// with [`cuDeviceGetDevResource`], [`cuCtxGetDevResource`], and [`cuGreenCtxGetDevResource`] for CU_DEV_RESOURCE_TYPE_SM, using the minSmPartitionSize and smCoscheduledAlignment fields to determine minimum partition size and alignment granularity, respectively.
    ///
    /// The remainder set does not have the same functional or performance guarantees as the groups in result. Its use should be carefully planned and future partitions of the remainder set are discouraged.
    ///
    /// The following flags are supported:
    ///
    /// * CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING : Lower the minimum SM count and alignment, and treat each SM independent of its hierarchy. This allows more fine grained
    ///   partitions but at the cost of advanced features (such as large clusters on compute capability 9.0+).
    /// * CU_DEV_SM_RESOURCE_SPLIT_MAX_POTENTIAL_CLUSTER_SIZE : Compute Capability 9.0+ only. Attempt to create groups that may allow for maximally sized thread clusters. This can be
    ///   queried post green context creation using [`cuOccupancyMaxPotentialClusterSize`] and launch configuration (config), return the maximum cluster size in *clusterSize.").
    ///
    /// A successful API call must either have:
    ///
    /// * A valid array of result pointers of size passed in nbGroups, with input of type [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`]. Value of minCount must be between 0 and the SM count specified in input. remainder may be NULL.
    /// * NULL passed in for result, with a valid integer pointer in nbGroups and input of type [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`]. Value of minCount must be between 0 and the SM count specified in input. remainder may be NULL. This queries the number of groups that would be created by the API.
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxGetDevResource`], [`cuCtxGetDevResource`], [`cuDeviceGetDevResource`].
    ///
    /// # Parameters
    ///
    /// - `result`: Output array of [`CUdevResource`] resources. Can be NULL to query the number of groups.
    /// - `nbGroups`: This is a pointer, specifying the number of groups that would be or should be created as described below.
    /// - `input`: Input SM resource to be split. Must be a valid [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resource.
    /// - `remainder`: If the input resource cannot be cleanly split among nbGroups, the remainder is placed in here. Can be ommitted (NULL) if the user does not need the remaining set.
    /// - `flags`: Flags specifying how these partitions are used or which constraints to abide by when splitting the input. Zero is valid
    /// for default behavior.
    /// - `minCount`: Minimum number of SMs required.
    pub fn cuDevSmResourceSplitByCount(
        result: *mut CUdevResource,
        nbGroups: *mut ::core::ffi::c_uint,
        input: *const CUdevResource,
        remainder: *mut CUdevResource,
        flags: ::core::ffi::c_uint,
        minCount: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Splits a [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resource into structured groups.
    ///
    /// This API will split a resource of CU_DEV_RESOURCE_TYPE_SM into nbGroups structured device resource groups (the result array), as well as an optional remainder, according to a set of requirements specified in the groupParams array. The term “structured” is a trait that specifies the result has SMs that are co-scheduled together. This co-scheduling can be specified via the coscheduledSmCount field of the groupParams structure, while the smCount will specify how many SMs are required in total for that result. The remainder is always “unstructured”, it does not have
    /// any set guarantees with respect to co-scheduling and those properties will need to either be queried via the occupancy set
    /// of APIs or further split into structured groups by this API.
    ///
    /// The API has a discovery mode for use cases where it is difficult to know ahead of time what the SM count should be. Discovery
    /// happens when the smCount field of a given groupParams array entry is set to 0 - the smCount will be filled in by the API with the derived SM count according to the provided groupParams fields and constraints. Discovery can be used with both a valid result array and with a NULL result pointer value. The latter is useful in situations where the smCount will end up being zero, which is an invalid value to
    /// create a result entry with, but allowed for discovery purposes when the result is NULL.
    ///
    /// The groupParams array is evaluated from index 0 to nbGroups - 1. For each index in the groupParams array, the API will evaluate which SMs may be a good fit based on constraints and assign those SMs to result. This evaluation order is important to consider when using discovery mode, as it helps discover the remaining SMs.
    ///
    /// For a valid call:
    ///
    /// * result should point to a [`CUdevResource`] array of size nbGroups, or alternatively, may be NULL, if the developer wishes for only the groupParams entries to be updated
    ///
    /// * input should be a valid CU_DEV_RESOURCE_TYPE_SM resource that originates from querying the green context, device context, or device.
    ///
    /// * The remainder group may be NULL.
    ///
    /// * There are no API flags at this time, so the value passed in should be 0.
    ///
    /// * A [`CU_DEV_SM_RESOURCE_GROUP_PARAMS`] array of size nbGroups. Each entry must be zero-initialized.
    ///   + smCount: must be either 0 or in the range of \[2,inputSmCount\] where inputSmCount is the amount of SMs the input resource has. smCount must be a multiple of 2, as well as a multiple of coscheduledSmCount. When assigning SMs to a group (and if results are expected by having the result parameter set), smCount cannot end up with 0 or a value less than coscheduledSmCount otherwise [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] will be returned.
    ///   + coscheduledSmCount: allows grouping SMs together in order to be able to launch clusters on Compute Architecture 9.0+. The default value may be
    /// queried from the device’s CU_DEV_RESOURCE_TYPE_SM resource (8 on Compute Architecture 9.0+ and 2 otherwise). The maximum is 32 on Compute Architecture 9.0+ and 2 otherwise.
    ///   + preferredCoscheduledSmCount: Attempts to merge coscheduledSmCount groups into larger groups, in order to make use of preferredClusterDimensions on Compute Architecture 10.0+. The default value is set to coscheduledSmCount.
    ///   + flags:
    /// - [`CUdevSmResourceGroup_flags::CU_DEV_SM_RESOURCE_GROUP_BACKFILL`]: lets smCount be a non-multiple of coscheduledSmCount, filling the difference between SM count and already assigned co-scheduled groupings with other SMs. This lets any resulting
    ///   group behave similar to the remainder group for example.
    ///
    /// **Example params and their effect:**
    ///
    /// A groupParams array element is defined in the following order:
    ///
    /// ```text
    ///  { .smCount, .coscheduledSmCount, .preferredCoscheduledSmCount, .flags, \/\* .reserved \*\/ }
    /// ```
    ///
    /// ```text
    /// // Example 1
    /// // Will discover how many SMs there are, that are co-scheduled in groups of smCoscheduledAlignment.
    /// // The rest is placed in the optional remainder.
    /// CU_DEV_SM_RESOURCE_GROUP_PARAMS params { 0, 0, 0, 0 };
    /// ```
    ///
    /// ```text
    /// // Example 2
    /// // Assuming the device has 10+ SMs, the result will have 10 SMs that are co-scheduled in groups of 2 SMs.
    /// // The rest is placed in the optional remainder.
    /// CU_DEV_SM_RESOURCE_GROUP_PARAMS params { 10, 2, 0, 0};
    /// // Setting the coscheduledSmCount to 2 guarantees that we can always have a valid result
    /// // as long as the SM count is less than or equal to the input resource SM count.
    /// ```
    ///
    /// ```text
    /// // Example 3
    /// // A single piece is split-off, but instead of assigning the rest to the remainder, a second group contains everything else
    /// // This assumes the device has 10+ SMs (8 of which are coscheduled in groups of 4),
    /// // otherwise the second group could end up with 0 SMs, which is not allowed.
    /// CU_DEV_SM_RESOURCE_GROUP_PARAMS params { {8, 4, 0, 0}, {0, 2, 0, CU_DEV_SM_RESOURCE_GROUP_BACKFILL } }
    /// ```
    ///
    /// The difference between a catch-all param group as the last entry and the remainder is in two aspects:
    ///
    /// * The remainder may be NULL / _TYPE_INVALID (if there are no SMs remaining), while a result group must always be valid.
    /// * The remainder does not have a structure, while the result group will always need to adhere to a structure of coscheduledSmCount
    ///   (even if its just 2), and therefore must always have enough coscheduled SMs to cover that requirement (even with the [`CUdevSmResourceGroup_flags::CU_DEV_SM_RESOURCE_GROUP_BACKFILL`] flag enabled).
    ///
    /// Splitting an input into N groups, can be accomplished by repeatedly splitting off 1 group and re-splitting the remainder (a
    /// bisect operation). However, it's recommended to accomplish this with a single call wherever possible.
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxGetDevResource`], [`cuCtxGetDevResource`], [`cuDeviceGetDevResource`].
    ///
    /// # Parameters
    ///
    /// - `result`: Output array of [`CUdevResource`] resources. Can be NULL, alongside an smCount of 0, for discovery purpose.
    /// - `nbGroups`: Specifies the number of groups in result and groupParams.
    /// - `input`: Input SM resource to be split. Must be a valid [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_SM`] resource.
    /// - `remainder`: If splitting the input resource leaves any SMs, the remainder is placed in here.
    /// - `flags`: Flags specifying how the API should behave. The value should be 0 for now.
    /// - `groupParams`: Description of how the SMs should be split and assigned to the corresponding result entry.
    pub fn cuDevSmResourceSplit(
        result: *mut CUdevResource,
        nbGroups: ::core::ffi::c_uint,
        input: *const CUdevResource,
        remainder: *mut CUdevResource,
        flags: ::core::ffi::c_uint,
        groupParams: *mut CU_DEV_SM_RESOURCE_GROUP_PARAMS,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Generate a resource descriptor.
    ///
    /// Generates a single resource descriptor with the set of resources specified in resources. The generated resource descriptor is necessary for the creation of green contexts via the [`cuGreenCtxCreate`] API. Resources of the same type can be passed in, provided they meet the requirements as noted below.
    ///
    /// A successful API call must have:
    ///
    /// * A valid output pointer for the phDesc descriptor as well as a valid array of resources pointers, with the array size passed in nbResources. If multiple resources are provided in resources, the device they came from must be the same, otherwise [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`] is returned. If multiple
    ///   resources are provided in resources and they are of type CU_DEV_RESOURCE_TYPE_SM, they must be outputs (whether result or remaining) from the same split API instance and have the same smCoscheduledAlignment values, otherwise [`CUresult::CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION`]
    ///   is returned.
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// **See also:**
    ///
    /// [`cuDevSmResourceSplitByCount`].
    ///
    /// # Parameters
    ///
    /// - `phDesc`: Output descriptor.
    /// - `resources`: Array of resources to be included in the descriptor.
    /// - `nbResources`: Number of resources passed in resources.
    pub fn cuDevResourceGenerateDesc(
        phDesc: *mut CUdevResourceDesc,
        resources: *mut CUdevResource,
        nbResources: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Records an event.
    ///
    /// Captures in hEvent all the activities of the green context of hCtx at the time of this call. hEvent and hCtx must be from the same primary context otherwise [`cudaError_enum::CUDA_ERROR_INVALID_HANDLE`] is returned. Calls such as [`cuEventQuery`] or [`cuGreenCtxWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of hCtx after this call do not modify hEvent.
    ///
    /// Note:
    ///
    /// The API will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] if the specified green context hCtx has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures.
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxWaitEvent`], [`cuEventRecord`], [`cuCtxRecordEvent`], [`cuCtxWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `hCtx`: Green context to record event for.
    /// - `hEvent`: Event to record.
    pub fn cuGreenCtxRecordEvent(hCtx: CUgreenCtx, hEvent: CUevent) -> CUresult;
}
unsafe extern "C" {
    /// Make a green context wait on an event.
    ///
    /// Makes all future work submitted to green context hCtx wait for all work captured in hEvent. The synchronization will be performed on the device and will not block the calling CPU thread. See [`cuGreenCtxRecordEvent`] or [`cuEventRecord`], for details on what is captured by an event.
    ///
    /// Note:
    ///
    /// * hEvent may be from a different context or device than hCtx.
    /// * The API will return [`cudaError_enum::CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`] and invalidate the capture if the specified event hEvent is part of an ongoing capture sequence or if the specified green context hCtx has a stream in the capture mode.
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxRecordEvent`], [`cuStreamWaitEvent`], [`cuCtxRecordEvent`], [`cuCtxWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `hCtx`: Green context to wait.
    /// - `hEvent`: Event to wait on.
    pub fn cuGreenCtxWaitEvent(hCtx: CUgreenCtx, hEvent: CUevent) -> CUresult;
}
unsafe extern "C" {
    /// Query the green context associated with a stream.
    ///
    /// Returns the CUDA green context that the stream is associated with, or NULL if the stream is not associated with any green
    /// context.
    ///
    /// The stream handle hStream can refer to any of the following:
    ///
    /// * a stream created via any of the CUDA driver APIs such as [`cuStreamCreate`], [`cuStreamCreateWithPriority`] and [`cuGreenCtxStreamCreate`], or their runtime API equivalents such as [cudaStreamCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da), [cudaStreamCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3) and [cudaStreamCreateWithPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1ge2be9e9858849bf62ba4a8b66d1c3540). If during stream creation the context that was active in the calling thread was obtained with cuCtxFromGreenCtx, that green
    ///   context is returned in phCtx. Otherwise, \*phCtx is set to NULL instead.
    /// * special stream such as the NULL stream or `CU_STREAM_LEGACY`. In that case if context that is active in the calling thread was obtained with cuCtxFromGreenCtx, that green context is
    ///   returned. Otherwise, \*phCtx is set to NULL instead.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuStreamCreate`], [`cuStreamCreateWithPriority`], [`cuStreamGetCtx`], [`cuGreenCtxStreamCreate`], [`cuStreamGetPriority`], [`cuStreamGetFlags`], [`cuStreamGetDevice`], [`cuStreamWaitEvent`], [`cuStreamQuery`], [`cuStreamSynchronize`], [`cuStreamAddCallback`], [cudaStreamCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g6a3c4b819e6a994c26d0c4824a4c80da), [cudaStreamCreateWithFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1gb1e32aff9f59119e4d0a9858991c4ad3).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `phCtx`: Returned green context associated with the stream.
    pub fn cuStreamGetGreenCtx(hStream: CUstream, phCtx: *mut CUgreenCtx) -> CUresult;
}
unsafe extern "C" {
    /// Create a stream for use in the green context.
    ///
    /// Creates a stream for use in the specified green context greenCtx and returns a handle in phStream. The stream can be destroyed by calling [`cuStreamDestroy_v2`]. Note that the API ignores the context that is current to the calling thread and creates a stream in the specified green
    /// context greenCtx.
    ///
    /// The supported values for flags are:
    ///
    /// * [`CUstream_flags_enum::CU_STREAM_NON_BLOCKING`]: This must be specified. It indicates that work running in the created stream may run concurrently with work in the default
    ///   stream, and that the created stream should perform no implicit synchronization with the default stream.
    ///
    /// Specifying priority affects the scheduling priority of work in the stream. Priorities provide a hint to preferentially run work with higher priority
    /// when possible, but do not preempt already-running work or provide any other functional guarantee on execution order. priority follows a convention where lower numbers represent higher priorities. '0' represents default priority. The range of meaningful
    /// numerical priorities can be queried using [`cuCtxGetStreamPriorityRange`]. If the specified priority is outside the numerical range returned by [`cuCtxGetStreamPriorityRange`], it will automatically be clamped to the lowest or the highest number in the range.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * In the current implementation, only compute kernels launched in priority streams are affected by the stream's priority. Stream
    ///   priorities have no effect on host-to-device and device-to-host memory operations.
    ///
    /// **See also:**
    ///
    /// [`cuStreamDestroy_v2`], [`cuGreenCtxCreate`].
    ///
    /// # Parameters
    ///
    /// - `phStream`: Returned newly created stream.
    /// - `greenCtx`: Green context for which to create the stream for.
    /// - `flags`: Flags for stream creation. [`CUstream_flags::CU_STREAM_NON_BLOCKING`] must be specified.
    /// - `priority`: Stream priority. Lower numbers represent higher priorities. See [`cuCtxGetStreamPriorityRange`] for more information about meaningful stream priorities that can be passed.
    pub fn cuGreenCtxStreamCreate(
        phStream: *mut CUstream,
        greenCtx: CUgreenCtx,
        flags: ::core::ffi::c_uint,
        priority: ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the unique Id associated with the green context supplied.
    ///
    /// Returns in greenCtxId the unique Id which is associated with a given green context. The Id is unique for the life of the program for this instance
    /// of CUDA. If green context is supplied as NULL and the current context is set to a green context, the Id of the current green
    /// context is returned.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxCreate`], [`cuGreenCtxDestroy`], [`cuCtxGetId`].
    ///
    /// # Parameters
    ///
    /// - `greenCtx`: Green context for which to obtain the Id.
    /// - `greenCtxId`: Pointer to store the Id of the green context.
    pub fn cuGreenCtxGetId(
        greenCtx: CUgreenCtx,
        greenCtxId: *mut ::core::ffi::c_ulonglong,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Get stream resources.
    ///
    /// Get the type resources available to the hStream and store them in resource.
    ///
    /// Note: The API will return [`cudaError_enum::CUDA_ERROR_INVALID_RESOURCE_TYPE`] is type is [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE_CONFIG`] or [`CUdevResourceType::CU_DEV_RESOURCE_TYPE_WORKQUEUE`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cuGreenCtxCreate`], [`cuGreenCtxStreamCreate`], [`cuStreamCreate`], [`cuDevSmResourceSplitByCount`], [`cuDevResourceGenerateDesc`], [cudaStreamGetDevResource](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/group__CUDART__EXECUTION__CONTEXT.html#group__CUDART__EXECUTION__CONTEXT_1g55c60bf05fec3cf837d96520c91b8396).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to get resource for.
    /// - `resource`: Output pointer to a [`CUdevResource`] structure.
    pub fn cuStreamGetDevResource(
        hStream: CUstream,
        resource: *mut CUdevResource,
        type_: CUdevResourceType,
    ) -> CUresult;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub enum CUlogLevel_enum {
    CU_LOG_LEVEL_ERROR = 0,
    CU_LOG_LEVEL_WARNING = 1,
}
pub use self::CUlogLevel_enum as CUlogLevel;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CUlogsCallbackEntry_st {
    _unused: [u8; 0],
}
pub type CUlogsCallbackHandle = *mut CUlogsCallbackEntry_st;
pub type CUlogsCallback = ::core::option::Option<
    unsafe extern "C" fn(
        data: *mut ::core::ffi::c_void,
        logLevel: CUlogLevel,
        message: *mut ::core::ffi::c_char,
        length: size_t,
    ),
>;
pub type CUlogIterator = ::core::ffi::c_uint;
unsafe extern "C" {
    /// Register a callback function to receive error log messages.
    ///
    /// # Parameters
    ///
    /// - `callbackFunc`: The function to register as a callback.
    /// - `userData`: A generic pointer to user data. This is passed into the callback function.
    /// - `callback_out`: Optional location to store the callback handle after it is registered.
    pub fn cuLogsRegisterCallback(
        callbackFunc: CUlogsCallback,
        userData: *mut ::core::ffi::c_void,
        callback_out: *mut CUlogsCallbackHandle,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unregister a log message callback.
    ///
    /// # Parameters
    ///
    /// - `callback`: The callback instance to unregister from receiving log messages.
    pub fn cuLogsUnregisterCallback(callback: CUlogsCallbackHandle) -> CUresult;
}
unsafe extern "C" {
    /// Sets log iterator to point to the end of log buffer, where the next message would be written.
    ///
    /// # Parameters
    ///
    /// - `iterator_out`: Location to store an iterator to the current tail of the logs.
    /// - `flags`: Reserved for future use, must be 0.
    pub fn cuLogsCurrent(
        iterator_out: *mut CUlogIterator,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Dump accumulated driver logs into a file.
    ///
    /// Logs generated by the driver are stored in an internal buffer and can be copied out using this API. This API dumps all driver
    /// logs starting from iterator into pathToFile provided.
    ///
    /// Note:
    ///
    /// * iterator is auto-advancing. Dumping logs will update the value of iterator to receive the next generated log.
    /// * The driver reserves limited memory for storing logs. The oldest logs may be overwritten and become unrecoverable. An indication
    ///   will appear in the destination outupt if the logs have been truncated. Call dump after each failed API to mitigate this risk.
    ///
    /// # Parameters
    ///
    /// - `iterator`: Optional auto-advancing iterator specifying the starting log to read. NULL value dumps all logs.
    /// - `pathToFile`: Path to output file for dumping logs.
    /// - `flags`: Reserved for future use, must be 0.
    pub fn cuLogsDumpToFile(
        iterator: *mut CUlogIterator,
        pathToFile: *const ::core::ffi::c_char,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Dump accumulated driver logs into a buffer.
    ///
    /// Logs generated by the driver are stored in an internal buffer and can be copied out using this API. This API dumps driver
    /// logs from iterator into buffer up to the size specified in \*size. The driver will always null terminate the buffer but there will not be a null character between log entries, only a newline
    /// \n. The driver will then return the actual number of bytes written in \*size, excluding the null terminator. If there are no messages to dump, \*size will be set to 0 and the function will return [`cudaError_enum::CUDA_SUCCESS`]. If the provided buffer is not large enough to hold any messages, \*size will be set to 0 and the function will return [`cudaError_enum::CUDA_ERROR_INVALID_VALUE`].
    ///
    /// Note:
    ///
    /// * iterator is auto-advancing. Dumping logs will update the value of iterator to receive the next generated log.
    /// * The driver reserves limited memory for storing logs. The maximum size of the buffer is 25600 bytes. The oldest logs may be
    ///   overwritten and become unrecoverable. An indication will appear in the destination outupt if the logs have been truncated.
    ///   Call dump after each failed API to mitigate this risk.
    /// * If the provided value in \*size is not large enough to hold all buffered messages, a message will be added at the head of the buffer indicating this. The
    ///   driver then computes the number of messages it is able to store in buffer and writes it out. The final message in buffer will always be the most recent log message as of when the API is called.
    ///
    /// # Parameters
    ///
    /// - `iterator`: Optional auto-advancing iterator specifying the starting log to read. NULL value dumps all logs.
    /// - `buffer`: Pointer to dump logs.
    /// - `size`: See description.
    /// - `flags`: Reserved for future use, must be 0.
    pub fn cuLogsDumpToMemory(
        iterator: *mut CUlogIterator,
        buffer: *mut ::core::ffi::c_char,
        size: *mut size_t,
        flags: ::core::ffi::c_uint,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the restore thread ID for a CUDA process.
    ///
    /// Returns in \*tid the thread ID of the CUDA restore thread for the process specified by pid.
    ///
    /// # Parameters
    ///
    /// - `pid`: The process ID of the CUDA process.
    /// - `tid`: Returned restore thread ID.
    pub fn cuCheckpointProcessGetRestoreThreadId(
        pid: ::core::ffi::c_int,
        tid: *mut ::core::ffi::c_int,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Returns the process state of a CUDA process.
    ///
    /// Returns in \*state the current state of the CUDA process specified by pid.
    ///
    /// # Parameters
    ///
    /// - `pid`: The process ID of the CUDA process.
    /// - `state`: Returned CUDA process state.
    pub fn cuCheckpointProcessGetState(
        pid: ::core::ffi::c_int,
        state: *mut CUprocessState,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Lock a running CUDA process.
    ///
    /// Lock the CUDA process specified by pid which will block further CUDA API calls. Process must be in the RUNNING state in order to lock.
    ///
    /// Upon successful return the process will be in the LOCKED state.
    ///
    /// If timeoutMs is specified and the timeout is reached the process will be left in the RUNNING state upon return.
    ///
    /// # Parameters
    ///
    /// - `pid`: The process ID of the CUDA process.
    /// - `args`: Optional lock operation arguments.
    pub fn cuCheckpointProcessLock(
        pid: ::core::ffi::c_int,
        args: *mut CUcheckpointLockArgs,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Checkpoint a CUDA process's GPU memory contents.
    ///
    /// Checkpoints a CUDA process specified by pid that is in the LOCKED state. The GPU memory contents will be brought into host memory and all underlying references will
    /// be released. Process must be in the LOCKED state to checkpoint.
    ///
    /// Upon successful return the process will be in the CHECKPOINTED state.
    ///
    /// # Parameters
    ///
    /// - `pid`: The process ID of the CUDA process.
    /// - `args`: Optional checkpoint operation arguments.
    pub fn cuCheckpointProcessCheckpoint(
        pid: ::core::ffi::c_int,
        args: *mut CUcheckpointCheckpointArgs,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Restore a CUDA process's GPU memory contents from its last checkpoint.
    ///
    /// Restores a CUDA process specified by pid from its last checkpoint. Process must be in the CHECKPOINTED state to restore.
    ///
    /// GPU UUID pairs can be specified in args to remap the process old GPUs onto new GPUs. The GPU to restore onto needs to have enough memory and be of the same chip
    /// type as the old GPU. If an array of GPU UUID pairs is specified, it must contain every checkpointed GPU.
    ///
    /// Upon successful return the process will be in the LOCKED state.
    ///
    /// CUDA process restore requires persistence mode to be enabled or [`cuInit`] has not been called, any function from the driver API will return [`CUresult::CUDA_ERROR_NOT_INITIALIZED`].") to have been called before execution.
    ///
    /// **See also:**
    ///
    /// [`cuInit`] has not been called, any function from the driver API will return [`CUresult::CUDA_ERROR_NOT_INITIALIZED`].")
    ///
    /// # Parameters
    ///
    /// - `pid`: The process ID of the CUDA process.
    /// - `args`: Optional restore operation arguments.
    pub fn cuCheckpointProcessRestore(
        pid: ::core::ffi::c_int,
        args: *mut CUcheckpointRestoreArgs,
    ) -> CUresult;
}
unsafe extern "C" {
    /// Unlock a CUDA process to allow CUDA API calls.
    ///
    /// Unlocks a process specified by pid allowing it to resume making CUDA API calls. Process must be in the LOCKED state.
    ///
    /// Upon successful return the process will be in the RUNNING state.
    ///
    /// # Parameters
    ///
    /// - `pid`: The process ID of the CUDA process.
    /// - `args`: Optional unlock operation arguments.
    pub fn cuCheckpointProcessUnlock(
        pid: ::core::ffi::c_int,
        args: *mut CUcheckpointUnlockArgs,
    ) -> CUresult;
}