singe-cuda-sys 0.1.0-alpha.6

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

pub const CUDART_VERSION: u32 = 13020;
pub const cudaSurfaceType1D: u32 = 1;
pub const cudaSurfaceType2D: u32 = 2;
pub const cudaSurfaceType3D: u32 = 3;
pub const cudaSurfaceTypeCubemap: u32 = 12;
pub const cudaSurfaceType1DLayered: u32 = 241;
pub const cudaSurfaceType2DLayered: u32 = 242;
pub const cudaSurfaceTypeCubemapLayered: u32 = 252;
pub const cudaTextureType1D: u32 = 1;
pub const cudaTextureType2D: u32 = 2;
pub const cudaTextureType3D: u32 = 3;
pub const cudaTextureTypeCubemap: u32 = 12;
pub const cudaTextureType1DLayered: u32 = 241;
pub const cudaTextureType2DLayered: u32 = 242;
pub const cudaTextureTypeCubemapLayered: u32 = 252;
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cudaRoundMode {
    cudaRoundNearest = 0,
    cudaRoundZero = 1,
    cudaRoundPosInf = 2,
    cudaRoundMinInf = 3,
}
pub type size_t = ::core::ffi::c_ulong;
/// CUDA Surface boundary modes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cudaSurfaceBoundaryMode {
    /// Zero boundary mode.
    cudaBoundaryModeZero = 0,
    /// Clamp boundary mode.
    cudaBoundaryModeClamp = 1,
    /// Trap boundary mode.
    cudaBoundaryModeTrap = 2,
}
/// CUDA Surface format modes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cudaSurfaceFormatMode {
    /// Forced format mode.
    cudaFormatModeForced = 0,
    /// Auto format mode.
    cudaFormatModeAuto = 1,
}
/// An opaque value that represents a CUDA Surface object.
pub type cudaSurfaceObject_t = ::core::ffi::c_ulonglong;
/// CUDA texture address modes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cudaTextureAddressMode {
    /// Wrapping address mode.
    cudaAddressModeWrap = 0,
    /// Clamp to edge address mode.
    cudaAddressModeClamp = 1,
    /// Mirror address mode.
    cudaAddressModeMirror = 2,
    /// Border address mode.
    cudaAddressModeBorder = 3,
}
/// CUDA texture filter modes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cudaTextureFilterMode {
    /// Point filter mode.
    cudaFilterModePoint = 0,
    /// Linear filter mode.
    cudaFilterModeLinear = 1,
}
/// CUDA texture read modes.
#[repr(u32)]
#[derive(
    Debug,
    Copy,
    Clone,
    Hash,
    PartialOrd,
    Ord,
    PartialEq,
    Eq,
    TryFromPrimitive,
    IntoPrimitive,
)]
pub enum cudaTextureReadMode {
    /// Read texture as specified element type.
    cudaReadModeElementType = 0,
    /// Read texture as normalized float.
    cudaReadModeNormalizedFloat = 1,
}
/// CUDA texture descriptor.
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq)]
pub struct cudaTextureDesc {
    /// Texture address mode for up to 3 dimensions.
    pub addressMode: [cudaTextureAddressMode; 3usize],
    /// Texture filter mode.
    pub filterMode: cudaTextureFilterMode,
    /// Texture read mode.
    pub readMode: cudaTextureReadMode,
    /// Perform sRGB->linear conversion during texture read.
    pub sRGB: ::core::ffi::c_int,
    /// Texture Border Color.
    pub borderColor: [f32; 4usize],
    /// Indicates whether texture reads are normalized or not.
    pub normalizedCoords: ::core::ffi::c_int,
    /// Limit to the anisotropy ratio.
    pub maxAnisotropy: ::core::ffi::c_uint,
    /// Mipmap filter mode.
    pub mipmapFilterMode: cudaTextureFilterMode,
    /// Offset applied to the supplied mipmap level.
    pub mipmapLevelBias: f32,
    /// Lower end of the mipmap level range to clamp access to.
    pub minMipmapLevelClamp: f32,
    /// Upper end of the mipmap level range to clamp access to.
    pub maxMipmapLevelClamp: f32,
    /// Disable any trilinear filtering optimizations.
    pub disableTrilinearOptimization: ::core::ffi::c_int,
    /// Enable seamless cube map filtering.
    pub seamlessCubemap: ::core::ffi::c_int,
}
impl Default for cudaTextureDesc {
    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()
        }
    }
}
/// An opaque value that represents a CUDA texture object.
pub type cudaTextureObject_t = ::core::ffi::c_ulonglong;
unsafe extern "C" {
    /// Destroy all allocations and reset all state on the current device in the current process.
    ///
    /// Explicitly destroys and cleans up all resources associated with the current device in the current process. It is the caller's
    /// responsibility to ensure that the resources are not accessed or passed in subsequent API calls and doing so will result in
    /// undefined behavior. These resources include CUDA types `cudaStream_t`, `cudaEvent_t`, `cudaArray_t`, `cudaMipmappedArray_t`, [`cudaPitchedPtr`], [`cudaTextureObject_t`], [`cudaSurfaceObject_t`], textureReference, surfaceReference, `cudaExternalMemory_t`, `cudaExternalSemaphore_t` and `cudaGraphicsResource_t`. These resources also include memory allocations by [`cudaMalloc`], [`cudaMallocHost`], [`cudaMallocManaged`] and [`cudaMallocPitch`]. Any subsequent API call to this device will reinitialize the device.
    ///
    /// Note that this function will reset the device immediately. It is the caller's responsibility to ensure that the device is
    /// not being accessed by any other host threads from the process when this function is called.
    ///
    /// Note:
    ///
    /// * [`cudaDeviceReset`] will not destroy memory allocations by [`cudaMallocAsync`] and [`cudaMallocFromPoolAsync`]. These memory allocations need to be destroyed explicitly.
    /// * If a non-primary [CUcontext](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1gf9f5bd81658f866613785b3a0bb7d7d9) is current to the thread, [`cudaDeviceReset`] will destroy only the internal CUDA RT state for that [CUcontext](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1gf9f5bd81658f866613785b3a0bb7d7d9).
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceSynchronize`].
    pub fn cudaDeviceReset() -> cudaError_t;
}
unsafe extern "C" {
    /// Wait for compute device to finish.
    ///
    /// Blocks until the device has completed all preceding requested tasks. [`cudaDeviceSynchronize`] returns an error if one of the preceding tasks has failed. If the `cudaDeviceScheduleBlockingSync` flag was set for this device, the host thread will block until the device has finished its work.
    ///
    /// Note:
    ///
    /// * Use of cudaDeviceSynchronize in device code was deprecated in CUDA 11.6 and removed for compute_90+ compilation. For compute
    ///   capability &lt; 9.0, compile-time opt-in by specifying -D CUDA_FORCE_CDP1_IF_SUPPORTED is required to continue using [`cudaDeviceSynchronize`] in device code for now. Note that this is different from host-side cudaDeviceSynchronize, which is still supported.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceReset`], [cuCtxSynchronize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g7a54725f28d34b8c6299f0c6ca579616).
    pub fn cudaDeviceSynchronize() -> cudaError_t;
}
unsafe extern "C" {
    /// Set resource limits.
    ///
    /// Setting limit to value is a request by the application to update the current limit maintained by the device. 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 [`cudaDeviceGetLimit`] to find out exactly what the limit has been set to.
    ///
    /// Setting each [`cudaLimit`] has its own specific restrictions, so each is discussed here.
    ///
    /// * [`cudaLimit::cudaLimitStackSize`] controls the stack size in bytes of each GPU thread.
    ///
    /// * [`cudaLimit::cudaLimitPrintfFifoSize`] controls the size in bytes of the shared FIFO used by the printf() device system call. Setting [`cudaLimit::cudaLimitPrintfFifoSize`] must not be performed after launching any kernel that uses the printf() device system call - in such case [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// * [`cudaLimit::cudaLimitMallocHeapSize`] controls the size in bytes of the heap used by the malloc() and free() device system calls. Setting [`cudaLimit::cudaLimitMallocHeapSize`] must not be performed after launching any kernel that uses the malloc() or free() device system calls - in such case [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// * [`cudaLimit::cudaLimitDevRuntimeSyncDepth`] controls the maximum nesting depth of a grid at which a thread can safely call [`cudaDeviceSynchronize`]. Setting this limit must be performed before any launch of a kernel that uses the device runtime and calls [`cudaDeviceSynchronize`] above the default sync depth, two levels of grids. Calls to [`cudaDeviceSynchronize`] will fail with error code [cudaErrorSyncDepthExceeded](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/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 runtime to reserve large amounts of device
    ///   memory which can no longer be used for user allocations. If these reservations of device memory fail, [`cudaDeviceSetLimit`] will return [cudaErrorMemoryAllocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f210f50ae7f17f655e0504929606add9), 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 will results in error [cudaErrorUnsupportedLimit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c3b950b6f8668f7282fae25bfcefd13a) being returned.
    ///
    /// * [`cudaLimit::cudaLimitDevRuntimePendingLaunchCount`] controls the maximum number of outstanding device runtime launches that can be made from the current device. 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/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382372902b9ffd65825d138e16125b1376) when [`cudaGetLastError`] 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
    ///   runtime to reserve larger amounts of device memory upfront which can no longer be used for allocations. If these reservations
    ///   fail, [`cudaDeviceSetLimit`] will return [cudaErrorMemoryAllocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f210f50ae7f17f655e0504929606add9), 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 [cudaErrorUnsupportedLimit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c3b950b6f8668f7282fae25bfcefd13a) being returned.
    ///
    /// * [`cudaLimit::cudaLimitMaxL2FetchGranularity`] 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.
    ///
    /// * [`cudaLimit::cudaLimitPersistingL2CacheSize`] 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceGetLimit`], [cuCtxSetLimit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g0651954dfb9788173e60a9af7201e65a).
    ///
    /// # Parameters
    ///
    /// - `limit`: Limit to set.
    /// - `value`: Size of limit.
    pub fn cudaDeviceSetLimit(limit: cudaLimit, value: size_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Return resource limits.
    ///
    /// Returns in \*pValue the current size of limit. The following [`cudaLimit`] values are supported.
    ///
    /// * [`cudaLimit::cudaLimitStackSize`] is the stack size in bytes of each GPU thread.
    /// * [`cudaLimit::cudaLimitPrintfFifoSize`] is the size in bytes of the shared FIFO used by the printf() device system call.
    /// * [`cudaLimit::cudaLimitMallocHeapSize`] is the size in bytes of the heap used by the malloc() and free() device system calls.
    /// * [`cudaLimit::cudaLimitDevRuntimeSyncDepth`] is the maximum grid depth at which a thread can isssue the device runtime call [`cudaDeviceSynchronize`] to wait on child grid launches to complete. This functionality is removed for devices of compute capability >= 9.0, and hence
    ///   will return error [cudaErrorUnsupportedLimit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c3b950b6f8668f7282fae25bfcefd13a) on such devices.
    /// * [`cudaLimit::cudaLimitDevRuntimePendingLaunchCount`] is the maximum number of outstanding device runtime launches.
    /// * [`cudaLimit::cudaLimitMaxL2FetchGranularity`] is the L2 cache fetch granularity.
    /// * [`cudaLimit::cudaLimitPersistingL2CacheSize`] is the persisting L2 cache size in bytes.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceSetLimit`], [cuCtxGetLimit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g9f2d47d1745752aa16da7ed0d111b6a8).
    ///
    /// # Parameters
    ///
    /// - `pValue`: Returned size of the limit.
    /// - `limit`: Limit to query.
    pub fn cudaDeviceGetLimit(pValue: *mut size_t, limit: cudaLimit) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the maximum number of elements allocatable in a 1D linear texture for a given element size.
    ///
    /// Returns in maxWidthInElements the maximum number of elements allocatable in a 1D linear texture for given format descriptor fmtDesc.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuDeviceGetTexture1DLinearMaxWidth](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1gb41b3a675bae9932bffa1c0ae969b1e0).
    ///
    /// # Parameters
    ///
    /// - `maxWidthInElements`: Returns maximum number of texture elements allocatable for given fmtDesc.
    /// - `fmtDesc`: Texture format description.
    pub fn cudaDeviceGetTexture1DLinearMaxWidth(
        maxWidthInElements: *mut size_t,
        fmtDesc: *const cudaChannelFormatDesc,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the preferred cache configuration for the current device.
    ///
    /// On devices where the L1 cache and shared memory use the same hardware resources, this returns through pCacheConfig the preferred cache configuration for the current device. This is only a preference. The runtime 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 pCacheConfig of [cudaFuncCachePreferNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49b3b4b8c65376ce1ca107be413e15981bc) on devices where the size of the L1 cache and shared memory are fixed.
    ///
    /// The supported cache configurations are:
    ///
    /// * [cudaFuncCachePreferNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49b3b4b8c65376ce1ca107be413e15981bc): no preference for shared memory or L1 (default)
    /// * [cudaFuncCachePreferShared](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49b84725d25c531f9bafc61ae329afe5b2b): prefer larger shared memory and smaller L1 cache
    /// * [cudaFuncCachePreferL1](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49b8ecb48ccbc2230c81528a2c7c695100e): prefer larger L1 cache and smaller shared memory
    /// * [cudaFuncCachePreferEqual](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49bd151ac8d667150c601de4b9542887a3b): prefer equal size L1 cache and shared memory
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceSetCacheConfig`], [cudaFuncSetCacheConfig ( C API)](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/execution-control.html#group__CUDART__EXECUTION_1g6699ca1943ac2655effa0d571b2f4f15 "Sets the preferred cache configuration for a device function."), [cudaFuncSetCacheConfig ( C++ API)](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/high-level-api.html#group__CUDART__HIGHLEVEL_1g7d9cc996fe45b6260ebb086caff1c685 "\[C++ API\] Sets the preferred cache configuration for a device function"), [cuCtxGetCacheConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g40b6b141698f76744dea6e39b9a25360).
    ///
    /// # Parameters
    ///
    /// - `pCacheConfig`: Returned cache configuration.
    pub fn cudaDeviceGetCacheConfig(pCacheConfig: *mut cudaFuncCache) -> cudaError_t;
}
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 [`cudaStreamCreateWithPriority`] 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 [`cudaDeviceGetAttribute`]).
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreateWithPriority`], [`cudaStreamGetPriority`], [cuCtxGetStreamPriorityRange](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g137920ab61a71be6ce67605b9f294091).
    ///
    /// # 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 cudaDeviceGetStreamPriorityRange(
        leastPriority: *mut ::core::ffi::c_int,
        greatestPriority: *mut ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the preferred cache configuration for the current device.
    ///
    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through cacheConfig the preferred cache configuration for the current device. This is only a preference. The runtime 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 [cudaFuncSetCacheConfig ( C API)](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/execution-control.html#group__CUDART__EXECUTION_1g6699ca1943ac2655effa0d571b2f4f15 "Sets the preferred cache configuration for a device function.") or [cudaFuncSetCacheConfig ( C++ API)](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/high-level-api.html#group__CUDART__HIGHLEVEL_1g7d9cc996fe45b6260ebb086caff1c685 "\[C++ API\] Sets the preferred cache configuration for a device function") will be preferred over this device-wide setting. Setting the device-wide cache configuration to [cudaFuncCachePreferNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49b3b4b8c65376ce1ca107be413e15981bc) 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:
    ///
    /// * [cudaFuncCachePreferNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49b3b4b8c65376ce1ca107be413e15981bc): no preference for shared memory or L1 (default)
    /// * [cudaFuncCachePreferShared](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49b84725d25c531f9bafc61ae329afe5b2b): prefer larger shared memory and smaller L1 cache
    /// * [cudaFuncCachePreferL1](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49b8ecb48ccbc2230c81528a2c7c695100e): prefer larger L1 cache and smaller shared memory
    /// * [cudaFuncCachePreferEqual](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggb980f35ed69ee7991704de29a13de49bd151ac8d667150c601de4b9542887a3b): prefer equal size L1 cache and shared memory
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceGetCacheConfig`], [cudaFuncSetCacheConfig ( C API)](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/execution-control.html#group__CUDART__EXECUTION_1g6699ca1943ac2655effa0d571b2f4f15 "Sets the preferred cache configuration for a device function."), [cudaFuncSetCacheConfig ( C++ API)](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/high-level-api.html#group__CUDART__HIGHLEVEL_1g7d9cc996fe45b6260ebb086caff1c685 "\[C++ API\] Sets the preferred cache configuration for a device function"), [cuCtxSetCacheConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g54699acf7e2ef27279d013ca2095f4a3).
    ///
    /// # Parameters
    ///
    /// - `cacheConfig`: Requested cache configuration.
    pub fn cudaDeviceSetCacheConfig(cacheConfig: cudaFuncCache) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a handle to a compute device.
    ///
    /// Returns in \*device a device ordinal given a PCI bus ID string.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceGetPCIBusId`], [cuDeviceGetByPCIBusId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1ga89cd3fa06334ba7853ed1232c5ebe2a).
    ///
    /// # Parameters
    ///
    /// - `device`: Returned device ordinal.
    /// - `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 cudaDeviceGetByPCIBusId(
        device: *mut ::core::ffi::c_int,
        pciBusId: *const ::core::ffi::c_char,
    ) -> cudaError_t;
}
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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceGetByPCIBusId`], [cuDeviceGetPCIBusId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g85295e7d9745ab8f0aa80dd1e172acfc).
    ///
    /// # 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.
    /// - `device`: Device to get identifier string for.
    pub fn cudaDeviceGetPCIBusId(
        pciBusId: *mut ::core::ffi::c_char,
        len: ::core::ffi::c_int,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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 `cudaEventInterprocess` and `cudaEventDisableTiming` flags set. This opaque handle may be copied into other processes and opened with [`cudaIpcOpenEventHandle`] to allow efficient hardware synchronization between GPU work in different processes.
    ///
    /// After the event has been been opened in the importing process, [`cudaEventRecord`], [`cudaEventSynchronize`], [`cudaStreamWaitEvent`] and [`cudaEventQuery`] may be used in either process. Performing operations on the imported event after the exported event has been freed with [`cudaEventDestroy`] 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 [`cudaDeviceGetAttribute`] with [cudaDevAttrIpcEventSupport](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd0ab012a7c597ffbe86090ee2f9e1758c)
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaEventCreate`], [`cudaEventDestroy`], [`cudaEventSynchronize`], [`cudaEventQuery`], [`cudaStreamWaitEvent`], [`cudaIpcOpenEventHandle`], [`cudaIpcGetMemHandle`], [`cudaIpcOpenMemHandle`], [`cudaIpcCloseMemHandle`], [cuIpcGetEventHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gea02eadd12483de5305878b13288a86c).
    ///
    /// # Parameters
    ///
    /// - `handle`: Pointer to a user allocated cudaIpcEventHandle in which to return the opaque event handle.
    /// - `event`: Event allocated with `cudaEventInterprocess` and `cudaEventDisableTiming` flags.
    pub fn cudaIpcGetEventHandle(
        handle: *mut cudaIpcEventHandle_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Opens an interprocess event handle for use in the current process.
    ///
    /// Opens an interprocess event handle exported from another process with [`cudaIpcGetEventHandle`]. This function returns a `cudaEvent_t` that behaves like a locally created event with the `cudaEventDisableTiming` flag specified. This event must be freed with [`cudaEventDestroy`].
    ///
    /// Performing operations on the imported event after the exported event has been freed with [`cudaEventDestroy`] 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 [`cudaDeviceGetAttribute`] with [cudaDevAttrIpcEventSupport](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd0ab012a7c597ffbe86090ee2f9e1758c)
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaEventCreate`], [`cudaEventDestroy`], [`cudaEventSynchronize`], [`cudaEventQuery`], [`cudaStreamWaitEvent`], [`cudaIpcGetEventHandle`], [`cudaIpcGetMemHandle`], [`cudaIpcOpenMemHandle`], [`cudaIpcCloseMemHandle`], [cuIpcOpenEventHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gf1d525918b6c643b99ca8c8e42e36c2e).
    ///
    /// # Parameters
    ///
    /// - `event`: Returns the imported event.
    /// - `handle`: Interprocess handle to open.
    pub fn cudaIpcOpenEventHandle(
        event: *mut cudaEvent_t,
        handle: cudaIpcEventHandle_t,
    ) -> cudaError_t;
}
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 [`cudaMalloc`] 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 [`cudaFree`] and a subsequent call to [`cudaMalloc`] returns memory with the same device address, [`cudaIpcGetMemHandle`] 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 [`cudaDeviceGetAttribute`] with [cudaDevAttrIpcEventSupport](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd0ab012a7c597ffbe86090ee2f9e1758c)
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaFree`], [`cudaIpcGetEventHandle`], [`cudaIpcOpenEventHandle`], [`cudaIpcOpenMemHandle`], [`cudaIpcCloseMemHandle`], [cuIpcGetMemHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g6f1b5be767b275f016523b2ac49ebec1).
    ///
    /// # Parameters
    ///
    /// - `handle`: Pointer to user allocated cudaIpcMemHandle to return the handle in.
    /// - `devPtr`: Base pointer to previously allocated device memory.
    pub fn cudaIpcGetMemHandle(
        handle: *mut cudaIpcMemHandle_t,
        devPtr: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
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 [`cudaIpcGetMemHandle`] into the current device address space. For contexts on different devices [`cudaIpcOpenMemHandle`] can attempt to enable peer access between the devices as if the user called [`cudaDeviceEnablePeerAccess`]. This behavior is controlled by the `cudaIpcMemLazyEnablePeerAccess` flag. [`cudaDeviceCanAccessPeer`] can determine if a mapping is possible.
    ///
    /// [`cudaIpcOpenMemHandle`] can open handles to devices that may not be visible in the process calling the API.
    ///
    /// Contexts that may open cudaIpcMemHandles are restricted in the following way. cudaIpcMemHandles from each device in a given
    /// process may only be opened by one context per device 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 [`cudaIpcOpenMemHandle`] must be freed with [`cudaIpcCloseMemHandle`].
    ///
    /// Calling [`cudaFree`] on an exported memory region before calling [`cudaIpcCloseMemHandle`] 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 [`cudaDeviceGetAttribute`] with [cudaDevAttrIpcEventSupport](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd0ab012a7c597ffbe86090ee2f9e1758c)
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * No guarantees are made about the address returned in \*devPtr. In particular, multiple processes may not receive the same address for the same handle.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaFree`], [`cudaIpcGetEventHandle`], [`cudaIpcOpenEventHandle`], [`cudaIpcGetMemHandle`], [`cudaIpcCloseMemHandle`], [`cudaDeviceEnablePeerAccess`], [`cudaDeviceCanAccessPeer`], [cuIpcOpenMemHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1ga8bd126fcff919a0c996b7640f197b79).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Returned device pointer.
    /// - `handle`: cudaIpcMemHandle to open.
    /// - `flags`: Flags for this operation. Must be specified as `cudaIpcMemLazyEnablePeerAccess`.
    pub fn cudaIpcOpenMemHandle(
        devPtr: *mut *mut ::core::ffi::c_void,
        handle: cudaIpcMemHandle_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Attempts to close memory mapped with cudaIpcOpenMemHandle.
    ///
    /// Decrements the reference count of the memory returnd by [`cudaIpcOpenMemHandle`] 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 [`cudaDeviceGetAttribute`] with [cudaDevAttrIpcEventSupport](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd0ab012a7c597ffbe86090ee2f9e1758c)
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaFree`], [`cudaIpcGetEventHandle`], [`cudaIpcOpenEventHandle`], [`cudaIpcGetMemHandle`], [`cudaIpcOpenMemHandle`], [cuIpcCloseMemHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gd6f5d5bcf6376c6853b64635b0157b9e).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Device pointer returned by [`cudaIpcOpenMemHandle`].
    pub fn cudaIpcCloseMemHandle(devPtr: *mut ::core::ffi::c_void) -> cudaError_t;
}
unsafe extern "C" {
    /// Blocks until remote writes are visible to the specified scope.
    ///
    /// Blocks until remote writes to the target context via mappings created through GPUDirect RDMA 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 [cudaDevAttrGPUDirectRDMAWritesOrdering](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd881d5b0c5bf7777e382920af4d743bde), 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.
    ///
    /// Users may query support for this API via [cudaDevAttrGPUDirectRDMAFlushWritesOptions](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd7b3462e13705248606f39fb5381446ee).
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuFlushGPUDirectRDMAWrites](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1g265e3c82ef0f0fe035f85c4c45a8fbdf).
    ///
    /// # Parameters
    ///
    /// - `target`: The target of the operation, see cudaFlushGPUDirectRDMAWritesTarget.
    /// - `scope`: The scope of the operation, see cudaFlushGPUDirectRDMAWritesScope.
    pub fn cudaDeviceFlushGPUDirectRDMAWrites(
        target: cudaFlushGPUDirectRDMAWritesTarget,
        scope: cudaFlushGPUDirectRDMAWritesScope,
    ) -> cudaError_t;
}
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 cudaDeviceRegisterAsyncNotification or cudaDeviceUnregisterAsyncNotification. Doing so will result
    /// in [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3). 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:**
    ///
    /// [`cudaDeviceUnregisterAsyncNotification`].
    ///
    /// # 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 cudaDeviceRegisterAsyncNotification(
        device: ::core::ffi::c_int,
        callbackFunc: cudaAsyncCallback,
        userData: *mut ::core::ffi::c_void,
        callback: *mut cudaAsyncCallbackHandle_t,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaDeviceRegisterAsyncNotification`].
    ///
    /// # Parameters
    ///
    /// - `device`: The device from which to remove callback.
    /// - `callback`: The callback instance to unregister from receiving async notifications.
    pub fn cudaDeviceUnregisterAsyncNotification(
        device: ::core::ffi::c_int,
        callback: cudaAsyncCallbackHandle_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the shared memory configuration for the current device.
    ///
    /// pConfig
    ///
    /// [`cudaDeviceSetSharedMemConfig`]
    ///
    /// [`cudaDeviceGetSharedMemConfig`]
    ///
    /// The returned bank configurations can be either:
    ///
    /// * cudaSharedMemBankSizeFourByte - shared memory bank width is four bytes.
    /// * cudaSharedMemBankSizeEightByte - shared memory bank width is eight bytes.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceSetCacheConfig`], [`cudaDeviceGetCacheConfig`], [`cudaDeviceSetSharedMemConfig`], [`cudaFuncSetCacheConfig`], [cuCtxGetSharedMemConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX__DEPRECATED.html#group__CUDA__CTX__DEPRECATED_1gfac1414497a1a2a40bba474c6b5bf194).
    ///
    /// # Parameters
    ///
    /// - `pConfig`: Returned cache configuration.
    #[deprecated]
    pub fn cudaDeviceGetSharedMemConfig(
        pConfig: *mut cudaSharedMemConfig,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the shared memory configuration for the current device.
    ///
    /// [`cudaFuncSetSharedMemConfig`]
    ///
    /// Changing the shared memory configuration between launches may introduce a device side synchronization point.
    ///
    /// 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:
    ///
    /// * cudaSharedMemBankSizeDefault: set bank width the device default (currently, four bytes)
    /// * cudaSharedMemBankSizeFourByte: set shared memory bank width to be four bytes natively.
    /// * cudaSharedMemBankSizeEightByte: set shared memory bank width to be eight bytes natively.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceSetCacheConfig`], [`cudaDeviceGetCacheConfig`], [`cudaDeviceGetSharedMemConfig`], [`cudaFuncSetCacheConfig`], [cuCtxSetSharedMemConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX__DEPRECATED.html#group__CUDA__CTX__DEPRECATED_1gb1fef6f9fd5c252245214f85ae01ec23).
    ///
    /// # Parameters
    ///
    /// - `config`: Requested cache configuration.
    #[deprecated]
    pub fn cudaDeviceSetSharedMemConfig(config: cudaSharedMemConfig) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the last error from a runtime call.
    ///
    /// Returns the last error that has been produced by any of the runtime calls in the same instance of the CUDA Runtime library
    /// in the host thread and resets it to [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591).
    ///
    /// Note: Multiple instances of the CUDA Runtime library can be present in an application when using a library that statically
    /// links the CUDA Runtime.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaPeekAtLastError`], [`cudaGetErrorName`], [`cudaGetErrorString`], `cudaError`.
    pub fn cudaGetLastError() -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the last error from a runtime call.
    ///
    /// Returns the last error that has been produced by any of the runtime calls in the same instance of the CUDA Runtime library
    /// in the host thread. This call does not reset the error to [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) like [`cudaGetLastError`].
    ///
    /// Note: Multiple instances of the CUDA Runtime library can be present in an application when using a library that statically
    /// links the CUDA Runtime.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetLastError`], [`cudaGetErrorName`], [`cudaGetErrorString`], `cudaError`.
    pub fn cudaPeekAtLastError() -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the string representation of an error code enum name.
    ///
    /// Returns a string containing the name of an error code in the enum. If the error code is not recognized, "unrecognized error
    /// code" is returned.
    ///
    /// **See also:**
    ///
    /// [`cudaGetErrorString`], [`cudaGetLastError`], [`cudaPeekAtLastError`], `cudaError`, [cuGetErrorName](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__ERROR.html#group__CUDA__ERROR_1g2c4ac087113652bb3d1f95bf2513c468).
    ///
    /// # Parameters
    ///
    /// - `error`: Error code to convert to string.
    pub fn cudaGetErrorName(error: cudaError_t) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    /// Returns the description string for an error code.
    ///
    /// Returns the description string for an error code. If the error code is not recognized, "unrecognized error code" is returned.
    ///
    /// **See also:**
    ///
    /// [`cudaGetErrorName`], [`cudaGetLastError`], [`cudaPeekAtLastError`], `cudaError`, [cuGetErrorString](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__ERROR.html#group__CUDA__ERROR_1g72758fcaf05b5c7fac5c25ead9445ada).
    ///
    /// # Parameters
    ///
    /// - `error`: Error code to convert to string.
    pub fn cudaGetErrorString(error: cudaError_t) -> *const ::core::ffi::c_char;
}
unsafe extern "C" {
    /// Returns the number of compute-capable devices.
    ///
    /// Returns in \*count the number of devices with compute capability greater or equal to 2.0 that are available for execution.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDevice`], [`cudaSetDevice`], [`cudaGetDeviceProperties`], [`cudaChooseDevice`], [`cudaInitDevice`], [cuDeviceGetCount](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1g52b5ce05cb8c5fb6831b2c0ff2887c74).
    ///
    /// # Parameters
    ///
    /// - `count`: Returns the number of devices with compute capability greater or equal to 2.0.
    pub fn cudaGetDeviceCount(count: *mut ::core::ffi::c_int) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns information about the compute-device.
    ///
    /// Returns in \*prop the properties of device dev.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaSetDevice`], [`cudaChooseDevice`], [`cudaDeviceGetAttribute`], [`cudaInitDevice`], [cuDeviceGetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1g9c3e1414f0ad901d3278a4d6645fc266), [cuDeviceGetName](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1gef75aa30df95446a845f2a7b9fffbb7f).
    ///
    /// # Parameters
    ///
    /// - `prop`: Properties for the specified device.
    /// - `device`: Device number to get properties for.
    pub fn cudaGetDeviceProperties(
        prop: *mut cudaDeviceProp,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns information about the device.
    ///
    /// Returns in \*value the integer value of the attribute attr on device device.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaSetDevice`], [`cudaChooseDevice`], [`cudaGetDeviceProperties`], [`cudaInitDevice`], [cuDeviceGetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1g9c3e1414f0ad901d3278a4d6645fc266).
    ///
    /// # Parameters
    ///
    /// - `value`: Returned device attribute value.
    /// - `attr`: Device attribute to query.
    /// - `device`: Device number to query.
    pub fn cudaDeviceGetAttribute(
        value: *mut ::core::ffi::c_int,
        attr: cudaDeviceAttr,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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 [`cudaAtomicOperation`] in \*operations, the corresponding result in \*capabilities will be a bitmask indicating which of `cudaAtomicOperationCapability` the link supports natively.
    ///
    /// Returns [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a) if dev is not valid.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) 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:**
    ///
    /// [`cudaDeviceGetAttribute`], [`cudaDeviceGetP2PAtomicCapabilities`], cuDeviceGeHostAtomicCapabilities.
    ///
    /// # Parameters
    ///
    /// - `capabilities`: Returned capability details of each requested operation.
    /// - `operations`: Requested operations.
    /// - `count`: Count of requested operations and size of capabilities.
    pub fn cudaDeviceGetHostAtomicCapabilities(
        capabilities: *mut ::core::ffi::c_uint,
        operations: *const cudaAtomicOperation,
        count: ::core::ffi::c_uint,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuDeviceGetDefaultMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1gc8bca3c97a78816303b8aa5773b741f2), [`cudaMallocAsync`], [`cudaMemPoolTrimTo`], [`cudaMemPoolGetAttribute`], [`cudaDeviceSetMemPool`], [`cudaMemPoolSetAttribute`], [`cudaMemPoolSetAccess`].
    pub fn cudaDeviceGetDefaultMemPool(
        memPool: *mut cudaMemPool_t,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the current memory pool of a device.
    ///
    /// The memory pool must be local to the specified device. Unless a mempool is specified in the [`cudaMallocAsync`] call, [`cudaMallocAsync`] 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 [`cudaMallocFromPoolAsync`] to specify asynchronous allocations from a device different than the one the stream runs on.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuDeviceSetMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1g4f2f276b84d9c2eaefdc76d6274db4a0), [`cudaDeviceGetMemPool`], [`cudaDeviceGetDefaultMemPool`], [`cudaMemPoolCreate`], [`cudaMemPoolDestroy`], [`cudaMallocFromPoolAsync`].
    pub fn cudaDeviceSetMemPool(
        device: ::core::ffi::c_int,
        memPool: cudaMemPool_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Gets the current mempool for a device.
    ///
    /// Returns the last pool provided to [`cudaDeviceSetMemPool`] for this device or the device's default memory pool if [`cudaDeviceSetMemPool`] 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](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1g4f2f276b84d9c2eaefdc76d6274db4a0) or [`cudaDeviceSetMemPool`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuDeviceGetMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1gdf186e9559d53a5eb18e572d48c1121b), [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceSetMemPool`].
    pub fn cudaDeviceGetMemPool(
        memPool: *mut cudaMemPool_t,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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 that matches this device's capabilities.
    ///
    /// If NvSciSyncAttrKey_RequiredPerm field in nvSciSyncAttrList is already set this API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// The applications should set nvSciSyncAttrList to a valid NvSciSyncAttrList failing which this API will return cudaErrorInvalidHandle.
    ///
    /// The flags controls how applications intends to use the NvSciSync created from the nvSciSyncAttrList. The valid flags are:
    ///
    /// * `cudaNvSciSyncAttrSignal`, specifies that the applications intends to signal an NvSciSync on this CUDA device.
    /// * `cudaNvSciSyncAttrWait`, 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 [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c). 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 `cudaNvSciSyncAttrSignal` is set in flags.
    /// * NvSciSyncAccessPerm_WaitOnly if `cudaNvSciSyncAttrWait` is set in flags.
    /// * NvSciSyncAccessPerm_WaitSignal if both `cudaNvSciSyncAttrWait` and `cudaNvSciSyncAttrSignal` 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 in [cudaDeviceProp.uuid](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_1626c20637498c7be1381db55a6261308) from cudaDeviceGetProperties for this device.
    ///
    /// [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591), [cudaErrorDeviceUninitialized](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00389e95927732f0d5a68151c72296581504), [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c), cudaErrorInvalidHandle, [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a), [cudaErrorNotSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038d846fd9f2e8ba5e2fb4f1695b7ab6164), [cudaErrorMemoryAllocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f210f50ae7f17f655e0504929606add9)
    ///
    /// **See also:**
    ///
    /// [`cudaImportExternalSemaphore`], [`cudaDestroyExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `nvSciSyncAttrList`: Return NvSciSync attributes supported.
    /// - `device`: Valid CUDA Device to get NvSciSync attributes for.
    /// - `flags`: flags describing NvSciSync usage.
    pub fn cudaDeviceGetNvSciSyncAttributes(
        nvSciSyncAttrList: *mut ::core::ffi::c_void,
        device: ::core::ffi::c_int,
        flags: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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:
    ///
    /// * [cudaDevP2PAttrPerformanceRank](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2f597e2acceab33f60bd61c41fea0c1bdca8430f659738ac2ebfbfc4e0899d3b): A relative value indicating the performance of the link between two devices. Lower value means better performance (0 being
    ///   the value used for most performant link).
    /// * [cudaDevP2PAttrAccessSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2f597e2acceab33f60bd61c41fea0c1b0fa6e51b6472b6ea6ea0cd27fea05a3c): 1 if peer access is enabled.
    /// * [cudaDevP2PAttrNativeAtomicSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2f597e2acceab33f60bd61c41fea0c1b8513982962e4439fa60f2a24348be587): 1 if all native atomic operations over the link are supported.
    /// * [cudaDevP2PAttrCudaArrayAccessSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2f597e2acceab33f60bd61c41fea0c1bc11dffbfb7a6d8872dfaeca4b971c11e): 1 if accessing CUDA arrays over the link is supported.
    /// * [cudaDevP2PAttrOnlyPartialNativeAtomicSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2f597e2acceab33f60bd61c41fea0c1be2a84f673603b20a1a3c41f2ab96621f): 1 if some CUDA-valid atomic operations over the link are supported. Information about specific operations can be retrieved
    ///   with [`cudaDeviceGetP2PAtomicCapabilities`].
    ///
    /// Returns [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a) if srcDevice or dstDevice are not valid or if they represent the same device.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceEnablePeerAccess`], [`cudaDeviceDisablePeerAccess`], [`cudaDeviceCanAccessPeer`], [cuDeviceGetP2PAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__PEER__ACCESS.html#group__CUDA__PEER__ACCESS_1g4c55c60508f8eba4546b51f2ee545393) [`cudaDeviceGetP2PAtomicCapabilities`].
    ///
    /// # Parameters
    ///
    /// - `value`: Returned value of the requested attribute.
    /// - `srcDevice`: The source device of the target link.
    /// - `dstDevice`: The destination device of the target link.
    pub fn cudaDeviceGetP2PAttribute(
        value: *mut ::core::ffi::c_int,
        attr: cudaDeviceP2PAttr,
        srcDevice: ::core::ffi::c_int,
        dstDevice: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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 [`cudaAtomicOperation`] in \*operations, the corresponding result in \*capabilities will be a bitmask indicating which of `cudaAtomicOperationCapability` the link supports natively.
    ///
    /// Returns [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a) if srcDevice or dstDevice are not valid or if they represent the same device.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) 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:**
    ///
    /// [`cudaDeviceGetP2PAttribute`], [cuDeviceGetP2PAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__PEER__ACCESS.html#group__CUDA__PEER__ACCESS_1g4c55c60508f8eba4546b51f2ee545393), [cuDeviceGetP2PAtomicCapabilities](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__PEER__ACCESS.html#group__CUDA__PEER__ACCESS_1gfd989876c8fd3291b520c0b561d5282d).
    ///
    /// # 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 cudaDeviceGetP2PAtomicCapabilities(
        capabilities: *mut ::core::ffi::c_uint,
        operations: *const cudaAtomicOperation,
        count: ::core::ffi::c_uint,
        srcDevice: ::core::ffi::c_int,
        dstDevice: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Select compute-device which best matches criteria.
    ///
    /// Returns in \*device the device which has properties that best match \*prop.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaSetDevice`], [`cudaGetDeviceProperties`], [`cudaInitDevice`].
    ///
    /// # Parameters
    ///
    /// - `device`: Device with best match.
    /// - `prop`: Desired device properties.
    pub fn cudaChooseDevice(
        device: *mut ::core::ffi::c_int,
        prop: *const cudaDeviceProp,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Initialize device to be used for GPU executions.
    ///
    /// This function will initialize the CUDA Runtime structures and primary context on device when called, but the context will not be made current to device.
    ///
    /// When `cudaInitDeviceFlagsAreValid` is set in flags, deviceFlags are applied to the requested device. The values of deviceFlags match those of the flags parameters in [`cudaSetDeviceFlags`]. The effect may be verified by [`cudaGetDeviceFlags`].
    ///
    /// This function will return an error if the device is in [`cudaComputeMode::cudaComputeModeExclusiveProcess`] and is occupied by another process or if the device is in [`cudaComputeMode::cudaComputeModeProhibited`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaGetDeviceProperties`], [`cudaChooseDevice`], [`cudaSetDevice`].
    ///
    /// # Parameters
    ///
    /// - `device`: Device on which the runtime will initialize itself.
    /// - `deviceFlags`: Parameters for device operation.
    /// - `flags`: Flags for controlling the device initialization.
    pub fn cudaInitDevice(
        device: ::core::ffi::c_int,
        deviceFlags: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Set device to be used for GPU executions.
    ///
    /// Sets device as the current device for the calling host thread. Valid device id's are 0 to ([`cudaGetDeviceCount`] - 1).
    ///
    /// Any device memory subsequently allocated from this host thread using [`cudaMalloc`], [`cudaMallocPitch`] or [`cudaMallocArray`] will be physically resident on device. Any host memory allocated from this host thread using [`cudaMallocHost`] or [`cudaHostAlloc`] or [`cudaHostRegister`] will have its lifetime associated with device. Any streams or events created from this host thread will be associated with device. Any kernels launched from this host thread using the &lt;&lt;&lt;>>> operator or [`cudaLaunchKernel`] will be executed on device.
    ///
    /// This call may be made from any host thread, to any device, and at any time. This function will do no synchronization with
    /// the previous or new device, and should only take significant time when it initializes the runtime's context state. This call
    /// will bind the primary context of the specified device to the calling thread and all the subsequent memory allocations, stream
    /// and event creations, and kernel launches will be associated with the primary context. This function will also immediately
    /// initialize the runtime state on the primary context, and the context will be current on device immediately. This function will return an error if the device is in [`cudaComputeMode::cudaComputeModeExclusiveProcess`] and is occupied by another process or if the device is in [`cudaComputeMode::cudaComputeModeProhibited`].
    ///
    /// It is not required to call [`cudaInitDevice`] before using this function.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaGetDeviceProperties`], [`cudaChooseDevice`], [`cudaInitDevice`], [cuCtxSetCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1gbe562ee6258b4fcc272ca6478ca2a2f7).
    ///
    /// # Parameters
    ///
    /// - `device`: Device on which the active host thread should execute the device code.
    pub fn cudaSetDevice(device: ::core::ffi::c_int) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns which device is currently being used.
    ///
    /// Returns in \*device the current device for the calling host thread.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceCount`], [`cudaSetDevice`], [`cudaGetDeviceProperties`], [`cudaChooseDevice`], [cuCtxGetCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g8f13165846b73750693640fb3e8380d0).
    ///
    /// # Parameters
    ///
    /// - `device`: Returns the device on which the active host thread executes the device code.
    pub fn cudaGetDevice(device: *mut ::core::ffi::c_int) -> cudaError_t;
}
unsafe extern "C" {
    /// Set a list of devices that can be used for CUDA.
    ///
    /// Sets a list of devices for CUDA execution in priority order using device_arr. The parameter len specifies the number of elements in the list. CUDA will try devices from the list sequentially until it finds one that works.
    /// If this function is not called, or if it is called with a len of 0, then CUDA will go back to its default behavior of trying devices sequentially from a default list containing all of
    /// the available CUDA devices in the system. If a specified device ID in the list does not exist, this function will return [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a). If len is not 0 and device_arr is NULL or if len exceeds the number of devices in the system, then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceCount`], [`cudaSetDevice`], [`cudaGetDeviceProperties`], [`cudaSetDeviceFlags`], [`cudaChooseDevice`].
    ///
    /// # Parameters
    ///
    /// - `device_arr`: List of devices to try.
    /// - `len`: Number of devices in specified list.
    pub fn cudaSetValidDevices(
        device_arr: *mut ::core::ffi::c_int,
        len: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets flags to be used for device executions.
    ///
    /// Records flags as the flags for the current device. If the current device has been set and that device has already been initialized, the
    /// previous flags are overwritten. If the current device has not been initialized, it is initialized with the provided flags.
    /// If no device has been made current to the calling thread, a default device is selected and initialized with the provided flags.
    ///
    /// The three LSBs of the flags parameter can be used to control how the CPU thread interacts with the OS scheduler when waiting for results from the device.
    ///
    /// * `cudaDeviceScheduleAuto`: 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 device, otherwise CUDA will not yield while waiting for results
    ///   and actively spin on the processor. Additionally, on Tegra devices, `cudaDeviceScheduleAuto` uses a heuristic based on the power profile of the platform and may choose `cudaDeviceScheduleBlockingSync` for low-powered devices.
    /// * `cudaDeviceScheduleSpin`: Instruct CUDA to actively spin when waiting for results from the device. This can decrease latency when waiting for the
    ///   device, but may lower the performance of CPU threads if they are performing work in parallel with the CUDA thread.
    /// * `cudaDeviceScheduleYield`: Instruct CUDA to yield its thread when waiting for results from the device. This can increase latency when waiting for the
    ///   device, but can increase the performance of CPU threads performing work in parallel with the device.
    /// * `cudaDeviceScheduleBlockingSync`: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the device to finish work.
    /// * `cudaDeviceBlockingSync`: Instruct CUDA to block the CPU thread on a synchronization primitive when waiting for the device to finish work.
    ///
    ///   [Deprecated:](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/deprecated.html#deprecated) This flag was deprecated as of CUDA 4.0 and replaced with `cudaDeviceScheduleBlockingSync`.
    /// * `cudaDeviceMapHost`: This flag enables allocating pinned host memory that is accessible to the device. It is implicit for the runtime but may
    ///   be absent if a context is created using the driver API. If this flag is not set, [`cudaHostGetDevicePointer`] will always return a failure code.
    /// * `cudaDeviceLmemResizeToMax`: 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:](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/deprecated.html#deprecated) This flag is deprecated and the behavior enabled by this flag is now the default and cannot be disabled.
    /// * `cudaDeviceSyncMemops`: 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceFlags`], [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaGetDeviceProperties`], [`cudaSetDevice`], [`cudaSetValidDevices`], [`cudaInitDevice`], [`cudaChooseDevice`], [cuDevicePrimaryCtxSetFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__PRIMARY__CTX.html#group__CUDA__PRIMARY__CTX_1gd779a84f17acdad0d9143d9fe719cfdf).
    ///
    /// # Parameters
    ///
    /// - `flags`: Parameters for device operation.
    pub fn cudaSetDeviceFlags(flags: ::core::ffi::c_uint) -> cudaError_t;
}
unsafe extern "C" {
    /// Gets the flags for the current device.
    ///
    /// Returns in flags the flags for the current device. If there is a current device for the calling thread, the flags for the device are returned.
    /// If there is no current device, the flags for the first device are returned, which may be the default flags. Compare to the
    /// behavior of [`cudaSetDeviceFlags`].
    ///
    /// Typically, the flags returned should match the behavior that will be seen if the calling thread uses a device after this call,
    /// without any change to the flags or current device inbetween by this or another thread. Note that if the device is not initialized,
    /// it is possible for another thread to change the flags for the current device before it is initialized. Additionally, when
    /// using exclusive mode, if this thread has not requested a specific device, it may use a device other than the first device,
    /// contrary to the assumption made by this function.
    ///
    /// If a context has been created via the driver API and is current to the calling thread, the flags for that context are always
    /// returned.
    ///
    /// Flags returned by this function may specifically include `cudaDeviceMapHost` even though it is not accepted by [`cudaSetDeviceFlags`] because it is implicit in runtime API flags. The reason for this is that the current context may have been created via the
    /// driver API in which case the flag is not implicit and may be unset.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDevice`], [`cudaGetDeviceProperties`], [`cudaSetDevice`], [`cudaSetDeviceFlags`], [`cudaInitDevice`], [cuCtxGetFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1gf81eef983c1e3b2ef4f166d7a930c86d), [cuDevicePrimaryCtxGetState](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__PRIMARY__CTX.html#group__CUDA__PRIMARY__CTX_1g65f3e018721b6d90aa05cfb56250f469).
    ///
    /// # Parameters
    ///
    /// - `flags`: Pointer to store the device flags.
    pub fn cudaGetDeviceFlags(flags: *mut ::core::ffi::c_uint) -> cudaError_t;
}
unsafe extern "C" {
    /// Create an asynchronous stream.
    ///
    /// Creates a new asynchronous stream on the context that is current to the calling host thread. If no context is current to the
    /// calling host thread, then the primary context for a device is selected, made current to the calling thread, and initialized
    /// before creating a stream on it.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreateWithPriority`], [`cudaStreamCreateWithFlags`], [`cudaStreamGetPriority`], [`cudaStreamGetFlags`], [`cudaStreamGetDevice`], [`cudaStreamGetDevResource`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamAddCallback`], [`cudaSetDevice`], [`cudaStreamDestroy`], [cuStreamCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4).
    ///
    /// # Parameters
    ///
    /// - `pStream`: Pointer to new stream identifier.
    pub fn cudaStreamCreate(pStream: *mut cudaStream_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Create an asynchronous stream.
    ///
    /// Creates a new asynchronous stream on the context that is current to the calling host thread. If no context is current to the
    /// calling host thread, then the primary context for a device is selected, made current to the calling thread, and initialized
    /// before creating a stream on it. The flags argument determines the behaviors of the stream. Valid values for flags are
    ///
    /// * [`cudaStreamDefault`]: Default stream creation flag.
    /// * [`cudaStreamNonBlocking`]: 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamCreateWithPriority`], [`cudaStreamGetFlags`], [`cudaStreamGetDevice`], [`cudaStreamGetDevResource`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamAddCallback`], [`cudaSetDevice`], [`cudaStreamDestroy`], [cuStreamCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4).
    ///
    /// # Parameters
    ///
    /// - `pStream`: Pointer to new stream identifier.
    /// - `flags`: Parameters for stream creation.
    pub fn cudaStreamCreateWithFlags(
        pStream: *mut cudaStream_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Create an asynchronous stream with the specified priority.
    ///
    /// Creates a stream with the specified priority and returns a handle in pStream. The stream is created on the context that is current to the calling host thread. If no context is current to the calling
    /// host thread, then the primary context for a device is selected, made current to the calling thread, and initialized before
    /// creating a stream on it. 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 [`cudaDeviceGetStreamPriorityRange`]. If the specified priority is outside the numerical range returned by [`cudaDeviceGetStreamPriorityRange`], 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * 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:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaDeviceGetStreamPriorityRange`], [`cudaStreamGetPriority`], [`cudaStreamQuery`], [`cudaStreamWaitEvent`], [`cudaStreamAddCallback`], [`cudaStreamSynchronize`], [`cudaSetDevice`], [`cudaStreamDestroy`], [cuStreamCreateWithPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471).
    ///
    /// # Parameters
    ///
    /// - `pStream`: Pointer to new stream identifier.
    /// - `flags`: Flags for stream creation. See [`cudaStreamCreateWithFlags`] for a list of valid flags that can be passed.
    /// - `priority`: Priority of the stream. Lower numbers represent higher priorities. See [`cudaDeviceGetStreamPriorityRange`] for more information about the meaningful stream priorities that can be passed.
    pub fn cudaStreamCreateWithPriority(
        pStream: *mut cudaStream_t,
        flags: ::core::ffi::c_uint,
        priority: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Query the priority of a stream.
    ///
    /// Query the priority of a stream. The priority is returned in in priority. Note that if the stream was created with a priority outside the meaningful numerical range returned by [`cudaDeviceGetStreamPriorityRange`], this function returns the clamped priority. See [`cudaStreamCreateWithPriority`] for details about priority clamping.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreateWithPriority`], [`cudaDeviceGetStreamPriorityRange`], [`cudaStreamGetFlags`], [`cudaStreamGetDevice`], [`cudaStreamGetDevResource`], [cuStreamGetPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g5bd5cb26915a2ecf1921807339488484).
    ///
    /// # 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 cudaStreamGetPriority(
        hStream: cudaStream_t,
        priority: *mut ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Query the flags of a stream.
    ///
    /// Query the flags of a stream. The flags are returned in flags. See [`cudaStreamCreateWithFlags`] for a list of valid flags.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreateWithPriority`], [`cudaStreamCreateWithFlags`], [`cudaStreamGetPriority`], [`cudaStreamGetDevice`], [cuStreamGetFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g4d39786855a6bed01215c1907fbbfbb7).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `flags`: Pointer to an unsigned integer in which the stream's flags are returned.
    pub fn cudaStreamGetFlags(
        hStream: cudaStream_t,
        flags: *mut ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Query the Id of a stream.
    ///
    /// Query the Id of a stream. The Id is returned in streamId. 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 runtime APIs such as [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`] and [`cudaStreamCreateWithPriority`], or their driver API equivalents such as [cuStreamCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1ga581f0c5833e21ded8b5a56594e243f4) or [cuStreamCreateWithPriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g95c1a8c7c3dacb13091692dd9c7f7471). Passing an invalid handle will result in undefined behavior.
    /// * any of the special streams such as the NULL stream, `cudaStreamLegacy` and `cudaStreamPerThread` respectively. The driver API equivalents of these are also accepted which are NULL, [CU_STREAM_LEGACY](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1ga53e8210837f039dd6434a3a4c3324aa) and [CU_STREAM_PER_THREAD](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1g02e40b82600f62c42ed29abb150f857c).
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreateWithPriority`], [`cudaStreamCreateWithFlags`], [`cudaStreamGetPriority`], [`cudaStreamGetFlags`], [cuStreamGetId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g5dafd2b6f48caeb13d5110a7f21e60e3).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `streamId`: Pointer to an unsigned long long in which the stream Id is returned.
    pub fn cudaStreamGetId(
        hStream: cudaStream_t,
        streamId: *mut ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Query the device of a stream.
    ///
    /// Returns in \*device the device of the stream.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaSetDevice`], [`cudaGetDevice`], [`cudaStreamCreate`], [`cudaStreamGetPriority`], [`cudaStreamGetFlags`], [cuStreamGetId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g5dafd2b6f48caeb13d5110a7f21e60e3).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Handle to the stream to be queried.
    /// - `device`: Returns the device to which the stream belongs.
    pub fn cudaStreamGetDevice(
        hStream: cudaStream_t,
        device: *mut ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Resets all persisting lines in cache to normal status.
    ///
    /// 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:**
    ///
    /// [`cudaAccessPolicyWindow`].
    pub fn cudaCtxResetPersistingL2Cache() -> cudaError_t;
}
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:**
    ///
    /// [`cudaAccessPolicyWindow`].
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination stream.
    /// - `src`: Source stream For attributes see cudaStreamAttrID.
    pub fn cudaStreamCopyAttributes(dst: cudaStream_t, src: cudaStream_t) -> cudaError_t;
}
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:**
    ///
    /// [`cudaAccessPolicyWindow`].
    pub fn cudaStreamGetAttribute(
        hStream: cudaStream_t,
        attr: cudaLaunchAttributeID,
        value_out: *mut cudaLaunchAttributeValue,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaAccessPolicyWindow`].
    pub fn cudaStreamSetAttribute(
        hStream: cudaStream_t,
        attr: cudaLaunchAttributeID,
        value: *const cudaLaunchAttributeValue,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Destroys and cleans up an asynchronous stream.
    ///
    /// Destroys and cleans up the asynchronous stream specified by stream.
    ///
    /// In case the device is still doing work in the stream stream when [`cudaStreamDestroy`] is called, the function will return immediately and the resources associated with stream will be released automatically once the device has completed all work in stream.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamQuery`], [`cudaStreamWaitEvent`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`], [cuStreamDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g244c8833de4596bcd31a06cdf21ee758).
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream identifier.
    pub fn cudaStreamDestroy(stream: cudaStream_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Make a compute stream wait on an event.
    ///
    /// Makes all future work submitted to stream wait for all work captured in event. See [`cudaEventRecord`] for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable.
    /// event may be from a different device than stream.
    ///
    /// flags include:
    ///
    /// * `cudaEventWaitDefault`: Default event creation flag.
    /// * `cudaEventWaitExternal`: Event is captured in the graph as an external event node when performing stream capture.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`], [`cudaStreamDestroy`], [cuStreamWaitEvent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g6a898b652dfc6aa1d5c8d97062618b2f).
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream to wait.
    /// - `event`: Event to wait on.
    /// - `flags`: Parameters for the operation(See above).
    pub fn cudaStreamWaitEvent(
        stream: cudaStream_t,
        event: cudaEvent_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
/// Type of stream callback functions.
pub type cudaStreamCallback_t = ::core::option::Option<
    unsafe extern "C" fn(
        stream: cudaStream_t,
        status: cudaError_t,
        userData: *mut ::core::ffi::c_void,
    ),
>;
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 [`cudaLaunchHostFunc`]. Additionally, this function is not supported with [`cudaStreamBeginCapture`] and [`cudaStreamEndCapture`], unlike [`cudaLaunchHostFunc`].
    ///
    /// Adds a callback to be called on the host after all currently enqueued items in the stream have completed. For each cudaStreamAddCallback
    /// call, a callback will be executed exactly once. The callback will block later work in the stream until it is finished.
    ///
    /// The callback may be passed [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) or an error code. In the event of a device error, all subsequently executed callbacks will receive an appropriate `cudaError_t`.
    ///
    /// Callbacks must not make any CUDA API calls. Attempting to use CUDA APIs may result in [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3). 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 callbacks have executed.
    ///   Thus, for example, a callback might use global attached memory even if work has been added to another stream, if it has been
    ///   properly ordered 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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamDestroy`], [`cudaMallocManaged`], [`cudaStreamAttachMemAsync`], [`cudaLaunchHostFunc`], [cuStreamAddCallback](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483).
    ///
    /// # Parameters
    ///
    /// - `stream`: 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 cudaStreamAddCallback(
        stream: cudaStream_t,
        callback: cudaStreamCallback_t,
        userData: *mut ::core::ffi::c_void,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Waits for stream tasks to complete.
    ///
    /// Blocks until stream has completed all operations. If the `cudaDeviceScheduleBlockingSync` flag was set for this device, the host 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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamQuery`], [`cudaStreamWaitEvent`], [`cudaStreamAddCallback`], [`cudaStreamDestroy`], [cuStreamSynchronize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g15e49dd91ec15991eb7c0a741beb7dad).
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream identifier.
    pub fn cudaStreamSynchronize(stream: cudaStream_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Queries an asynchronous stream for completion status.
    ///
    /// Returns [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) if all operations in stream have completed, or [cudaErrorNotReady](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038285d0c852ab65b8925505e1065563f6d) if not.
    ///
    /// For the purposes of Unified Memory, a return value of [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) is equivalent to having called [`cudaStreamSynchronize`].
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamCreateWithFlags`], [`cudaStreamWaitEvent`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`], [`cudaStreamDestroy`], [cuStreamQuery](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g1b0d24bbe97fa68e4bc511fb6adfeb0b).
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream identifier.
    pub fn cudaStreamQuery(stream: cudaStream_t) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `stream`: Stream in which to enqueue the attach operation.
    /// - `devPtr`: Pointer to memory (must be a pointer to managed memory or to a valid host-accessible region of system-allocated memory).
    /// - `length`: Length of memory (defaults to zero).
    /// - `flags`: Must be one of `cudaMemAttachGlobal`, `cudaMemAttachHost` or `cudaMemAttachSingle` (defaults to `cudaMemAttachSingle`).
    pub fn cudaStreamAttachMemAsync(
        stream: cudaStream_t,
        devPtr: *mut ::core::ffi::c_void,
        length: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Begins graph capture on a stream.
    ///
    /// Begin graph capture on stream. 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 [`cudaStreamEndCapture`]. Capture may not be initiated if stream is `cudaStreamLegacy`. 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 [`cudaStreamIsCapturing`]. A unique id representing the capture sequence may be queried via [`cudaStreamGetCaptureInfo`].
    ///
    /// If mode is not cudaStreamCaptureModeRelaxed, [`cudaStreamEndCapture`] 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:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamIsCapturing`], [`cudaStreamEndCapture`], [`cudaThreadExchangeStreamCaptureMode`].
    ///
    /// # Parameters
    ///
    /// - `stream`: 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
    /// [`cudaThreadExchangeStreamCaptureMode`].
    pub fn cudaStreamBeginCapture(
        stream: cudaStream_t,
        mode: cudaStreamCaptureMode,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Begins graph capture on a stream to an existing graph.
    ///
    /// Begin graph capture on stream. When a stream is in capture mode, all operations pushed into the stream will not be executed, but will instead be captured
    /// into graph, which will be returned via [`cudaStreamEndCapture`].
    ///
    /// Capture may not be initiated if stream is `cudaStreamLegacy`. 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 [`cudaStreamIsCapturing`]. A unique id representing the capture sequence may be queried via [`cudaStreamGetCaptureInfo`].
    ///
    /// If mode is not cudaStreamCaptureModeRelaxed, [`cudaStreamEndCapture`] 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:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamIsCapturing`], [`cudaStreamEndCapture`], [`cudaThreadExchangeStreamCaptureMode`].
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream in which to initiate capture.
    /// - `graph`: 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
    /// [`cudaThreadExchangeStreamCaptureMode`].
    pub fn cudaStreamBeginCaptureToGraph(
        stream: cudaStream_t,
        graph: cudaGraph_t,
        dependencies: *const cudaGraphNode_t,
        dependencyData: *const cudaGraphEdgeData,
        numDependencies: size_t,
        mode: cudaStreamCaptureMode,
    ) -> cudaError_t;
}
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
    /// cudaStreamCaptureMode mode = desiredMode;
    /// cudaThreadExchangeStreamCaptureMode(&mode);
    /// ...
    /// cudaThreadExchangeStreamCaptureMode(&mode); // restore previous mode
    /// ```
    ///
    /// During stream capture (see [`cudaStreamBeginCapture`]), some actions, such as a call to [`cudaMalloc`], may be unsafe. In the case of [`cudaMalloc`], the operation is not enqueued asynchronously to a stream, and is not observed by stream capture. Therefore, if the sequence
    /// of operations captured via [`cudaStreamBeginCapture`] 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 [`cudaStreamBeginCapture`]-[`cudaStreamEndCapture`] sequence. This behavior can be controlled via this API and flags to [`cudaStreamBeginCapture`].
    ///
    /// A thread's mode is one of the following:
    ///
    /// * cudaStreamCaptureModeGlobal: This is the default mode. If the local thread has an ongoing capture sequence that was not initiated with cudaStreamCaptureModeRelaxed at cuStreamBeginCapture, or if any other thread has a concurrent capture sequence initiated with cudaStreamCaptureModeGlobal, this thread is prohibited from potentially unsafe API calls.
    /// * cudaStreamCaptureModeThreadLocal: If the local thread has an ongoing capture sequence not initiated with cudaStreamCaptureModeRelaxed, it is prohibited from potentially unsafe API calls. Concurrent capture sequences in other threads are ignored.
    /// * cudaStreamCaptureModeRelaxed: 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 [`cudaEventQuery`] 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:**
    ///
    /// [`cudaStreamBeginCapture`].
    ///
    /// # Parameters
    ///
    /// - `mode`: Pointer to mode value to swap with the current mode.
    pub fn cudaThreadExchangeStreamCaptureMode(
        mode: *mut cudaStreamCaptureMode,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Ends capture on a stream, returning the captured graph.
    ///
    /// End capture on stream, returning the captured graph via pGraph. Capture must have been initiated on stream via a call to [`cudaStreamBeginCapture`]. 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 [`cudaStreamBeginCapture`] was not cudaStreamCaptureModeRelaxed, this call must be from the same thread as [`cudaStreamBeginCapture`].
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamBeginCapture`], [`cudaStreamIsCapturing`], [`cudaGraphDestroy`].
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream to query.
    /// - `pGraph`: The captured graph.
    pub fn cudaStreamEndCapture(
        stream: cudaStream_t,
        pGraph: *mut cudaGraph_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a stream's capture status.
    ///
    /// Return the capture status of stream via pCaptureStatus. After a successful call, \*pCaptureStatus will contain one of the following:
    ///
    /// * [cudaStreamCaptureStatusNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg0ec4aacc66fe76c145252d12b189e233dbbe6269245e62cd99e6c95206008e50): The stream is not capturing.
    /// * [cudaStreamCaptureStatusActive](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg0ec4aacc66fe76c145252d12b189e233b165b0917377d0d7283ca5ac8013568b): The stream is capturing.
    /// * [cudaStreamCaptureStatusInvalidated](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg0ec4aacc66fe76c145252d12b189e2334c61e87e6268a6f9b6c928c574c12c76): The stream was capturing but an error has invalidated the capture sequence. The capture sequence must be terminated with
    ///   [`cudaStreamEndCapture`] on the stream where it was initiated in order to continue using stream.
    ///
    /// Note that, if this is called on `cudaStreamLegacy` (the "null stream") while a blocking stream on the same device is capturing, it will return [cudaErrorStreamCaptureImplicit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038cf775033deb76dbde57b8df7bd9244e7) and \*pCaptureStatus 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:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamBeginCapture`], [`cudaStreamEndCapture`].
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream to query.
    /// - `pCaptureStatus`: Returns the stream's capture status.
    pub fn cudaStreamIsCapturing(
        stream: cudaStream_t,
        pCaptureStatus: *mut cudaStreamCaptureStatus,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Query a stream's capture state.
    ///
    /// Query stream state related to stream capture.
    ///
    /// If called on `cudaStreamLegacy` (the "null stream") while a stream not created with [`cudaStreamNonBlocking`] is capturing, returns [cudaErrorStreamCaptureImplicit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038cf775033deb76dbde57b8df7bd9244e7).
    ///
    /// Valid data (other than capture status) is returned only if both of the following are true:
    ///
    /// * the call returns cudaSuccess
    /// * the returned capture status is [cudaStreamCaptureStatusActive](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg0ec4aacc66fe76c145252d12b189e233b165b0917377d0d7283ca5ac8013568b)
    ///
    /// 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 [cudaErrorLossyQuery](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038d484d9d8e8f269cf93d4c111b646f908).
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamBeginCapture`], [`cudaStreamIsCapturing`], [`cudaStreamUpdateCaptureDependencies`].
    ///
    /// # Parameters
    ///
    /// - `stream`: 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 [`cudaStreamEndCapture`]. 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 [`cudaStreamEndCapture`] due to direct actions on the graph do not trigger [cudaErrorStreamCaptureUnjoined](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce9e4b4b58c1abf9faa1ce8b1079076d).
    /// - `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 cudaStreamGetCaptureInfo(
        stream: cudaStream_t,
        captureStatus_out: *mut cudaStreamCaptureStatus,
        id_out: *mut ::core::ffi::c_ulonglong,
        graph_out: *mut cudaGraph_t,
        dependencies_out: *mut *const cudaGraphNode_t,
        edgeData_out: *mut *const cudaGraphEdgeData,
        numDependencies_out: *mut size_t,
    ) -> cudaError_t;
}
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.
    ///
    /// Valid flags are [`cudaStreamUpdateCaptureDependenciesFlags::cudaStreamAddCaptureDependencies`] and [`cudaStreamUpdateCaptureDependenciesFlags::cudaStreamSetCaptureDependencies`]. 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 [`cudaStreamUpdateCaptureDependenciesFlags::cudaStreamAddCaptureDependencies`].
    ///
    /// Nodes that are removed from the dependency set via this API do not result in [cudaErrorStreamCaptureUnjoined](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce9e4b4b58c1abf9faa1ce8b1079076d) if they are unreachable from the stream at [`cudaStreamEndCapture`].
    ///
    /// Returns [cudaErrorIllegalState](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00380604022302a2ed15d31bc33546b2e963) if the stream is not capturing.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamBeginCapture`], [`cudaStreamGetCaptureInfo`],.
    ///
    /// # Parameters
    ///
    /// - `stream`: 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 cudaStreamUpdateCaptureDependencies(
        stream: cudaStream_t,
        dependencies: *mut cudaGraphNode_t,
        dependencyData: *const cudaGraphEdgeData,
        numDependencies: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `event`: Newly created event.
    pub fn cudaEventCreate(event: *mut cudaEvent_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates an event object with the specified flags.
    ///
    /// Creates an event object for the current device with the specified flags. Valid flags include:
    ///
    /// * `cudaEventDefault`: Default event creation flag.
    /// * `cudaEventBlockingSync`: Specifies that event should use blocking synchronization. A host thread that uses [`cudaEventSynchronize`] to wait on an event created with this flag will block until the event actually completes.
    /// * `cudaEventDisableTiming`: Specifies that the created event does not need to record timing data. Events created with this flag specified and the `cudaEventBlockingSync` flag not specified will provide the best performance when used with [`cudaStreamWaitEvent`] and [`cudaEventQuery`].
    /// * `cudaEventInterprocess`: Specifies that the created event may be used as an interprocess event by [`cudaIpcGetEventHandle`]. `cudaEventInterprocess` must be specified along with `cudaEventDisableTiming`.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// cudaEventCreate ( C API), [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cudaStreamWaitEvent`], [cuEventCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1g450687e75f3ff992fe01662a43d9d3db).
    ///
    /// # Parameters
    ///
    /// - `event`: Newly created event.
    /// - `flags`: Flags for new event.
    pub fn cudaEventCreateWithFlags(
        event: *mut cudaEvent_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Records an event.
    ///
    /// Captures in event the contents of stream at the time of this call. event and stream must be on the same CUDA context. Calls such as [`cudaEventQuery`] or [`cudaStreamWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of stream after this call do not modify event. See note on default stream behavior for what is captured in the default case.
    ///
    /// [`cudaEventRecord`] can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as [`cudaStreamWaitEvent`] use the most recently captured state at the time of the API call, and are not affected by later calls to [`cudaEventRecord`]. Before the first call to [`cudaEventRecord`], an event represents an empty set of work, so for example [`cudaEventQuery`] would return [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591).
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Returns [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) in the event of being passed NULL as the input event.
    ///
    /// **See also:**
    ///
    /// cudaEventCreate ( C API), [`cudaEventCreateWithFlags`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cudaStreamWaitEvent`], [`cudaEventRecordWithFlags`], [cuEventRecord](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1g95424d3be52c4eb95d83861b70fb89d1).
    ///
    /// # Parameters
    ///
    /// - `event`: Event to record.
    /// - `stream`: Stream in which to record event.
    pub fn cudaEventRecord(event: cudaEvent_t, stream: cudaStream_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Records an event.
    ///
    /// Captures in event the contents of stream at the time of this call. event and stream must be on the same CUDA context. Calls such as [`cudaEventQuery`] or [`cudaStreamWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of stream after this call do not modify event. See note on default stream behavior for what is captured in the default case.
    ///
    /// [`cudaEventRecordWithFlags`] can be called multiple times on the same event and will overwrite the previously captured state. Other APIs such as [`cudaStreamWaitEvent`] use the most recently captured state at the time of the API call, and are not affected by later calls to [`cudaEventRecordWithFlags`]. Before the first call to [`cudaEventRecordWithFlags`], an event represents an empty set of work, so for example [`cudaEventQuery`] would return [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591).
    ///
    /// flags include:
    ///
    /// * [`cudaEventRecordDefault`]: Default event creation flag.
    /// * [`cudaEventRecordExternal`]: Event is captured in the graph as an external event node when performing stream capture.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Returns [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) in the event of being passed NULL as the input event.
    ///
    /// **See also:**
    ///
    /// cudaEventCreate ( C API), [`cudaEventCreateWithFlags`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [`cudaStreamWaitEvent`], [`cudaEventRecord`], [cuEventRecord](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1g95424d3be52c4eb95d83861b70fb89d1),.
    ///
    /// # Parameters
    ///
    /// - `event`: Event to record.
    /// - `stream`: Stream in which to record event.
    /// - `flags`: Parameters for the operation(See above).
    pub fn cudaEventRecordWithFlags(
        event: cudaEvent_t,
        stream: cudaStream_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Queries an event's status.
    ///
    /// Queries the status of all work currently captured by event. See [`cudaEventRecord`] for details on what is captured by an event.
    ///
    /// Returns [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) if all captured work has been completed, or [cudaErrorNotReady](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038285d0c852ab65b8925505e1065563f6d) if any captured work is incomplete.
    ///
    /// For the purposes of Unified Memory, a return value of [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) is equivalent to having called [`cudaEventSynchronize`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Returns [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) in the event of being passed NULL as the input event.
    ///
    /// **See also:**
    ///
    /// cudaEventCreate ( C API), [`cudaEventCreateWithFlags`], [`cudaEventRecord`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [cuEventQuery](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1g6f0704d755066b0ee705749ae911deef).
    ///
    /// # Parameters
    ///
    /// - `event`: Event to query.
    pub fn cudaEventQuery(event: cudaEvent_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Waits for an event to complete.
    ///
    /// Waits until the completion of all work currently captured in event. See [`cudaEventRecord`] for details on what is captured by an event.
    ///
    /// Waiting for an event that was created with the `cudaEventBlockingSync` flag will cause the calling CPU thread to block until the event has been completed by the device. If the `cudaEventBlockingSync` 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Returns [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) in the event of being passed NULL as the input event.
    ///
    /// **See also:**
    ///
    /// cudaEventCreate ( C API), [`cudaEventCreateWithFlags`], [`cudaEventRecord`], [`cudaEventQuery`], [`cudaEventDestroy`], [`cudaEventElapsedTime`], [cuEventSynchronize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1g9e520d34e51af7f5375610bca4add99c).
    ///
    /// # Parameters
    ///
    /// - `event`: Event to wait for.
    pub fn cudaEventSynchronize(event: cudaEvent_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Destroys an event object.
    ///
    /// Destroys the event specified by event.
    ///
    /// An event may be destroyed before it is complete (i.e., while [`cudaEventQuery`] would return [cudaErrorNotReady](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038285d0c852ab65b8925505e1065563f6d)). 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    /// * Returns [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) in the event of being passed NULL as the input event.
    ///
    /// **See also:**
    ///
    /// cudaEventCreate ( C API), [`cudaEventCreateWithFlags`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventRecord`], [`cudaEventElapsedTime`], [cuEventDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1g593ec73a8ec5a5fc031311d3e4dca1ef).
    ///
    /// # Parameters
    ///
    /// - `event`: Event to destroy.
    pub fn cudaEventDestroy(event: cudaEvent_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Computes the elapsed time between 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 a elapsed time calculation
    /// only and polling for completion on the events to be compared should be done with [`cudaEventQuery`] 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 [`cudaEventRecord`] 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 [`cudaEventRecord`] has not been called on either event, then [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) is returned. If [`cudaEventRecord`] has been called on both events but one or both of them has not yet been completed (that is, [`cudaEventQuery`] would return [cudaErrorNotReady](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038285d0c852ab65b8925505e1065563f6d) on at least one of the events), [cudaErrorNotReady](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038285d0c852ab65b8925505e1065563f6d) is returned. If either event was created with the `cudaEventDisableTiming` flag, then this function will return [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273).
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Returns [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) in the event of being passed NULL as the input event.
    ///
    /// **See also:**
    ///
    /// cudaEventCreate ( C API), [`cudaEventCreateWithFlags`], [`cudaEventQuery`], [`cudaEventSynchronize`], [`cudaEventDestroy`], [`cudaEventRecord`], [cuEventElapsedTime](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1gdfb1178807353bbcaa9e245da497cf97).
    ///
    /// # Parameters
    ///
    /// - `ms`: Time between start and end in ms.
    /// - `start`: Starting event.
    /// - `end`: Ending event.
    pub fn cudaEventElapsedTime(
        ms: *mut f32,
        start: cudaEvent_t,
        end: cudaEvent_t,
    ) -> cudaError_t;
}
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 [`cudaExternalMemoryHandleDesc`] structure is defined as follows:
    ///
    /// ```text
    /// typedef struct cudaExternalMemoryHandleDesc_st {
    /// cudaExternalMemoryHandleType type;
    /// union {
    /// int fd;
    /// struct {
    /// void *handle;
    /// const void *name;
    /// } win32;
    /// const void *nvSciBufObject;
    /// } handle;
    /// unsigned long long size;
    /// unsigned int flags;
    /// } cudaExternalMemoryHandleDesc;
    /// ```
    ///
    /// where [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) specifies the type of handle being imported. [`cudaExternalMemoryHandleType`] is defined as:
    ///
    /// ```text
    /// typedef enum cudaExternalMemoryHandleType_enum {
    /// cudaExternalMemoryHandleTypeOpaqueFd         = 1,
    /// cudaExternalMemoryHandleTypeOpaqueWin32      = 2,
    /// cudaExternalMemoryHandleTypeOpaqueWin32Kmt   = 3,
    /// cudaExternalMemoryHandleTypeD3D12Heap        = 4,
    /// cudaExternalMemoryHandleTypeD3D12Resource    = 5,
    /// cudaExternalMemoryHandleTypeD3D11Resource    = 6,
    /// cudaExternalMemoryHandleTypeD3D11ResourceKmt = 7,
    /// cudaExternalMemoryHandleTypeNvSciBuf         = 8
    /// } cudaExternalMemoryHandleType;
    /// ```
    ///
    /// If [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeOpaqueFd`], then cudaExternalMemoryHandleDesc::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 [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeOpaqueWin32`], then exactly one of cudaExternalMemoryHandleDesc::handle::win32::handle and cudaExternalMemoryHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalMemoryHandleDesc::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 cudaExternalMemoryHandleDesc::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 [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeOpaqueWin32Kmt`], then cudaExternalMemoryHandleDesc::handle::win32::handle must be non-NULL and cudaExternalMemoryHandleDesc::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 [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D12Heap`], then exactly one of cudaExternalMemoryHandleDesc::handle::win32::handle and cudaExternalMemoryHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalMemoryHandleDesc::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 cudaExternalMemoryHandleDesc::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 [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D12Resource`], then exactly one of cudaExternalMemoryHandleDesc::handle::win32::handle and cudaExternalMemoryHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalMemoryHandleDesc::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 cudaExternalMemoryHandleDesc::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 [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11Resource`],then exactly one of cudaExternalMemoryHandleDesc::handle::win32::handle and cudaExternalMemoryHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalMemoryHandleDesc::handle::win32::handle is not NULL, then it must represent a valid shared
    /// NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a ID3D11Resource object. If cudaExternalMemoryHandleDesc::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 [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11ResourceKmt`], then cudaExternalMemoryHandleDesc::handle::win32::handle must be non-NULL and cudaExternalMemoryHandleDesc::handle::win32::name
    /// must be NULL. The handle specified must be a valid shared KMT handle that is returned by IDXGIResource::GetSharedHandle when
    /// referring to a ID3D11Resource object.
    ///
    /// If [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf`], then cudaExternalMemoryHandleDesc::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 [`cudaWaitExternalSemaphoresAsync`] or [`cudaSignalExternalSemaphoresAsync`] as approprriate barriers to maintain coherence between CUDA and the other drivers. See `cudaExternalSemaphoreWaitSkipNvSciBufMemSync` and `cudaExternalSemaphoreSignalSkipNvSciBufMemSync` for memory synchronization.
    ///
    /// The size of the memory object must be specified in [cudaExternalMemoryHandleDesc::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_1362086a22da90ac8fba1ca294e65548e).
    ///
    /// Specifying the flag `cudaExternalMemoryDedicated` in [cudaExternalMemoryHandleDesc::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_174412d3d2777ebc856aea0b9158aaafa) 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 [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is one of the following: [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D12Resource`][`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11Resource`][`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11ResourceKmt`]
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * 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:**
    ///
    /// [`cudaDestroyExternalMemory`], [`cudaExternalMemoryGetMappedBuffer`], [`cudaExternalMemoryGetMappedMipmappedArray`].
    ///
    /// # Parameters
    ///
    /// - `extMem_out`: Returned handle to an external memory object.
    /// - `memHandleDesc`: Memory import handle descriptor.
    pub fn cudaImportExternalMemory(
        extMem_out: *mut cudaExternalMemory_t,
        memHandleDesc: *const cudaExternalMemoryHandleDesc,
    ) -> cudaError_t;
}
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 [`cudaExternalMemoryBufferDesc`] structure is defined as follows:
    ///
    /// ```text
    /// typedef struct cudaExternalMemoryBufferDesc_st {
    /// unsigned long long offset;
    /// unsigned long long size;
    /// unsigned int flags;
    /// } cudaExternalMemoryBufferDesc;
    /// ```
    ///
    /// where [cudaExternalMemoryBufferDesc::offset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryBufferDesc.html#structcudaExternalMemoryBufferDesc_1034839893ecb4e103f82498888157ba6) is the offset in the memory object where the buffer's base address is. [cudaExternalMemoryBufferDesc::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryBufferDesc.html#structcudaExternalMemoryBufferDesc_156bdddff67c72329350ed4fa4f2cd746) is the size of the buffer. [cudaExternalMemoryBufferDesc::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryBufferDesc.html#structcudaExternalMemoryBufferDesc_10a7888cacfea49ab9b30ae7e9ab47d32) 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 [`cudaFree`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaImportExternalMemory`], [`cudaDestroyExternalMemory`], [`cudaExternalMemoryGetMappedMipmappedArray`].
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Returned device pointer to buffer.
    /// - `extMem`: Handle to external memory object.
    /// - `bufferDesc`: Buffer descriptor.
    pub fn cudaExternalMemoryGetMappedBuffer(
        devPtr: *mut *mut ::core::ffi::c_void,
        extMem: cudaExternalMemory_t,
        bufferDesc: *const cudaExternalMemoryBufferDesc,
    ) -> cudaError_t;
}
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 [`cudaExternalMemoryMipmappedArrayDesc`] is defined as follows:
    ///
    /// ```text
    /// typedef struct cudaExternalMemoryMipmappedArrayDesc_st {
    /// unsigned long long offset;
    /// cudaChannelFormatDesc formatDesc;
    /// cudaExtent extent;
    /// unsigned int flags;
    /// unsigned int numLevels;
    /// } cudaExternalMemoryMipmappedArrayDesc;
    /// ```
    ///
    /// where [cudaExternalMemoryMipmappedArrayDesc::offset](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaExternalMemoryMipmappedArrayDesc_12f9441c3c6e3100f1517ccaf668ffd83) is the offset in the memory object where the base level of the mipmap chain is. [cudaExternalMemoryMipmappedArrayDesc::formatDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaExternalMemoryMipmappedArrayDesc_142333e3049cc4a40213b086be45927e1) describes the format of the data. [cudaExternalMemoryMipmappedArrayDesc::extent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaExternalMemoryMipmappedArrayDesc_1cba41d5152a8458ac72a24e65ee0f3ac) specifies the dimensions of the base level of the mipmap chain. [cudaExternalMemoryMipmappedArrayDesc::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaExternalMemoryMipmappedArrayDesc_1de6d5579b7f13034ea82e06012c8758f) are flags associated with CUDA mipmapped arrays. For further details, please refer to the documentation for [`cudaMalloc3DArray`]. Note that if the mipmapped array is bound as a color target in the graphics API, then the flag `cudaArrayColorAttachment` must be specified in [cudaExternalMemoryMipmappedArrayDesc::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaExternalMemoryMipmappedArrayDesc_1de6d5579b7f13034ea82e06012c8758f). [cudaExternalMemoryMipmappedArrayDesc::numLevels](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaExternalMemoryMipmappedArrayDesc_14a939b3d6c1fca916dd78679049f36eb) specifies the total number of levels in the mipmap chain.
    ///
    /// The returned CUDA mipmapped array must be freed using [`cudaFreeMipmappedArray`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaImportExternalMemory`], [`cudaDestroyExternalMemory`], [`cudaExternalMemoryGetMappedBuffer`]
    ///
    /// Note:
    ///
    /// If [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryHandleDesc.html#structcudaExternalMemoryHandleDesc_18d2b65d3b597280eb9be66ee34c7ee52) is [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf`], then [cudaExternalMemoryMipmappedArrayDesc::numLevels](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaExternalMemoryMipmappedArrayDesc_14a939b3d6c1fca916dd78679049f36eb) must not be greater than 1.
    ///
    /// # Parameters
    ///
    /// - `mipmap`: Returned CUDA mipmapped array.
    /// - `extMem`: Handle to external memory object.
    /// - `mipmapDesc`: CUDA array descriptor.
    pub fn cudaExternalMemoryGetMappedMipmappedArray(
        mipmap: *mut cudaMipmappedArray_t,
        extMem: cudaExternalMemory_t,
        mipmapDesc: *const cudaExternalMemoryMipmappedArrayDesc,
    ) -> cudaError_t;
}
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 [`cudaFree`] and [`cudaFreeMipmappedArray`] respectively.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaImportExternalMemory`], [`cudaExternalMemoryGetMappedBuffer`], [`cudaExternalMemoryGetMappedMipmappedArray`].
    ///
    /// # Parameters
    ///
    /// - `extMem`: External memory object to be destroyed.
    pub fn cudaDestroyExternalMemory(extMem: cudaExternalMemory_t) -> cudaError_t;
}
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 [`cudaExternalSemaphoreHandleDesc`] is defined as follows:
    ///
    /// ```text
    /// typedef struct cudaExternalSemaphoreHandleDesc_st {
    /// cudaExternalSemaphoreHandleType type;
    /// union {
    /// int fd;
    /// struct {
    /// void *handle;
    /// const void *name;
    /// } win32;
    /// const void* NvSciSyncObj;
    /// } handle;
    /// unsigned int flags;
    /// } cudaExternalSemaphoreHandleDesc;
    /// ```
    ///
    /// where [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) specifies the type of handle being imported. [`cudaExternalSemaphoreHandleType`] is defined as:
    ///
    /// ```text
    /// typedef enum cudaExternalSemaphoreHandleType_enum {
    /// cudaExternalSemaphoreHandleTypeOpaqueFd                = 1,
    /// cudaExternalSemaphoreHandleTypeOpaqueWin32             = 2,
    /// cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt          = 3,
    /// cudaExternalSemaphoreHandleTypeD3D12Fence              = 4,
    /// cudaExternalSemaphoreHandleTypeD3D11Fence              = 5,
    /// cudaExternalSemaphoreHandleTypeNvSciSync               = 6,
    /// cudaExternalSemaphoreHandleTypeKeyedMutex              = 7,
    /// cudaExternalSemaphoreHandleTypeKeyedMutexKmt           = 8,
    /// cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd     = 9,
    /// cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32  = 10
    /// } cudaExternalSemaphoreHandleType;
    /// ```
    ///
    /// If [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueFd`], then cudaExternalSemaphoreHandleDesc::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 [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32`], then exactly one of cudaExternalSemaphoreHandleDesc::handle::win32::handle and cudaExternalSemaphoreHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalSemaphoreHandleDesc::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 cudaExternalSemaphoreHandleDesc::handle::win32::name
    /// is not NULL, then it must name a valid synchronization object.
    ///
    /// If [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt`], then cudaExternalSemaphoreHandleDesc::handle::win32::handle must be non-NULL and cudaExternalSemaphoreHandleDesc::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 [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D12Fence`], then exactly one of cudaExternalSemaphoreHandleDesc::handle::win32::handle and cudaExternalSemaphoreHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalSemaphoreHandleDesc::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 cudaExternalSemaphoreHandleDesc::handle::win32::name is not NULL, then it must name
    /// a valid synchronization object that refers to a valid ID3D12Fence object.
    ///
    /// If [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D11Fence`], then exactly one of cudaExternalSemaphoreHandleDesc::handle::win32::handle and cudaExternalSemaphoreHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalSemaphoreHandleDesc::handle::win32::handle is not NULL, then it must represent a valid shared
    /// NT handle that is returned by ID3D11Fence::CreateSharedHandle. If cudaExternalSemaphoreHandleDesc::handle::win32::name is
    /// not NULL, then it must name a valid synchronization object that refers to a valid ID3D11Fence object.
    ///
    /// If [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`], then cudaExternalSemaphoreHandleDesc::handle::nvSciSyncObj represents a valid NvSciSyncObj.
    ///
    /// [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutex`], then exactly one of cudaExternalSemaphoreHandleDesc::handle::win32::handle and cudaExternalSemaphoreHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalSemaphoreHandleDesc::handle::win32::handle is not NULL, then it represent a valid shared
    /// NT handle that is returned by IDXGIResource1::CreateSharedHandle when referring to a IDXGIKeyedMutex object.
    ///
    /// If [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutexKmt`], then cudaExternalSemaphoreHandleDesc::handle::win32::handle must be non-NULL and cudaExternalSemaphoreHandleDesc::handle::win32::name
    /// must be NULL. The handle specified must represent a valid KMT handle that is returned by IDXGIResource::GetSharedHandle when
    /// referring to a IDXGIKeyedMutex object.
    ///
    /// If [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`], then cudaExternalSemaphoreHandleDesc::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 [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaExternalSemaphoreHandleDesc.html#structcudaExternalSemaphoreHandleDesc_1e925b19e386170fb3cccf58cfab0fd9c) is [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32`], then exactly one of cudaExternalSemaphoreHandleDesc::handle::win32::handle and cudaExternalSemaphoreHandleDesc::handle::win32::name
    /// must not be NULL. If cudaExternalSemaphoreHandleDesc::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 cudaExternalSemaphoreHandleDesc::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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDestroyExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `extSem_out`: Returned handle to an external semaphore.
    /// - `semHandleDesc`: Semaphore import handle descriptor.
    pub fn cudaImportExternalSemaphore(
        extSem_out: *mut cudaExternalSemaphore_t,
        semHandleDesc: *const cudaExternalSemaphoreHandleDesc,
    ) -> cudaError_t;
}
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: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueFd`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt`] then signaling the semaphore will set it to the signaled state.
    ///
    /// If the semaphore object is any one of the following types: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D12Fence`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D11Fence`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32`] then the semaphore will be set to the value specified in cudaExternalSemaphoreSignalParams::params::fence::value.
    ///
    /// If the semaphore object is of the type [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`] this API sets cudaExternalSemaphoreSignalParams::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 cudaExternalSemaphoreSignalParams::params::nvSciSync::fence. By default,
    /// signaling such an external semaphore object causes appropriate memory synchronization operations to be performed over all
    /// the external memory objects that are imported as [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf`]. 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 `cudaExternalSemaphoreSignalSkipNvSciBufMemSync`, 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 [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`], if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in [`cudaDeviceGetNvSciSyncAttributes`] to cudaNvSciSyncAttrSignal, this API will return cudaErrorNotSupported.
    ///
    /// cudaExternalSemaphoreSignalParams::params::nvSciSync::fence associated with semaphore object of the type [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`] 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. cudaExternalSemaphoreSignalParams::params::nvSciSync::fence
    /// associated with semaphore object of the type [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`] 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: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutex`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutexKmt`], then the keyed mutex will be released with the key specified in cudaExternalSemaphoreSignalParams::params::keyedmutex::key.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaImportExternalSemaphore`], [`cudaDestroyExternalSemaphore`], [`cudaWaitExternalSemaphoresAsync`].
    ///
    /// # 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 cudaSignalExternalSemaphoresAsync(
        extSemArray: *const cudaExternalSemaphore_t,
        paramsArray: *const cudaExternalSemaphoreSignalParams,
        numExtSems: ::core::ffi::c_uint,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
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: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueFd`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeOpaqueWin32Kmt`] 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: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D12Fence`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeD3D11Fence`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreFd`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeTimelineSemaphoreWin32`] then waiting on the semaphore will wait until the value of the semaphore is greater than or equal to cudaExternalSemaphoreWaitParams::params::fence::value.
    ///
    /// If the semaphore object is of the type [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`] then, waiting on the semaphore will wait until the cudaExternalSemaphoreSignalParams::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 [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeNvSciBuf`]. 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 `cudaExternalSemaphoreWaitSkipNvSciBufMemSync`, 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 [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeNvSciSync`], if the NvSciSyncAttrList used to create the NvSciSyncObj had not set the flags in [`cudaDeviceGetNvSciSyncAttributes`] to cudaNvSciSyncAttrWait, this API will return cudaErrorNotSupported.
    ///
    /// If the semaphore object is any one of the following types: [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutex`], [`cudaExternalSemaphoreHandleType::cudaExternalSemaphoreHandleTypeKeyedMutexKmt`], then the keyed mutex will be acquired when it is released with the key specified in cudaExternalSemaphoreSignalParams::params::keyedmutex::key
    /// or until the timeout specified by cudaExternalSemaphoreSignalParams::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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaImportExternalSemaphore`], [`cudaDestroyExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`].
    ///
    /// # 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 cudaWaitExternalSemaphoresAsync(
        extSemArray: *const cudaExternalSemaphore_t,
        paramsArray: *const cudaExternalSemaphoreWaitParams,
        numExtSems: ::core::ffi::c_uint,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `extSem`: External semaphore to be destroyed.
    pub fn cudaDestroyExternalSemaphore(extSem: cudaExternalSemaphore_t) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `func`: Device function symbol.
    /// - `gridDim`: Grid dimentions.
    /// - `blockDim`: Block dimentions.
    /// - `args`: Arguments.
    /// - `sharedMem`: Shared memory (defaults to 0).
    /// - `stream`: Stream identifier (defaults to NULL).
    pub fn cudaLaunchKernel(
        func: *const ::core::ffi::c_void,
        gridDim: dim3,
        blockDim: dim3,
        args: *mut *mut ::core::ffi::c_void,
        sharedMem: size_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Launches a CUDA function with launch-time configuration.
    ///
    /// Note that the functionally equivalent variadic template [cudaLaunchKernelEx](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/high-level-api.html#group__CUDART__HIGHLEVEL_1g81f2b11c6726c7b2f3fc54fc718eaf1c "Launches a CUDA function with launch-time configuration.") is available for C++11 and newer.
    ///
    /// Invokes the kernel func on config->gridDim (config->gridDim.xconfig->gridDim.yconfig->gridDim.z) grid of blocks. Each block contains config->blockDim (config->blockDim.xconfig->blockDim.yconfig->blockDim.z) threads.
    ///
    /// config->dynamicSmemBytes sets the amount of dynamic shared memory that will be available to each thread block.
    ///
    /// config->stream specifies a stream the invocation is associated to.
    ///
    /// Configuration beyond grid and block dimensions, dynamic shared memory size, and stream can be provided with the following
    /// two fields of config:
    ///
    /// config->attrs is an array of config->numAttrs contiguous [`cudaLaunchAttribute`] elements. The value of this pointer is not considered if config->numAttrs is zero. However, in that case, it is recommended to set the pointer to NULL. config->numAttrs is the number of attributes populating the first config->numAttrs positions of the config->attrs array.
    ///
    /// If the kernel has N parameters the args should point to array of N pointers. Each pointer, from args\[0\] to args\[N - 1\], point to the region of memory from which the actual parameter will be copied.
    ///
    /// N.B. This function is so named to avoid unintentionally invoking the templated version, cudaLaunchKernelEx, for kernels taking a single void\*\* or void\* parameter.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The API can also be used with a kernel `cudaKernel_t` by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol entryFuncAddr passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
    /// * Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type
    ///   that can be reliably passed to a different runtime instance is `cudaKernel_t`
    ///
    /// **See also:**
    ///
    /// [cudaLaunchKernelEx](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/high-level-api.html#group__CUDART__HIGHLEVEL_1g81f2b11c6726c7b2f3fc54fc718eaf1c "Launches a CUDA function with launch-time configuration.")(const [`cudaLaunchConfig_t`] \*config, void (\*kernel)(ExpTypes...), ActTypes &&... args) "cudaLaunchKernelEx (C++ API)", [cuLaunchKernelEx](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EXEC.html#group__CUDA__EXEC_1gb9c891eb6bb8f4089758e64c9c976db9).
    ///
    /// # Parameters
    ///
    /// - `config`: Launch configuration.
    /// - `func`: Kernel to launch.
    /// - `args`: Array of pointers to kernel parameters.
    pub fn cudaLaunchKernelExC(
        config: *const cudaLaunchConfig_t,
        func: *const ::core::ffi::c_void,
        args: *mut *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `func`: Device function symbol.
    /// - `gridDim`: Grid dimentions.
    /// - `blockDim`: Block dimentions.
    /// - `args`: Arguments.
    /// - `sharedMem`: Shared memory (defaults to 0).
    /// - `stream`: Stream identifier (defaults to NULL).
    pub fn cudaLaunchCooperativeKernel(
        func: *const ::core::ffi::c_void,
        gridDim: dim3,
        blockDim: dim3,
        args: *mut *mut ::core::ffi::c_void,
        sharedMem: size_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `func`: device function pointer.
    /// - `cacheConfig`: Requested cache configuration.
    pub fn cudaFuncSetCacheConfig(
        func: *const ::core::ffi::c_void,
        cacheConfig: cudaFuncCache,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `attr`: Return pointer to function's attributes.
    pub fn cudaFuncGetAttributes(
        attr: *mut cudaFuncAttributes,
        func: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `attr`: Attribute to set.
    /// - `value`: Value to set.
    pub fn cudaFuncSetAttribute(
        func: *const ::core::ffi::c_void,
        attr: cudaFuncAttribute,
        value: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `name`: The returned name of the function.
    /// - `func`: The function pointer to retrieve name for.
    pub fn cudaFuncGetName(
        name: *mut *const ::core::ffi::c_char,
        func: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the offset and size of a kernel parameter in the device-side parameter layout.
    ///
    /// Queries the kernel parameter at paramIndex in func's list of parameters and returns parameter information via paramOffset and paramSize. paramOffset returns the offset of the parameter in the device-side parameter layout. paramSize returns the size in bytes of the parameter. 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/graph-management.html#group__CUDART__GRAPH_1g9171bc40a4f9be650b3fe867e8bfb549 "Updates the kernel parameters of the given kernel node.") and `cudaGraphKernelNodeUpdatesApply`. paramIndex must be less than the number of parameters that func takes.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * The API can also be used with a kernel `cudaKernel_t` by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol entryFuncAddr passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
    /// * Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type
    ///   that can be reliably passed to a different runtime instance is `cudaKernel_t`.
    ///
    /// # Parameters
    ///
    /// - `func`: The function to query.
    /// - `paramIndex`: The parameter index to query.
    /// - `paramOffset`: The offset into the device-side parameter layout at which the parameter resides.
    /// - `paramSize`: The size of the parameter in the device-side parameter layout.
    pub fn cudaFuncGetParamInfo(
        func: *const ::core::ffi::c_void,
        paramIndex: size_t,
        paramOffset: *mut size_t,
        paramSize: *mut size_t,
    ) -> cudaError_t;
}
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.
    /// * The API can also be used with a kernel `cudaKernel_t` by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol entryFuncAddr passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
    /// * Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type
    ///   that can be reliably passed to a different runtime instance is `cudaKernel_t`.
    ///
    /// # Parameters
    ///
    /// - `func`: The function to query.
    /// - `paramCount`: Returns the number of parameters used by the function.
    pub fn cudaFuncGetParamCount(
        func: *const ::core::ffi::c_void,
        paramCount: *mut size_t,
    ) -> cudaError_t;
}
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 [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3), 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 constrast to [cuStreamAddCallback](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483), 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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamDestroy`], [`cudaMallocManaged`], [`cudaStreamAttachMemAsync`], [`cudaStreamAddCallback`], [cuLaunchHostFunc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EXEC.html#group__CUDA__EXEC_1gab95a78143bae7f21eebb978f91e7f3f).
    ///
    /// # Parameters
    ///
    /// - `userData`: User-specified data to be passed to the function.
    pub fn cudaLaunchHostFunc(
        stream: cudaStream_t,
        fn_: cudaHostFn_t,
        userData: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
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 [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3), 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 constrast to [cuStreamAddCallback](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__STREAM.html#group__CUDA__STREAM_1g613d97a277d7640f4cb1c03bd51c2483), 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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaStreamCreate`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamWaitEvent`], [`cudaStreamDestroy`], [`cudaMallocManaged`], [`cudaStreamAttachMemAsync`], [`cudaStreamAddCallback`], [cuLaunchHostFunc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EXEC.html#group__CUDA__EXEC_1gab95a78143bae7f21eebb978f91e7f3f).
    ///
    /// # Parameters
    ///
    /// - `userData`: User-specified data to be passed to the function.
    /// - `syncMode`: Sync mode for the host function.
    pub fn cudaLaunchHostFunc_v2(
        stream: cudaStream_t,
        fn_: cudaHostFn_t,
        userData: *mut ::core::ffi::c_void,
        syncMode: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the shared memory configuration for a device function.
    ///
    /// Any per-function setting of shared memory bank size set via [`cudaFuncSetSharedMemConfig`] will override the device wide setting set by [`cudaDeviceSetSharedMemConfig`].
    ///
    /// 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.
    ///
    /// For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,...,template_arg_N>
    ///
    /// The supported bank configurations are:
    ///
    /// * cudaSharedMemBankSizeDefault: use the device's shared memory configuration when launching this function.
    /// * cudaSharedMemBankSizeFourByte: set shared memory bank width to be four bytes natively when launching this function.
    /// * cudaSharedMemBankSizeEightByte: set shared memory bank width to be eight bytes natively when launching this function.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Use of a string naming a function as the func parameter was deprecated in CUDA 4.1 and removed in CUDA 5.0.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceSetSharedMemConfig`], [`cudaDeviceGetSharedMemConfig`], [`cudaDeviceSetCacheConfig`], [`cudaDeviceGetCacheConfig`], [`cudaFuncSetCacheConfig`], [cuFuncSetSharedMemConfig](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EXEC__DEPRECATED.html#group__CUDA__EXEC__DEPRECATED_1g3fe2417a78a7b5554a694c40355b54ce).
    ///
    /// # Parameters
    ///
    /// - `func`: Device function symbol.
    /// - `config`: Requested shared memory configuration.
    #[deprecated]
    pub fn cudaFuncSetSharedMemConfig(
        func: *const ::core::ffi::c_void,
        config: cudaSharedMemConfig,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `numBlocks`: Returned occupancy.
    /// - `func`: Kernel function for which occupancy is calulated.
    /// - `blockSize`: Block size the kernel is intended to be launched with.
    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
    pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessor(
        numBlocks: *mut ::core::ffi::c_int,
        func: *const ::core::ffi::c_void,
        blockSize: ::core::ffi::c_int,
        dynamicSMemSize: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # 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 block.
    pub fn cudaOccupancyAvailableDynamicSMemPerBlock(
        dynamicSmemSize: *mut size_t,
        func: *const ::core::ffi::c_void,
        numBlocks: ::core::ffi::c_int,
        blockSize: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `numBlocks`: Returned occupancy.
    /// - `func`: Kernel function for which occupancy is calulated.
    /// - `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 cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(
        numBlocks: *mut ::core::ffi::c_int,
        func: *const ::core::ffi::c_void,
        blockSize: ::core::ffi::c_int,
        dynamicSMemSize: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # 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.
    pub fn cudaOccupancyMaxPotentialClusterSize(
        clusterSize: *mut ::core::ffi::c_int,
        func: *const ::core::ffi::c_void,
        launchConfig: *const cudaLaunchConfig_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # 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.
    pub fn cudaOccupancyMaxActiveClusters(
        numClusters: *mut ::core::ffi::c_int,
        func: *const ::core::ffi::c_void,
        launchConfig: *const cudaLaunchConfig_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to allocated device memory.
    /// - `size`: Requested allocation size in bytes.
    /// - `flags`: Must be either `cudaMemAttachGlobal` or `cudaMemAttachHost` (defaults to `cudaMemAttachGlobal`).
    pub fn cudaMallocManaged(
        devPtr: *mut *mut ::core::ffi::c_void,
        size: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Allocate memory on the device.
    ///
    /// Allocates size bytes of linear memory on the device and returns in \*devPtr a pointer to the allocated memory. The allocated memory is suitably aligned for any kind of variable. The memory is not cleared.
    /// [`cudaMalloc`] returns [cudaErrorMemoryAllocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f210f50ae7f17f655e0504929606add9) in case of failure.
    ///
    /// The device version of [`cudaFree`] cannot be used with a \*devPtr allocated using the host API, and vice versa.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], [`cudaFreeArray`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaHostAlloc`], [cuMemAlloc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gb82d2a09844a58dd9e744dc31e8aa467).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to allocated device memory.
    /// - `size`: Requested allocation size in bytes.
    pub fn cudaMalloc(
        devPtr: *mut *mut ::core::ffi::c_void,
        size: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `ptr`: Device pointer to allocated memory.
    /// - `size`: Requested allocation size in bytes.
    pub fn cudaMallocHost(
        ptr: *mut *mut ::core::ffi::c_void,
        size: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Allocates pitched memory on the device.
    ///
    /// Allocates at least width (in bytes) \* height bytes of linear memory on the device and returns in \*devPtr 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. The pitch returned
    /// in \*pitch by [`cudaMallocPitch`] 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;
    /// ```
    ///
    /// For allocations of 2D arrays, it is recommended that programmers consider performing pitch allocations using [`cudaMallocPitch`]. Due to pitch 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).
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaFree`], [`cudaMallocArray`], [`cudaFreeArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaHostAlloc`], [cuMemAllocPitch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gcbe9b033f6c4de80f63cc6e58ed9a45a).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to allocated pitched device memory.
    /// - `pitch`: Pitch for allocation.
    /// - `width`: Requested pitched allocation width (in bytes).
    /// - `height`: Requested pitched allocation height.
    pub fn cudaMallocPitch(
        devPtr: *mut *mut ::core::ffi::c_void,
        pitch: *mut size_t,
        width: size_t,
        height: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Allocate an array on the device.
    ///
    /// Allocates a CUDA array according to the [`cudaChannelFormatDesc`] structure desc and returns a handle to the new CUDA array in \*array.
    ///
    /// The [`cudaChannelFormatDesc`] is defined as:
    ///
    /// ```text
    /// struct cudaChannelFormatDesc {
    /// int x, y, z, w;
    /// enum cudaChannelFormatKind
    /// f;
    /// };
    /// ```
    ///
    /// [`cudaChannelFormatKind`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindSigned`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindFloat`]
    ///
    /// The flags parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// * `cudaArrayDefault`: This flag's value is defined to be 0 and provides default array allocation
    /// * `cudaArraySurfaceLoadStore`: Allocates an array that can be read from or written to using a surface reference
    /// * `cudaArrayTextureGather`: This flag indicates that texture gather operations will be performed on the array.
    /// * `cudaArraySparse`: Allocates a CUDA array without physical backing memory. The subregions within this sparse array can later be mapped onto
    ///   a physical memory allocation by calling [cuMemMapArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g5dc41a62a9feb68f2e943b438c83e5ab). The physical backing memory must be allocated via [cuMemCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g899d69a862bba36449789c64b430dc7c).
    /// * `cudaArrayDeferredMapping`: Allocates a CUDA array without physical backing memory. The entire array can later be mapped onto a physical memory allocation
    ///   by calling [cuMemMapArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g5dc41a62a9feb68f2e943b438c83e5ab). The physical backing memory must be allocated via [cuMemCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g899d69a862bba36449789c64b430dc7c).
    ///
    /// width and height must meet certain size requirements. See [`cudaMalloc3DArray`] for more details.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaFreeArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaHostAlloc`], [cuArrayCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g4192ff387a81c3bd5ed8c391ed62ca24).
    ///
    /// # Parameters
    ///
    /// - `array`: Pointer to allocated array in device memory.
    /// - `desc`: Requested channel format.
    /// - `width`: Requested array allocation width.
    /// - `height`: Requested array allocation height.
    /// - `flags`: Requested properties of allocated array.
    pub fn cudaMallocArray(
        array: *mut cudaArray_t,
        desc: *const cudaChannelFormatDesc,
        width: size_t,
        height: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Frees memory on the device.
    ///
    /// Frees the memory space pointed to by devPtr, which must have been returned by a previous call to one of the following memory allocation APIs - [`cudaMalloc`], [`cudaMallocPitch`], cudaMallocManaged(), [`cudaMallocAsync`], [`cudaMallocFromPoolAsync`].
    ///
    /// Note - This API will not perform any implicit synchronization when the pointer was allocated with [`cudaMallocAsync`] or [`cudaMallocFromPoolAsync`]. Callers must ensure that all accesses to these pointer have completed before invoking [`cudaFree`]. For best performance and memory reuse, users should use [`cudaFreeAsync`] to free memory allocated via the stream ordered memory allocator. For all other pointers, this API may perform implicit synchronization.
    ///
    /// If `cudaFree`(devPtr) has already been called before, an error is returned. If devPtr is 0, no operation is performed. [`cudaFree`] returns cudaErrorValue in case of failure.
    ///
    /// The device version of [`cudaFree`] cannot be used with a \*devPtr allocated using the host API, and vice versa.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaMallocPitch`], [`cudaMallocManaged`], [`cudaMallocArray`], [`cudaFreeArray`], [`cudaMallocAsync`], [`cudaMallocFromPoolAsync`]cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaFreeAsync`].
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Device pointer to memory to free.
    pub fn cudaFree(devPtr: *mut ::core::ffi::c_void) -> cudaError_t;
}
unsafe extern "C" {
    /// Frees page-locked memory.
    ///
    /// Frees the memory space pointed to by hostPtr, which must have been returned by a previous call to cudaMallocHost() or [`cudaHostAlloc`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], [`cudaFreeArray`], cudaMallocHost ( C API), [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaHostAlloc`], [cuMemFreeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g62e0fdbe181dab6b1c90fa1a51c7b92c).
    ///
    /// # Parameters
    ///
    /// - `ptr`: Pointer to memory to free.
    pub fn cudaFreeHost(ptr: *mut ::core::ffi::c_void) -> cudaError_t;
}
unsafe extern "C" {
    /// Frees an array on the device.
    ///
    /// Frees the CUDA array array, which must have been returned by a previous call to [`cudaMallocArray`]. If devPtr is 0, no operation is performed.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaHostAlloc`], [cuArrayDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g982878affbbc023de84874faac838b0b).
    ///
    /// # Parameters
    ///
    /// - `array`: Pointer to array to free.
    pub fn cudaFreeArray(array: cudaArray_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Frees a mipmapped array on the device.
    ///
    /// Frees the CUDA mipmapped array mipmappedArray, which must have been returned by a previous call to [`cudaMallocMipmappedArray`]. If devPtr is 0, no operation is performed.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaMallocArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaHostAlloc`], [cuMipmappedArrayDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1ge0d7c768b6a6963c4d4bde5bbc74f0ad).
    ///
    /// # Parameters
    ///
    /// - `mipmappedArray`: Pointer to mipmapped array to free.
    pub fn cudaFreeMipmappedArray(mipmappedArray: cudaMipmappedArray_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Allocates page-locked memory on the host.
    ///
    /// Allocates size 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 [`cudaMemcpy`]. 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(). Allocating excessive amounts of pinned 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.
    ///
    /// * [`cudaHostAllocDefault`]: This flag's value is defined to be 0 and causes [`cudaHostAlloc`] to emulate cudaMallocHost().
    /// * [`cudaHostAllocPortable`]: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed
    ///   the allocation.
    /// * [`cudaHostAllocMapped`]: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling [`cudaHostGetDevicePointer`].
    /// * [`cudaHostAllocWriteCombined`]: 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 device 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.
    ///
    /// In order for the [`cudaHostAllocMapped`] flag to have any effect, the CUDA context must support the `cudaDeviceMapHost` flag, which can be checked via [`cudaGetDeviceFlags`]. The `cudaDeviceMapHost` flag is implicitly set for contexts created via the runtime API.
    ///
    /// The [`cudaHostAllocMapped`] flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to [`cudaHostGetDevicePointer`] because the memory may be mapped into other CUDA contexts via the [`cudaHostAllocPortable`] flag.
    ///
    /// Memory allocated by this function must be freed with [`cudaFreeHost`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaSetDeviceFlags`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaGetDeviceFlags`], [cuMemHostAlloc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g572ca4011bfcb25034888a14d4e035b9).
    ///
    /// # Parameters
    ///
    /// - `pHost`: Device pointer to allocated memory.
    /// - `size`: Requested allocation size in bytes.
    /// - `flags`: Requested properties of allocated memory.
    pub fn cudaHostAlloc(
        pHost: *mut *mut ::core::ffi::c_void,
        size: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Registers an existing host memory range for use by CUDA.
    ///
    /// Page-locks the memory range specified by ptr and size and maps it for the device(s) as specified by flags. This memory range also is added to the same tracking mechanism as [`cudaHostAlloc`] to automatically accelerate calls to functions such as [`cudaMemcpy`]. 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 pageableMemoryAccessUsesHostPageTables is true, [`cudaHostRegister`] will not page-lock the memory range specified by ptr but only populate unpopulated pages.
    ///
    /// [`cudaHostRegister`] is supported only on I/O coherent devices that have a non-zero value for the device attribute [cudaDevAttrHostRegisterSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd6ea4a004a336c3c95b6ff06ec6269e29).
    ///
    /// The flags parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// * [`cudaHostRegisterDefault`]: On a system with unified virtual addressing, the memory will be both mapped and portable. On a system with no unified virtual
    ///   addressing, the memory will be neither mapped nor portable.
    ///
    /// * [`cudaHostRegisterPortable`]: The memory returned by this call will be considered as pinned memory by all CUDA contexts, not just the one that performed
    ///   the allocation.
    ///
    /// * [`cudaHostRegisterMapped`]: Maps the allocation into the CUDA address space. The device pointer to the memory may be obtained by calling [`cudaHostGetDevicePointer`].
    ///
    /// * [`cudaHostRegisterIoMemory`]: The passed memory pointer is treated as pointing to some memory-mapped I/O space, e.g. belonging to a third-party PCIe device,
    ///   and it will marked as non cache-coherent and contiguous.
    ///
    /// * [`cudaHostRegisterReadOnly`]: The passed memory pointer is treated as pointing to memory that is considered read-only by the device. On platforms without
    ///   [cudaDevAttrPageableMemoryAccessUsesHostPageTables](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc228cf8983c97d0e035da72a71494eaa), 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 [cudaDevAttrHostRegisterReadOnlySupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cde8ea38ec2872f63a74170354e375edb3). Using this flag with a current context associated with a device that does not have this attribute set will cause [`cudaHostRegister`] to error with cudaErrorNotSupported.
    ///
    /// All of these flags are orthogonal to one another: a developer may page-lock memory that is portable or mapped with no restrictions.
    ///
    /// The CUDA context must have been created with the cudaMapHost flag in order for the [`cudaHostRegisterMapped`] flag to have any effect.
    ///
    /// The [`cudaHostRegisterMapped`] flag may be specified on CUDA contexts for devices that do not support mapped pinned memory. The failure is deferred to [`cudaHostGetDevicePointer`] because the memory may be mapped into other CUDA contexts via the [`cudaHostRegisterPortable`] flag.
    ///
    /// For devices that have a non-zero value for the device attribute [cudaDevAttrCanUseHostPointerForRegisteredMem](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdb08e379a7a038dc8134914702c223f69), the memory can also be accessed from the device using the host pointer ptr. The device pointer returned by [`cudaHostGetDevicePointer`] 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 [`cudaHostGetDevicePointer`] 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 [`cudaHostGetDevicePointer`] 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 [`cudaHostUnregister`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaHostUnregister`], [`cudaHostGetFlags`], [`cudaHostGetDevicePointer`], [cuMemHostRegister](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gf0a9fe11544326dabd743b7aa6b54223).
    ///
    /// # Parameters
    ///
    /// - `ptr`: Host pointer to memory to page-lock.
    /// - `size`: Size in bytes of the address range to page-lock in bytes.
    /// - `flags`: Flags for allocation request.
    pub fn cudaHostRegister(
        ptr: *mut ::core::ffi::c_void,
        size: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Unregisters a memory range that was registered with cudaHostRegister.
    ///
    /// Unmaps the memory range whose base address is specified by ptr, and makes it pageable again.
    ///
    /// The base address must be the same one specified to [`cudaHostRegister`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaHostUnregister`], [cuMemHostUnregister](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g63f450c8125359be87b7623b1c0b2a14).
    ///
    /// # Parameters
    ///
    /// - `ptr`: Host pointer to memory to unregister.
    pub fn cudaHostUnregister(ptr: *mut ::core::ffi::c_void) -> cudaError_t;
}
unsafe extern "C" {
    /// Passes back device pointer of mapped host memory allocated by cudaHostAlloc or registered by cudaHostRegister.
    ///
    /// Passes back the device pointer corresponding to the mapped, pinned host buffer allocated by [`cudaHostAlloc`] or registered by [`cudaHostRegister`].
    ///
    /// [`cudaHostGetDevicePointer`] will fail if the `cudaDeviceMapHost` flag was not specified before deferred context creation occurred, or if called on a device that does not support mapped,
    /// pinned memory.
    ///
    /// For devices that have a non-zero value for the device attribute [cudaDevAttrCanUseHostPointerForRegisteredMem](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdb08e379a7a038dc8134914702c223f69), the memory can also be accessed from the device using the host pointer pHost. The device pointer returned by [`cudaHostGetDevicePointer`] may or may not match the original host pointer pHost 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 [`cudaHostGetDevicePointer`] will match the original pointer pHost. If any device visible to the application has a zero value for the device attribute, the device pointer returned by [`cudaHostGetDevicePointer`] will not match the original host pointer pHost, 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.
    ///
    /// 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaSetDeviceFlags`], [`cudaHostAlloc`], [cuMemHostGetDevicePointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g57a39e5cba26af4d06be67fc77cc62f0).
    ///
    /// # Parameters
    ///
    /// - `pDevice`: Returned device pointer for mapped memory.
    /// - `pHost`: Requested host pointer mapping.
    /// - `flags`: Flags for extensions (must be 0 for now).
    pub fn cudaHostGetDevicePointer(
        pDevice: *mut *mut ::core::ffi::c_void,
        pHost: *mut ::core::ffi::c_void,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Passes back flags used to allocate pinned host memory allocated by cudaHostAlloc.
    ///
    /// [`cudaHostGetFlags`] will fail if the input pointer does not reside in an address range allocated by [`cudaHostAlloc`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaHostAlloc`], [cuMemHostGetFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g42066246915fcb0400df2a17a851b35f).
    ///
    /// # Parameters
    ///
    /// - `pFlags`: Returned flags word.
    /// - `pHost`: Host pointer.
    pub fn cudaHostGetFlags(
        pFlags: *mut ::core::ffi::c_uint,
        pHost: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Allocates logical 1D, 2D, or 3D memory objects on the device.
    ///
    /// Allocates at least width \* height \* depth bytes of linear memory on the device and returns a [`cudaPitchedPtr`] in which ptr is a pointer to the allocated memory. The function may pad the allocation to ensure hardware alignment requirements are met.
    /// The pitch returned in the pitch field of pitchedDevPtr is the width in bytes of the allocation.
    ///
    /// The returned [`cudaPitchedPtr`] contains additional fields xsize and ysize, the logical width and height of the allocation, which are equivalent to the width and heightextent parameters provided by the programmer during allocation.
    ///
    /// For allocations of 2D and 3D objects, it is highly recommended that programmers perform allocations using [`cudaMalloc3D`] or [`cudaMallocPitch`]. Due to alignment restrictions in the hardware, this is especially true if the application will be performing memory copies
    /// involving 2D or 3D objects (whether linear memory or CUDA arrays).
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMallocPitch`], [`cudaFree`], [`cudaMemcpy3D`], [`cudaMemset3D`], [`cudaMalloc3DArray`], [`cudaMallocArray`], [`cudaFreeArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaHostAlloc`], `make_cudaPitchedPtr`, `make_cudaExtent`, [cuMemAllocPitch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gcbe9b033f6c4de80f63cc6e58ed9a45a).
    ///
    /// # Parameters
    ///
    /// - `pitchedDevPtr`: Pointer to allocated pitched device memory.
    /// - `extent`: Requested allocation size (width field in bytes).
    pub fn cudaMalloc3D(
        pitchedDevPtr: *mut cudaPitchedPtr,
        extent: cudaExtent,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Allocate an array on the device.
    ///
    /// Allocates a CUDA array according to the [`cudaChannelFormatDesc`] structure desc and returns a handle to the new CUDA array in \*array.
    ///
    /// The [`cudaChannelFormatDesc`] is defined as:
    ///
    /// ```text
    /// struct cudaChannelFormatDesc {
    /// int x, y, z, w;
    /// enum cudaChannelFormatKind
    /// f;
    /// };
    /// ```
    ///
    /// [`cudaChannelFormatKind`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindSigned`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindFloat`]
    ///
    /// [`cudaMalloc3DArray`] can allocate the following:
    ///
    /// * A 1D array is allocated if the height and depth extents are both zero.
    /// * A 2D array is allocated if only the 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 the height extent is zero and the cudaArrayLayered 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 cudaArrayLayered 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 cudaArrayCubemap 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 `cudaGraphicsCubeFace`.
    /// * A cubemap layered CUDA array is allocated if all three extents are non-zero, and both, cudaArrayCubemap and cudaArrayLayered
    ///   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.
    ///
    /// The flags parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// * `cudaArrayDefault`: This flag's value is defined to be 0 and provides default array allocation
    /// * `cudaArrayLayered`: Allocates a layered CUDA array, with the depth extent indicating the number of layers
    /// * `cudaArrayCubemap`: Allocates a cubemap CUDA array. Width must be equal to height, and depth must be six. If the cudaArrayLayered flag is also
    ///   set, depth must be a multiple of six.
    /// * `cudaArraySurfaceLoadStore`: Allocates a CUDA array that could be read from or written to using a surface reference.
    /// * `cudaArrayTextureGather`: This flag indicates that texture gather operations will be performed on the CUDA array. Texture gather can only be performed
    ///   on 2D CUDA arrays.
    /// * `cudaArraySparse`: Allocates a CUDA array without physical backing memory. The subregions within this sparse array can later be mapped onto
    ///   a physical memory allocation by calling [cuMemMapArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g5dc41a62a9feb68f2e943b438c83e5ab). This flag can only be used for creating 2D, 3D or 2D layered sparse CUDA arrays. The physical backing memory must be allocated
    ///   via [cuMemCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g899d69a862bba36449789c64b430dc7c).
    /// * `cudaArrayDeferredMapping`: Allocates a CUDA array without physical backing memory. The entire array can later be mapped onto a physical memory allocation
    ///   by calling [cuMemMapArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g5dc41a62a9feb68f2e943b438c83e5ab). The physical backing memory must be allocated via [cuMemCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g899d69a862bba36449789c64b430dc7c).
    ///
    /// The width, height and depth extents must meet certain size requirements as listed in the following table. All values are specified
    /// in elements.
    ///
    /// Note that 2D CUDA arrays have different size requirements if the `cudaArrayTextureGather` flag is set. In that case, the valid range for (width, height, depth) is ((1,maxTexture2DGather\[0\]), (1,maxTexture2DGather\[1\]),
    /// 0).
    ///
    /// | CUDA array type | Valid extents that must always be met {(width range in elements), (height range), (depth range)} | Valid extents with cudaArraySurfaceLoadStore set {(width range in elements), (height range), (depth range)} |
    /// | --- | --- | --- |
    /// | 1D | { (1,maxTexture1D), 0, 0 } | { (1,maxSurface1D), 0, 0 } |
    /// | 2D | { (1,maxTexture2D\[0\]), (1,maxTexture2D\[1\]), 0 } | { (1,maxSurface2D\[0\]), (1,maxSurface2D\[1\]), 0 } |
    /// | 3D | { (1,maxTexture3D\[0\]), (1,maxTexture3D\[1\]), (1,maxTexture3D\[2\]) } OR { (1,maxTexture3DAlt\[0\]), (1,maxTexture3DAlt\[1\]), (1,maxTexture3DAlt\[2\]) } | { (1,maxSurface3D\[0\]), (1,maxSurface3D\[1\]), (1,maxSurface3D\[2\]) } |
    /// | 1D Layered | { (1,maxTexture1DLayered\[0\]), 0, (1,maxTexture1DLayered\[1\]) } | { (1,maxSurface1DLayered\[0\]), 0, (1,maxSurface1DLayered\[1\]) } |
    /// | 2D Layered | { (1,maxTexture2DLayered\[0\]), (1,maxTexture2DLayered\[1\]), (1,maxTexture2DLayered\[2\]) } | { (1,maxSurface2DLayered\[0\]), (1,maxSurface2DLayered\[1\]), (1,maxSurface2DLayered\[2\]) } |
    /// | Cubemap | { (1,maxTextureCubemap), (1,maxTextureCubemap), 6 } | { (1,maxSurfaceCubemap), (1,maxSurfaceCubemap), 6 } |
    /// | Cubemap Layered | { (1,maxTextureCubemapLayered\[0\]), (1,maxTextureCubemapLayered\[0\]), (1,maxTextureCubemapLayered\[1\]) } | { (1,maxSurfaceCubemapLayered\[0\]), (1,maxSurfaceCubemapLayered\[0\]), (1,maxSurfaceCubemapLayered\[1\]) } |
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc3D`], [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaFreeArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaHostAlloc`], `make_cudaExtent`, [cuArray3DCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gc2322c70b38c2984536c90ed118bb1d7).
    ///
    /// # Parameters
    ///
    /// - `array`: Pointer to allocated array in device memory.
    /// - `desc`: Requested channel format.
    /// - `extent`: Requested allocation size (width field in elements).
    /// - `flags`: Flags for extensions.
    pub fn cudaMalloc3DArray(
        array: *mut cudaArray_t,
        desc: *const cudaChannelFormatDesc,
        extent: cudaExtent,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Allocate a mipmapped array on the device.
    ///
    /// Allocates a CUDA mipmapped array according to the [`cudaChannelFormatDesc`] structure desc and returns a handle to the new CUDA mipmapped array in \*mipmappedArray. numLevels 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 [`cudaChannelFormatDesc`] is defined as:
    ///
    /// ```text
    /// struct cudaChannelFormatDesc {
    /// int x, y, z, w;
    /// enum cudaChannelFormatKind
    /// f;
    /// };
    /// ```
    ///
    /// [`cudaChannelFormatKind`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindSigned`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`]
    ///
    /// [`cudaChannelFormatKind::cudaChannelFormatKindFloat`]
    ///
    /// [`cudaMallocMipmappedArray`] can allocate the following:
    ///
    /// * A 1D mipmapped array is allocated if the height and depth extents are both zero.
    /// * A 2D mipmapped array is allocated if only the 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 the height extent is zero and the cudaArrayLayered flag is set. Each
    ///   layer is a 1D mipmapped 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 cudaArrayLayered flag is set. Each
    ///   layer is a 2D mipmapped 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 cudaArrayCubemap flag is set. Width
    ///   must be equal to height, and depth must be six. The order of the six layers in memory is the same as that listed in `cudaGraphicsCubeFace`.
    /// * A cubemap layered CUDA mipmapped array is allocated if all three extents are non-zero, and both, cudaArrayCubemap and cudaArrayLayered
    ///   flags are set. Width must be equal to height, and depth must be a multiple of six. A cubemap layered CUDA mipmapped array
    ///   is a special type of 2D layered CUDA mipmapped array that consists of a collection of cubemap mipmapped arrays. The first
    ///   six layers represent the first cubemap mipmapped array, the next six layers form the second cubemap mipmapped array, and so
    ///   on.
    ///
    /// The flags parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// * `cudaArrayDefault`: This flag's value is defined to be 0 and provides default mipmapped array allocation
    /// * `cudaArrayLayered`: Allocates a layered CUDA mipmapped array, with the depth extent indicating the number of layers
    /// * `cudaArrayCubemap`: Allocates a cubemap CUDA mipmapped array. Width must be equal to height, and depth must be six. If the cudaArrayLayered
    ///   flag is also set, depth must be a multiple of six.
    /// * `cudaArraySurfaceLoadStore`: This flag indicates that individual mipmap levels of the CUDA mipmapped array will be read from or written to using a surface
    ///   reference.
    /// * `cudaArrayTextureGather`: This flag indicates that texture gather operations will be performed on the CUDA array. Texture gather can only be performed
    ///   on 2D CUDA mipmapped arrays, and the gather operations are performed only on the most detailed mipmap level.
    /// * `cudaArraySparse`: Allocates a CUDA mipmapped array without physical backing memory. The subregions within this sparse array can later be mapped
    ///   onto a physical memory allocation by calling [cuMemMapArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g5dc41a62a9feb68f2e943b438c83e5ab). This flag can only be used for creating 2D, 3D or 2D layered sparse CUDA mipmapped arrays. The physical backing memory must
    ///   be allocated via [cuMemCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g899d69a862bba36449789c64b430dc7c).
    /// * `cudaArrayDeferredMapping`: Allocates a CUDA mipmapped array without physical backing memory. The entire array can later be mapped onto a physical memory
    ///   allocation by calling [cuMemMapArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g5dc41a62a9feb68f2e943b438c83e5ab). The physical backing memory must be allocated via [cuMemCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g899d69a862bba36449789c64b430dc7c).
    ///
    /// The width, height and depth extents must meet certain size requirements as listed in the following table. All values are specified
    /// in elements.
    ///
    /// | CUDA array type | Valid extents that must always be met {(width range in elements), (height range), (depth range)} | Valid extents with cudaArraySurfaceLoadStore set {(width range in elements), (height range), (depth range)} |
    /// | --- | --- | --- |
    /// | 1D | { (1,maxTexture1DMipmap), 0, 0 } | { (1,maxSurface1D), 0, 0 } |
    /// | 2D | { (1,maxTexture2DMipmap\[0\]), (1,maxTexture2DMipmap\[1\]), 0 } | { (1,maxSurface2D\[0\]), (1,maxSurface2D\[1\]), 0 } |
    /// | 3D | { (1,maxTexture3D\[0\]), (1,maxTexture3D\[1\]), (1,maxTexture3D\[2\]) } OR { (1,maxTexture3DAlt\[0\]), (1,maxTexture3DAlt\[1\]), (1,maxTexture3DAlt\[2\]) } | { (1,maxSurface3D\[0\]), (1,maxSurface3D\[1\]), (1,maxSurface3D\[2\]) } |
    /// | 1D Layered | { (1,maxTexture1DLayered\[0\]), 0, (1,maxTexture1DLayered\[1\]) } | { (1,maxSurface1DLayered\[0\]), 0, (1,maxSurface1DLayered\[1\]) } |
    /// | 2D Layered | { (1,maxTexture2DLayered\[0\]), (1,maxTexture2DLayered\[1\]), (1,maxTexture2DLayered\[2\]) } | { (1,maxSurface2DLayered\[0\]), (1,maxSurface2DLayered\[1\]), (1,maxSurface2DLayered\[2\]) } |
    /// | Cubemap | { (1,maxTextureCubemap), (1,maxTextureCubemap), 6 } | { (1,maxSurfaceCubemap), (1,maxSurfaceCubemap), 6 } |
    /// | Cubemap Layered | { (1,maxTextureCubemapLayered\[0\]), (1,maxTextureCubemapLayered\[0\]), (1,maxTextureCubemapLayered\[1\]) } | { (1,maxSurfaceCubemapLayered\[0\]), (1,maxSurfaceCubemapLayered\[0\]), (1,maxSurfaceCubemapLayered\[1\]) } |
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc3D`], [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaFreeArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaHostAlloc`], `make_cudaExtent`, [cuMipmappedArrayCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1ga5d2e311c7f9b0bc6d130af824a40bd3).
    ///
    /// # Parameters
    ///
    /// - `mipmappedArray`: Pointer to allocated mipmapped array in device memory.
    /// - `desc`: Requested channel format.
    /// - `extent`: Requested allocation size (width field in elements).
    /// - `numLevels`: Number of mipmap levels to allocate.
    /// - `flags`: Flags for extensions.
    pub fn cudaMallocMipmappedArray(
        mipmappedArray: *mut cudaMipmappedArray_t,
        desc: *const cudaChannelFormatDesc,
        extent: cudaExtent,
        numLevels: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Gets a mipmap level of a CUDA mipmapped array.
    ///
    /// Returns in \*levelArray a CUDA array that represents a single mipmap level of the CUDA mipmapped array mipmappedArray.
    ///
    /// If level is greater than the maximum number of levels in this mipmapped array, [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// If mipmappedArray is NULL, [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) is returned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc3D`], [`cudaMalloc`], [`cudaMallocPitch`], [`cudaFree`], [`cudaFreeArray`], cudaMallocHost ( C API), [`cudaFreeHost`], [`cudaHostAlloc`], `make_cudaExtent`, [cuMipmappedArrayGetLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g82f276659f05be14820e99346b0f86b7).
    ///
    /// # Parameters
    ///
    /// - `levelArray`: Returned mipmap level CUDA array.
    /// - `mipmappedArray`: CUDA mipmapped array.
    /// - `level`: Mipmap level.
    pub fn cudaGetMipmappedArrayLevel(
        levelArray: *mut cudaArray_t,
        mipmappedArray: cudaMipmappedArray_const_t,
        level: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between 3D objects.
    ///
    /// ```text
    /// struct cudaExtent {
    /// size_t width;
    /// size_t height;
    /// size_t depth;
    /// };
    /// struct cudaExtent
    /// make_cudaExtent(size_t w, size_t h, size_t d);
    ///
    /// struct cudaPos {
    /// size_t x;
    /// size_t y;
    /// size_t z;
    /// };
    /// struct cudaPos
    /// make_cudaPos(size_t x, size_t y, size_t z);
    ///
    /// struct cudaMemcpy3DParms {
    /// cudaArray_t
    /// srcArray;
    /// struct cudaPos
    /// srcPos;
    /// struct cudaPitchedPtr
    /// srcPtr;
    /// cudaArray_t
    /// dstArray;
    /// struct cudaPos
    /// dstPos;
    /// struct cudaPitchedPtr
    /// dstPtr;
    /// struct cudaExtent
    /// extent;
    /// enum cudaMemcpyKind
    /// kind;
    /// };
    /// ```
    ///
    /// [`cudaMemcpy3D`] copies data betwen two 3D objects. The source and destination objects may be in either host memory, device memory, or a CUDA
    /// array. The source, destination, extent, and kind of copy performed is specified by the [`cudaMemcpy3DParms`] struct which should be initialized to zero before use:
    ///
    /// ```text
    /// cudaMemcpy3DParms myParms = {0};
    /// ```
    ///
    /// The struct passed to [`cudaMemcpy3D`] must specify one of srcArray or srcPtr and one of dstArray or dstPtr. Passing more than one non-zero source or destination will cause [`cudaMemcpy3D`] to return an error.
    ///
    /// The srcPos and dstPos fields are optional offsets into the source and destination objects and are defined in units of each object's elements. The
    /// element for a host or device pointer is assumed to be **unsigned char**.
    ///
    /// The extent field defines the dimensions of the transferred area in elements. If a CUDA array is participating in the copy, the extent
    /// is defined in terms of that array's elements. If no CUDA array is participating in the copy then the extents are defined in
    /// elements of **unsigned char**.
    ///
    /// The kind field defines the direction of the copy. It must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. For [`cudaMemcpyKind::cudaMemcpyHostToHost`] or [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] passed as kind and cudaArray type passed as source or destination, if the kind implies cudaArray type to be present on the
    /// host, [`cudaMemcpy3D`] will disregard that implication and silently correct the kind based on the fact that cudaArray type can only be present on
    /// the device.
    ///
    /// If the source and destination are both arrays, [`cudaMemcpy3D`] will return an error if they do not have the same element size.
    ///
    /// The source and destination object may not overlap. If overlapping source and destination objects are specified, undefined
    /// behavior will result.
    ///
    /// The source object must entirely contain the region defined by srcPos and extent. The destination object must entirely contain the region defined by dstPos and extent.
    ///
    /// [`cudaMemcpy3D`] returns an error if the pitch of srcPtr or dstPtr exceeds the maximum allowed. The pitch of a [`cudaPitchedPtr`] allocated with [`cudaMalloc3D`] will always be valid.
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaMemset3D`], [`cudaMemcpy3DAsync`], [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], `make_cudaExtent`, `make_cudaPos`, [cuMemcpy3D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g4b5238975579f002c0199a3800ca44df).
    ///
    /// # Parameters
    ///
    /// - `p`: 3D memory copy parameters.
    pub fn cudaMemcpy3D(p: *const cudaMemcpy3DParms) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies memory between devices.
    ///
    /// Perform a 3D memory copy according to the parameters specified in p. See the definition of the [`cudaMemcpy3DPeerParms`] structure for documentation of its parameters.
    ///
    /// Note that this function is synchronous with respect to the host only if the source or destination of the transfer is host
    /// memory. Note also that this copy is serialized with respect to all pending and future asynchronous work in to the current
    /// device, the copy's source device, and the copy's destination device (use [`cudaMemcpy3DPeerAsync`] to avoid this synchronization).
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpyPeerAsync`], [`cudaMemcpy3DPeerAsync`], [cuMemcpy3DPeer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g11466fd70cde9329a4e16eb1f258c433).
    ///
    /// # Parameters
    ///
    /// - `p`: Parameters for the memory copy.
    pub fn cudaMemcpy3DPeer(p: *const cudaMemcpy3DPeerParms) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between 3D objects.
    ///
    /// ```text
    /// struct cudaExtent {
    /// size_t width;
    /// size_t height;
    /// size_t depth;
    /// };
    /// struct cudaExtent
    /// make_cudaExtent(size_t w, size_t h, size_t d);
    ///
    /// struct cudaPos {
    /// size_t x;
    /// size_t y;
    /// size_t z;
    /// };
    /// struct cudaPos
    /// make_cudaPos(size_t x, size_t y, size_t z);
    ///
    /// struct cudaMemcpy3DParms {
    /// cudaArray_t
    /// srcArray;
    /// struct cudaPos
    /// srcPos;
    /// struct cudaPitchedPtr
    /// srcPtr;
    /// cudaArray_t
    /// dstArray;
    /// struct cudaPos
    /// dstPos;
    /// struct cudaPitchedPtr
    /// dstPtr;
    /// struct cudaExtent
    /// extent;
    /// enum cudaMemcpyKind
    /// kind;
    /// };
    /// ```
    ///
    /// [`cudaMemcpy3DAsync`] copies data betwen two 3D objects. The source and destination objects may be in either host memory, device memory, or a CUDA
    /// array. The source, destination, extent, and kind of copy performed is specified by the [`cudaMemcpy3DParms`] struct which should be initialized to zero before use:
    ///
    /// ```text
    /// cudaMemcpy3DParms myParms = {0};
    /// ```
    ///
    /// The struct passed to [`cudaMemcpy3DAsync`] must specify one of srcArray or srcPtr and one of dstArray or dstPtr. Passing more than one non-zero source or destination will cause [`cudaMemcpy3DAsync`] to return an error.
    ///
    /// The srcPos and dstPos fields are optional offsets into the source and destination objects and are defined in units of each object's elements. The
    /// element for a host or device pointer is assumed to be **unsigned char**. For CUDA arrays, positions must be in the range [0, 2048) for any dimension.
    ///
    /// The extent field defines the dimensions of the transferred area in elements. If a CUDA array is participating in the copy, the extent
    /// is defined in terms of that array's elements. If no CUDA array is participating in the copy then the extents are defined in
    /// elements of **unsigned char**.
    ///
    /// The kind field defines the direction of the copy. It must be one of [cudaMemcpyHostToHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg18fa99055ee694244a270e4d5101e95bdeec295de8a74ac2a74f98ffb6c5d7c7), [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. For [`cudaMemcpyKind::cudaMemcpyHostToHost`] or [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] passed as kind and cudaArray type passed as source or destination, if the kind implies cudaArray type to be present on the
    /// host, [`cudaMemcpy3DAsync`] will disregard that implication and silently correct the kind based on the fact that cudaArray type can only be present on
    /// the device.
    ///
    /// If the source and destination are both arrays, [`cudaMemcpy3DAsync`] will return an error if they do not have the same element size.
    ///
    /// The source and destination object may not overlap. If overlapping source and destination objects are specified, undefined
    /// behavior will result.
    ///
    /// The source object must lie entirely within the region defined by srcPos and extent. The destination object must lie entirely within the region defined by dstPos and extent.
    ///
    /// [`cudaMemcpy3DAsync`] returns an error if the pitch of srcPtr or dstPtr exceeds the maximum allowed. The pitch of a [`cudaPitchedPtr`] allocated with [`cudaMalloc3D`] will always be valid.
    ///
    /// [`cudaMemcpy3DAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be
    /// associated to a stream by passing a non-zero stream argument. If kind is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and stream is non-zero, the copy may overlap with operations in other streams.
    ///
    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMalloc3D`], [`cudaMalloc3DArray`], [`cudaMemset3D`], [`cudaMemcpy3D`], [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], :[`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], `make_cudaExtent`, `make_cudaPos`, [cuMemcpy3DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g79f4f3fde6ae0f529568d881d9e11987).
    ///
    /// # Parameters
    ///
    /// - `p`: 3D memory copy parameters.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpy3DAsync(
        p: *const cudaMemcpy3DParms,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies memory between devices asynchronously.
    ///
    /// Perform a 3D memory copy according to the parameters specified in p. See the definition of the [`cudaMemcpy3DPeerParms`] 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpyPeerAsync`], [`cudaMemcpy3DPeerAsync`], [cuMemcpy3DPeerAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gc4e4bfd9f627d3aa3695979e058f1bb8).
    ///
    /// # Parameters
    ///
    /// - `p`: Parameters for the memory copy.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpy3DPeerAsync(
        p: *const cudaMemcpy3DPeerParms,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Gets free and total device 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.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuMemGetInfo](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g808f555540d0143a331cc42aa98835c0).
    ///
    /// # Parameters
    ///
    /// - `free`: Returned free memory in bytes.
    /// - `total`: Returned total memory in bytes.
    pub fn cudaMemGetInfo(free: *mut size_t, total: *mut size_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Gets info about the specified cudaArray.
    ///
    /// Returns in \*desc, \*extent and \*flags respectively, the type, shape and flags of array.
    ///
    /// Any of \*desc, \*extent and \*flags may be specified as NULL.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuArrayGetDescriptor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g661fe823dbd37bf11f82a71bd4762acf), [cuArray3DGetDescriptor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gb58549f2f3f390b9e0e7c8f3acd53857).
    ///
    /// # Parameters
    ///
    /// - `desc`: Returned array type.
    /// - `extent`: Returned array shape. 2D arrays will have depth of zero.
    /// - `flags`: Returned array flags.
    /// - `array`: The cudaArray to get info for.
    pub fn cudaArrayGetInfo(
        desc: *mut cudaChannelFormatDesc,
        extent: *mut cudaExtent,
        flags: *mut ::core::ffi::c_uint,
        array: cudaArray_t,
    ) -> cudaError_t;
}
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: [`cudaChannelFormatKind::cudaChannelFormatKindNV12`], then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// Note that if the hArray has format [`cudaChannelFormatKind::cudaChannelFormatKindNV12`], then passing in 0 for planeIdx returns a CUDA array of the same size as hArray but with one 8-bit channel and [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`] as its format kind. If 1 is passed for planeIdx, then the returned CUDA array has half the height and width of hArray with two 8-bit channels and [`cudaChannelFormatKind::cudaChannelFormatKindUnsigned`] as its format kind.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cuArrayGetPlane](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1ge66ce245a1e3802f9ccc3583cec6b71f).
    ///
    /// # Parameters
    ///
    /// - `pPlaneArray`: Returned CUDA array referenced by the planeIdx.
    /// - `hArray`: CUDA array.
    /// - `planeIdx`: Plane index.
    pub fn cudaArrayGetPlane(
        pPlaneArray: *mut cudaArray_t,
        hArray: cudaArray_t,
        planeIdx: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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 `cudaArrayDeferredMapping`[cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// The returned value in [cudaArrayMemoryRequirements::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArrayMemoryRequirements.html#structcudaArrayMemoryRequirements_1cff0bc12daa05c6c40892a2187befd87) represents the total size of the CUDA array. The returned value in [cudaArrayMemoryRequirements::alignment](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArrayMemoryRequirements.html#structcudaArrayMemoryRequirements_137898b13b500d39e4a43d0ee04cf0ef3) represents the alignment necessary for mapping the CUDA array.
    ///
    /// **See also:**
    ///
    /// [`cudaMipmappedArrayGetMemoryRequirements`].
    ///
    /// # Parameters
    ///
    /// - `memoryRequirements`: Pointer to `cudaArrayMemoryRequirements`.
    /// - `array`: CUDA array to get the memory requirements of.
    /// - `device`: Device to get the memory requirements for.
    pub fn cudaArrayGetMemoryRequirements(
        memoryRequirements: *mut cudaArrayMemoryRequirements,
        array: cudaArray_t,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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 `cudaArrayDeferredMapping`[cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// The returned value in [cudaArrayMemoryRequirements::size](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArrayMemoryRequirements.html#structcudaArrayMemoryRequirements_1cff0bc12daa05c6c40892a2187befd87) represents the total size of the CUDA mipmapped array. The returned value in [cudaArrayMemoryRequirements::alignment](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArrayMemoryRequirements.html#structcudaArrayMemoryRequirements_137898b13b500d39e4a43d0ee04cf0ef3) represents the alignment necessary for mapping the CUDA mipmapped array.
    ///
    /// **See also:**
    ///
    /// [`cudaArrayGetMemoryRequirements`].
    ///
    /// # Parameters
    ///
    /// - `memoryRequirements`: Pointer to `cudaArrayMemoryRequirements`.
    /// - `mipmap`: CUDA mipmapped array to get the memory requirements of.
    /// - `device`: Device to get the memory requirements for.
    pub fn cudaMipmappedArrayGetMemoryRequirements(
        memoryRequirements: *mut cudaArrayMemoryRequirements,
        mipmap: cudaMipmappedArray_t,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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 `cudaArraySparse`[cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// If the returned value in [cudaArraySparseProperties::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_144c8728469d60e511aceb4ba7086c164) contains `cudaArraySparsePropertiesSingleMipTail`, then [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_122cfa4ad83195f0e9585303c988bb886) represents the total size of the array. Otherwise, it will be zero. Also, the returned value in [cudaArraySparseProperties::miptailFirstLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_1b6909e5db55b866477b6cc16fb02f9d3) is always zero. Note that the array must have been allocated using [`cudaMallocArray`] or [`cudaMalloc3DArray`]. For CUDA arrays obtained using cudaMipmappedArrayGetLevel, [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) will be returned. Instead, [`cudaMipmappedArrayGetSparseProperties`] must be used to obtain the sparse properties of the entire CUDA mipmapped array to which array belongs to.
    ///
    /// **See also:**
    ///
    /// [`cudaMipmappedArrayGetSparseProperties`], [cuMemMapArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g5dc41a62a9feb68f2e943b438c83e5ab).
    ///
    /// # Parameters
    ///
    /// - `sparseProperties`: Pointer to return the `cudaArraySparseProperties`.
    /// - `array`: The CUDA array to get the sparse properties of.
    pub fn cudaArrayGetSparseProperties(
        sparseProperties: *mut cudaArraySparseProperties,
        array: cudaArray_t,
    ) -> cudaError_t;
}
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 `cudaArraySparse`[cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// For non-layered CUDA mipmapped arrays, [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_122cfa4ad83195f0e9585303c988bb886) 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 [cudaArraySparseProperties::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_144c8728469d60e511aceb4ba7086c164) contains `cudaArraySparsePropertiesSingleMipTail`, then [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_122cfa4ad83195f0e9585303c988bb886) specifies the size of the mip tail of all layers combined. Otherwise, [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_122cfa4ad83195f0e9585303c988bb886) specifies mip tail size per layer. The returned value of [cudaArraySparseProperties::miptailFirstLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_1b6909e5db55b866477b6cc16fb02f9d3) is valid only if [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaArraySparseProperties.html#structcudaArraySparseProperties_122cfa4ad83195f0e9585303c988bb886) is non-zero.
    ///
    /// **See also:**
    ///
    /// [`cudaArrayGetSparseProperties`], [cuMemMapArrayAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VA.html#group__CUDA__VA_1g5dc41a62a9feb68f2e943b438c83e5ab).
    ///
    /// # Parameters
    ///
    /// - `sparseProperties`: Pointer to return `cudaArraySparseProperties`.
    /// - `mipmap`: The CUDA mipmapped array to get the sparse properties of.
    pub fn cudaMipmappedArrayGetSparseProperties(
        sparseProperties: *mut cudaArraySparseProperties,
        mipmap: cudaMipmappedArray_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// Copies count bytes from the memory area pointed to by src to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. Calling [`cudaMemcpy`] with dst and src pointers that do not match the direction of the copy results in an undefined behavior.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * This function exhibits [synchronous](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpyDtoH](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g3480368ee0208a98f75019c9a8450893), [cuMemcpyHtoD](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g4d32266788c440b0220b1a9ba5795169), [cuMemcpyDtoD](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g1725774abf8b51b91945f3336b778c8b), [cuMemcpy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g8d0ff510f26d4b87bd3a51e731e7f698).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    pub fn cudaMemcpy(
        dst: *mut ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies memory between two devices.
    ///
    /// Copies memory from one device to memory on another device. dst is the base device pointer of the destination memory and dstDevice is the destination device. src is the base device pointer of the source memory and srcDevice is the source device. count specifies the number of bytes to copy.
    ///
    /// Note that this function is asynchronous with respect to the host, but serialized with respect all pending and future asynchronous
    /// work in to the current device, srcDevice, and dstDevice (use [`cudaMemcpyPeerAsync`] to avoid this synchronization).
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpyAsync`], [`cudaMemcpyPeerAsync`], [`cudaMemcpy3DPeerAsync`], [cuMemcpyPeer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1ge1f5c7771544fee150ada8853c7cbf4a).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination device pointer.
    /// - `dstDevice`: Destination device.
    /// - `src`: Source device pointer.
    /// - `srcDevice`: Source device.
    /// - `count`: Size of memory copy in bytes.
    pub fn cudaMemcpyPeer(
        dst: *mut ::core::ffi::c_void,
        dstDevice: ::core::ffi::c_int,
        src: *const ::core::ffi::c_void,
        srcDevice: ::core::ffi::c_int,
        count: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// Copies a matrix (height rows of width bytes each) from the memory area pointed to by src to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. dpitch and spitch are the widths in memory in bytes of the 2D arrays pointed to by dst and src, including any padding added to the end of each row. The memory areas may not overlap. width must not exceed either dpitch or spitch. Calling [`cudaMemcpy2D`] with dst and src pointers that do not match the direction of the copy results in an undefined behavior. [`cudaMemcpy2D`] returns an error if dpitch or spitch exceeds the maximum allowed.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * 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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpy2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g27f885b30c34cc20a663a671dbf6fc27), [cuMemcpy2DUnaligned](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g2fa285d47fd7020e596bfeab3deb651b).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `dpitch`: Pitch of destination memory.
    /// - `src`: Source memory address.
    /// - `spitch`: Pitch of source memory.
    /// - `width`: Width of matrix transfer (columns in bytes).
    /// - `height`: Height of matrix transfer (rows).
    /// - `kind`: Type of transfer.
    pub fn cudaMemcpy2D(
        dst: *mut ::core::ffi::c_void,
        dpitch: size_t,
        src: *const ::core::ffi::c_void,
        spitch: size_t,
        width: size_t,
        height: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// Copies a matrix (height rows of width bytes each) from the memory area pointed to by src to the CUDA array dst starting at hOffset rows and wOffset bytes from the upper left corner, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. spitch is the width in memory in bytes of the 2D array pointed to by src, including any padding added to the end of each row. wOffset + width must not exceed the width of the CUDA array dst. width must not exceed spitch. [`cudaMemcpy2DToArray`] returns an error if spitch exceeds the maximum allowed.
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * 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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpy2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g27f885b30c34cc20a663a671dbf6fc27), [cuMemcpy2DUnaligned](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g2fa285d47fd7020e596bfeab3deb651b).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `wOffset`: Destination starting X offset (columns in bytes).
    /// - `hOffset`: Destination starting Y offset (rows).
    /// - `src`: Source memory address.
    /// - `spitch`: Pitch of source memory.
    /// - `width`: Width of matrix transfer (columns in bytes).
    /// - `height`: Height of matrix transfer (rows).
    /// - `kind`: Type of transfer.
    pub fn cudaMemcpy2DToArray(
        dst: cudaArray_t,
        wOffset: size_t,
        hOffset: size_t,
        src: *const ::core::ffi::c_void,
        spitch: size_t,
        width: size_t,
        height: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// Copies a matrix (height rows of width bytes each) from the CUDA array src starting at hOffset rows and wOffset bytes from the upper left corner to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. dpitch is the width in memory in bytes of the 2D array pointed to by dst, including any padding added to the end of each row. wOffset + width must not exceed the width of the CUDA array src. width must not exceed dpitch. [`cudaMemcpy2DFromArray`] returns an error if dpitch exceeds the maximum allowed.
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * 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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpy2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g27f885b30c34cc20a663a671dbf6fc27), [cuMemcpy2DUnaligned](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g2fa285d47fd7020e596bfeab3deb651b).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `dpitch`: Pitch of destination memory.
    /// - `src`: Source memory address.
    /// - `wOffset`: Source starting X offset (columns in bytes).
    /// - `hOffset`: Source starting Y offset (rows).
    /// - `width`: Width of matrix transfer (columns in bytes).
    /// - `height`: Height of matrix transfer (rows).
    /// - `kind`: Type of transfer.
    pub fn cudaMemcpy2DFromArray(
        dst: *mut ::core::ffi::c_void,
        dpitch: size_t,
        src: cudaArray_const_t,
        wOffset: size_t,
        hOffset: size_t,
        width: size_t,
        height: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// Copies a matrix (height rows of width bytes each) from the CUDA array src starting at hOffsetSrc rows and wOffsetSrc bytes from the upper left corner to the CUDA array dst starting at hOffsetDst rows and wOffsetDst bytes from the upper left corner, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. wOffsetDst + width must not exceed the width of the CUDA array dst. wOffsetSrc + width must not exceed the width of the CUDA array src.
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpy2D](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g27f885b30c34cc20a663a671dbf6fc27), [cuMemcpy2DUnaligned](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g2fa285d47fd7020e596bfeab3deb651b).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `wOffsetDst`: Destination starting X offset (columns in bytes).
    /// - `hOffsetDst`: Destination starting Y offset (rows).
    /// - `src`: Source memory address.
    /// - `wOffsetSrc`: Source starting X offset (columns in bytes).
    /// - `hOffsetSrc`: Source starting Y offset (rows).
    /// - `width`: Width of matrix transfer (columns in bytes).
    /// - `height`: Height of matrix transfer (rows).
    /// - `kind`: Type of transfer.
    pub fn cudaMemcpy2DArrayToArray(
        dst: cudaArray_t,
        wOffsetDst: size_t,
        hOffsetDst: size_t,
        src: cudaArray_const_t,
        wOffsetSrc: size_t,
        hOffsetSrc: size_t,
        width: size_t,
        height: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `symbol`: Device symbol reference.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    pub fn cudaMemcpyToSymbol(
        symbol: *const ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `symbol`: Device symbol reference.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    pub fn cudaMemcpyFromSymbol(
        dst: *mut ::core::ffi::c_void,
        symbol: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpyAsync(
        dst: *mut ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        kind: cudaMemcpyKind,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies memory between two devices asynchronously.
    ///
    /// Copies memory from one device to memory on another device. dst is the base device pointer of the destination memory and dstDevice is the destination device. src is the base device pointer of the source memory and srcDevice is the source device. count specifies the number of bytes to copy.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpy3DPeerAsync`], [cuMemcpyPeerAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g82fcecb38018e64b98616a8ac30112f2).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination device pointer.
    /// - `dstDevice`: Destination device.
    /// - `src`: Source device pointer.
    /// - `srcDevice`: Source device.
    /// - `count`: Size of memory copy in bytes.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpyPeerAsync(
        dst: *mut ::core::ffi::c_void,
        dstDevice: ::core::ffi::c_int,
        src: *const ::core::ffi::c_void,
        srcDevice: ::core::ffi::c_int,
        count: size_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # 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.
    pub fn cudaMemcpyBatchAsync(
        dsts: *const *mut ::core::ffi::c_void,
        srcs: *const *const ::core::ffi::c_void,
        sizes: *const size_t,
        count: size_t,
        attrs: *mut cudaMemcpyAttributes,
        attrsIdxs: *mut size_t,
        numAttrs: size_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
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 cudaMemcpy3DBatchOp::src and cudaMemcpy3DBatchOp::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 cudaMemcpy3DBatchOp::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 cudaMemcpy3DOperand::type is specified as [cudaMemcpyOperandTypePointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggda2d93832ded1a29fd7cb28a6261ee6c395369a66615a9cacf1a734334859a67), then cudaMemcpy3DOperand::op::ptr will be used. The cudaMemcpy3DOperand::op::ptr::ptr field must contain the pointer where
    /// the copy should begin. The cudaMemcpy3DOperand::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 cudaMemcpy3DBatchOp::extent::width.
    /// The cudaMemcpy3DOperand::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 cudaMemcpy3DBatchOp::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 [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09) is true or system-allocated pageable memory on devices where [cudaDevAttrPageableMemoryAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cddc80992427a92713e699953a6d249d6f) is true, the cudaMemcpy3DOperand::op::ptr::locHint field can be used to hint the location of the operand.
    ///
    /// If an operand's type is specified as [cudaMemcpyOperandTypeArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggda2d93832ded1a29fd7cb28a6261ee6c468b9e5daeac88a1cddc387310cb2952), then cudaMemcpy3DOperand::op::array will be used. The cudaMemcpy3DOperand::op::array::array field specifies the CUDA array
    /// and cudaMemcpy3DOperand::op::array::offset specifies the 3D offset into that array where the copy begins.
    ///
    /// The [cudaMemcpyAttributes::srcAccessOrder](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemcpyAttributes.html#structcudaMemcpyAttributes_10d466b9b554cfd529fa0d0344c0c391a) indicates the source access ordering to be observed for copies associated with the attribute. If the source access order
    /// is set to [cudaMemcpySrcAccessOrderStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg1a0bf7e313a2ef3dcabacefcf8a013b5b0c0860266a1fe9e640296317e8e32ae), then the source will be accessed in stream order. If the source access order is set to [cudaMemcpySrcAccessOrderDuringApiCall](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg1a0bf7e313a2ef3dcabacefcf8a013b5cf1101b874ba5ffe6ad6d89b7e807b29) 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 [cudaMemcpySrcAccessOrderAny](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg1a0bf7e313a2ef3dcabacefcf8a013b517b318d18bd58f8bfb6eb4b44a7d6949) 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 [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// The [cudaMemcpyAttributes::flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemcpyAttributes.html#structcudaMemcpyAttributes_1f18d7011fefaecb0fa72cbdbf8aad0fb) field can be used to specify certain flags for copies. Setting the [cudaMemcpyFlagPreferOverlapWithCompute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gge21aa0690949b1d1e5360e4edcf75dcffef0e1bac799cb33d1ee092124ced948) 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-runtime-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 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.
    pub fn cudaMemcpy3DBatchAsync(
        numOps: size_t,
        opList: *mut cudaMemcpy3DBatchOp,
        flags: ::core::ffi::c_ulonglong,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
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 `cudaMemcpyAttributes` and it's usage desciption [`cudaMemcpyBatchAsync`]
    ///
    /// 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-runtime-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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpyBatchAsync`]
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination device pointer.
    /// - `src`: Source device pointer.
    /// - `size`: Number of bytes to copy.
    /// - `attr`: Attributes for the copy.
    pub fn cudaMemcpyWithAttributesAsync(
        dst: *mut ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        size: size_t,
        attr: *mut cudaMemcpyAttributes,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Performs 3D asynchronous memory copy with the specified attributes.
    ///
    /// 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 cudaMemcpy3DBatchOp and it's usage desciption [`cudaMemcpy3DBatchAsync`]
    ///
    /// 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-runtime-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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy3DBatchAsync`].
    ///
    /// # Parameters
    ///
    /// - `op`: Operation to perform.
    /// - `flags`: Flags for the copy, must be zero now.
    pub fn cudaMemcpy3DWithAttributesAsync(
        op: *mut cudaMemcpy3DBatchOp,
        flags: ::core::ffi::c_ulonglong,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// Copies a matrix (height rows of width bytes each) from the memory area pointed to by src to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. dpitch and spitch are the widths in memory in bytes of the 2D arrays pointed to by dst and src, including any padding added to the end of each row. The memory areas may not overlap. width must not exceed either dpitch or spitch.
    ///
    /// Calling [`cudaMemcpy2DAsync`] with dst and src pointers that do not match the direction of the copy results in an undefined behavior. [`cudaMemcpy2DAsync`] returns an error if dpitch or spitch is greater than the maximum allowed.
    ///
    /// [`cudaMemcpy2DAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be
    /// associated to a stream by passing a non-zero stream argument. If kind is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and stream is non-zero, the copy may overlap with operations in other streams.
    ///
    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * 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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpy2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g4acf155faeb969d9d21f5433d3d0f274).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `dpitch`: Pitch of destination memory.
    /// - `src`: Source memory address.
    /// - `spitch`: Pitch of source memory.
    /// - `width`: Width of matrix transfer (columns in bytes).
    /// - `height`: Height of matrix transfer (rows).
    /// - `kind`: Type of transfer.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpy2DAsync(
        dst: *mut ::core::ffi::c_void,
        dpitch: size_t,
        src: *const ::core::ffi::c_void,
        spitch: size_t,
        width: size_t,
        height: size_t,
        kind: cudaMemcpyKind,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// Copies a matrix (height rows of width bytes each) from the memory area pointed to by src to the CUDA array dst starting at hOffset rows and wOffset bytes from the upper left corner, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. spitch is the width in memory in bytes of the 2D array pointed to by src, including any padding added to the end of each row. wOffset + width must not exceed the width of the CUDA array dst. width must not exceed spitch. [`cudaMemcpy2DToArrayAsync`] returns an error if spitch exceeds the maximum allowed.
    ///
    /// [`cudaMemcpy2DToArrayAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be
    /// associated to a stream by passing a non-zero stream argument. If kind is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and stream is non-zero, the copy may overlap with operations in other streams.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * 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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`],
    ///
    /// [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpy2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g4acf155faeb969d9d21f5433d3d0f274).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `wOffset`: Destination starting X offset (columns in bytes).
    /// - `hOffset`: Destination starting Y offset (rows).
    /// - `src`: Source memory address.
    /// - `spitch`: Pitch of source memory.
    /// - `width`: Width of matrix transfer (columns in bytes).
    /// - `height`: Height of matrix transfer (rows).
    /// - `kind`: Type of transfer.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpy2DToArrayAsync(
        dst: cudaArray_t,
        wOffset: size_t,
        hOffset: size_t,
        src: *const ::core::ffi::c_void,
        spitch: size_t,
        width: size_t,
        height: size_t,
        kind: cudaMemcpyKind,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// Copies a matrix (height rows of width bytes each) from the CUDA array src starting at hOffset rows and wOffset bytes from the upper left corner to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. dpitch is the width in memory in bytes of the 2D array pointed to by dst, including any padding added to the end of each row. wOffset + width must not exceed the width of the CUDA array src. width must not exceed dpitch. [`cudaMemcpy2DFromArrayAsync`] returns an error if dpitch exceeds the maximum allowed.
    ///
    /// [`cudaMemcpy2DFromArrayAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be
    /// associated to a stream by passing a non-zero stream argument. If kind is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and stream is non-zero, the copy may overlap with operations in other streams.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * 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 CUDA_ERROR_INVALID_VALUE.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`],
    ///
    /// [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpy2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g4acf155faeb969d9d21f5433d3d0f274).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `dpitch`: Pitch of destination memory.
    /// - `src`: Source memory address.
    /// - `wOffset`: Source starting X offset (columns in bytes).
    /// - `hOffset`: Source starting Y offset (rows).
    /// - `width`: Width of matrix transfer (columns in bytes).
    /// - `height`: Height of matrix transfer (rows).
    /// - `kind`: Type of transfer.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpy2DFromArrayAsync(
        dst: *mut ::core::ffi::c_void,
        dpitch: size_t,
        src: cudaArray_const_t,
        wOffset: size_t,
        hOffset: size_t,
        width: size_t,
        height: size_t,
        kind: cudaMemcpyKind,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `symbol`: Device symbol reference.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpyToSymbolAsync(
        symbol: *const ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `symbol`: Device symbol reference.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpyFromSymbolAsync(
        dst: *mut ::core::ffi::c_void,
        symbol: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Initializes or sets device memory to a value.
    ///
    /// Fills the first count bytes of the memory area pointed to by devPtr with the constant byte value value.
    ///
    /// Note that this function is asynchronous with respect to the host unless devPtr refers to pinned host memory.
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuMemsetD8](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g6e582bf866e9e2fb014297bfaf354d7b), [cuMemsetD16](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g7d805e610054392a4d11e8a8bf5eb35c), [cuMemsetD32](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g983e8d8759acd1b64326317481fbf132).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to device memory.
    /// - `value`: Value to set for each byte of specified memory.
    /// - `count`: Size in bytes to set.
    pub fn cudaMemset(
        devPtr: *mut ::core::ffi::c_void,
        value: ::core::ffi::c_int,
        count: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Initializes or sets device memory to a value.
    ///
    /// Sets to the specified value value a matrix (height rows of width bytes each) pointed to by dstPtr. pitch is the width in bytes of the 2D array pointed to by dstPtr, including any padding added to the end of each row. This function performs fastest when the pitch is one that has been passed
    /// back by [`cudaMallocPitch`].
    ///
    /// Note that this function is asynchronous with respect to the host unless devPtr refers to pinned host memory.
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemset`], [`cudaMemset3D`], [`cudaMemsetAsync`], [`cudaMemset2DAsync`], [`cudaMemset3DAsync`], [cuMemsetD2D8](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1ge88b13e646e2be6ba0e0475ef5205974), [cuMemsetD2D16](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g7f561a15a66144fa9f6ab5350edc8a30), [cuMemsetD2D32](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g74b359b2d026bfeb7c795b5038d07523).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to 2D device memory.
    /// - `pitch`: Pitch in bytes of 2D device memory(Unused if height is 1).
    /// - `value`: Value to set for each byte of specified memory.
    /// - `width`: Width of matrix set (columns in bytes).
    /// - `height`: Height of matrix set (rows).
    pub fn cudaMemset2D(
        devPtr: *mut ::core::ffi::c_void,
        pitch: size_t,
        value: ::core::ffi::c_int,
        width: size_t,
        height: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Initializes or sets device memory to a value.
    ///
    /// Initializes each element of a 3D array to the specified value value. The object to initialize is defined by pitchedDevPtr. The pitch field of pitchedDevPtr is the width in memory in bytes of the 3D array pointed to by pitchedDevPtr, including any padding added to the end of each row. The xsize field specifies the logical width of each row in bytes, while the ysize field specifies the height of each 2D slice in rows. The pitch field of pitchedDevPtr is ignored when height and depth are both equal to 1.
    ///
    /// The extents of the initialized region are specified as a width in bytes, a height in rows, and a depth in slices.
    ///
    /// Extents with width greater than or equal to the xsize of pitchedDevPtr may perform significantly faster than extents narrower than the xsize. Secondarily, extents with height equal to the ysize of pitchedDevPtr will perform faster than when the height is shorter than the ysize.
    ///
    /// This function performs fastest when the pitchedDevPtr has been allocated by [`cudaMalloc3D`].
    ///
    /// Note that this function is asynchronous with respect to the host unless pitchedDevPtr refers to pinned host memory.
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memset).
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemset`], [`cudaMemset2D`], [`cudaMemsetAsync`], [`cudaMemset2DAsync`], [`cudaMemset3DAsync`], [`cudaMalloc3D`], `make_cudaPitchedPtr`, `make_cudaExtent`.
    ///
    /// # Parameters
    ///
    /// - `pitchedDevPtr`: Pointer to pitched device memory.
    /// - `value`: Value to set for each byte of specified memory.
    /// - `extent`: Size parameters for where to set device memory (width field in bytes).
    pub fn cudaMemset3D(
        pitchedDevPtr: cudaPitchedPtr,
        value: ::core::ffi::c_int,
        extent: cudaExtent,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Initializes or sets device memory to a value.
    ///
    /// Fills the first count bytes of the memory area pointed to by devPtr with the constant byte value value.
    ///
    /// [`cudaMemsetAsync`] is asynchronous with respect to the host, so the call may return before the memset is complete. The operation can optionally
    /// be associated to a stream by passing a non-zero stream argument. If stream is non-zero, the operation may overlap with operations in other streams.
    ///
    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemset`], [`cudaMemset2D`], [`cudaMemset3D`], [`cudaMemset2DAsync`], [`cudaMemset3DAsync`], [cuMemsetD8Async](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gaef08a7ccd61112f94e82f2b30d43627), [cuMemsetD16Async](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gf731438877dd8ec875e4c43d848c878c), [cuMemsetD32Async](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g58229da5d30f1c0cdf667b320ec2c0f5).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to device memory.
    /// - `value`: Value to set for each byte of specified memory.
    /// - `count`: Size in bytes to set.
    /// - `stream`: Stream identifier.
    pub fn cudaMemsetAsync(
        devPtr: *mut ::core::ffi::c_void,
        value: ::core::ffi::c_int,
        count: size_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Initializes or sets device memory to a value.
    ///
    /// Sets to the specified value value a matrix (height rows of width bytes each) pointed to by dstPtr. pitch is the width in bytes of the 2D array pointed to by dstPtr, including any padding added to the end of each row. This function performs fastest when the pitch is one that has been passed
    /// back by [`cudaMallocPitch`].
    ///
    /// [`cudaMemset2DAsync`] is asynchronous with respect to the host, so the call may return before the memset is complete. The operation can optionally
    /// be associated to a stream by passing a non-zero stream argument. If stream is non-zero, the operation may overlap with operations in other streams.
    ///
    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemset`], [`cudaMemset2D`], [`cudaMemset3D`], [`cudaMemsetAsync`], [`cudaMemset3DAsync`], [cuMemsetD2D8Async](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g3f7b6924a3e49c3265b328f534102e97), [cuMemsetD2D16Async](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g64ee197befac3d74d9fefedcf6ef6b10), [cuMemsetD2D32Async](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g8a78d3147ac93fac955052c815d9ea3c).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to 2D device memory.
    /// - `pitch`: Pitch in bytes of 2D device memory(Unused if height is 1).
    /// - `value`: Value to set for each byte of specified memory.
    /// - `width`: Width of matrix set (columns in bytes).
    /// - `height`: Height of matrix set (rows).
    /// - `stream`: Stream identifier.
    pub fn cudaMemset2DAsync(
        devPtr: *mut ::core::ffi::c_void,
        pitch: size_t,
        value: ::core::ffi::c_int,
        width: size_t,
        height: size_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Initializes or sets device memory to a value.
    ///
    /// Initializes each element of a 3D array to the specified value value. The object to initialize is defined by pitchedDevPtr. The pitch field of pitchedDevPtr is the width in memory in bytes of the 3D array pointed to by pitchedDevPtr, including any padding added to the end of each row. The xsize field specifies the logical width of each row in bytes, while the ysize field specifies the height of each 2D slice in rows. The pitch field of pitchedDevPtr is ignored when height and depth are both equal to 1.
    ///
    /// The extents of the initialized region are specified as a width in bytes, a height in rows, and a depth in slices.
    ///
    /// Extents with width greater than or equal to the xsize of pitchedDevPtr may perform significantly faster than extents narrower than the xsize. Secondarily, extents with height equal to the ysize of pitchedDevPtr will perform faster than when the height is shorter than the ysize.
    ///
    /// This function performs fastest when the pitchedDevPtr has been allocated by [`cudaMalloc3D`].
    ///
    /// [`cudaMemset3DAsync`] is asynchronous with respect to the host, so the call may return before the memset is complete. The operation can optionally
    /// be associated to a stream by passing a non-zero stream argument. If stream is non-zero, the operation may overlap with operations in other streams.
    ///
    /// The device version of this function only handles device to device copies and cannot be given local or shared pointers.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemset`], [`cudaMemset2D`], [`cudaMemset3D`], [`cudaMemsetAsync`], [`cudaMemset2DAsync`], [`cudaMalloc3D`], `make_cudaPitchedPtr`, `make_cudaExtent`.
    ///
    /// # Parameters
    ///
    /// - `pitchedDevPtr`: Pointer to pitched device memory.
    /// - `value`: Value to set for each byte of specified memory.
    /// - `extent`: Size parameters for where to set device memory (width field in bytes).
    /// - `stream`: Stream identifier.
    pub fn cudaMemset3DAsync(
        pitchedDevPtr: cudaPitchedPtr,
        value: ::core::ffi::c_int,
        extent: cudaExtent,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `devPtr`: Return device pointer associated with symbol.
    /// - `symbol`: Device symbol reference.
    pub fn cudaGetSymbolAddress(
        devPtr: *mut *mut ::core::ffi::c_void,
        symbol: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `size`: Size of object associated with symbol.
    /// - `symbol`: Device symbol reference.
    pub fn cudaGetSymbolSize(
        size: *mut size_t,
        symbol: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
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. stream is the stream in which the operation is enqueued. The memory range must refer to managed memory allocated via [`cudaMallocManaged`] or declared via __managed__ variables, or it may also refer to memory allocated from a managed memory pool, or it may also
    /// refer to system-allocated memory on systems with non-zero cudaDevAttrPageableMemoryAccess.
    ///
    /// Specifying [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4) for [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) will prefetch memory to GPU specified by device ordinal [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) which must have non-zero value for the device attribute concurrentManagedAccess. Additionally, stream must be associated with a device that has a non-zero value for the device attribute concurrentManagedAccess. Specifying [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) as [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) will prefetch data to host memory. Applications can request prefetching memory to a specific host NUMA node by specifying
    /// [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0) for [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) and a valid host NUMA node id in [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) Users can also request prefetching memory to the host NUMA node closest to the current thread's CPU by specifying [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0a3925690e32332c940cb726ef56a4258) for [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0). Note when [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) is etiher [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) OR [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0a3925690e32332c940cb726ef56a4258), [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) 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
    /// [`cudaMallocManaged`] allocations to host memory in order to make room. Device memory allocated using [`cudaMalloc`] or [`cudaMallocArray`] 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](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__UNIFIED.html#group__CUDA__UNIFIED_1gaac8924b2f5a2a93f8775fb81c1a643f) as described below:
    ///
    /// If [cudaMemAdviseSetReadMostly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857441d911811beda174627f403142d5ff0) 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 [cudaMemAdviseSetPreferredLocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857a4a2bc3c7d218dcd9a1b425b432759eb) 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 [cudaMemAdviseSetAccessedBy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c85750a22279bce0dc29956ad4f257084623) 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpy3DPeerAsync`], [`cudaMemAdvise`], [cuMemPrefetchAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__UNIFIED.html#group__CUDA__UNIFIED_1g45c0e085febc3be8fabf5c526355b6a3).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to be prefetched.
    /// - `count`: Size in bytes.
    /// - `location`: location to prefetch to.
    /// - `flags`: flags for future use, must be zero now.
    /// - `stream`: Stream to enqueue prefetch operation.
    pub fn cudaMemPrefetchAsync(
        devPtr: *const ::core::ffi::c_void,
        count: size_t,
        location: cudaMemLocation,
        flags: ::core::ffi::c_uint,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # 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.
    pub fn cudaMemPrefetchBatchAsync(
        dptrs: *mut *mut ::core::ffi::c_void,
        sizes: *mut size_t,
        count: size_t,
        prefetchLocs: *mut cudaMemLocation,
        prefetchLocIdxs: *mut size_t,
        numPrefetchLocs: size_t,
        flags: ::core::ffi::c_ulonglong,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
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 [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09) 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 [`cudaMemPrefetchAsync`] or [`cudaMemPrefetchBatchAsync`]. 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 [`cudaMallocManaged`] or declared via __managed__ variables or it may also refer to system-allocated memory when all devices have a non-zero value
    /// for [cudaDevAttrPageableMemoryAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cddc80992427a92713e699953a6d249d6f).
    ///
    /// # 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.
    pub fn cudaMemDiscardBatchAsync(
        dptrs: *mut *mut ::core::ffi::c_void,
        sizes: *mut size_t,
        count: size_t,
        flags: ::core::ffi::c_ulonglong,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # 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.
    pub fn cudaMemDiscardAndPrefetchBatchAsync(
        dptrs: *mut *mut ::core::ffi::c_void,
        sizes: *mut size_t,
        count: size_t,
        prefetchLocs: *mut cudaMemLocation,
        prefetchLocIdxs: *mut size_t,
        numPrefetchLocs: size_t,
        flags: ::core::ffi::c_ulonglong,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
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 [`cudaMallocManaged`] 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:
    ///
    /// * [cudaMemAdviseSetReadMostly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857441d911811beda174627f403142d5ff0): 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 [`cudaMemPrefetchAsync`] or [`cudaMemPrefetchAsync`] is called on this region, it will create a read-only copy of the data on the destination processor. If the target location
    ///   for [`cudaMemPrefetchAsync`] 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 [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09). Also, if a context is created on a device that does not have the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09) 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 [cudaDevAttrPageableMemoryAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cddc80992427a92713e699953a6d249d6f) 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 [cudaDevAttrPageableMemoryAccessUsesHostPageTables](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc228cf8983c97d0e035da72a71494eaa), then setting this advice will not create a read-only copy when that device accesses this memory region.
    ///
    /// * cudaMemAdviceUnsetReadMostly: Undoes the effect of [cudaMemAdviseSetReadMostly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857441d911811beda174627f403142d5ff0) 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.
    ///
    /// * [cudaMemAdviseSetPreferredLocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857a4a2bc3c7d218dcd9a1b425b432759eb): This advice sets the preferred location for the data to be the memory belonging to location. When [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) is [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5), [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) 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 [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) to [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0) and [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) must specify the NUMA ID of the host NUMA node. If [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) is set to [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0a3925690e32332c940cb726ef56a4258), [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) will be ignored and the host NUMA node closest to the calling thread's CPU will be used as the preferred location. If [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) is a [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4), then [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) must be a valid device ordinal and the device must have a non-zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09). 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 [`cudaMemPrefetchAsync`]. 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 [cudaMemAdviseSetReadMostly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857441d911811beda174627f403142d5ff0) 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 [cudaMemAdviseSetReadMostly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857441d911811beda174627f403142d5ff0). If the memory region refers to valid system-allocated pageable memory, and [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) is [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4) then [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) must be a valid device that has a non-zero alue for the device attribute [cudaDevAttrPageableMemoryAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cddc80992427a92713e699953a6d249d6f).
    ///
    /// * [cudaMemAdviseUnsetPreferredLocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857537caa36d8dddd3cedee0b2de7b74322): Undoes the effect of [cudaMemAdviseSetPreferredLocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857a4a2bc3c7d218dcd9a1b425b432759eb) and changes the preferred location to none. The location argument is ignored for this advice.
    ///
    /// * [cudaMemAdviseSetAccessedBy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c85750a22279bce0dc29956ad4f257084623): This advice implies that the data will be accessed by processor location. The [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) must be either [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4) with [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) representing a valid device ordinal or [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) and [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) will be ignored. All other location types are invalid. If [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) is a GPU, then the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09) 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 [cudaMemAdviseSetAccessedBy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c85750a22279bce0dc29956ad4f257084623) flag set for this data will now have its mapping updated to point to the page in host memory. If [cudaMemAdviseSetReadMostly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c857441d911811beda174627f403142d5ff0) 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 [CU_MEM_ADVISE_SET_PREFERRED_LOCATION](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1ggcfe2ed2d4567745dd4ad41034136fff3ddee285dc5e0e7d26469009ffd583cea) will override the policies of this advice. If the memory region refers to valid system-allocated pageable memory, and [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) is [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4) then device in [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) must have a non-zero value for the device attribute [cudaDevAttrPageableMemoryAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cddc80992427a92713e699953a6d249d6f). Additionally, if [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) has a non-zero value for the device attribute [cudaDevAttrPageableMemoryAccessUsesHostPageTables](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc228cf8983c97d0e035da72a71494eaa), then this call has no effect.
    ///
    /// * [CU_MEM_ADVISE_UNSET_ACCESSED_BY](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1ggcfe2ed2d4567745dd4ad41034136fff3f8118635c5f39d76432654ec13a726a5): Undoes the effect of [cudaMemAdviseSetAccessedBy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc314a8b14091f7e02a7ad15dcb36c85750a22279bce0dc29956ad4f257084623). 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 [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_16df2243c9f48e48ad92306df676b2fe0) is [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4) then device in [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) must have a non-zero value for the device attribute [cudaDevAttrPageableMemoryAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cddc80992427a92713e699953a6d249d6f). Additionally, if [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemLocation.html#structcudaMemLocation_11c914cd5c3cc7323b4fde9756458efb0) has a non-zero value for the device attribute [cudaDevAttrPageableMemoryAccessUsesHostPageTables](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc228cf8983c97d0e035da72a71494eaa), 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpyPeer`], [`cudaMemcpyAsync`], [`cudaMemcpy3DPeerAsync`], [`cudaMemPrefetchAsync`], [cuMemAdvise](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__UNIFIED.html#group__CUDA__UNIFIED_1gaac8924b2f5a2a93f8775fb81c1a643f).
    ///
    /// # 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 cudaMemAdvise(
        devPtr: *const ::core::ffi::c_void,
        count: size_t,
        advice: cudaMemoryAdvise,
        location: cudaMemLocation,
    ) -> cudaError_t;
}
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 [`cudaMallocManaged`] or declared via __managed__ variables.
    ///
    /// The attribute parameter can take the following values:
    ///
    /// * [cudaMemRangeAttributeReadMostly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a3794afd2109d3b8be3e1dd0fdfeed1275ee): 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.
    /// * [cudaMemRangeAttributePreferredLocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a37946c596738ff234fa4c82859349e698f7): 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 cudaCpuDeviceId if all pages in the memory range have the CPU as their preferred location, or it will
    ///   be cudaInvalidDeviceId 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.
    /// * [cudaMemRangeAttributeAccessedBy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a3790cbc6164d35671ca02e1b0813a8b7b20): 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 cudaMemAdviceSetAccessedBy 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, cudaInvalidDeviceId 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, cudaInvalidDeviceId, cudaInvalidDeviceId
    ///   }. 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.
    /// * [cudaMemRangeAttributeLastPrefetchLocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a3794e9e1521833d7ff0a4dcfbd2f6304592): 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 [`cudaMemPrefetchAsync`]. This will either be a GPU id or cudaCpuDeviceId 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, cudaInvalidDeviceId will be returned. Note that this simply returns the last location that the applicaton 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.
    /// * [cudaMemRangeAttributePreferredLocationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a379f2a7a75f029a9066e3cfea932c4870da): If this attribute is specified, data will be interpreted as a `cudaMemLocationType`, and dataSize must be sizeof(cudaMemLocationType). The `cudaMemLocationType` returned will be [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4) if all pages in the memory range have the same GPU as their preferred location, or `cudaMemLocationType` will be [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) if all pages in the memory range have the CPU as their preferred location, or or it will be [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0) if all the pages in the memory range have the same host NUMA node ID as their preferred location or it will be cudaMemLocationTypeInvalid
    ///   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.
    ///   + [cudaMemRangeAttributePreferredLocationId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a3794b4222e06b1067f90ffd9e1b250ce184): If this attribute is specified, data will be interpreted as a 32-bit integer, and dataSize must be 4. If the [cudaMemRangeAttributePreferredLocationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a379f2a7a75f029a9066e3cfea932c4870da) query for the same address range returns [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4), it will be a valid device ordinal or if it returns [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0), it will be a valid host NUMA node ID or if it returns any other location type, the id should be ignored.
    /// * [cudaMemRangeAttributeLastPrefetchLocationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a379f68f9fab3cfdeb75d08e8b129bdd6762): If this attribute is specified, data will be interpreted as a `cudaMemLocationType`, and dataSize must be sizeof(cudaMemLocationType). The result returned will be the last location type to which all pages in the memory
    ///   range were prefetched explicitly via [cuMemPrefetchAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__UNIFIED.html#group__CUDA__UNIFIED_1g45c0e085febc3be8fabf5c526355b6a3). The `cudaMemLocationType` returned will be [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4) if the last prefetch location was the GPU or [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) if it was the CPU or [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0) 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](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1g75cfd5b9fa5c1c6ee2be2547bfbe882e) will be cudaMemLocationTypeInvalid. 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.
    ///   + [cudaMemRangeAttributeLastPrefetchLocationId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a37919d650ef233ba3b126447b0b21cc6a96): If this attribute is specified, data will be interpreted as a 32-bit integer, and dataSize must be 4. If the [cudaMemRangeAttributeLastPrefetchLocationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a379f68f9fab3cfdeb75d08e8b129bdd6762) query for the same address range returns [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4), it will be a valid device ordinal or if it returns [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0), 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemRangeGetAttributes`], [`cudaMemPrefetchAsync`], [`cudaMemAdvise`], [cuMemRangeGetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__UNIFIED.html#group__CUDA__UNIFIED_1g1c92408a7d0d8875e19b1a58af56f67d).
    ///
    /// # 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 cudaMemRangeGetAttribute(
        data: *mut ::core::ffi::c_void,
        dataSize: size_t,
        attribute: cudaMemRangeAttribute,
        devPtr: *const ::core::ffi::c_void,
        count: size_t,
    ) -> cudaError_t;
}
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 [`cudaMallocManaged`] 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 [`cudaMemRangeGetAttribute`] for attribute descriptions and restrictions.
    ///
    /// * [cudaMemRangeAttributeReadMostly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a3794afd2109d3b8be3e1dd0fdfeed1275ee)
    /// * [cudaMemRangeAttributePreferredLocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a37946c596738ff234fa4c82859349e698f7)
    /// * [cudaMemRangeAttributeAccessedBy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a3790cbc6164d35671ca02e1b0813a8b7b20)
    /// * [cudaMemRangeAttributeLastPrefetchLocation](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggdfcc848da2b9f49661333f861ad1a3794e9e1521833d7ff0a4dcfbd2f6304592)
    /// * :: cudaMemRangeAttributePreferredLocationType
    /// * :: cudaMemRangeAttributePreferredLocationId
    /// * :: cudaMemRangeAttributeLastPrefetchLocationType
    /// * :: cudaMemRangeAttributeLastPrefetchLocationId
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemRangeGetAttribute`], [`cudaMemAdvise`], [`cudaMemPrefetchAsync`], [cuMemRangeGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__UNIFIED.html#group__CUDA__UNIFIED_1gc7ce142e60f8613cfb7d722b87dc9d12).
    ///
    /// # 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 cudaMemRangeGetAttributes(
        data: *mut *mut ::core::ffi::c_void,
        dataSizes: *mut size_t,
        attributes: *mut cudaMemRangeAttribute,
        numAttributes: size_t,
        devPtr: *const ::core::ffi::c_void,
        count: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// count
    ///
    /// src
    ///
    /// dst
    ///
    /// hOffset
    ///
    /// wOffset
    ///
    /// kind
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpy2DToArray`], [`cudaMemcpyFromArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyArrayToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpyToArrayAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpyFromArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpyHtoA](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g57d3d780d165ecc0e3b3ce08e141cd89), [cuMemcpyDtoA](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gad6827247af91600b56ce6e2ddb802e1).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `wOffset`: Destination starting X offset (columns in bytes).
    /// - `hOffset`: Destination starting Y offset (rows).
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    #[deprecated]
    pub fn cudaMemcpyToArray(
        dst: cudaArray_t,
        wOffset: size_t,
        hOffset: size_t,
        src: *const ::core::ffi::c_void,
        count: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// count
    ///
    /// src
    ///
    /// hOffset
    ///
    /// wOffset
    ///
    /// dst
    ///
    /// kind
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// 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-runtime-api/api-sync-behavior.html#api-sync-behavior__memcpy-sync) behavior for most use cases.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpyToArray`], [`cudaMemcpy2DToArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyArrayToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpyToArrayAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpyFromArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpyAtoH](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gf7ad1edb2539cccc352c6b8b76f657f4), [cuMemcpyAtoD](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g825b3f037f7f51382cae991bae8173fd).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `src`: Source memory address.
    /// - `wOffset`: Source starting X offset (columns in bytes).
    /// - `hOffset`: Source starting Y offset (rows).
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    #[deprecated]
    pub fn cudaMemcpyFromArray(
        dst: *mut ::core::ffi::c_void,
        src: cudaArray_const_t,
        wOffset: size_t,
        hOffset: size_t,
        count: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// count
    ///
    /// src
    ///
    /// hOffsetSrc
    ///
    /// wOffsetSrc
    ///
    /// dst
    ///
    /// hOffsetDst
    ///
    /// wOffsetDst
    ///
    /// kind
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpyToArray`], [`cudaMemcpy2DToArray`], [`cudaMemcpyFromArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpyToArrayAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpyFromArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpyAtoA](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gf81b218c984a31436ec9e23a85fb604a).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `wOffsetDst`: Destination starting X offset (columns in bytes).
    /// - `hOffsetDst`: Destination starting Y offset (rows).
    /// - `src`: Source memory address.
    /// - `wOffsetSrc`: Source starting X offset (columns in bytes).
    /// - `hOffsetSrc`: Source starting Y offset (rows).
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    #[deprecated]
    pub fn cudaMemcpyArrayToArray(
        dst: cudaArray_t,
        wOffsetDst: size_t,
        hOffsetDst: size_t,
        src: cudaArray_const_t,
        wOffsetSrc: size_t,
        hOffsetSrc: size_t,
        count: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// count
    ///
    /// src
    ///
    /// dst
    ///
    /// hOffset
    ///
    /// wOffset
    ///
    /// kind
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyToArrayAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be
    /// associated to a stream by passing a non-zero stream argument. If kind is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and stream is non-zero, the copy may overlap with operations in other streams.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpyToArray`], [`cudaMemcpy2DToArray`], [`cudaMemcpyFromArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyArrayToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpyFromArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpyHtoAAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gb5c4863f64f132b4bc2661818b3fd188), [cuMemcpy2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g4acf155faeb969d9d21f5433d3d0f274).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `wOffset`: Destination starting X offset (columns in bytes).
    /// - `hOffset`: Destination starting Y offset (rows).
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    /// - `stream`: Stream identifier.
    #[deprecated]
    pub fn cudaMemcpyToArrayAsync(
        dst: cudaArray_t,
        wOffset: size_t,
        hOffset: size_t,
        src: *const ::core::ffi::c_void,
        count: size_t,
        kind: cudaMemcpyKind,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies data between host and device.
    ///
    /// count
    ///
    /// src
    ///
    /// hOffset
    ///
    /// wOffset
    ///
    /// dst
    ///
    /// kind
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyHostToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToHost`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyKind::cudaMemcpyDefault`]
    ///
    /// [`cudaMemcpyFromArrayAsync`] is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be
    /// associated to a stream by passing a non-zero stream argument. If kind is [`cudaMemcpyKind::cudaMemcpyHostToDevice`] or [`cudaMemcpyKind::cudaMemcpyDeviceToHost`] and stream is non-zero, the copy may overlap with operations in other streams.
    ///
    /// 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-runtime-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-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaMemcpy2D`], [`cudaMemcpyToArray`], [`cudaMemcpy2DToArray`], [`cudaMemcpyFromArray`], [`cudaMemcpy2DFromArray`], [`cudaMemcpyArrayToArray`], [`cudaMemcpy2DArrayToArray`], [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaMemcpyAsync`], [`cudaMemcpy2DAsync`], [`cudaMemcpyToArrayAsync`], [`cudaMemcpy2DToArrayAsync`], [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], [cuMemcpyAtoHAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g64cbd2e60436699aebdd0bdbf14d0f01), [cuMemcpy2DAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g4acf155faeb969d9d21f5433d3d0f274).
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination memory address.
    /// - `src`: Source memory address.
    /// - `wOffset`: Source starting X offset (columns in bytes).
    /// - `hOffset`: Source starting Y offset (rows).
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    /// - `stream`: Stream identifier.
    #[deprecated]
    pub fn cudaMemcpyFromArrayAsync(
        dst: *mut ::core::ffi::c_void,
        src: cudaArray_const_t,
        wOffset: size_t,
        hOffset: size_t,
        count: size_t,
        kind: cudaMemcpyKind,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `devPtr`: Returned device pointer.
    /// - `size`: Number of bytes to allocate.
    /// - `hStream`: The stream establishing the stream ordering contract and the memory pool to allocate from.
    pub fn cudaMallocAsync(
        devPtr: *mut *mut ::core::ffi::c_void,
        size: size_t,
        hStream: cudaStream_t,
    ) -> cudaError_t;
}
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.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuMemFreeAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g41acf4131f672a2a75cd93d3241f10cf), [`cudaMallocAsync`]
    ///
    /// # Parameters
    ///
    /// - `hStream`: The stream establishing the stream ordering promise.
    pub fn cudaFreeAsync(
        devPtr: *mut ::core::ffi::c_void,
        hStream: cudaStream_t,
    ) -> cudaError_t;
}
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.
    ///
    /// Note:
    ///
    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuMemPoolTrimTo](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g9c7e267e3460945b0ca76c48314bb669), [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolCreate`].
    ///
    /// # Parameters
    ///
    /// - `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 cudaMemPoolTrimTo(
        memPool: cudaMemPool_t,
        minBytesToKeep: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets attributes of a memory pool.
    ///
    /// Supported attributes are:
    ///
    /// * [cudaMemPoolAttrReleaseThreshold](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03e0451f4d34d8f3c418882b3ba5259f37): (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)
    /// * [cudaMemPoolReuseFollowEventDependencies](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03d75287b5752ea45a3d98b9a339f797ce): (value type = int) Allow [`cudaMallocAsync`] 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)
    /// * [cudaMemPoolReuseAllowOpportunistic](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03858390d544051a61033a05e1a4005d01): (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default
    ///   enabled)
    /// * [cudaMemPoolReuseAllowInternalDependencies](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a031a545a7d23c103583900e784360f9d2a): (value type = int) Allow [`cudaMallocAsync`] to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released
    ///   by [`cudaFreeAsync`] (default enabled).
    /// * [cudaMemPoolAttrReservedMemHigh](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a035cd74d683873f75a8b4bd27b7511d9fc): (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.
    /// * [cudaMemPoolAttrUsedMemHigh](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03eb9b02506f4844de4ea40f01538bc85c): (value type = cuuint64_t) Reset the high watermark that tracks the amount of used memory that was allocated for the memory
    ///   pool. It is illegal to set this attribute to a non-zero value.
    ///
    /// Note:
    ///
    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuMemPoolSetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g223e786cb217709235a06e41bccaec00), [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolCreate`].
    ///
    /// # Parameters
    ///
    /// - `attr`: The attribute to modify.
    /// - `value`: Pointer to the value to assign.
    pub fn cudaMemPoolSetAttribute(
        memPool: cudaMemPool_t,
        attr: cudaMemPoolAttr,
        value: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Gets attributes of a memory pool.
    ///
    /// Supported attributes are:
    ///
    /// * [cudaMemPoolAttrReleaseThreshold](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03e0451f4d34d8f3c418882b3ba5259f37): (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)
    /// * [cudaMemPoolReuseFollowEventDependencies](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03d75287b5752ea45a3d98b9a339f797ce): (value type = int) Allow [`cudaMallocAsync`] 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)
    /// * [cudaMemPoolReuseAllowOpportunistic](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03858390d544051a61033a05e1a4005d01): (value type = int) Allow reuse of already completed frees when there is no dependency between the free and allocation. (default
    ///   enabled)
    /// * [cudaMemPoolReuseAllowInternalDependencies](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a031a545a7d23c103583900e784360f9d2a): (value type = int) Allow [`cudaMallocAsync`] to insert new stream dependencies in order to establish the stream ordering required to reuse a piece of memory released
    ///   by [`cudaFreeAsync`] (default enabled).
    /// * [cudaMemPoolAttrReservedMemCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03accd25158875da327b34d1ee63847b02): (value type = cuuint64_t) Amount of backing memory currently allocated for the mempool.
    /// * [cudaMemPoolAttrReservedMemHigh](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a035cd74d683873f75a8b4bd27b7511d9fc): (value type = cuuint64_t) High watermark of backing memory allocated for the mempool since the last time it was reset.
    /// * [cudaMemPoolAttrUsedMemCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03627447991490641c9fcacbfe7b54c5a4): (value type = cuuint64_t) Amount of memory from the pool that is currently in use by the application.
    /// * [cudaMemPoolAttrUsedMemHigh](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03eb9b02506f4844de4ea40f01538bc85c): (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.
    ///
    /// The following properties can be also be queried on imported and default pools:
    ///
    /// * [cudaMemPoolAttrAllocationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03eedb98c7c000df951f3d36501a829311): (value type = cudaMemAllocationType) The allocation type of the mempool
    /// * [cudaMemPoolAttrExportHandleTypes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a0364fa069d99766b22111d97e9d3d37e1b): (value type = cudaMemAllocationHandleType) Available export handle types for the mempool. For imported pools this value
    ///   is always cudaMemHandleTypeNone as an imported pool cannot be re-exported
    /// * [cudaMemPoolAttrLocationId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a035867500cd6840751dbeca2d5ff4c638d): (value type = int) The location id for the mempool. If the location type for this pool is cudaMemLocationTypeInvisible then
    ///   ID will be cudaInvalidDeviceId.
    /// * [cudaMemPoolAttrLocationType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03e53307bbf1d2af20fe4411ae7deba1fe): (value type = cudaMemLocationType) 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 cudaMemlocataionTypeInvisible.
    /// * [cudaMemPoolAttrMaxPoolSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a03799958957449f066faf0677ab8a6169e): (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 cudaMemAllocationTypeManaged and
    ///   IPC imported pools this value will be system dependent.
    /// * [cudaMemPoolAttrHwDecompressEnabled](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb088e985dfbf286005a684095501a032c3f8c11ad000a47eca679c2f33ce53b): (value type = int) Indicates whether the pool has hardware compresssion enabled
    ///
    /// Note:
    ///
    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuMemPoolGetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1gd45ea7c43e4a1add4b971d06fa72eda4), [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolCreate`].
    ///
    /// # Parameters
    ///
    /// - `attr`: The attribute to get.
    /// - `value`: Retrieved value.
    pub fn cudaMemPoolGetAttribute(
        memPool: cudaMemPool_t,
        attr: cudaMemPoolAttr,
        value: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Controls visibility of pools between devices.
    ///
    /// **See also:**
    ///
    /// [cuMemPoolSetAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1gff3ce33e252443f4b087b94e42913406), [`cudaMemPoolGetAccess`], [`cudaMallocAsync`], [`cudaFreeAsync`].
    ///
    /// # Parameters
    ///
    /// - `count`: Number of descriptors in the map array.
    pub fn cudaMemPoolSetAccess(
        memPool: cudaMemPool_t,
        descList: *const cudaMemAccessDesc,
        count: size_t,
    ) -> cudaError_t;
}
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:**
    ///
    /// [cuMemPoolGetAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g838f28fd535a1cbd06c5f7fe0edbdcc7), [`cudaMemPoolSetAccess`].
    ///
    /// # Parameters
    ///
    /// - `flags`: the accessibility of the pool from the specified location.
    /// - `memPool`: the pool being queried.
    /// - `location`: the location accessing the pool.
    pub fn cudaMemPoolGetAccess(
        flags: *mut cudaMemAccessFlags,
        memPool: cudaMemPool_t,
        location: *mut cudaMemLocation,
    ) -> cudaError_t;
}
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 cudaMemPoolProps::cudaMemLocation::type
    /// to [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5). cudaMemPoolProps::cudaMemLocation::id is ignored for such pools. Pools created with the type [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) are not IPC capable and [cudaMemPoolProps::handleTypes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemPoolProps.html#structcudaMemPoolProps_14cf896bffe71384e374c4d2decca9a53) must be 0, any other values will result in [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c). To create a memory pool targeting a specific host NUMA node, applications must set cudaMemPoolProps::cudaMemLocation::type
    /// to [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0) and cudaMemPoolProps::cudaMemLocation::id must specify the NUMA ID of the host memory node. Specifying [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0a3925690e32332c940cb726ef56a4258) as the cudaMemPoolProps::cudaMemLocation::type will result in [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c). By default, the pool's memory will be accessible from the device it is allocated on. In the case of pools created with [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0) or [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5), 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 [cudaMemPoolProps::maxSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemPoolProps.html#structcudaMemPoolProps_12d90e82afb8d577a2aee847d082e145d). If set to 0, the maximum size of the pool will default to a system dependent value.
    ///
    /// Applications that intend to use [CU_MEM_HANDLE_TYPE_FABRIC](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1gg450a23153d86fce0afe30e25d63caef9e38a182adb450da6c1a3f29cd5dca032) 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 `cudaMemPoolProps`:cudaMemAllocationType to [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. `cudaMemAllocationHandleType` must also be set to [cudaMemHandleTypeNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggabde707dfb8a602b917e0b177f77f365fed45251c1591431e1b9da28c1a04191) since IPC is not supported. For managed memory pools, cudaMemPoolProps::cudaMemLocation will be treated as the preferred
    /// location for all allocations created from the pool. An application can also set [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f053b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location. [cudaMemPoolProps::maxSize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemPoolProps.html#structcudaMemPoolProps_12d90e82afb8d577a2aee847d082e145d) must be set to zero for managed memory pools. [cudaMemPoolProps::usage](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaMemPoolProps.html#structcudaMemPoolProps_1377241affe79dd0a3c7b40453824bd6b) 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 [cudaErrorNotSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038d846fd9f2e8ba5e2fb4f1695b7ab6164)
    ///
    /// Note:
    ///
    /// Specifying [cudaMemHandleTypeNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggabde707dfb8a602b917e0b177f77f365fed45251c1591431e1b9da28c1a04191) creates a memory pool that will not support IPC.
    ///
    /// **See also:**
    ///
    /// [cuMemPoolCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g8aa4c143dbc20293659cd883232b95f2), [`cudaDeviceSetMemPool`], [`cudaMallocFromPoolAsync`], [`cudaMemPoolExportToShareableHandle`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`].
    pub fn cudaMemPoolCreate(
        memPool: *mut cudaMemPool_t,
        poolProps: *const cudaMemPoolProps,
    ) -> cudaError_t;
}
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 [`cudaMemPoolDestroy`] 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:**
    ///
    /// [cuMemPoolDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1ge0e211115e5ad1c79250b9dd425b77f7), [`cudaFreeAsync`], [`cudaDeviceSetMemPool`], [`cudaDeviceGetDefaultMemPool`], [`cudaDeviceGetMemPool`], [`cudaMemPoolCreate`].
    pub fn cudaMemPoolDestroy(memPool: cudaMemPool_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the default memory pool for a given location and allocation type.
    ///
    /// The memory location can be of one of [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) or [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0). The allocation type can be one of [`cudaMemAllocationType::cudaMemAllocationTypePinned`] or [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. When the allocation type is [`cudaMemAllocationType::cudaMemAllocationTypeManaged`], the location type can also be [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f053b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. In all other cases, the call return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c)
    ///
    /// **See also:**
    ///
    /// [cuMemAllocAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g13413273e84a641bce1929eae9e6501f), [cuMemPoolTrimTo](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g9c7e267e3460945b0ca76c48314bb669), [cuMemPoolGetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1gd45ea7c43e4a1add4b971d06fa72eda4), [cuMemPoolSetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g223e786cb217709235a06e41bccaec00), [cuMemPoolSetAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1gff3ce33e252443f4b087b94e42913406), [cuMemGetMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g5283d28ee187477e1a2b06fd731ec575), [cuMemPoolCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g8aa4c143dbc20293659cd883232b95f2).
    pub fn cudaMemGetDefaultMemPool(
        memPool: *mut cudaMemPool_t,
        location: *mut cudaMemLocation,
        type_: cudaMemAllocationType,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Gets the current memory pool for a given memory location and allocation type.
    ///
    /// The memory location can be of one of [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) or [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0). The allocation type can be one of [`cudaMemAllocationType::cudaMemAllocationTypePinned`] or [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. When the allocation type is [`cudaMemAllocationType::cudaMemAllocationTypeManaged`], the location type can also be [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f053b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. In all other cases, the call return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c)
    ///
    /// Returns the last pool provided to [`cudaMemSetMemPool`] or [`cudaDeviceSetMemPool`] for this location and allocation type or the location's default memory pool if [`cudaMemSetMemPool`] or [`cudaDeviceSetMemPool`] for that allocType and location has never been called. By default the current mempool of a location is the default mempool
    /// for a device that can be obtained via cudaMemGetDefaultMemPool Otherwise the returned pool must have been set with [`cudaDeviceSetMemPool`].
    ///
    /// **See also:**
    ///
    /// [cuDeviceGetDefaultMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1gc8bca3c97a78816303b8aa5773b741f2), [cuMemPoolCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g8aa4c143dbc20293659cd883232b95f2), [cuDeviceSetMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1g4f2f276b84d9c2eaefdc76d6274db4a0), [cuMemSetMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g779e76c810c5f088210ea907730e17c9).
    pub fn cudaMemGetMemPool(
        memPool: *mut cudaMemPool_t,
        location: *mut cudaMemLocation,
        type_: cudaMemAllocationType,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the current memory pool for a memory location and allocation type.
    ///
    /// The memory location can be of one of [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f01ec97ff5f3c715e4b18e39dabf9e31c5) or [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f024dc63fb938dee27b41e3842da35d2d0). The allocation type can be one of [`cudaMemAllocationType::cudaMemAllocationTypePinned`] or [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. When the allocation type is [`cudaMemAllocationType::cudaMemAllocationTypeManaged`], the location type can also be [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f053b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. In all other cases, the call return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c)
    ///
    /// When a memory pool is set as the current memory pool, the location parameter should be the same as the location of the pool.
    /// If the location type or index don't match, the call returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c). The type of memory pool should also match the parameter allocType. Else the call returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c). By default, a memory location's current memory pool is its default memory pool. If the location type is [cudaMemLocationTypeDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2279aa08666f329f3ba4afe397fa60f0e479b8710f3c5270117ee9d8cf5868d4) and the allocation type is [`cudaMemAllocationType::cudaMemAllocationTypePinned`], then this API is the equivalent of calling [`cudaDeviceSetMemPool`] with the location id as the device. For further details on the implications, please refer to the documentation for [`cudaDeviceSetMemPool`].
    ///
    /// Note:
    ///
    /// Use [`cudaMallocFromPoolAsync`] to specify asynchronous allocations from a device different than the one the stream runs on.
    ///
    /// **See also:**
    ///
    /// [cuDeviceGetDefaultMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1gc8bca3c97a78816303b8aa5773b741f2), [cuDeviceGetMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DEVICE.html#group__CUDA__DEVICE_1gdf186e9559d53a5eb18e572d48c1121b), [cuMemGetMemPool](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g5283d28ee187477e1a2b06fd731ec575), [cuMemPoolCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g8aa4c143dbc20293659cd883232b95f2), [cuMemPoolDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1ge0e211115e5ad1c79250b9dd425b77f7), [cuMemAllocFromPoolAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1gf1dd6e1e2e8f767a5e0ea63f38ff260b).
    pub fn cudaMemSetMemPool(
        location: *mut cudaMemLocation,
        type_: cudaMemAllocationType,
        memPool: cudaMemPool_t,
    ) -> cudaError_t;
}
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:**
    ///
    /// [cuMemAllocFromPoolAsync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1gf1dd6e1e2e8f767a5e0ea63f38ff260b), [cudaMallocAsync ( C++ API)](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/high-level-api.html#group__CUDART__HIGHLEVEL_1ga31efcffc48981621feddd98d71a0feb "Allocate from a pool."), [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaDeviceGetDefaultMemPool`], [`cudaMemPoolCreate`], [`cudaMemPoolSetAccess`], [`cudaMemPoolSetAttribute`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: Returned device pointer.
    /// - `memPool`: The pool to allocate from.
    /// - `stream`: The stream establishing the stream ordering semantic.
    pub fn cudaMallocFromPoolAsync(
        ptr: *mut *mut ::core::ffi::c_void,
        size: size_t,
        memPool: cudaMemPool_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
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 [`cudaMemPoolImportFromShareableHandle`]. Individual pointers can then be shared with the [`cudaMemPoolExportPointer`] and [`cudaMemPoolImportPointer`] 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 cudaMemHandleTypeNone.
    ///
    /// **See also:**
    ///
    /// [cuMemPoolExportToShareableHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g79ed285fdfffb76932871fb96fbba8f8), [`cudaMemPoolImportFromShareableHandle`], [`cudaMemPoolExportPointer`], [`cudaMemPoolImportPointer`].
    ///
    /// # Parameters
    ///
    /// - `handleType`: the type of handle to create.
    /// - `flags`: must be 0.
    pub fn cudaMemPoolExportToShareableHandle(
        shareableHandle: *mut ::core::ffi::c_void,
        memPool: cudaMemPool_t,
        handleType: cudaMemAllocationHandleType,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// imports a memory pool from a shared handle.
    ///
    /// Specific allocations can be imported from the imported pool with [`cudaMemPoolImportPointer`].
    ///
    /// Note:
    ///
    /// Imported memory pools do not support creating new allocations. As such imported memory pools may not be used in [`cudaDeviceSetMemPool`] or [`cudaMallocFromPoolAsync`] calls.
    ///
    /// **See also:**
    ///
    /// [cuMemPoolImportFromShareableHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g02b4f18dd8a1c45b7f302800e90cec5b), [`cudaMemPoolExportToShareableHandle`], [`cudaMemPoolExportPointer`], [`cudaMemPoolImportPointer`].
    ///
    /// # Parameters
    ///
    /// - `handleType`: The type of handle being imported.
    /// - `flags`: must be 0.
    pub fn cudaMemPoolImportFromShareableHandle(
        memPool: *mut cudaMemPool_t,
        shareableHandle: *mut ::core::ffi::c_void,
        handleType: cudaMemAllocationHandleType,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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 [`cudaMemPoolImportPointer`] api. The data is not a handle and may be shared through any IPC mechanism.
    ///
    /// **See also:**
    ///
    /// [cuMemPoolExportPointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1gfe89f0478d26edaa91eb8a2e0349329d), [`cudaMemPoolExportToShareableHandle`], [`cudaMemPoolImportFromShareableHandle`], [`cudaMemPoolImportPointer`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: pointer to memory being exported.
    pub fn cudaMemPoolExportPointer(
        exportData: *mut cudaMemPoolPtrExportData,
        ptr: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
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 cudaFree or cudaFreeAsync. If [`cudaFreeAsync`] is used, the free must be completed on the importing process before the free operation on the exporting process.
    ///
    /// Note:
    ///
    /// The [`cudaFreeAsync`] api may be used in the exporting process before the [`cudaFreeAsync`] operation completes in its stream as long as the [`cudaFreeAsync`] in the exporting process specifies a stream with a stream dependency on the importing process's [`cudaFreeAsync`].
    ///
    /// **See also:**
    ///
    /// [cuMemPoolImportPointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MALLOC__ASYNC.html#group__CUDA__MALLOC__ASYNC_1g2620bb972ed5edcce312d3689454acbd), [`cudaMemPoolExportToShareableHandle`], [`cudaMemPoolImportFromShareableHandle`], [`cudaMemPoolExportPointer`].
    pub fn cudaMemPoolImportPointer(
        ptr: *mut *mut ::core::ffi::c_void,
        memPool: cudaMemPool_t,
        exportData: *mut cudaMemPoolPtrExportData,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns attributes about a specified pointer.
    ///
    /// Returns in \*attributes the attributes of the pointer ptr. If pointer was not allocated in, mapped by or registered with context supporting unified addressing [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// Note:
    ///
    /// In CUDA 11.0 forward passing host pointer will return [`cudaMemoryType::cudaMemoryTypeUnregistered`] in [cudaPointerAttributes::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaPointerAttributes.html#structcudaPointerAttributes_191ef95dac597cc710558dabbc8b9ae38) and call will return [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591).
    ///
    /// The [`cudaPointerAttributes`] structure is defined as:
    ///
    /// ```text
    /// struct cudaPointerAttributes {
    /// enum cudaMemoryType
    /// type;
    /// int device;
    /// void *devicePointer;
    /// void *hostPointer;
    /// }
    /// ```
    ///
    /// * [cudaPointerAttributes::type](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaPointerAttributes.html#structcudaPointerAttributes_191ef95dac597cc710558dabbc8b9ae38) identifies type of memory. It can be [`cudaMemoryType::cudaMemoryTypeUnregistered`] for unregistered host memory, [`cudaMemoryType::cudaMemoryTypeHost`] for registered host memory, [`cudaMemoryType::cudaMemoryTypeDevice`] for device memory or [`cudaMemoryType::cudaMemoryTypeManaged`] for managed memory.
    ///
    /// * [device](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaPointerAttributes.html#structcudaPointerAttributes_120015540684b0c85e0debf64923bedec) is the device against which ptr was allocated. If ptr has memory type [`cudaMemoryType::cudaMemoryTypeDevice`] then this identifies the device on which the memory referred to by ptr physically resides. If ptr has memory type [`cudaMemoryType::cudaMemoryTypeHost`] then this identifies the device which was current when the allocation was made (and if that device is deinitialized then
    ///   this allocation will vanish with that device's state).
    ///
    /// * [devicePointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaPointerAttributes.html#structcudaPointerAttributes_19edc9782e1ee337072994780fd3b675f) is the device pointer alias through which the memory referred to by ptr may be accessed on the current device. If the memory referred to by ptr cannot be accessed directly by the current device then this is NULL.
    ///
    /// * [hostPointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaPointerAttributes.html#structcudaPointerAttributes_119cbae18cd685096287e41cce1c9a087) is the host pointer alias through which the memory referred to by ptr may be accessed on the host. If the memory referred to by ptr cannot be accessed directly by the host then this is NULL.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGetDeviceCount`], [`cudaGetDevice`], [`cudaSetDevice`], [`cudaChooseDevice`], [`cudaInitDevice`], [cuPointerGetAttributes](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__UNIFIED.html#group__CUDA__UNIFIED_1gf65e9ea532e311dd049166e4894955ad).
    ///
    /// # Parameters
    ///
    /// - `attributes`: Attributes for the specified pointer.
    /// - `ptr`: Pointer to get attributes for.
    pub fn cudaPointerGetAttributes(
        attributes: *mut cudaPointerAttributes,
        ptr: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Queries if a device may directly access a peer device's memory.
    ///
    /// Returns in \*canAccessPeer a value of 1 if device device is capable of directly accessing memory from peerDevice and 0 otherwise. If direct access of peerDevice from device is possible, then access may be enabled by calling [`cudaDeviceEnablePeerAccess`].
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceEnablePeerAccess`], [`cudaDeviceDisablePeerAccess`], [cuDeviceCanAccessPeer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__PEER__ACCESS.html#group__CUDA__PEER__ACCESS_1g496bdaae1f632ebfb695b99d2c40f19e).
    ///
    /// # Parameters
    ///
    /// - `canAccessPeer`: Returned access capability.
    /// - `device`: Device from which allocations on peerDevice are to be directly accessed.
    /// - `peerDevice`: Device on which the allocations to be directly accessed by device reside.
    pub fn cudaDeviceCanAccessPeer(
        canAccessPeer: *mut ::core::ffi::c_int,
        device: ::core::ffi::c_int,
        peerDevice: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Enables direct access to memory allocations on a peer device.
    ///
    /// On success, all allocations from peerDevice will immediately be accessible by the current device. They will remain accessible until access is explicitly disabled using
    /// [`cudaDeviceDisablePeerAccess`] or either device is reset using [`cudaDeviceReset`].
    ///
    /// Note that access granted by this call is unidirectional and that in order to access memory on the current device from peerDevice, a separate symmetric call to [`cudaDeviceEnablePeerAccess`] 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 [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038938c6e8b96ecde62e3ab5137156f739a) if [`cudaDeviceCanAccessPeer`] indicates that the current device cannot directly access memory from peerDevice.
    ///
    /// Returns [cudaErrorPeerAccessAlreadyEnabled](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00380bc28e8217afa14b95f907631cb84f33) if direct access of peerDevice from the current device has already been enabled.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) if flags is not 0.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceCanAccessPeer`], [`cudaDeviceDisablePeerAccess`], [cuCtxEnablePeerAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__PEER__ACCESS.html#group__CUDA__PEER__ACCESS_1g0889ec6728e61c05ed359551d67b3f5a).
    ///
    /// # Parameters
    ///
    /// - `peerDevice`: Peer device to enable direct access to from the current device.
    /// - `flags`: Reserved for future use and must be set to 0.
    pub fn cudaDeviceEnablePeerAccess(
        peerDevice: ::core::ffi::c_int,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Disables direct access to memory allocations on a peer device.
    ///
    /// Returns [cudaErrorPeerAccessNotEnabled](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038821b54bce59b87db6efc2ea59a867bf7) if direct access to memory on peerDevice has not yet been enabled from the current device.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceCanAccessPeer`], [`cudaDeviceEnablePeerAccess`], [cuCtxDisablePeerAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__PEER__ACCESS.html#group__CUDA__PEER__ACCESS_1g5b4b6936ea868d4954ce4d841a3b4810).
    ///
    /// # Parameters
    ///
    /// - `peerDevice`: Peer device to disable direct access to.
    pub fn cudaDeviceDisablePeerAccess(peerDevice: ::core::ffi::c_int) -> cudaError_t;
}
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 [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) is returned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// `cudaGraphicsD3D9RegisterResource`, `cudaGraphicsD3D10RegisterResource`, `cudaGraphicsD3D11RegisterResource`, `cudaGraphicsGLRegisterBuffer`, `cudaGraphicsGLRegisterImage`, [cuGraphicsUnregisterResource](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPHICS.html#group__CUDA__GRAPHICS_1ga7e5e97b74eaa13dfa6582e853e4c96d).
    ///
    /// # Parameters
    ///
    /// - `resource`: Resource to unregister.
    pub fn cudaGraphicsUnregisterResource(
        resource: cudaGraphicsResource_t,
    ) -> cudaError_t;
}
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:
    ///
    /// * [cudaGraphicsMapFlagsNone](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2c3c3a69caaf333d29d0b38b75de5ffd81ae074138583e9421692bec52bfe44b): Specifies no hints about how resource will be used. It is therefore assumed that CUDA may read from or write to resource.
    /// * [cudaGraphicsMapFlagsReadOnly](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2c3c3a69caaf333d29d0b38b75de5ffde34096084cfafea1399b5682efd8b74c): Specifies that CUDA will not write to resource.
    /// * [cudaGraphicsMapFlagsWriteDiscard](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg2c3c3a69caaf333d29d0b38b75de5ffd3d4fa7699e964ffc201daac20d2ecd6b): Specifies CUDA will not read from resource and will write over the entire contents of resource, so none of the data previously stored in resource will be preserved.
    ///
    /// If resource is presently mapped for access by CUDA then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned. If flags is not one of the above values then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphicsMapResources`], [cuGraphicsResourceSetMapFlags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPHICS.html#group__CUDA__GRAPHICS_1gfe96aa7747f8b11d44a6fa6a851e1b39).
    ///
    /// # Parameters
    ///
    /// - `resource`: Registered resource to set flags for.
    /// - `flags`: Parameters for resource mapping.
    pub fn cudaGraphicsResourceSetMapFlags(
        resource: cudaGraphicsResource_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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 [`cudaGraphicsMapResources`] will complete before any subsequent CUDA work issued in stream begins.
    ///
    /// If resources contains any duplicate entries then [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) is returned. If any of resources are presently mapped for access by CUDA then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphicsResourceGetMappedPointer`], [`cudaGraphicsSubResourceGetMappedArray`], [`cudaGraphicsUnmapResources`], [cuGraphicsMapResources](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPHICS.html#group__CUDA__GRAPHICS_1gffcfd8e78d82cc4f6dd987e8bce4edb0).
    ///
    /// # Parameters
    ///
    /// - `count`: Number of resources to map.
    /// - `resources`: Resources to map for CUDA.
    /// - `stream`: Stream for synchronization.
    pub fn cudaGraphicsMapResources(
        count: ::core::ffi::c_int,
        resources: *mut cudaGraphicsResource_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
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 [`cudaGraphicsUnmapResources`] will complete before any subsequently issued graphics work begins.
    ///
    /// If resources contains any duplicate entries then [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038c4673247aee4d1ab8d07871f376e0273) is returned. If any of resources are not presently mapped for access by CUDA then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// Note:
    ///
    /// * This function uses standard [default stream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/stream-sync-behavior.html#stream-sync-behavior__default-stream) semantics.
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphicsMapResources`], [cuGraphicsUnmapResources](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPHICS.html#group__CUDA__GRAPHICS_1g8e9ff25d071375a0df1cb5aee924af32).
    ///
    /// # Parameters
    ///
    /// - `count`: Number of resources to unmap.
    /// - `resources`: Resources to unmap.
    /// - `stream`: Stream for synchronization.
    pub fn cudaGraphicsUnmapResources(
        count: ::core::ffi::c_int,
        resources: *mut cudaGraphicsResource_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Get an device pointer through which to access a mapped graphics resource.
    ///
    /// Returns in \*devPtr a pointer through which the mapped graphics resource resource may be accessed. Returns in \*size the size of the memory in bytes which may be accessed from that pointer. The value set in devPtr may change every time that resource is mapped.
    ///
    /// If resource is not a buffer then it cannot be accessed via a pointer and [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned. If resource is not mapped then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned. \*
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphicsMapResources`], [`cudaGraphicsSubResourceGetMappedArray`], [cuGraphicsResourceGetMappedPointer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPHICS.html#group__CUDA__GRAPHICS_1g8a634cf4150d399f0018061580592457).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Returned pointer through which resource may be accessed.
    /// - `size`: Returned size of the buffer accessible starting at \*devPtr.
    /// - `resource`: Mapped resource to access.
    pub fn cudaGraphicsResourceGetMappedPointer(
        devPtr: *mut *mut ::core::ffi::c_void,
        size: *mut size_t,
        resource: cudaGraphicsResource_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Get an array through which to access a subresource of a mapped graphics resource.
    ///
    /// Returns in \*array 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 array may change every time that resource is mapped.
    ///
    /// If resource is not a texture then it cannot be accessed via an array and [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned. If arrayIndex is not a valid array index for resource then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) is returned. If mipLevel is not a valid mipmap level for resource then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) is returned. If resource is not mapped then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphicsResourceGetMappedPointer`], [cuGraphicsSubResourceGetMappedArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPHICS.html#group__CUDA__GRAPHICS_1g61c55e987e54558cce547240d6123078).
    ///
    /// # Parameters
    ///
    /// - `array`: 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 `cudaGraphicsCubeFace` for cubemap textures for the subresource to access.
    /// - `mipLevel`: Mipmap level for the subresource to access.
    pub fn cudaGraphicsSubResourceGetMappedArray(
        array: *mut cudaArray_t,
        resource: cudaGraphicsResource_t,
        arrayIndex: ::core::ffi::c_uint,
        mipLevel: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Get a mipmapped array through which to access a mapped graphics resource.
    ///
    /// Returns in \*mipmappedArray a mipmapped array through which the mapped graphics resource resource may be accessed. The value set in mipmappedArray may change every time that resource is mapped.
    ///
    /// If resource is not a texture then it cannot be accessed via an array and [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned. If resource is not mapped then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00382e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphicsResourceGetMappedPointer`], [cuGraphicsResourceGetMappedMipmappedArray](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPHICS.html#group__CUDA__GRAPHICS_1g37680bbe89c7fe5c613563eaab9d14c1).
    ///
    /// # Parameters
    ///
    /// - `mipmappedArray`: Returned mipmapped array through which resource may be accessed.
    /// - `resource`: Mapped resource to access.
    pub fn cudaGraphicsResourceGetMappedMipmappedArray(
        mipmappedArray: *mut cudaMipmappedArray_t,
        resource: cudaGraphicsResource_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Get the channel descriptor of an array.
    ///
    /// Returns in \*desc the channel descriptor of the CUDA array array.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// cudaCreateChannelDesc ( C API), [`cudaCreateTextureObject`], [`cudaCreateSurfaceObject`].
    ///
    /// # Parameters
    ///
    /// - `desc`: Channel format.
    /// - `array`: Memory array on device.
    pub fn cudaGetChannelDesc(
        desc: *mut cudaChannelFormatDesc,
        array: cudaArray_const_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `x`: X component.
    /// - `y`: Y component.
    /// - `z`: Z component.
    /// - `w`: W component.
    /// - `f`: Channel format.
    pub fn cudaCreateChannelDesc(
        x: ::core::ffi::c_int,
        y: ::core::ffi::c_int,
        z: ::core::ffi::c_int,
        w: ::core::ffi::c_int,
        f: cudaChannelFormatKind,
    ) -> cudaChannelFormatDesc;
}
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 [`cudaResourceDesc`] structure is defined as:
    ///
    /// ```text
    /// struct cudaResourceDesc {
    /// enum cudaResourceType
    /// resType;
    ///
    /// union {
    /// struct {
    /// cudaArray_t
    /// array;
    /// } array;
    /// struct {
    /// cudaMipmappedArray_t
    /// mipmap;
    /// } mipmap;
    /// struct {
    /// void *devPtr;
    /// struct cudaChannelFormatDesc
    /// desc;
    /// size_t sizeInBytes;
    /// } linear;
    /// struct {
    /// void *devPtr;
    /// struct cudaChannelFormatDesc
    /// desc;
    /// size_t width;
    /// size_t height;
    /// size_t pitchInBytes;
    /// } pitch2D;
    /// } res;
    /// };
    /// ```
    ///
    /// * [cudaResourceDesc::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceDesc.html#structcudaResourceDesc_1aac8b3bb1d63bd25d8e9af7ee0b9a580) specifies the type of resource to texture from. CUresourceType is defined as:
    ///
    /// ```text
    /// enum cudaResourceType {
    /// cudaResourceTypeArray          = 0x00,
    /// cudaResourceTypeMipmappedArray = 0x01,
    /// cudaResourceTypeLinear         = 0x02,
    /// cudaResourceTypePitch2D        = 0x03
    /// };
    /// ```
    ///
    /// If [cudaResourceDesc::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceDesc.html#structcudaResourceDesc_1aac8b3bb1d63bd25d8e9af7ee0b9a580) is set to [`cudaResourceType::cudaResourceTypeArray`], cudaResourceDesc::res::array::array must be set to a valid CUDA array handle.
    ///
    /// If [cudaResourceDesc::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceDesc.html#structcudaResourceDesc_1aac8b3bb1d63bd25d8e9af7ee0b9a580) is set to [`cudaResourceType::cudaResourceTypeMipmappedArray`], cudaResourceDesc::res::mipmap::mipmap must be set to a valid CUDA mipmapped array handle and [cudaTextureDesc::normalizedCoords](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_14244ae4f85cd69ff050fdc681be4cd35) must be set to true.
    ///
    /// If [cudaResourceDesc::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceDesc.html#structcudaResourceDesc_1aac8b3bb1d63bd25d8e9af7ee0b9a580) is set to [`cudaResourceType::cudaResourceTypeLinear`], cudaResourceDesc::res::linear::devPtr must be set to a valid device pointer, that is aligned to [cudaDeviceProp::textureAlignment](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_1500248658a996f51752e1ab1769f8a88). cudaResourceDesc::res::linear::desc describes the format and the number of components per array element. cudaResourceDesc::res::linear::sizeInBytes
    /// specifies the size of the array in bytes. The total number of elements in the linear address range cannot exceed [`cudaDeviceGetTexture1DLinearMaxWidth`]. The number of elements is computed as (sizeInBytes / sizeof(desc)).
    ///
    /// If [cudaResourceDesc::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceDesc.html#structcudaResourceDesc_1aac8b3bb1d63bd25d8e9af7ee0b9a580) is set to [`cudaResourceType::cudaResourceTypePitch2D`], cudaResourceDesc::res::pitch2D::devPtr must be set to a valid device pointer, that is aligned to [cudaDeviceProp::textureAlignment](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_1500248658a996f51752e1ab1769f8a88). cudaResourceDesc::res::pitch2D::desc describes the format and the number of components per array element. cudaResourceDesc::res::pitch2D::width
    /// and cudaResourceDesc::res::pitch2D::height specify the width and height of the array in elements, and cannot exceed [cudaDeviceProp::maxTexture2DLinear](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_1757a4245a175441c2a1535ef9c9524a4)\[0\] and [cudaDeviceProp::maxTexture2DLinear](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_1757a4245a175441c2a1535ef9c9524a4)\[1\] respectively. cudaResourceDesc::res::pitch2D::pitchInBytes specifies the pitch between two rows in bytes and has to be
    /// aligned to [cudaDeviceProp::texturePitchAlignment](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_13a3f10d2833bdc82ceb370a449aafeec). Pitch cannot exceed [cudaDeviceProp::maxTexture2DLinear](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaDeviceProp.html#structcudaDeviceProp_1757a4245a175441c2a1535ef9c9524a4)\[2\].
    ///
    /// The [`cudaTextureDesc`] struct is defined as
    ///
    /// ```text
    /// struct cudaTextureDesc {
    /// enum cudaTextureAddressMode
    /// addressMode\[3\];
    /// enum cudaTextureFilterMode
    /// filterMode;
    /// enum cudaTextureReadMode
    /// readMode;
    /// int                         sRGB;
    /// float                       borderColor\[4\];
    /// int                         normalizedCoords;
    /// unsigned int                maxAnisotropy;
    /// enum cudaTextureFilterMode
    /// mipmapFilterMode;
    /// float                       mipmapLevelBias;
    /// float                       minMipmapLevelClamp;
    /// float                       maxMipmapLevelClamp;
    /// int                         disableTrilinearOptimization;
    /// int                         seamlessCubemap;
    /// };
    /// ```
    ///
    /// * [cudaTextureDesc::addressMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1444fd48870cf61180673e0ed0abb4a1c) specifies the addressing mode for each dimension of the texture data. [`cudaTextureAddressMode`] is defined as:
    ///
    /// ```text
    /// enum cudaTextureAddressMode {
    /// cudaAddressModeWrap   = 0,
    /// cudaAddressModeClamp  = 1,
    /// cudaAddressModeMirror = 2,
    /// cudaAddressModeBorder = 3
    /// };
    /// ```
    ///
    ///   This is ignored if [cudaResourceDesc::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceDesc.html#structcudaResourceDesc_1aac8b3bb1d63bd25d8e9af7ee0b9a580) is [`cudaResourceType::cudaResourceTypeLinear`]. Also, if [cudaTextureDesc::normalizedCoords](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_14244ae4f85cd69ff050fdc681be4cd35) is set to zero, [`cudaTextureAddressMode::cudaAddressModeWrap`] and [`cudaTextureAddressMode::cudaAddressModeMirror`] won't be supported and will be switched to [`cudaTextureAddressMode::cudaAddressModeClamp`].
    ///
    /// * [cudaTextureDesc::filterMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1c61993bf71d0cdec670ad92e567ba582) specifies the filtering mode to be used when fetching from the texture. [`cudaTextureFilterMode`] is defined as:
    ///
    /// ```text
    /// enum cudaTextureFilterMode {
    /// cudaFilterModePoint  = 0,
    /// cudaFilterModeLinear = 1
    /// };
    /// ```
    ///
    ///   This is ignored if [cudaResourceDesc::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceDesc.html#structcudaResourceDesc_1aac8b3bb1d63bd25d8e9af7ee0b9a580) is [`cudaResourceType::cudaResourceTypeLinear`].
    ///
    /// * [cudaTextureDesc::readMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1279c5b27ef0194711344dc402228af94) specifies whether integer data should be converted to floating point or not. [`cudaTextureReadMode`] is defined as:
    ///
    /// ```text
    /// enum cudaTextureReadMode {
    /// cudaReadModeElementType     = 0,
    /// cudaReadModeNormalizedFloat = 1
    /// };
    /// ```
    ///
    ///   Note that this applies only to 8-bit and 16-bit integer formats. 32-bit integer format would not be promoted, regardless
    ///   of whether or not this [cudaTextureDesc::readMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1279c5b27ef0194711344dc402228af94) is set [`cudaTextureReadMode::cudaReadModeNormalizedFloat`] is specified.
    ///
    /// * [cudaTextureDesc::sRGB](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1173e8d365c55f50e9eb586c282af30ca) specifies whether sRGB to linear conversion should be performed during texture fetch.
    ///
    /// * [cudaTextureDesc::borderColor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_18a99cc6b95b3629dc204393576ebae9e) specifies the float values of color. where: [cudaTextureDesc::borderColor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_18a99cc6b95b3629dc204393576ebae9e)\[0\] contains value of 'R', [cudaTextureDesc::borderColor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_18a99cc6b95b3629dc204393576ebae9e)\[1\] contains value of 'G', [cudaTextureDesc::borderColor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_18a99cc6b95b3629dc204393576ebae9e)\[2\] contains value of 'B', [cudaTextureDesc::borderColor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_18a99cc6b95b3629dc204393576ebae9e)\[3\] contains value of 'A' Note that application using integer border color values will need to &lt;reinterpret_cast> these values
    ///   to float. The values are set only when the addressing mode specified by [cudaTextureDesc::addressMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1444fd48870cf61180673e0ed0abb4a1c) is cudaAddressModeBorder.
    ///
    /// * [cudaTextureDesc::normalizedCoords](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_14244ae4f85cd69ff050fdc681be4cd35) specifies whether the texture coordinates will be normalized or not.
    ///
    /// * [cudaTextureDesc::maxAnisotropy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_14fadc6bfa59fe7f8f076d58e407381e5) specifies the maximum anistropy ratio to be used when doing anisotropic filtering. This value will be clamped to the range
    ///   \[1,16\].
    ///
    /// * [cudaTextureDesc::mipmapFilterMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1bbdaf1bc430ac931a12ffa7d3f8809ce) specifies the filter mode when the calculated mipmap level lies between two defined mipmap levels.
    ///
    /// * [cudaTextureDesc::mipmapLevelBias](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_139f79ca1c9fd8f476597df0d3a8ed34c) specifies the offset to be applied to the calculated mipmap level.
    ///
    /// * [cudaTextureDesc::minMipmapLevelClamp](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1928642b629ae8fd8d2adc198979b6840) specifies the lower end of the mipmap level range to clamp access to.
    ///
    /// * [cudaTextureDesc::maxMipmapLevelClamp](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_19cb54762bd472fb9bd58fed7f22e64c2) specifies the upper end of the mipmap level range to clamp access to.
    ///
    /// * [cudaTextureDesc::disableTrilinearOptimization](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_17a70376ee9551c40991b587b48dbd728) specifies whether the trilinear filtering optimizations will be disabled.
    ///
    /// * [cudaTextureDesc::seamlessCubemap](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1d2d887e7ecfead1ed118743bc9dce779) specifies whether seamless cube map filtering is enabled. 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 `cudaArrayCubemap`. When seamless cube map filtering is enabled, texture address modes specified by [cudaTextureDesc::addressMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1444fd48870cf61180673e0ed0abb4a1c) are ignored. Instead, if the [cudaTextureDesc::filterMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1c61993bf71d0cdec670ad92e567ba582) is set to [`cudaTextureFilterMode::cudaFilterModePoint`] the address mode [`cudaTextureAddressMode::cudaAddressModeClamp`] will be applied for all dimensions. If the [cudaTextureDesc::filterMode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1c61993bf71d0cdec670ad92e567ba582) is set to [`cudaTextureFilterMode::cudaFilterModeLinear`] seamless cube map filtering will be performed when sampling along the cube face borders.
    ///
    /// The [`cudaResourceViewDesc`] struct is defined as
    ///
    /// ```text
    /// struct cudaResourceViewDesc {
    /// enum cudaResourceViewFormat
    /// format;
    /// size_t                      width;
    /// size_t                      height;
    /// size_t                      depth;
    /// unsigned int                firstMipmapLevel;
    /// unsigned int                lastMipmapLevel;
    /// unsigned int                firstLayer;
    /// unsigned int                lastLayer;
    /// };
    /// ```
    ///
    /// * [cudaResourceViewDesc::format](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceViewDesc.html#structcudaResourceViewDesc_104e9ec20e3b58859dbae8e8e598e1603) 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 32-bit unsigned integer format with 2 or 4 channels, depending on the block compressed
    ///   format. For ex., BC1 and BC4 require the underlying CUDA array to have a 32-bit unsigned int with 2 channels. The other BC
    ///   formats require the underlying resource to have the same 32-bit unsigned int format but with 4 channels.
    ///
    /// * [cudaResourceViewDesc::width](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceViewDesc.html#structcudaResourceViewDesc_1914fc3c27ce32c98a1d8d21936642924) 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.
    ///
    /// * [cudaResourceViewDesc::height](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceViewDesc.html#structcudaResourceViewDesc_1f94839eb926fba26fa5ff28775c79d33) 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.
    ///
    /// * [cudaResourceViewDesc::depth](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceViewDesc.html#structcudaResourceViewDesc_17f76b4084ffdcb7f88e4149b586a990d) specifies the new depth of the texture data. This value has to be equal to that of the original resource.
    ///
    /// * [cudaResourceViewDesc::firstMipmapLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceViewDesc.html#structcudaResourceViewDesc_1f63fa90d2bf6c66f3865bf13006edded) specifies the most detailed mipmap level. This will be the new mipmap level zero. For non-mipmapped resources, this value
    ///   has to be zero.[cudaTextureDesc::minMipmapLevelClamp](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_1928642b629ae8fd8d2adc198979b6840) and [cudaTextureDesc::maxMipmapLevelClamp](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaTextureDesc.html#structcudaTextureDesc_19cb54762bd472fb9bd58fed7f22e64c2) 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.
    ///
    /// * [cudaResourceViewDesc::lastMipmapLevel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceViewDesc.html#structcudaResourceViewDesc_1469d25794fec5471648d0d9e42790431) specifies the least detailed mipmap level. For non-mipmapped resources, this value has to be zero.
    ///
    /// * [cudaResourceViewDesc::firstLayer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceViewDesc.html#structcudaResourceViewDesc_1ab0d42bf9dc88944181f697b17e6943a) 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.
    ///
    /// * [cudaResourceViewDesc::lastLayer](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceViewDesc.html#structcudaResourceViewDesc_16d96c5b3df0bce3d945d4ea99666226f) specifies the last layer index for layered textures. For non-layered resources, this value has to be zero.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDestroyTextureObject`], [cuTexObjectCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TEXOBJECT.html#group__CUDA__TEXOBJECT_1g1f6dd0f9cbf56db725b1f45aa0a7218a).
    ///
    /// # Parameters
    ///
    /// - `pTexObject`: Texture object to create.
    /// - `pResDesc`: Resource descriptor.
    /// - `pTexDesc`: Texture descriptor.
    /// - `pResViewDesc`: Resource view descriptor.
    pub fn cudaCreateTextureObject(
        pTexObject: *mut cudaTextureObject_t,
        pResDesc: *const cudaResourceDesc,
        pTexDesc: *const cudaTextureDesc,
        pResViewDesc: *const cudaResourceViewDesc,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Destroys a texture object.
    ///
    /// Destroys the texture object specified by texObject.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaCreateTextureObject`], [cuTexObjectDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TEXOBJECT.html#group__CUDA__TEXOBJECT_1gcd522ba5e2d1852aff8c0388f66247fd).
    ///
    /// # Parameters
    ///
    /// - `texObject`: Texture object to destroy.
    pub fn cudaDestroyTextureObject(texObject: cudaTextureObject_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a texture object's resource descriptor.
    ///
    /// Returns the resource descriptor for the texture object specified by texObject.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaCreateTextureObject`], [cuTexObjectGetResourceDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TEXOBJECT.html#group__CUDA__TEXOBJECT_1g0cc8eb2fa1e584d2b04d631586d0921f).
    ///
    /// # Parameters
    ///
    /// - `pResDesc`: Resource descriptor.
    /// - `texObject`: Texture object.
    pub fn cudaGetTextureObjectResourceDesc(
        pResDesc: *mut cudaResourceDesc,
        texObject: cudaTextureObject_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a texture object's texture descriptor.
    ///
    /// Returns the texture descriptor for the texture object specified by texObject.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaCreateTextureObject`], [cuTexObjectGetTextureDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TEXOBJECT.html#group__CUDA__TEXOBJECT_1g688de37b844df7313c8fce30fc912645).
    ///
    /// # Parameters
    ///
    /// - `pTexDesc`: Texture descriptor.
    /// - `texObject`: Texture object.
    pub fn cudaGetTextureObjectTextureDesc(
        pTexDesc: *mut cudaTextureDesc,
        texObject: cudaTextureObject_t,
    ) -> cudaError_t;
}
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 specified, [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaCreateTextureObject`], [cuTexObjectGetResourceViewDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TEXOBJECT.html#group__CUDA__TEXOBJECT_1g185fa4c933a1c3a7b6aebe3e4291a37b).
    ///
    /// # Parameters
    ///
    /// - `pResViewDesc`: Resource view descriptor.
    /// - `texObject`: Texture object.
    pub fn cudaGetTextureObjectResourceViewDesc(
        pResViewDesc: *mut cudaResourceViewDesc,
        texObject: cudaTextureObject_t,
    ) -> cudaError_t;
}
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. [cudaResourceDesc::resType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/structcudaResourceDesc.html#structcudaResourceDesc_1aac8b3bb1d63bd25d8e9af7ee0b9a580) must be [`cudaResourceType::cudaResourceTypeArray`] and cudaResourceDesc::res::array::array must be set to a valid CUDA array handle.
    ///
    /// 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.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDestroySurfaceObject`], [cuSurfObjectCreate](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__SURFOBJECT.html#group__CUDA__SURFOBJECT_1g6bc972c90c9590c9f720b2754e6d079d).
    ///
    /// # Parameters
    ///
    /// - `pSurfObject`: Surface object to create.
    /// - `pResDesc`: Resource descriptor.
    pub fn cudaCreateSurfaceObject(
        pSurfObject: *mut cudaSurfaceObject_t,
        pResDesc: *const cudaResourceDesc,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Destroys a surface object.
    ///
    /// Destroys the surface object specified by surfObject.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaCreateSurfaceObject`], [cuSurfObjectDestroy](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__SURFOBJECT.html#group__CUDA__SURFOBJECT_1g4c4ec48d203d1e0bb71750ddc4d7aef3).
    ///
    /// # Parameters
    ///
    /// - `surfObject`: Surface object to destroy.
    pub fn cudaDestroySurfaceObject(surfObject: cudaSurfaceObject_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a surface object's resource descriptor Returns the resource descriptor for the surface object specified by surfObject.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaCreateSurfaceObject`], [cuSurfObjectGetResourceDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__SURFOBJECT.html#group__CUDA__SURFOBJECT_1g2472b7ea0b7e74600ed3d6c244b7ba21).
    ///
    /// # Parameters
    ///
    /// - `pResDesc`: Resource descriptor.
    /// - `surfObject`: Surface object.
    pub fn cudaGetSurfaceObjectResourceDesc(
        pResDesc: *mut cudaResourceDesc,
        surfObject: cudaSurfaceObject_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the latest version of CUDA supported by the driver.
    ///
    /// Returns in \*driverVersion the latest 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. If no driver is installed, then 0 is returned as the driver version.
    ///
    /// This function automatically returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) if driverVersion is NULL.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaRuntimeGetVersion`], [cuDriverGetVersion](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VERSION.html#group__CUDA__VERSION_1g8b7a10395392e049006e61bcdc8ebe71).
    ///
    /// # Parameters
    ///
    /// - `driverVersion`: Returns the CUDA driver version.
    pub fn cudaDriverGetVersion(driverVersion: *mut ::core::ffi::c_int) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the CUDA Runtime version.
    ///
    /// Returns in \*runtimeVersion the version number of the current CUDA Runtime instance. The version is returned as (1000 major + 10 minor). For example,
    /// CUDA 9.2 would be represented by 9020.
    ///
    /// As of CUDA 12.0, this function no longer initializes CUDA. The purpose of this API is solely to return a compile-time constant
    /// stating the CUDA Toolkit version in the above format.
    ///
    /// This function automatically returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) if the runtimeVersion argument is NULL.
    ///
    /// Note:
    ///
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDriverGetVersion`], [cuDriverGetVersion](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__VERSION.html#group__CUDA__VERSION_1g8b7a10395392e049006e61bcdc8ebe71).
    ///
    /// # Parameters
    ///
    /// - `runtimeVersion`: Returns the CUDA Runtime version.
    pub fn cudaRuntimeGetVersion(runtimeVersion: *mut ::core::ffi::c_int) -> cudaError_t;
}
/// Type of public error reporting callback functions.
pub type cudaLogsCallback_t = ::core::option::Option<
    unsafe extern "C" fn(
        data: *mut ::core::ffi::c_void,
        logLevel: cudaLogLevel,
        message: *mut ::core::ffi::c_char,
        length: size_t,
    ),
>;
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 cudaLogsRegisterCallback(
        callbackFunc: cudaLogsCallback_t,
        userData: *mut ::core::ffi::c_void,
        callback_out: *mut cudaLogsCallbackHandle,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Unregister a log message callback.
    ///
    /// # Parameters
    ///
    /// - `callback`: The callback instance to unregister from receiving log messages.
    pub fn cudaLogsUnregisterCallback(callback: cudaLogsCallbackHandle) -> cudaError_t;
}
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 cudaLogsCurrent(
        iterator_out: *mut cudaLogIterator,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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 cudaLogsDumpToFile(
        iterator: *mut cudaLogIterator,
        pathToFile: *const ::core::ffi::c_char,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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 [CUDA_SUCCESS](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e9a0eed720f8a87cd1c5fd1c453bc7a03d). If the provided buffer is not large enough to hold any messages, \*size will be set to 0 and the function will return [CUDA_ERROR_INVALID_VALUE](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e990696c86fcee1f536a1ec7d25867feeb).
    ///
    /// 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 cudaLogsDumpToMemory(
        iterator: *mut cudaLogIterator,
        buffer: *mut ::core::ffi::c_char,
        size: *mut size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates a graph.
    ///
    /// Creates an empty graph, which is returned via pGraph.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`], [`cudaGraphInstantiate`], [`cudaGraphDestroy`], [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphGetEdges`], [`cudaGraphClone`].
    ///
    /// # Parameters
    ///
    /// - `pGraph`: Returns newly created graph.
    /// - `flags`: Graph creation flags, must be 0.
    pub fn cudaGraphCreate(
        pGraph: *mut cudaGraph_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates a kernel execution node and adds it to a graph.
    ///
    /// Creates a new kernel execution node and adds it to graph with numDependencies dependencies specified via pDependencies and arguments specified in pNodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// The [`cudaKernelNodeParams`] structure is defined as:
    ///
    /// ```text
    ///   struct cudaKernelNodeParams
    /// {
    /// void* func;
    /// dim3 gridDim;
    /// dim3 blockDim;
    /// unsigned int sharedMemBytes;
    /// void **kernelParams;
    /// void **extra;
    /// };
    /// ```
    ///
    /// When the graph is launched, the node will invoke kernel func on a (gridDim.x x gridDim.y x gridDim.z) grid of blocks. Each block contains (blockDim.x x blockDim.y x blockDim.z) threads.
    ///
    /// sharedMem 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 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](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1gd5c11cff5adfa5a69d66829399653532), which indicates the end of the extra array;
    /// * [CU_LAUNCH_PARAM_BUFFER_POINTER](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1g36d10d0b40c51372877578a2cffd6acd), 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](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1gf339c057cd94562ead93a192e11c17e9), 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](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1g36d10d0b40c51372877578a2cffd6acd);
    ///
    /// The error [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) will be returned if kernel parameters are specified with both kernelParams and extra (i.e. both kernelParams and extra are non-NULL).
    ///
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The API can also be used with a kernel `cudaKernel_t` by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol entryFuncAddr passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
    /// * Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type
    ///   that can be reliably passed to a different runtime instance is `cudaKernel_t`
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaLaunchKernel`], [`cudaGraphKernelNodeGetParams`], [`cudaGraphKernelNodeSetParams`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `pNodeParams`: Parameters for the GPU execution node.
    pub fn cudaGraphAddKernelNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        pNodeParams: *const cudaKernelNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a kernel node's parameters.
    ///
    /// Returns the parameters of kernel node node in pNodeParams. The kernelParams or extra array returned in pNodeParams, 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 [`cudaGraphKernelNodeSetParams`] 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaLaunchKernel`], [`cudaGraphAddKernelNode`], [`cudaGraphKernelNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to get the parameters for.
    /// - `pNodeParams`: Pointer to return the parameters.
    pub fn cudaGraphKernelNodeGetParams(
        node: cudaGraphNode_t,
        pNodeParams: *mut cudaKernelNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets a kernel node's parameters.
    ///
    /// Sets the parameters of kernel node node to pNodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The API can also be used with a kernel `cudaKernel_t` by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol entryFuncAddr passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
    /// * Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type
    ///   that can be reliably passed to a different runtime instance is `cudaKernel_t`
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetParams`], [`cudaLaunchKernel`], [`cudaGraphAddKernelNode`], [`cudaGraphKernelNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `pNodeParams`: Parameters to copy.
    pub fn cudaGraphKernelNodeSetParams(
        node: cudaGraphNode_t,
        pNodeParams: *const cudaKernelNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Copies attributes from source node to destination node.
    ///
    /// Copies attributes from source node hSrc to destination node hDst. Both node must have the same context.
    ///
    /// Note:
    ///
    /// Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cudaAccessPolicyWindow`].
    ///
    /// # Parameters
    ///
    /// - `hDst`: Destination node.
    /// - `hSrc`: Source node For list of attributes see cudaKernelNodeAttrID.
    pub fn cudaGraphKernelNodeCopyAttributes(
        hDst: cudaGraphNode_t,
        hSrc: cudaGraphNode_t,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaAccessPolicyWindow`].
    pub fn cudaGraphKernelNodeGetAttribute(
        hNode: cudaGraphNode_t,
        attr: cudaLaunchAttributeID,
        value_out: *mut cudaLaunchAttributeValue,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaAccessPolicyWindow`].
    pub fn cudaGraphKernelNodeSetAttribute(
        hNode: cudaGraphNode_t,
        attr: cudaLaunchAttributeID,
        value: *const cudaLaunchAttributeValue,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates a memcpy node and adds it to a graph.
    ///
    /// Creates a new memcpy node and adds it to graph with numDependencies dependencies specified via pDependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// When the graph is launched, the node will perform the memcpy described by pCopyParams. See [`cudaMemcpy3D`] 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 [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09).
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaMemcpy3D`], [`cudaGraphAddMemcpyNodeToSymbol`], [`cudaGraphAddMemcpyNodeFromSymbol`], [`cudaGraphAddMemcpyNode1D`], [`cudaGraphMemcpyNodeGetParams`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `pCopyParams`: Parameters for the memory copy.
    pub fn cudaGraphAddMemcpyNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        pCopyParams: *const cudaMemcpy3DParms,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `symbol`: Device symbol address.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphAddMemcpyNodeToSymbol(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        symbol: *const ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `dst`: Destination memory address.
    /// - `symbol`: Device symbol address.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphAddMemcpyNodeFromSymbol(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        dst: *mut ::core::ffi::c_void,
        symbol: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates a 1D memcpy node and adds it to a graph.
    ///
    /// Creates a new 1D memcpy node and adds it to graph with numDependencies dependencies specified via pDependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// When the graph is launched, the node will copy count bytes from the memory area pointed to by src to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. Launching a memcpy node with dst and src pointers that
    /// do not match the direction of the copy results in an undefined behavior.
    ///
    /// 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 [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc88178f29891f2c18fe67361cc80de09).
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeGetParams`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParams1D`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `dst`: Destination memory address.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphAddMemcpyNode1D(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        dst: *mut ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a memcpy node's parameters.
    ///
    /// Returns the parameters of memcpy node node in pNodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaMemcpy3D`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to get the parameters for.
    /// - `pNodeParams`: Pointer to return the parameters.
    pub fn cudaGraphMemcpyNodeGetParams(
        node: cudaGraphNode_t,
        pNodeParams: *mut cudaMemcpy3DParms,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets a memcpy node's parameters.
    ///
    /// Sets the parameters of memcpy node node to pNodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetParams`], [`cudaMemcpy3D`], [`cudaGraphMemcpyNodeSetParamsToSymbol`], [`cudaGraphMemcpyNodeSetParamsFromSymbol`], [`cudaGraphMemcpyNodeSetParams1D`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `pNodeParams`: Parameters to copy.
    pub fn cudaGraphMemcpyNodeSetParams(
        node: cudaGraphNode_t,
        pNodeParams: *const cudaMemcpy3DParms,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `symbol`: Device symbol address.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphMemcpyNodeSetParamsToSymbol(
        node: cudaGraphNode_t,
        symbol: *const ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `dst`: Destination memory address.
    /// - `symbol`: Device symbol address.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphMemcpyNodeSetParamsFromSymbol(
        node: cudaGraphNode_t,
        dst: *mut ::core::ffi::c_void,
        symbol: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets a memcpy node's parameters to perform a 1-dimensional copy.
    ///
    /// Sets the parameters of memcpy node node to the copy described by the provided parameters.
    ///
    /// When the graph is launched, the node will copy count bytes from the memory area pointed to by src to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of [`cudaMemcpyKind::cudaMemcpyHostToHost`], [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`cudaMemcpyKind::cudaMemcpyDeviceToHost`], [`cudaMemcpyKind::cudaMemcpyDeviceToDevice`], or [`cudaMemcpyKind::cudaMemcpyDefault`]. Passing [`cudaMemcpyKind::cudaMemcpyDefault`] is recommended, in which case the type of transfer is inferred from the pointer values. However, [`cudaMemcpyKind::cudaMemcpyDefault`] is only allowed on systems that support unified virtual addressing. Launching a memcpy node with dst and src pointers that
    /// do not match the direction of the copy results in an undefined behavior.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaMemcpy`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `dst`: Destination memory address.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphMemcpyNodeSetParams1D(
        node: cudaGraphNode_t,
        dst: *mut ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates a memset node and adds it to a graph.
    ///
    /// Creates a new memset node and adds it to graph with numDependencies dependencies specified via pDependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// The element size must be 1, 2, or 4 bytes. When the graph is launched, the node will perform the memset described by pMemsetParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaMemset2D`], [`cudaGraphMemsetNodeGetParams`], [`cudaGraphMemsetNodeSetParams`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `pMemsetParams`: Parameters for the memory set.
    pub fn cudaGraphAddMemsetNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        pMemsetParams: *const cudaMemsetParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a memset node's parameters.
    ///
    /// Returns the parameters of memset node node in pNodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaMemset2D`], [`cudaGraphAddMemsetNode`], [`cudaGraphMemsetNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to get the parameters for.
    /// - `pNodeParams`: Pointer to return the parameters.
    pub fn cudaGraphMemsetNodeGetParams(
        node: cudaGraphNode_t,
        pNodeParams: *mut cudaMemsetParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets a memset node's parameters.
    ///
    /// Sets the parameters of memset node node to pNodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetParams`], [`cudaMemset2D`], [`cudaGraphAddMemsetNode`], [`cudaGraphMemsetNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `pNodeParams`: Parameters to copy.
    pub fn cudaGraphMemsetNodeSetParams(
        node: cudaGraphNode_t,
        pNodeParams: *const cudaMemsetParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates a host execution node and adds it to a graph.
    ///
    /// Creates a new CPU execution node and adds it to graph with numDependencies dependencies specified via pDependencies and arguments specified in pNodeParams. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaLaunchHostFunc`], [`cudaGraphHostNodeGetParams`], [`cudaGraphHostNodeSetParams`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `pNodeParams`: Parameters for the host node.
    pub fn cudaGraphAddHostNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        pNodeParams: *const cudaHostNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a host node's parameters.
    ///
    /// Returns the parameters of host node node in pNodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaLaunchHostFunc`], [`cudaGraphAddHostNode`], [`cudaGraphHostNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to get the parameters for.
    /// - `pNodeParams`: Pointer to return the parameters.
    pub fn cudaGraphHostNodeGetParams(
        node: cudaGraphNode_t,
        pNodeParams: *mut cudaHostNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets a host node's parameters.
    ///
    /// Sets the parameters of host node node to nodeParams.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetParams`], [`cudaLaunchHostFunc`], [`cudaGraphAddHostNode`], [`cudaGraphHostNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `pNodeParams`: Parameters to copy.
    pub fn cudaGraphHostNodeSetParams(
        node: cudaGraphNode_t,
        pNodeParams: *const cudaHostNodeParams,
    ) -> cudaError_t;
}
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 graph with numDependencies dependencies specified via pDependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphChildGraphNodeGetGraph`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`], [`cudaGraphClone`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `childGraph`: The graph to clone into this node.
    pub fn cudaGraphAddChildGraphNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        childGraph: cudaGraph_t,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddChildGraphNode`], [`cudaGraphNodeFindInClone`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to get the embedded graph for.
    /// - `pGraph`: Location to store a handle to the graph.
    pub fn cudaGraphChildGraphNodeGetGraph(
        node: cudaGraphNode_t,
        pGraph: *mut cudaGraph_t,
    ) -> cudaError_t;
}
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 graph with numDependencies dependencies specified via pDependencies. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    pub fn cudaGraphAddEmptyNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
    ) -> cudaError_t;
}
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.
    ///
    /// These nodes may not be used in loops or conditionals.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphAddEventWaitNode`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `numDependencies`: Number of dependencies.
    /// - `event`: Event for the node.
    pub fn cudaGraphAddEventRecordNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddEventRecordNode`], [`cudaGraphEventRecordNodeSetEvent`], [`cudaGraphEventWaitNodeGetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `event_out`: Pointer to return the event.
    pub fn cudaGraphEventRecordNodeGetEvent(
        node: cudaGraphNode_t,
        event_out: *mut cudaEvent_t,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetParams`], [`cudaGraphAddEventRecordNode`], [`cudaGraphEventRecordNodeGetEvent`], [`cudaGraphEventWaitNodeSetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `event`: Event to use.
    pub fn cudaGraphEventRecordNodeSetEvent(
        node: cudaGraphNode_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
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()](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__EVENT.html#group__CUDA__EVENT_1g95424d3be52c4eb95d83861b70fb89d1) for details on what is captured by an event. The synchronization will be performed efficiently on the device when applicable.
    /// event may be from a different context or device than the launch stream.
    ///
    /// These nodes may not be used in loops or conditionals.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphAddEventRecordNode`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `numDependencies`: Number of dependencies.
    /// - `event`: Event for the node.
    pub fn cudaGraphAddEventWaitNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddEventWaitNode`], [`cudaGraphEventWaitNodeSetEvent`], [`cudaGraphEventRecordNodeGetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `event_out`: Pointer to return the event.
    pub fn cudaGraphEventWaitNodeGetEvent(
        node: cudaGraphNode_t,
        event_out: *mut cudaEvent_t,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetParams`], [`cudaGraphAddEventWaitNode`], [`cudaGraphEventWaitNodeGetEvent`], [`cudaGraphEventRecordNodeSetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`].
    ///
    /// # Parameters
    ///
    /// - `event`: Event to use.
    pub fn cudaGraphEventWaitNodeSetEvent(
        node: cudaGraphNode_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
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 graph 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 pGraphNode.
    ///
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphExternalSemaphoresSignalNodeGetParams`], [`cudaGraphExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddEventRecordNode`], [`cudaGraphAddEventWaitNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the node.
    pub fn cudaGraphAddExternalSemaphoresSignalNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
    ) -> cudaError_t;
}
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 [`cudaGraphExternalSemaphoresSignalNodeSetParams`] 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaLaunchKernel`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaGraphExternalSemaphoresSignalNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `params_out`: Pointer to return the parameters.
    pub fn cudaGraphExternalSemaphoresSignalNodeGetParams(
        hNode: cudaGraphNode_t,
        params_out: *mut cudaExternalSemaphoreSignalNodeParams,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetParams`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaGraphExternalSemaphoresSignalNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cudaGraphExternalSemaphoresSignalNodeSetParams(
        hNode: cudaGraphNode_t,
        nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
    ) -> cudaError_t;
}
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 graph 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 pGraphNode.
    ///
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphExternalSemaphoresWaitNodeGetParams`], [`cudaGraphExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddEventRecordNode`], [`cudaGraphAddEventWaitNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the node.
    pub fn cudaGraphAddExternalSemaphoresWaitNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
    ) -> cudaError_t;
}
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 [`cudaGraphExternalSemaphoresSignalNodeSetParams`] 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaLaunchKernel`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaGraphExternalSemaphoresWaitNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to get the parameters for.
    /// - `params_out`: Pointer to return the parameters.
    pub fn cudaGraphExternalSemaphoresWaitNodeGetParams(
        hNode: cudaGraphNode_t,
        params_out: *mut cudaExternalSemaphoreWaitNodeParams,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaGraphExternalSemaphoresWaitNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cudaGraphExternalSemaphoresWaitNodeSetParams(
        hNode: cudaGraphNode_t,
        nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates an allocation node and adds it to a graph.
    ///
    /// Creates a new allocation node and adds it to graph with numDependencies dependencies specified via pDependencies 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. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// When [`cudaGraphAddMemAllocNode`] 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 [`cudaGraphAddMemFreeNode`], 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 cudaMemFreeAsync or cudaMemFree;
    /// * launching a graph with a free node for that allocation; or
    /// * specifying [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d090044258c8d3adc203f97e73e92810e1785f) during instantiation, which makes each launch behave as though it called cudaMemFreeAsync 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphAddMemFreeNode`], [`cudaGraphMemAllocNodeGetParams`], [`cudaDeviceGraphMemTrim`], [`cudaDeviceGetGraphMemAttribute`], [`cudaDeviceSetGraphMemAttribute`], [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddEventRecordNode`], [`cudaGraphAddEventWaitNode`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `nodeParams`: Parameters for the node.
    pub fn cudaGraphAddMemAllocNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        nodeParams: *mut cudaMemAllocNodeParams,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaGraphAddMemAllocNode`], [`cudaGraphMemFreeNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to get the parameters for.
    /// - `params_out`: Pointer to return the parameters.
    pub fn cudaGraphMemAllocNodeGetParams(
        node: cudaGraphNode_t,
        params_out: *mut cudaMemAllocNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates a memory free node and adds it to a graph.
    ///
    /// Creates a new memory free node and adds it to graph with numDependencies dependencies specified via pDependencies and address specified in dptr. It is possible for numDependencies to be 0, in which case the node will be placed at the root of the graph. pDependencies may not have any duplicate entries. A handle to the new node will be returned in pGraphNode.
    ///
    /// [`cudaGraphAddMemFreeNode`] will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphAddMemAllocNode`], [`cudaGraphMemFreeNodeGetParams`], [`cudaDeviceGraphMemTrim`], [`cudaDeviceGetGraphMemAttribute`], [`cudaDeviceSetGraphMemAttribute`], [`cudaMallocAsync`], [`cudaFreeAsync`], [`cudaGraphCreate`], [`cudaGraphDestroyNode`], [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddEventRecordNode`], [`cudaGraphAddEventWaitNode`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: Dependencies of the node.
    /// - `numDependencies`: Number of dependencies.
    /// - `dptr`: Address of memory to free.
    pub fn cudaGraphAddMemFreeNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        numDependencies: size_t,
        dptr: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaGraphAddMemFreeNode`], [`cudaGraphMemFreeNodeGetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to get the parameters for.
    /// - `dptr_out`: Pointer to return the device address.
    pub fn cudaGraphMemFreeNodeGetParams(
        node: cudaGraphNode_t,
        dptr_out: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
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.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddMemAllocNode`], [`cudaGraphAddMemFreeNode`], [`cudaDeviceGetGraphMemAttribute`], [`cudaDeviceSetGraphMemAttribute`], [`cudaMallocAsync`], [`cudaFreeAsync`].
    ///
    /// # Parameters
    ///
    /// - `device`: The device for which cached memory should be freed.
    pub fn cudaDeviceGraphMemTrim(device: ::core::ffi::c_int) -> cudaError_t;
}
unsafe extern "C" {
    /// Query asynchronous allocation attributes related to graphs.
    ///
    /// Valid attributes are:
    ///
    /// * [cudaGraphMemAttrUsedMemCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg4764cb94cff3171bdc738dd11a4c2ba6872828f088bcae83289bdc6bf9e9cf32): Amount of memory, in bytes, currently associated with graphs
    /// * [cudaGraphMemAttrUsedMemHigh](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg4764cb94cff3171bdc738dd11a4c2ba63bbc7271f7ec7c63ec4b7a17a0ae7f59): High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be
    ///   reset to zero.
    /// * [cudaGraphMemAttrReservedMemCurrent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg4764cb94cff3171bdc738dd11a4c2ba68634b0b4cf96510b19cc684052505a43): Amount of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
    /// * [cudaGraphMemAttrReservedMemHigh](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg4764cb94cff3171bdc738dd11a4c2ba611955e0833a2fab17aeb4a6026c6f542): High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceSetGraphMemAttribute`], [`cudaGraphAddMemAllocNode`], [`cudaGraphAddMemFreeNode`], [`cudaDeviceGraphMemTrim`], [`cudaMallocAsync`], [`cudaFreeAsync`].
    ///
    /// # Parameters
    ///
    /// - `device`: Specifies the scope of the query.
    /// - `attr`: attribute to get.
    /// - `value`: retrieved value.
    pub fn cudaDeviceGetGraphMemAttribute(
        device: ::core::ffi::c_int,
        attr: cudaGraphMemAttributeType,
        value: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Set asynchronous allocation attributes related to graphs.
    ///
    /// Valid attributes are:
    ///
    /// * [cudaGraphMemAttrUsedMemHigh](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg4764cb94cff3171bdc738dd11a4c2ba63bbc7271f7ec7c63ec4b7a17a0ae7f59): High watermark of memory, in bytes, associated with graphs since the last time it was reset. High watermark can only be
    ///   reset to zero.
    /// * [cudaGraphMemAttrReservedMemHigh](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg4764cb94cff3171bdc738dd11a4c2ba611955e0833a2fab17aeb4a6026c6f542): High watermark of memory, in bytes, currently allocated for use by the CUDA graphs asynchronous allocator.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceGetGraphMemAttribute`], [`cudaGraphAddMemAllocNode`], [`cudaGraphAddMemFreeNode`], [`cudaDeviceGraphMemTrim`], [`cudaMallocAsync`], [`cudaFreeAsync`].
    ///
    /// # Parameters
    ///
    /// - `device`: Specifies the scope of the query.
    /// - `attr`: attribute to get.
    /// - `value`: pointer to value to set.
    pub fn cudaDeviceSetGraphMemAttribute(
        device: ::core::ffi::c_int,
        attr: cudaGraphMemAttributeType,
        value: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Clones a graph.
    ///
    /// This function creates a copy of originalGraph and returns it in pGraphClone. 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphCreate`], [`cudaGraphNodeFindInClone`].
    ///
    /// # Parameters
    ///
    /// - `pGraphClone`: Returns newly created cloned graph.
    /// - `originalGraph`: Graph to clone.
    pub fn cudaGraphClone(
        pGraphClone: *mut cudaGraph_t,
        originalGraph: cudaGraph_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Finds a cloned version of a node.
    ///
    /// This function returns the node in clonedGraph corresponding to originalNode in the original graph.
    ///
    /// clonedGraph must have been cloned from originalGraph via [`cudaGraphClone`]. originalNode must have been in originalGraph at the time of the call to [`cudaGraphClone`], and the corresponding cloned node in clonedGraph must not have been removed. The cloned node is then returned via pClonedNode.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphClone`].
    ///
    /// # Parameters
    ///
    /// - `pNode`: Returns handle to the cloned node.
    /// - `originalNode`: Handle to the original node.
    /// - `clonedGraph`: Cloned graph to query.
    pub fn cudaGraphNodeFindInClone(
        pNode: *mut cudaGraphNode_t,
        originalNode: cudaGraphNode_t,
        clonedGraph: cudaGraph_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a node's type.
    ///
    /// Returns the node type of node in pType.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphChildGraphNodeGetGraph`], [`cudaGraphKernelNodeGetParams`], [`cudaGraphKernelNodeSetParams`], [`cudaGraphHostNodeGetParams`], [`cudaGraphHostNodeSetParams`], [`cudaGraphMemcpyNodeGetParams`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemsetNodeGetParams`], [`cudaGraphMemsetNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to query.
    /// - `pType`: Pointer to return the node type.
    pub fn cudaGraphNodeGetType(
        node: cudaGraphNode_t,
        pType: *mut cudaGraphNodeType,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`]cudaGraphNodeGetLocalId [`cudaGraphNodeGetToolsId`]cudaGraphGetId [`cudaGraphExecGetId`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    /// - `phGraph`: Pointer to return the containing graph.
    pub fn cudaGraphNodeGetContainingGraph(
        hNode: cudaGraphNode_t,
        phGraph: *mut cudaGraph_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the node id of a given graph node.
    ///
    /// Returns the node id of hNode in \*nodeId. The nodeId matches that referenced by [`cudaGraphDebugDotPrint`]. The local nodeId and graphId together can uniquely identify the node.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`]cudaGraphNodeGetContainingGraph [`cudaGraphNodeGetToolsId`]cudaGraphGetId [`cudaGraphExecGetId`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    /// - `nodeId`: Pointer to return the nodeId.
    pub fn cudaGraphNodeGetLocalId(
        hNode: cudaGraphNode_t,
        nodeId: *mut ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns an id used by tools to identify a given node.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`]cudaGraphNodeGetContainingGraph [`cudaGraphNodeGetLocalId`]cudaGraphGetId [`cudaGraphExecGetId`].
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    pub fn cudaGraphNodeGetToolsId(
        hNode: cudaGraphNode_t,
        toolsNodeId: *mut ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the id of a given graph.
    ///
    /// Returns the id of hGraph in \*graphId. The value in \*graphId matches that referenced by [`cudaGraphDebugDotPrint`].
    ///
    /// **See also:**
    ///
    /// [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`]cudaGraphNodeGetContainingGraph [`cudaGraphNodeGetLocalId`]cudaGraphNodeGetToolsId [`cudaGraphExecGetId`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph to query.
    pub fn cudaGraphGetId(
        hGraph: cudaGraph_t,
        graphID: *mut ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the id of a given graph exec.
    ///
    /// Returns the id of hGraphExec in \*graphId. The value in \*graphId matches that referenced by [`cudaGraphDebugDotPrint`].
    ///
    /// **See also:**
    ///
    /// [`cudaGraphGetNodes`], [`cudaGraphDebugDotPrint`]cudaGraphNodeGetContainingGraph [`cudaGraphNodeGetLocalId`]cudaGraphNodeGetToolsId [`cudaGraphGetId`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: Graph to query.
    pub fn cudaGraphExecGetId(
        hGraphExec: cudaGraphExec_t,
        graphID: *mut ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a graph's nodes.
    ///
    /// Returns a list of graph'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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphCreate`], [`cudaGraphGetRootNodes`], [`cudaGraphGetEdges`], [`cudaGraphNodeGetType`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
    ///
    /// # Parameters
    ///
    /// - `graph`: Graph to query.
    /// - `nodes`: Pointer to return the nodes.
    /// - `numNodes`: See description.
    pub fn cudaGraphGetNodes(
        graph: cudaGraph_t,
        nodes: *mut cudaGraphNode_t,
        numNodes: *mut size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a graph's root nodes.
    ///
    /// Returns a list of graph's root nodes. pRootNodes may be NULL, in which case this function will return the number of root nodes in pNumRootNodes. Otherwise, pNumRootNodes entries will be filled in. If pNumRootNodes is higher than the actual number of root nodes, the remaining entries in pRootNodes will be set to NULL, and the number of nodes actually obtained will be returned in pNumRootNodes.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphCreate`], [`cudaGraphGetNodes`], [`cudaGraphGetEdges`], [`cudaGraphNodeGetType`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
    ///
    /// # Parameters
    ///
    /// - `graph`: Graph to query.
    /// - `pRootNodes`: Pointer to return the root nodes.
    /// - `pNumRootNodes`: See description.
    pub fn cudaGraphGetRootNodes(
        graph: cudaGraph_t,
        pRootNodes: *mut cudaGraphNode_t,
        pNumRootNodes: *mut size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a graph's dependency edges.
    ///
    /// Returns a list of graph'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 losst query via NULL edgeData will result in [cudaErrorLossyQuery](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038d484d9d8e8f269cf93d4c111b646f908). 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphAddDependencies`], [`cudaGraphRemoveDependencies`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
    ///
    /// # Parameters
    ///
    /// - `graph`: 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 cudaGraphGetEdges(
        graph: cudaGraph_t,
        from: *mut cudaGraphNode_t,
        to: *mut cudaGraphNode_t,
        edgeData: *mut cudaGraphEdgeData,
        numEdges: *mut size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a node's dependencies.
    ///
    /// Returns a list of node's dependencies. pDependencies may be NULL, in which case this function will return the number of dependencies in pNumDependencies. Otherwise, pNumDependencies entries will be filled in. If pNumDependencies is higher than the actual number of dependencies, the remaining entries in pDependencies will be set to NULL, and the number of nodes actually obtained will be returned in pNumDependencies.
    ///
    /// Note that if an edge has non-zero (non-default) edge data and edgeData is NULL, this API will return [cudaErrorLossyQuery](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038d484d9d8e8f269cf93d4c111b646f908). If edgeData is non-NULL, then pDependencies must be as well.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetDependentNodes`], [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphGetEdges`], [`cudaGraphAddDependencies`], [`cudaGraphRemoveDependencies`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to query.
    /// - `pDependencies`: Pointer to return the dependencies.
    /// - `edgeData`: Optional array to return edge data for each dependency.
    /// - `pNumDependencies`: See description.
    pub fn cudaGraphNodeGetDependencies(
        node: cudaGraphNode_t,
        pDependencies: *mut cudaGraphNode_t,
        edgeData: *mut cudaGraphEdgeData,
        pNumDependencies: *mut size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a node's dependent nodes.
    ///
    /// Returns a list of node's dependent nodes. pDependentNodes may be NULL, in which case this function will return the number of dependent nodes in pNumDependentNodes. Otherwise, pNumDependentNodes entries will be filled in. If pNumDependentNodes is higher than the actual number of dependent nodes, the remaining entries in pDependentNodes will be set to NULL, and the number of nodes actually obtained will be returned in pNumDependentNodes.
    ///
    /// Note that if an edge has non-zero (non-default) edge data and edgeData is NULL, this API will return [cudaErrorLossyQuery](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038d484d9d8e8f269cf93d4c111b646f908). If edgeData is non-NULL, then pDependentNodes must be as well.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetDependencies`], [`cudaGraphGetNodes`], [`cudaGraphGetRootNodes`], [`cudaGraphGetEdges`], [`cudaGraphAddDependencies`], [`cudaGraphRemoveDependencies`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to query.
    /// - `pDependentNodes`: Pointer to return the dependent nodes.
    /// - `edgeData`: Optional pointer to return edge data for dependent nodes.
    /// - `pNumDependentNodes`: See description.
    pub fn cudaGraphNodeGetDependentNodes(
        node: cudaGraphNode_t,
        pDependentNodes: *mut cudaGraphNode_t,
        edgeData: *mut cudaGraphEdgeData,
        pNumDependentNodes: *mut size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Adds dependency edges to a graph.
    ///
    /// The number of dependencies to be added is defined by numDependencies Elements in pFrom and pTo at corresponding indices define a dependency. Each node in pFrom and pTo must belong to graph.
    ///
    /// If numDependencies is 0, elements in pFrom and pTo 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphRemoveDependencies`], [`cudaGraphGetEdges`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
    ///
    /// # Parameters
    ///
    /// - `graph`: 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 cudaGraphAddDependencies(
        graph: cudaGraph_t,
        from: *const cudaGraphNode_t,
        to: *const cudaGraphNode_t,
        edgeData: *const cudaGraphEdgeData,
        numDependencies: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Removes dependency edges from a graph.
    ///
    /// The number of pDependencies to be removed is defined by numDependencies. Elements in pFrom and pTo at corresponding indices define a dependency. Each node in pFrom and pTo must belong to graph.
    ///
    /// If numDependencies is 0, elements in pFrom and pTo 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.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddDependencies`], [`cudaGraphGetEdges`], [`cudaGraphNodeGetDependencies`], [`cudaGraphNodeGetDependentNodes`].
    ///
    /// # Parameters
    ///
    /// - `graph`: 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 cudaGraphRemoveDependencies(
        graph: cudaGraph_t,
        from: *const cudaGraphNode_t,
        to: *const cudaGraphNode_t,
        edgeData: *const cudaGraphEdgeData,
        numDependencies: size_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Remove a node from the graph.
    ///
    /// Removes node from its graph. This operation also severs any dependencies of other nodes on node and vice versa.
    ///
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddChildGraphNode`], [`cudaGraphAddEmptyNode`], [`cudaGraphAddKernelNode`], [`cudaGraphAddHostNode`], [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemsetNode`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to remove.
    pub fn cudaGraphDestroyNode(node: cudaGraphNode_t) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `pGraphExec`: Returns instantiated graph.
    /// - `graph`: Graph to instantiate.
    pub fn cudaGraphInstantiate(
        pGraphExec: *mut cudaGraphExec_t,
        graph: cudaGraph_t,
        flags: ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates an executable graph from a graph.
    ///
    /// Instantiates graph as an executable graph. 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 pGraphExec.
    ///
    /// The flags parameter controls the behavior of instantiation and subsequent graph launches. Valid flags are:
    ///
    /// * [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d090044258c8d3adc203f97e73e92810e1785f), which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before
    ///   the graph is relaunched.
    ///
    /// * [cudaGraphInstantiateFlagDeviceLaunch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d090043fee5a1234b9f5d4ef329a660e6e3f5a), 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 [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d090044258c8d3adc203f97e73e92810e1785f).
    ///
    /// * [cudaGraphInstantiateFlagUseNodePriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d0900495adbcaa8c89c323deec4b2070a4bab5), 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 graph 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 [`cudaGraphExecDestroy`] will result in an error. The same also applies if graph contains any device-updatable kernel nodes.
    ///
    /// If graph contains kernels which call device-side [`cudaGraphLaunch`] from multiple devices, 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 device.
    /// * 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 device, and the current device must match the device of other nodes in the
    /// ```text
    /// graph.
    ///
    /// ```
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphInstantiate`], [`cudaGraphCreate`], [`cudaGraphUpload`], [`cudaGraphLaunch`], [`cudaGraphExecDestroy`].
    ///
    /// # Parameters
    ///
    /// - `pGraphExec`: Returns instantiated graph.
    /// - `graph`: Graph to instantiate.
    /// - `flags`: Flags to control instantiation. See [CUgraphInstantiate_flags](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1g070bf5517d3a7915667c256eefce4956).
    pub fn cudaGraphInstantiateWithFlags(
        pGraphExec: *mut cudaGraphExec_t,
        graph: cudaGraph_t,
        flags: ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates an executable graph from a graph.
    ///
    /// Instantiates graph 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 pGraphExec.
    ///
    /// instantiateParams controls the behavior of instantiation and subsequent graph launches, as well as returning more detailed information in the
    /// event of an error. `cudaGraphInstantiateParams` is defined as:
    ///
    /// ```text
    /// typedef struct {
    /// unsigned long long flags;
    /// cudaStream_t uploadStream;
    /// cudaGraphNode_t errNode_out;
    /// cudaGraphInstantiateResult result_out;
    /// } cudaGraphInstantiateParams;
    /// ```
    ///
    /// The flags field controls the behavior of instantiation and subsequent graph launches. Valid flags are:
    ///
    /// * [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d090044258c8d3adc203f97e73e92810e1785f), which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before
    ///   the graph is relaunched.
    ///
    /// * [cudaGraphInstantiateFlagUpload](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d09004565872dd74cc9d97125bf43740345238), which will perform an upload of the graph into uploadStream once the graph has been instantiated.
    ///
    /// * [cudaGraphInstantiateFlagDeviceLaunch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d090043fee5a1234b9f5d4ef329a660e6e3f5a), 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 [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d090044258c8d3adc203f97e73e92810e1785f).
    ///
    /// * [cudaGraphInstantiateFlagUseNodePriority](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d0900495adbcaa8c89c323deec4b2070a4bab5), 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 graph 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 [`cudaGraphExecDestroy`] will result in an error. The same also applies if graph contains any device-updatable kernel nodes.
    ///
    /// If graph contains kernels which call device-side [`cudaGraphLaunch`] from multiple devices, 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 device.
    /// * 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 device, and the current device must match the device of other nodes in the
    /// ```text
    /// graph.
    ///
    /// ```
    /// In the event of an error, the result_out and errNode_out fields will contain more information about the nature of the error. Possible error reporting includes:
    ///
    /// * [cudaGraphInstantiateError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3faefd09000966e3b9d6ca5bcf7b2b9db27a3438c6c187c9d105ff36692abebd), if passed an invalid value or if an unexpected error occurred which is described by the return value of the function. errNode_out will be set to NULL.
    /// * [cudaGraphInstantiateInvalidStructure](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3faefd09000966e3b9d6ca5bcf7b2b9d1f6436346e713fc9ddf43408e9b63da0), if the graph structure is invalid. errNode_out will be set to one of the offending nodes.
    /// * [cudaGraphInstantiateNodeOperationNotSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3faefd09000966e3b9d6ca5bcf7b2b9dfe90eb1caaa8ce17e628dd5fa4651e25), 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. errNode_out will be set to this node.
    /// * [cudaGraphInstantiateMultipleDevicesNotSupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3faefd09000966e3b9d6ca5bcf7b2b9d344068129ac717f6ec29a4a6c88e90f0), if the graph is instantiated for device launch but a node’s device 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`] from multiple devices. errNode_out will be set to this node.
    ///
    /// If instantiation is successful, result_out will be set to [cudaGraphInstantiateSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3faefd09000966e3b9d6ca5bcf7b2b9d6b92d94f90110623dafb5fe8081f6f45), 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphCreate`], [`cudaGraphInstantiate`], [`cudaGraphInstantiateWithFlags`], [`cudaGraphExecDestroy`].
    ///
    /// # Parameters
    ///
    /// - `pGraphExec`: Returns instantiated graph.
    /// - `graph`: Graph to instantiate.
    /// - `instantiateParams`: Instantiation parameters.
    pub fn cudaGraphInstantiateWithParams(
        pGraphExec: *mut cudaGraphExec_t,
        graph: cudaGraph_t,
        instantiateParams: *mut cudaGraphInstantiateParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Query the instantiation flags of an executable graph.
    ///
    /// Returns the flags that were passed to instantiation for the given executable graph. [cudaGraphInstantiateFlagUpload](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d09004565872dd74cc9d97125bf43740345238) 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphInstantiate`], [`cudaGraphInstantiateWithFlags`], [`cudaGraphInstantiateWithParams`].
    ///
    /// # Parameters
    ///
    /// - `graphExec`: The executable graph to query.
    /// - `flags`: Returns the instantiation flags.
    pub fn cudaGraphExecGetFlags(
        graphExec: cudaGraphExec_t,
        flags: *mut ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
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 node in the non-executable graph, from which the executable graph was instantiated.
    ///
    /// node must not have been removed from the original graph. All nodeParams fields may change, but the following restrictions apply to func updates:
    ///
    /// * The owning device 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`] cannot be updated to a function which uses device-side [`cudaGraphLaunch`] unless the node resides on the same device 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. node is also not modified by this call.
    ///
    /// If node 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The API can also be used with a kernel `cudaKernel_t` by querying the handle using [`cudaLibraryGetKernel`] or [`cudaGetKernel`] and then passing it to the API by casting to void\*. The symbol entryFuncAddr passed to [`cudaGetKernel`] should be a symbol that is registered with the same CUDA Runtime instance.
    /// * Passing a symbol that belongs that belongs to a different runtime instance will result in undefined behavior. The only type
    ///   that can be reliably passed to a different runtime instance is `cudaKernel_t`
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddKernelNode`], [`cudaGraphKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `node`: kernel node from the graph from which graphExec was instantiated.
    /// - `pNodeParams`: Updated Parameters to set.
    pub fn cudaGraphExecKernelNodeSetParams(
        hGraphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        pNodeParams: *const cudaKernelNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the parameters for a memcpy node in the given graphExec.
    ///
    /// Updates the work represented by node in hGraphExec as though node had contained pNodeParams at instantiation. node must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from node are ignored.
    ///
    /// The source and destination memory in pNodeParams 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 pNodeParams 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. node is also not modified by this call.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddMemcpyNode`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParamsToSymbol`], [`cudaGraphExecMemcpyNodeSetParamsFromSymbol`], [`cudaGraphExecMemcpyNodeSetParams1D`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `node`: Memcpy node from the graph which was used to instantiate graphExec.
    /// - `pNodeParams`: Updated Parameters to set.
    pub fn cudaGraphExecMemcpyNodeSetParams(
        hGraphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        pNodeParams: *const cudaMemcpy3DParms,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `node`: Memcpy node from the graph which was used to instantiate graphExec.
    /// - `symbol`: Device symbol address.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphExecMemcpyNodeSetParamsToSymbol(
        hGraphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        symbol: *const ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `node`: Memcpy node from the graph which was used to instantiate graphExec.
    /// - `dst`: Destination memory address.
    /// - `symbol`: Device symbol address.
    /// - `count`: Size in bytes to copy.
    /// - `offset`: Offset from start of symbol in bytes.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphExecMemcpyNodeSetParamsFromSymbol(
        hGraphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        dst: *mut ::core::ffi::c_void,
        symbol: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the parameters for a memcpy node in the given graphExec to perform a 1-dimensional copy.
    ///
    /// Updates the work represented by node in hGraphExec as though node had contained the given params at instantiation. node must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from node are ignored.
    ///
    /// src and dst must be allocated from the same contexts as the original source and destination memory. The instantiation-time memory operands
    /// 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. node is also not modified by this call.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c) if the memory operands' mappings changed or the original memory operands are multidimensional.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddMemcpyNode`], [`cudaGraphAddMemcpyNode1D`], [`cudaGraphMemcpyNodeSetParams`], [`cudaGraphMemcpyNodeSetParams1D`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `node`: Memcpy node from the graph which was used to instantiate graphExec.
    /// - `dst`: Destination memory address.
    /// - `src`: Source memory address.
    /// - `count`: Size in bytes to copy.
    /// - `kind`: Type of transfer.
    pub fn cudaGraphExecMemcpyNodeSetParams1D(
        hGraphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        dst: *mut ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the parameters for a memset node in the given graphExec.
    ///
    /// Updates the work represented by node in hGraphExec as though node had contained pNodeParams at instantiation. node must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from node are ignored.
    ///
    /// Zero sized operations are not supported.
    ///
    /// The new destination pointer in pNodeParams 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. node 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddMemsetNode`], [`cudaGraphMemsetNodeSetParams`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `node`: Memset node from the graph which was used to instantiate graphExec.
    /// - `pNodeParams`: Updated Parameters to set.
    pub fn cudaGraphExecMemsetNodeSetParams(
        hGraphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        pNodeParams: *const cudaMemsetParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets the parameters for a host node in the given graphExec.
    ///
    /// Updates the work represented by node in hGraphExec as though node had contained pNodeParams at instantiation. node must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from node are ignored.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. node 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddHostNode`], [`cudaGraphHostNodeSetParams`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `node`: Host node from the graph which was used to instantiate graphExec.
    /// - `pNodeParams`: Updated Parameters to set.
    pub fn cudaGraphExecHostNodeSetParams(
        hGraphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        pNodeParams: *const cudaHostNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Updates node parameters in the child graph node in the given graphExec.
    ///
    /// Updates the work represented by node in hGraphExec as though the nodes contained in node's graph had the parameters contained in childGraph's nodes at instantiation. node must remain in the graph which was used to instantiate hGraphExec. Changed edges to and from node are ignored.
    ///
    /// The modifications only affect future launches of hGraphExec. Already enqueued or running launches of hGraphExec are not affected by this call. node 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 node. See [`cudaGraphExecUpdate`] 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddChildGraphNode`], [`cudaGraphChildGraphNodeGetGraph`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The executable graph in which to set the specified node.
    /// - `node`: Host node from the graph which was used to instantiate graphExec.
    /// - `childGraph`: The graph supplying the updated parameters.
    pub fn cudaGraphExecChildGraphNodeSetParams(
        hGraphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        childGraph: cudaGraph_t,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddEventRecordNode`], [`cudaGraphEventRecordNodeGetEvent`], [`cudaGraphEventWaitNodeSetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # 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 cudaGraphExecEventRecordNodeSetEvent(
        hGraphExec: cudaGraphExec_t,
        hNode: cudaGraphNode_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddEventWaitNode`], [`cudaGraphEventWaitNodeGetEvent`], [`cudaGraphEventRecordNodeSetEvent`], [`cudaEventRecordWithFlags`], [`cudaStreamWaitEvent`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # 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 cudaGraphExecEventWaitNodeSetEvent(
        hGraphExec: cudaGraphExec_t,
        hNode: cudaGraphNode_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddExternalSemaphoresSignalNode`], [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresWaitNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # 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 cudaGraphExecExternalSemaphoresSignalNodeSetParams(
        hGraphExec: cudaGraphExec_t,
        hNode: cudaGraphNode_t,
        nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
    ) -> cudaError_t;
}
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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphExecNodeSetParams`], [`cudaGraphAddExternalSemaphoresWaitNode`], [`cudaImportExternalSemaphore`], [`cudaSignalExternalSemaphoresAsync`], [`cudaWaitExternalSemaphoresAsync`], [`cudaGraphExecKernelNodeSetParams`], [`cudaGraphExecMemcpyNodeSetParams`], [`cudaGraphExecMemsetNodeSetParams`], [`cudaGraphExecHostNodeSetParams`], [`cudaGraphExecChildGraphNodeSetParams`], [`cudaGraphExecEventRecordNodeSetEvent`], [`cudaGraphExecEventWaitNodeSetEvent`], [`cudaGraphExecExternalSemaphoresSignalNodeSetParams`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`]
    ///
    /// # 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 cudaGraphExecExternalSemaphoresWaitNodeSetParams(
        hGraphExec: cudaGraphExec_t,
        hNode: cudaGraphNode_t,
        nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
    ) -> cudaError_t;
}
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.
    ///
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetEnabled`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`] [`cudaGraphLaunch`].
    ///
    /// # 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 cudaGraphNodeSetEnabled(
        hGraphExec: cudaGraphExec_t,
        hNode: cudaGraphNode_t,
        isEnabled: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeSetEnabled`], [`cudaGraphExecUpdate`], [`cudaGraphInstantiate`] [`cudaGraphLaunch`].
    ///
    /// # 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 cudaGraphNodeGetEnabled(
        hGraphExec: cudaGraphExec_t,
        hNode: cudaGraphNode_t,
        isEnabled: *mut ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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 cudaGraphInstantiateFlagUseNodePriority, 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`] cannot be updated to a function which uses device-side [`cudaGraphLaunch`] unless the node resides on the same device 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. CU_MEMORYTYPE_DEVICE, CU_MEMORYTYPE_ARRAY, etc.) 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.
    ///
    /// cudaGraphExecUpdate sets the result member of resultInfo to cudaGraphExecUpdateErrorTopologyChanged 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.
    ///
    /// cudaGraphExecUpdate sets the result member of resultInfo to:
    ///
    /// * cudaGraphExecUpdateError if passed an invalid value.
    /// * cudaGraphExecUpdateErrorTopologyChanged if the graph topology changed
    /// * cudaGraphExecUpdateErrorNodeTypeChanged if the type of a node changed, in which case hErrorNode_out is set to the node from hGraph.
    /// * cudaGraphExecUpdateErrorFunctionChanged if the function of a kernel node changed (CUDA driver &lt; 11.2)
    /// * cudaGraphExecUpdateErrorUnsupportedFunctionChange if the func field of a kernel changed in an unsupported way(see note above),
    ///   in which case hErrorNode_out is set to the node from hGraph
    /// * cudaGraphExecUpdateErrorParametersChanged 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
    /// * cudaGraphExecUpdateErrorAttributesChanged 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
    /// * cudaGraphExecUpdateErrorNotSupported 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 cudaGraphExecUpdateError. If the update succeeds, the result member will be set to cudaGraphExecUpdateSuccess.
    ///
    /// cudaGraphExecUpdate returns cudaSuccess when the updated was performed successfully. It returns cudaErrorGraphExecUpdateFailure
    /// 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphInstantiate`]
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: The instantiated graph to be updated.
    /// - `hGraph`: The graph containing the updated parameters.
    /// - `resultInfo`: the error info structure.
    pub fn cudaGraphExecUpdate(
        hGraphExec: cudaGraphExec_t,
        hGraph: cudaGraph_t,
        resultInfo: *mut cudaGraphExecUpdateResultInfo,
    ) -> cudaError_t;
}
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 graphExec.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphInstantiate`], [`cudaGraphLaunch`], [`cudaGraphExecDestroy`].
    pub fn cudaGraphUpload(
        graphExec: cudaGraphExec_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Launches an executable graph in a stream.
    ///
    /// Executes graphExec in stream. Only one instance of graphExec may be executing at a time. Each launch is ordered behind both any previous work in stream and any previous launches of graphExec. To execute a graph concurrently, it must be instantiated multiple times into multiple executable graphs.
    ///
    /// If any allocations created by graphExec remain unfreed (from a previous launch) and graphExec was not instantiated with [cudaGraphInstantiateFlagAutoFreeOnLaunch](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg638577f2b0f6a98b5e6a0e6a72d090044258c8d3adc203f97e73e92810e1785f), the launch will fail with [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphInstantiate`], [`cudaGraphUpload`], [`cudaGraphExecDestroy`].
    ///
    /// # Parameters
    ///
    /// - `graphExec`: Executable graph to launch.
    /// - `stream`: Stream in which to launch the graph.
    pub fn cudaGraphLaunch(
        graphExec: cudaGraphExec_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Destroys an executable graph.
    ///
    /// Destroys the executable graph specified by graphExec.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphInstantiate`], [`cudaGraphUpload`], [`cudaGraphLaunch`].
    ///
    /// # Parameters
    ///
    /// - `graphExec`: Executable graph to destroy.
    pub fn cudaGraphExecDestroy(graphExec: cudaGraphExec_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Destroys a graph.
    ///
    /// Destroys the graph specified by graph, 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * Use of the handle after this call is undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphCreate`].
    ///
    /// # Parameters
    ///
    /// - `graph`: Graph to destroy.
    pub fn cudaGraphDestroy(graph: cudaGraph_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Write a DOT file describing graph structure.
    ///
    /// Using the provided graph, 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
    ///
    /// - `graph`: The graph to create a DOT file from.
    /// - `path`: The path to write the DOT file to.
    /// - `flags`: Flags from cudaGraphDebugDotFlags for specifying which additional node information to write.
    pub fn cudaGraphDebugDotPrint(
        graph: cudaGraph_t,
        path: *const ::core::ffi::c_char,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaUserObjectRetain`], [`cudaUserObjectRelease`], [`cudaGraphRetainUserObject`], [`cudaGraphReleaseUserObject`], [`cudaGraphCreate`].
    ///
    /// # 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 [cudaUserObjectNoDestructorSync](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf4748f36762263564ca8a7a47fd902bbca181af9d994c9a5290b509175ea99fe), 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 cudaUserObjectCreate(
        object_out: *mut cudaUserObject_t,
        ptr: *mut ::core::ffi::c_void,
        destroy: cudaHostFn_t,
        initialRefcount: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaUserObjectCreate`], [`cudaUserObjectRelease`], [`cudaGraphRetainUserObject`], [`cudaGraphReleaseUserObject`], [`cudaGraphCreate`].
    ///
    /// # 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 cudaUserObjectRetain(
        object: cudaUserObject_t,
        count: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaUserObjectCreate`], [`cudaUserObjectRetain`], [`cudaGraphRetainUserObject`], [`cudaGraphReleaseUserObject`], [`cudaGraphCreate`].
    ///
    /// # 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 cudaUserObjectRelease(
        object: cudaUserObject_t,
        count: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaUserObjectCreate`] transfers references from the calling thread, rather than create new references. Pass 0 to create new references.
    pub fn cudaGraphRetainUserObject(
        graph: cudaGraph_t,
        object: cudaUserObject_t,
        count: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaUserObjectCreate`][`cudaUserObjectRetain`], [`cudaUserObjectRelease`], [`cudaGraphRetainUserObject`], [`cudaGraphCreate`].
    ///
    /// # 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 cudaGraphReleaseUserObject(
        graph: cudaGraph_t,
        object: cudaUserObject_t,
        count: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Adds a node of arbitrary type to a graph.
    ///
    /// Creates a new node in graph described by nodeParams with numDependencies dependencies specified via pDependencies. numDependencies may be 0. pDependencies may be null if numDependencies is 0. pDependencies 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphCreate`], [`cudaGraphNodeSetParams`], [`cudaGraphExecNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `pGraphNode`: Returns newly created node.
    /// - `graph`: Graph to which to add the node.
    /// - `pDependencies`: 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 cudaGraphAddNode(
        pGraphNode: *mut cudaGraphNode_t,
        graph: cudaGraph_t,
        pDependencies: *const cudaGraphNode_t,
        dependencyData: *const cudaGraphEdgeData,
        numDependencies: size_t,
        nodeParams: *mut cudaGraphNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Update a graph node's parameters.
    ///
    /// Sets the parameters of graph node node to nodeParams. The node type specified by nodeParams->type must match the type of node. nodeParams must be fully initialized and all unused bytes (reserved, padding) zeroed.
    ///
    /// Modifying parameters is not supported for node types cudaGraphNodeTypeMemAlloc and cudaGraphNodeTypeMemFree.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaGraphAddNode`], [`cudaGraphExecNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cudaGraphNodeSetParams(
        node: cudaGraphNode_t,
        nodeParams: *mut cudaGraphNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns a graph node's parameters.
    ///
    /// Returns the parameters of graph node node 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-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphNodeGetParams`], [`cudaGraphNodeSetParams`], [`cudaGraphAddNode`], [`cudaGraphExecNodeSetParams`].
    ///
    /// # Parameters
    ///
    /// - `node`: Node to get the parameters for.
    /// - `nodeParams`: Pointer to return the parameters.
    pub fn cudaGraphNodeGetParams(
        node: cudaGraphNode_t,
        nodeParams: *mut cudaGraphNodeParams,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Update a graph node's parameters in an instantiated graph.
    ///
    /// Sets the parameters of a node in an executable graph graphExec. The node is identified by the corresponding node node in the non-executable graph from which the executable graph was instantiated. node must not have been removed from the original graph.
    ///
    /// The modifications only affect future launches of graphExec. Already enqueued or running launches of graphExec are not affected by this call. node is also not modified by this call.
    ///
    /// Allowed changes to parameters on executable graphs are as follows:
    ///
    /// | Node type | Allowed changes |
    /// | --- | --- |
    /// | kernel | See [`cudaGraphExecKernelNodeSetParams`] |
    /// | memcpy | Addresses for 1-dimensional copies if allocated in same context; see [`cudaGraphExecMemcpyNodeSetParams`] |
    /// | memset | Addresses for 1-dimensional memsets if allocated in same context; see [`cudaGraphExecMemsetNodeSetParams`] |
    /// | host | Unrestricted |
    /// | child graph | Topology must match and restrictions apply recursively; see [`cudaGraphExecUpdate`] |
    /// | 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 |
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGraphAddNode`], [`cudaGraphNodeSetParams`]
    ///
    /// # Parameters
    ///
    /// - `graphExec`: The executable graph in which to update the specified node.
    /// - `node`: Corresponding node from the graph from which graphExec was instantiated.
    /// - `nodeParams`: Updated Parameters to set.
    pub fn cudaGraphExecNodeSetParams(
        graphExec: cudaGraphExec_t,
        node: cudaGraphNode_t,
        nodeParams: *mut cudaGraphNodeParams,
    ) -> cudaError_t;
}
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.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cuGraphAddNode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPH.html#group__CUDA__GRAPH_1ge01208e62f72a53367a2af903bf17d23),.
    ///
    /// # Parameters
    ///
    /// - `pHandle_out`: Pointer used to return the handle to the caller.
    /// - `graph`: Graph which will contain the conditional node using this handle.
    /// - `defaultLaunchValue`: Optional initial value for the conditional variable. Applied at the beginning of each graph execution if cudaGraphCondAssignDefault
    /// is set in flags.
    /// - `flags`: Currently must be cudaGraphCondAssignDefault or 0.
    pub fn cudaGraphConditionalHandleCreate(
        pHandle_out: *mut cudaGraphConditionalHandle,
        graph: cudaGraph_t,
        defaultLaunchValue: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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.
    ///
    /// Note:
    ///
    /// * Graph objects are not threadsafe. [More here](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/graphs-thread-safety.html#graphs-thread-safety).
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    ///
    /// **See also:**
    ///
    /// [cuGraphAddNode](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GRAPH.html#group__CUDA__GRAPH_1ge01208e62f72a53367a2af903bf17d23),.
    ///
    /// # Parameters
    ///
    /// - `pHandle_out`: Pointer used to return the handle to the caller.
    /// - `graph`: Graph which will contain the conditional node using this handle.
    /// - `ctx`: Execution context for the handle and associated conditional node. If NULL, current context will be used.
    /// - `defaultLaunchValue`: Optional initial value for the conditional variable. Applied at the beginning of each graph execution if cudaGraphCondAssignDefault
    /// is set in flags.
    /// - `flags`: Currently must be cudaGraphCondAssignDefault or 0.
    pub fn cudaGraphConditionalHandleCreate_v2(
        pHandle_out: *mut cudaGraphConditionalHandle,
        graph: cudaGraph_t,
        ctx: cudaExecutionContext_t,
        defaultLaunchValue: ::core::ffi::c_uint,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the requested driver API function pointer.
    ///
    /// Returns in \*\*funcPtr the address of the CUDA driver function for the requested flags.
    ///
    /// For a requested driver symbol, if the CUDA version in which the driver symbol was introduced is less than or equal to the
    /// CUDA runtime version, the API will return the function pointer to the corresponding versioned driver function.
    ///
    /// 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 [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) and set the returned funcPtr if the requested driver function is valid and supported on the platform.
    ///
    /// The API will return [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) and set the returned funcPtr to NULL if the requested driver function is not supported on the platform, no ABI compatible driver function exists for the
    /// CUDA runtime version or if the driver symbol is invalid.
    ///
    /// It will also set the optional driverStatus to one of the values in `cudaDriverEntryPointQueryResult` with the following meanings:
    ///
    /// * [cudaDriverEntryPointSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb22957eedf779d624069585c25f1d1f675c627fcf7d85babf3566ef9b9ae15d) - The requested symbol was succesfully found based on input arguments and pfn is valid
    /// * [cudaDriverEntryPointSymbolNotFound](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb22957eedf779d624069585c25f1d1fe498f752ad230907d91c997be955565b) - The requested symbol was not found
    /// * [cudaDriverEntryPointVersionNotSufficent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb22957eedf779d624069585c25f1d1fc5e673dbc3e97f620e20ae5aeb0b7426) - The requested symbol was found but is not supported by the current runtime version (CUDART_VERSION)
    ///
    /// The requested flags can be:
    ///
    /// * [cudaEnableDefault](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd61a9c0bcf076678d03418b7922a39bb1d5): This is the default mode. This is equivalent to [cudaEnablePerThreadDefaultStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd611bd1da9af3fbaa465a199706ef94328f) if the code is compiled with --default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM
    ///   is defined; [cudaEnableLegacyStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd61e37885317cc9edcece9b5069b1494e1b) otherwise.
    /// * [cudaEnableLegacyStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd61e37885317cc9edcece9b5069b1494e1b): This will enable the search for all driver symbols that match the requested driver symbol name except the corresponding
    ///   per-thread versions.
    /// * [cudaEnablePerThreadDefaultStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd611bd1da9af3fbaa465a199706ef94328f): 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:
    ///
    /// 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-runtime-api/version-mixing-rules.html#version-mixing-rules).
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuGetProcAddress](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DRIVER__ENTRY__POINT.html#group__CUDA__DRIVER__ENTRY__POINT_1gcae5adad00590572ab35b2508c2d6e0d).
    ///
    /// # 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. Note that the API will use the CUDA runtime version to return the address to the most recent ABI compatible
    /// driver symbol, [cuMemAlloc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1gb82d2a09844a58dd9e744dc31e8aa467) or cuMemAlloc_v2.
    /// - `funcPtr`: Location to return the function pointer to the requested driver function.
    /// - `flags`: Flags to specify search options.
    /// - `driverStatus`: Optional location to store the status of finding the symbol from the driver. See `cudaDriverEntryPointQueryResult` for possible values.
    #[deprecated]
    pub fn cudaGetDriverEntryPoint(
        symbol: *const ::core::ffi::c_char,
        funcPtr: *mut *mut ::core::ffi::c_void,
        flags: ::core::ffi::c_ulonglong,
        driverStatus: *mut cudaDriverEntryPointQueryResult,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the requested driver API function pointer by CUDA version.
    ///
    /// Returns in \*\*funcPtr the address of the CUDA driver function for the requested flags and CUDA driver version.
    ///
    /// 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 [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// 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.
    ///
    /// For the case where the CUDA version requested is greater than the CUDA Toolkit installed, there may not be an appropriate
    /// function pointer typedef in the corresponding header file and may need a custom typedef to match the driver function signature
    /// returned. This can be done by getting the typedefs from a later toolkit or creating appropriately matching custom function
    /// typedefs.
    ///
    /// The API will return [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) and set the returned funcPtr if the requested driver function is valid and supported on the platform.
    ///
    /// The API will return [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) and set the returned funcPtr to NULL if the requested driver function is not supported on the platform, no ABI compatible driver function exists for the
    /// requested version or if the driver symbol is invalid.
    ///
    /// It will also set the optional driverStatus to one of the values in `cudaDriverEntryPointQueryResult` with the following meanings:
    ///
    /// * [cudaDriverEntryPointSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb22957eedf779d624069585c25f1d1f675c627fcf7d85babf3566ef9b9ae15d) - The requested symbol was succesfully found based on input arguments and pfn is valid
    /// * [cudaDriverEntryPointSymbolNotFound](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb22957eedf779d624069585c25f1d1fe498f752ad230907d91c997be955565b) - The requested symbol was not found
    /// * [cudaDriverEntryPointVersionNotSufficent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggeb22957eedf779d624069585c25f1d1fc5e673dbc3e97f620e20ae5aeb0b7426) - The requested symbol was found but is not supported by the specified version cudaVersion
    ///
    /// The requested flags can be:
    ///
    /// * [cudaEnableDefault](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd61a9c0bcf076678d03418b7922a39bb1d5): This is the default mode. This is equivalent to [cudaEnablePerThreadDefaultStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd611bd1da9af3fbaa465a199706ef94328f) if the code is compiled with --default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM
    ///   is defined; [cudaEnableLegacyStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd61e37885317cc9edcece9b5069b1494e1b) otherwise.
    /// * [cudaEnableLegacyStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd61e37885317cc9edcece9b5069b1494e1b): This will enable the search for all driver symbols that match the requested driver symbol name except the corresponding
    ///   per-thread versions.
    /// * [cudaEnablePerThreadDefaultStream](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggf2f2b7ea8f2f705095200807ac5dfd611bd1da9af3fbaa465a199706ef94328f): 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-runtime-api/version-mixing-rules.html#version-mixing-rules).
    /// * Note that this function may also return [cudaErrorInitializationError](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038ce7993a88ecf2c57b8102d55d997a18c), [cudaErrorInsufficientDriver](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038f5e52d1774934b77ba55d2aa2c063067) or [cudaErrorNoDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e942e4cbbd2bef6e92e293253f055613) if this call tries to initialize internal CUDA RT state.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuGetProcAddress](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__DRIVER__ENTRY__POINT.html#group__CUDA__DRIVER__ENTRY__POINT_1gcae5adad00590572ab35b2508c2d6e0d).
    ///
    /// # 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.
    /// - `funcPtr`: 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.
    /// - `driverStatus`: Optional location to store the status of finding the symbol from the driver. See `cudaDriverEntryPointQueryResult` for possible values.
    pub fn cudaGetDriverEntryPointByVersion(
        symbol: *const ::core::ffi::c_char,
        funcPtr: *mut *mut ::core::ffi::c_void,
        cudaVersion: ::core::ffi::c_uint,
        flags: ::core::ffi::c_ulonglong,
        driverStatus: *mut cudaDriverEntryPointQueryResult,
    ) -> cudaError_t;
}
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 [`cudaLibraryUnload`].
    /// * 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. Please also
    /// see the documentation for nvrtc (<https://docs.nvidia.com/cuda/nvrtc/index.html>), nvjitlink (<https://docs.nvidia.com/cuda/nvjitlink/index.html>), and nvfatbin (<https://docs.nvidia.com/cuda/nvfatbin/index.html>) for more information on generating loadable code at runtime.
    ///
    /// 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.
    ///
    /// **See also:**
    ///
    /// [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [cuLibraryLoadData](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__LIBRARY.html#group__CUDA__LIBRARY_1g957f12ff5af4166f43c89d17cfb0a74d).
    ///
    /// # 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 cudaLibraryLoadData(
        library: *mut cudaLibrary_t,
        code: *const ::core::ffi::c_void,
        jitOptions: *mut cudaJitOption,
        jitOptionsValues: *mut *mut ::core::ffi::c_void,
        numJitOptions: ::core::ffi::c_uint,
        libraryOptions: *mut cudaLibraryOption,
        libraryOptionValues: *mut *mut ::core::ffi::c_void,
        numLibraryOptions: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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 [`cudaLibraryUnload`].
    /// * 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. Please also
    /// see the documentation for nvrtc (<https://docs.nvidia.com/cuda/nvrtc/index.html>), nvjitlink (<https://docs.nvidia.com/cuda/nvjitlink/index.html>), and nvfatbin (<https://docs.nvidia.com/cuda/nvfatbin/index.html>) for more information on generating loadable code at runtime.
    ///
    /// 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.
    ///
    /// **See also:**
    ///
    /// [`cudaLibraryLoadData`], [`cudaLibraryUnload`], [cuLibraryLoadFromFile](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__LIBRARY.html#group__CUDA__LIBRARY_1g88cff489fab37c7fd1985ceb61023205).
    ///
    /// # 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 cudaLibraryLoadFromFile(
        library: *mut cudaLibrary_t,
        fileName: *const ::core::ffi::c_char,
        jitOptions: *mut cudaJitOption,
        jitOptionsValues: *mut *mut ::core::ffi::c_void,
        numJitOptions: ::core::ffi::c_uint,
        libraryOptions: *mut cudaLibraryOption,
        libraryOptionValues: *mut *mut ::core::ffi::c_void,
        numLibraryOptions: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Unloads a library.
    ///
    /// Unloads the library specified with library
    ///
    /// **See also:**
    ///
    /// [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [cuLibraryUnload](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__LIBRARY.html#group__CUDA__LIBRARY_1g24969cb24138171edf465bc8669d5914).
    ///
    /// # Parameters
    ///
    /// - `library`: Library to unload.
    pub fn cudaLibraryUnload(library: cudaLibrary_t) -> cudaError_t;
}
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 [cudaErrorSymbolNotFound](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00389d51ecb21a3081d01e078d136c137593).
    ///
    /// **See also:**
    ///
    /// [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [cuLibraryGetKernel](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__LIBRARY.html#group__CUDA__LIBRARY_1g15336d865f5abd63e3dc6004d5bc037a).
    ///
    /// # Parameters
    ///
    /// - `pKernel`: Returned kernel handle.
    /// - `library`: Library to retrieve kernel from.
    /// - `name`: Name of kernel to retrieve.
    pub fn cudaLibraryGetKernel(
        pKernel: *mut cudaKernel_t,
        library: cudaLibrary_t,
        name: *const ::core::ffi::c_char,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `dptr`: Returned global device pointer for the requested library.
    /// - `bytes`: Returned global size in bytes.
    /// - `library`: Library to retrieve global from.
    /// - `name`: Name of global to retrieve.
    pub fn cudaLibraryGetGlobal(
        dptr: *mut *mut ::core::ffi::c_void,
        bytes: *mut size_t,
        library: cudaLibrary_t,
        name: *const ::core::ffi::c_char,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # 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 cudaLibraryGetManaged(
        dptr: *mut *mut ::core::ffi::c_void,
        bytes: *mut size_t,
        library: cudaLibrary_t,
        name: *const ::core::ffi::c_char,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # 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 cudaLibraryGetUnifiedFunction(
        fptr: *mut *mut ::core::ffi::c_void,
        library: cudaLibrary_t,
        symbol: *const ::core::ffi::c_char,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the number of kernels within a library.
    ///
    /// Returns in count the number of kernels in lib.
    ///
    /// **See also:**
    ///
    /// [`cudaLibraryEnumerateKernels`], [`cudaLibraryLoadFromFile`], [`cudaLibraryLoadData`], [cuLibraryGetKernelCount](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__LIBRARY.html#group__CUDA__LIBRARY_1g142732b1c9afaa662f21cae9a558d2d4).
    ///
    /// # Parameters
    ///
    /// - `count`: Number of kernels found within the library.
    /// - `lib`: Library to query.
    pub fn cudaLibraryGetKernelCount(
        count: *mut ::core::ffi::c_uint,
        lib: cudaLibrary_t,
    ) -> cudaError_t;
}
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:**
    ///
    /// [`cudaLibraryGetKernelCount`], [cuLibraryEnumerateKernels](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__LIBRARY.html#group__CUDA__LIBRARY_1ga8ae2f42ab3a8fe789ac2dced8219608).
    ///
    /// # 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 cudaLibraryEnumerateKernels(
        kernels: *mut cudaKernel_t,
        numKernels: ::core::ffi::c_uint,
        lib: cudaLibrary_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Sets information about a kernel.
    ///
    /// This call sets the value of a specified attribute attr on the kernel kernel for the requested device device to an integer value specified by value. This function returns [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038e355f04607d824883b4a50662830d591) 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 ([cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c))
    ///
    /// Note that attributes set using [`cudaFuncSetAttribute`] will override the attribute set by this API irrespective of whether the call to [`cudaFuncSetAttribute`] is made before or after this API call. Because of this and the stricter locking requirements mentioned below it is suggested
    /// that this call be used during the initialization path and not on each thread accessing kernel such as on kernel launches or on the critical path.
    ///
    /// Valid values for attr are:
    ///
    /// * [cudaFuncAttributeMaxDynamicSharedMemorySize](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc6c537b33d22c871a103f0fda8ac8bbe9d5a5aea324596d0e686f7c416f71c26) - The requested maximum size in bytes of dynamically-allocated shared memory. The sum of this value and the function attribute
    ///   sharedSizeBytes cannot exceed the device attribute [cudaDevAttrMaxSharedMemoryPerBlockOptin](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cd024f669ca60d8ff7b3126dbfc61fd925). The maximal size of requestable dynamic shared memory may differ by GPU architecture.
    /// * [cudaFuncAttributePreferredSharedMemoryCarveout](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc6c537b33d22c871a103f0fda8ac8bbed410365fab79998b26bf68000cac7194) - 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 [cudaDevAttrMaxSharedMemoryPerMultiprocessor](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg49e2f8c2c0bd6fe264f2fc970912e5cdc478150b5ec1689a2944aaf7e25a5685). This is only a hint, and the driver can choose a different ratio if required to execute the function.
    /// * [cudaFuncAttributeRequiredClusterWidth](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc6c537b33d22c871a103f0fda8ac8bbeaff9c1fcfc7b30e1a5cc2af3efa28c74): 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 cudaErrorNotPermitted.
    /// * [cudaFuncAttributeRequiredClusterHeight](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc6c537b33d22c871a103f0fda8ac8bbe6919f695b717254c6ade1c158039aaa2): 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 cudaErrorNotPermitted.
    /// * [cudaFuncAttributeRequiredClusterDepth](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc6c537b33d22c871a103f0fda8ac8bbec04c7730923141bd5136dcf68c20203d): 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 cudaErrorNotPermitted.
    /// * [cudaFuncAttributeNonPortableClusterSizeAllowed](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc6c537b33d22c871a103f0fda8ac8bbe7c8c14bf3a2b16ea255c98439d5c54c6): Indicates whether the function can be launched with non-portable cluster size. 1 is allowed, 0 is disallowed.
    /// * [cudaFuncAttributeClusterSchedulingPolicyPreference](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1ggc6c537b33d22c871a103f0fda8ac8bbe6f047d04c6fa955aa5d4719e2f510cee): The block scheduling policy of a function. The value type is cudaClusterSchedulingPolicy.
    ///
    /// Note:
    ///
    /// The API has stricter locking requirements in comparison to its legacy counterpart [`cudaFuncSetAttribute`] 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:**
    ///
    /// [`cudaLibraryLoadData`], [`cudaLibraryLoadFromFile`], [`cudaLibraryUnload`], [`cudaLibraryGetKernel`], [`cudaLaunchKernel`], [`cudaFuncSetAttribute`], [cuKernelSetAttribute](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__LIBRARY.html#group__CUDA__LIBRARY_1g1093ade718915249de3b14320d567067).
    ///
    /// # Parameters
    ///
    /// - `kernel`: Kernel to set attribute of.
    /// - `attr`: Attribute requested.
    /// - `value`: Value to set.
    /// - `device`: Device to set attribute of.
    pub fn cudaKernelSetAttributeForDevice(
        kernel: cudaKernel_t,
        attr: cudaFuncAttribute,
        value: ::core::ffi::c_int,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
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.
    ///
    /// Note:
    ///
    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuDeviceGetDevResource](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GREEN__CONTEXTS.html#group__CUDA__GREEN__CONTEXTS_1g6115d21604653f4eafb257f725538ab6), [`cudaExecutionCtxGetDevResource`], [`cudaDevSmResourceSplit`], [`cudaDevResourceGenerateDesc`].
    ///
    /// # Parameters
    ///
    /// - `device`: Device to get resource for.
    /// - `resource`: Output pointer to a [`cudaDevResource`] structure.
    pub fn cudaDeviceGetDevResource(
        device: ::core::ffi::c_int,
        resource: *mut cudaDevResource,
        type_: cudaDevResourceType,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Splits cudaDevResourceTypeSm resources.
    ///
    /// Splits cudaDevResourceTypeSm 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 [`cudaDeviceGetDevResource`], or [`cudaExecutionCtxGetDevResource`]. 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 [`cudaDeviceGetDevResource`], or [`cudaExecutionCtxGetDevResource`] for [`cudaDevResourceType::cudaDevResourceTypeSm`], 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:
    ///
    /// * cudaDevSmResourceSplitIgnoreSmCoscheduling : 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+).
    /// * cudaDevSmResourceSplitMaxPotentialClusterSize : 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 [`cudaOccupancyMaxPotentialClusterSize`] 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 cudaDevResourceTypeSm. Value of minCount must be between 0 and the SM count specified in input. remaining may be NULL.
    /// * NULL passed in for result, with a valid integer pointer in nbGroups and input of type cudaDevResourceTypeSm. Value of minCount must be between 0 and the SM count specified in input. remaining 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.
    ///
    /// Note:
    ///
    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuDevSmResourceSplitByCount](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GREEN__CONTEXTS.html#group__CUDA__GREEN__CONTEXTS_1gf8359c74d7286ac32e5db253240d9a6c), [`cudaDeviceGetDevResource`], [`cudaExecutionCtxGetDevResource`], [`cudaDevResourceGenerateDesc`].
    ///
    /// # Parameters
    ///
    /// - `result`: Output array of [`cudaDevResource`] 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 [`cudaDevSmResource`] resource.
    /// - `remaining`: If the input resource cannot be cleanly split among nbGroups, the remaining 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 cudaDevSmResourceSplitByCount(
        result: *mut cudaDevResource,
        nbGroups: *mut ::core::ffi::c_uint,
        input: *const cudaDevResource,
        remaining: *mut cudaDevResource,
        flags: ::core::ffi::c_uint,
        minCount: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Splits a cudaDevResourceTypeSm resource into structured groups.
    ///
    /// This API will split a resource of [`cudaDevResourceType::cudaDevResourceTypeSm`] 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 [`cudaDevResource`] 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 [`cudaDevResourceType::cudaDevResourceTypeSm`] resource that originates from querying the execution 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 [`cudaDevSmResourceGroupParams`] 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 [cudaErrorInvalidResourceConfiguration](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038727a029e221467a4372a957c009fe8d3) 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 [`cudaDevResourceType::cudaDevResourceTypeSm`] 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:
    /// - cudaDevSmResourceGroupBackfill: 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.
    /// cudaDevSmResourceGroupParams 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.
    /// cudaDevSmResourceGroupParams 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.
    /// cudaDevSmResourceGroupParams params { {8, 4, 0, 0}, {0, 2, 0, cudaDevSmResourceGroupBackfill } }
    /// ```
    ///
    /// 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 cudaDevSmResourceGroupBackfill 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.
    ///
    /// Note:
    ///
    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuDevSmResourceSplit](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GREEN__CONTEXTS.html#group__CUDA__GREEN__CONTEXTS_1gc739e0a0b57766ee10437c89909865f3), [`cudaDeviceGetDevResource`], [`cudaExecutionCtxGetDevResource`], [`cudaDevResourceGenerateDesc`].
    ///
    /// # Parameters
    ///
    /// - `result`: Output array of [`cudaDevResource`] 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 cudaDevResourceTypeSm 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 cudaDevSmResourceSplit(
        result: *mut cudaDevResource,
        nbGroups: ::core::ffi::c_uint,
        input: *const cudaDevResource,
        remainder: *mut cudaDevResource,
        flags: ::core::ffi::c_uint,
        groupParams: *mut cudaDevSmResourceGroupParams,
    ) -> cudaError_t;
}
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 [`cudaGreenCtxCreate`] 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 [cudaErrorInvalidResourceConfiguration](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038727a029e221467a4372a957c009fe8d3) is returned. If multiple resources are provided in resources and they are of type [`cudaDevResourceType::cudaDevResourceTypeSm`], they must be outputs (whether result or remaining) from the same split API instance and have the same smCoscheduledAlignment values, otherwise [cudaErrorInvalidResourceConfiguration](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038727a029e221467a4372a957c009fe8d3) is returned.
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// Note:
    ///
    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [cuDevResourceGenerateDesc](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GREEN__CONTEXTS.html#group__CUDA__GREEN__CONTEXTS_1g1ea7743fd633d2e2dd92eb1c84c4fbc5), [`cudaDeviceGetDevResource`], [`cudaExecutionCtxGetDevResource`], [`cudaDevSmResourceSplit`], [`cudaGreenCtxCreate`].
    ///
    /// # Parameters
    ///
    /// - `phDesc`: Output descriptor.
    /// - `resources`: Array of resources to be included in the descriptor.
    /// - `nbResources`: Number of resources passed in resources.
    pub fn cudaDevResourceGenerateDesc(
        phDesc: *mut cudaDevResourceDesc_t,
        resources: *mut cudaDevResource,
        nbResources: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
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 retains the device’s primary context for the lifetime of the green context. The primary context will be released
    /// when the green context is destroyed. To avoid the overhead of repeated initialization and teardown, it is recommended to explicitly
    /// initialize the device's primary context ahead of time using [`cudaInitDevice`]. This ensures that the primary context remains initialized throughout the program’s lifetime, minimizing overhead during
    /// green context creation and destruction.
    ///
    /// The API does not create a default stream for the green context. Developers are expected to create streams explicitly using
    /// [`cudaExecutionCtxStreamCreate`] to submit work to the green context.
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// Note:
    ///
    /// Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceGetDevResource`], [`cudaDevSmResourceSplit`], [`cudaDevResourceGenerateDesc`], [`cudaExecutionCtxGetDevResource`], [`cudaExecutionCtxDestroy`], [`cudaInitDevice`], [`cudaExecutionCtxStreamCreate`].
    ///
    /// # Parameters
    ///
    /// - `phCtx`: Pointer for the output handle to the green context.
    /// - `desc`: Descriptor generated via [`cudaDevResourceGenerateDesc`] which contains the set of resources to be used.
    /// - `device`: Device on which to create the green context.
    /// - `flags`: Green context creation flags. Must be 0, currently reserved for future use.
    pub fn cudaGreenCtxCreate(
        phCtx: *mut cudaExecutionContext_t,
        desc: cudaDevResourceDesc_t,
        device: ::core::ffi::c_int,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Destroy a execution context.
    ///
    /// Destroys the specified execution context ctx. It is the responsibility of the caller to ensure that no API call issues using ctx while [`cudaExecutionCtxDestroy`] is executing or subsequently.
    ///
    /// If ctx is a green context, any resources provisioned for it (that were initially available via the resource descriptor) are released
    /// as well.
    ///
    /// The API does not destroy streams created via [`cudaExecutionCtxStreamCreate`]. Users are expected to destroy these streams explicitly using [`cudaStreamDestroy`] to avoid resource leaks. Once the execution context is destroyed, any subsequent API calls involving these streams will return
    /// [cudaErrorStreamDetached](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038dac625035f38851dbb8e21a4b556c141) with the exception of the following APIs:
    ///
    /// * [`cudaStreamDestroy`]. Note this is only supported on CUDA drivers 13.1 and above.
    ///
    /// Additionally, the API will invalidate all active captures on these streams.
    ///
    /// Passing in a ctx that was not explicitly created via CUDA Runtime APIs is not allowed and will result in undefined behavior.
    ///
    /// Note:
    ///
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit
    ///   context-based programming without relying on thread-local state. If no context is specified, the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// **See also:**
    ///
    /// [`cudaGreenCtxCreate`].
    ///
    /// # Parameters
    ///
    /// - `ctx`: Execution context to destroy (required parameter, see note below).
    pub fn cudaExecutionCtxDestroy(ctx: cudaExecutionContext_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Get context resources.
    ///
    /// Get the type resources available to context represented by ctx.
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit
    ///   context-based programming without relying on thread-local state. If no context is specified, the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// **See also:**
    ///
    /// [`cudaDeviceGetDevResource`], [`cudaDevSmResourceSplit`], [`cudaDevResourceGenerateDesc`], [`cudaGreenCtxCreate`].
    ///
    /// # Parameters
    ///
    /// - `ctx`: Execution context to get resource for (required parameter, see note below).
    /// - `resource`: Output pointer to a [`cudaDevResource`] structure.
    pub fn cudaExecutionCtxGetDevResource(
        ctx: cudaExecutionContext_t,
        resource: *mut cudaDevResource,
        type_: cudaDevResourceType,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the device handle for the execution context.
    ///
    /// Returns in \*device the handle of the specified execution context's device. The execution context should not be NULL.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit
    ///   context-based programming without relying on thread-local state. If no context is specified, the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// **See also:**
    ///
    /// [`cudaGreenCtxCreate`], [`cudaExecutionCtxDestroy`], [cuCtxGetDevice](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g4e84b109eba36cdaaade167f34ae881e).
    ///
    /// # Parameters
    ///
    /// - `device`: Returned device handle for the specified execution context.
    /// - `ctx`: Execution context for which to obtain the device (required parameter, see note below).
    pub fn cudaExecutionCtxGetDevice(
        device: *mut ::core::ffi::c_int,
        ctx: cudaExecutionContext_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the unique Id associated with the execution 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. The execution context should not be NULL.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit
    ///   context-based programming without relying on thread-local state. If no context is specified, the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// **See also:**
    ///
    /// [`cudaGreenCtxCreate`], [`cudaExecutionCtxDestroy`], [`cudaExecutionCtxGetDevice`], [cuCtxGetId](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g32f492cd6c3f90af0d6935b294392db5).
    ///
    /// # Parameters
    ///
    /// - `ctx`: Context for which to obtain the Id (required parameter, see note below).
    /// - `ctxId`: Pointer to store the Id of the context.
    pub fn cudaExecutionCtxGetId(
        ctx: cudaExecutionContext_t,
        ctxId: *mut ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Creates a stream and initializes it for the given execution context.
    ///
    /// The API creates a CUDA stream with the specified flags and priority, initializing it with resources as defined at the time of creating the specified ctx. Additionally, the API also enables work submitted to to the stream to be tracked under ctx.
    ///
    /// The supported values for flags are:
    ///
    /// * [`cudaStreamDefault`]: Default stream creation flag. This would be [`cudaStreamNonBlocking`] for streams created on a green context.
    /// * [`cudaStreamNonBlocking`]: 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
    ///
    /// 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 [`cudaDeviceGetStreamPriorityRange`]. If the specified priority is outside the numerical range returned by [`cudaDeviceGetStreamPriorityRange`], 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.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit
    ///   context-based programming without relying on thread-local state. If no context is specified, the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    /// * 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:**
    ///
    /// [`cudaStreamDestroy`], [`cudaGreenCtxCreate`], [`cudaDeviceGetStreamPriorityRange`], [`cudaStreamGetFlags`], [`cudaStreamGetPriority`], [`cudaStreamGetDevice`], [`cudaStreamGetDevResource`], [`cudaLaunchKernel`], [`cudaEventRecord`], [`cudaStreamWaitEvent`], [`cudaStreamQuery`], [`cudaStreamSynchronize`], [`cudaStreamAddCallback`].
    ///
    /// # Parameters
    ///
    /// - `phStream`: Returned stream handle.
    /// - `ctx`: Execution context to initialize the stream with (required parameter, see note below).
    /// - `flags`: Flags for stream creation.
    /// - `priority`: Stream priority.
    pub fn cudaExecutionCtxStreamCreate(
        phStream: *mut cudaStream_t,
        ctx: cudaExecutionContext_t,
        flags: ::core::ffi::c_uint,
        priority: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Block for the specified execution context's tasks to complete.
    ///
    /// Blocks until the specified execution context has completed all preceding requested tasks. If the specified execution context
    /// is the device (primary) context obtained via [`cudaDeviceGetExecutionCtx`], green contexts that have been created on the device will also be synchronized.
    ///
    /// The API returns an error if one of the preceding tasks failed.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit
    ///   context-based programming without relying on thread-local state. If no context is specified, the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// **See also:**
    ///
    /// [`cudaGreenCtxCreate`], [`cudaExecutionCtxDestroy`], [`cudaDeviceSynchronize`], [cuCtxSynchronize_v2](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1g7c57ec88e825af32ef8cc1754d69eca5).
    ///
    /// # Parameters
    ///
    /// - `ctx`: Execution context to synchronize (required parameter, see note below).
    pub fn cudaExecutionCtxSynchronize(ctx: cudaExecutionContext_t) -> cudaError_t;
}
unsafe extern "C" {
    /// Get stream resources.
    ///
    /// Get the type resources available to the hStream and store them in resource.
    ///
    /// Note: The API will return [cudaErrorInvalidResourceType](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00384954cdb4893fda9f1a30251a018c32fe) is type is cudaDevResourceTypeWorkqueueConfig or cudaDevResourceTypeWorkqueue.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    ///
    /// **See also:**
    ///
    /// [`cudaGreenCtxCreate`], [`cudaExecutionCtxStreamCreate`], [`cudaStreamCreate`], [`cudaDevSmResourceSplit`], [`cudaDevResourceGenerateDesc`], [cuStreamGetDevResource](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GREEN__CONTEXTS.html#group__CUDA__GREEN__CONTEXTS_1g25acc306a4e2ba88d1eb8b7bd2b2b578).
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to get resource for.
    /// - `resource`: Output pointer to a [`cudaDevResource`] structure.
    pub fn cudaStreamGetDevResource(
        hStream: cudaStream_t,
        resource: *mut cudaDevResource,
        type_: cudaDevResourceType,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Records an event for the specified execution context.
    ///
    /// Captures in event all the activities of the execution context ctx at the time of this call. event and ctx must be from the same CUDA device, otherwise cudaErrorInvalidHandle will be returned. Calls such as [`cudaEventQuery`] or [`cudaExecutionCtxWaitEvent`] will then examine or wait for completion of the work that was captured. Uses of ctx after this call do not modify event. If the execution context passed to ctx is the device (primary) context obtained via [`cudaDeviceGetExecutionCtx`], event will capture all the activities of the green contexts created on the device as well.
    ///
    /// Note:
    ///
    /// The API will return [cudaErrorStreamCaptureUnsupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038868e03e02390c8d77f8f60e47038b563) if the specified execution context ctx has a stream in the capture mode. In such a case, the call will invalidate all the conflicting captures.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit
    ///   context-based programming without relying on thread-local state. If no context is specified, the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// **See also:**
    ///
    /// [`cudaEventRecord`], [`cudaExecutionCtxWaitEvent`], [cuCtxRecordEvent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1gf3ee63561a7a371fa9d4dc0e31f94afd), [cuGreenCtxRecordEvent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GREEN__CONTEXTS.html#group__CUDA__GREEN__CONTEXTS_1g9dd087071cc217ad7ebda6df96d2ee40).
    ///
    /// # Parameters
    ///
    /// - `ctx`: Execution context to record event for (required parameter, see note below).
    /// - `event`: Event to record.
    pub fn cudaExecutionCtxRecordEvent(
        ctx: cudaExecutionContext_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Make an execution context wait on an event.
    ///
    /// Makes all future work submitted to execution context ctx wait for all work captured in event. The synchronization will be performed on the device and will not block the calling CPU thread. See [`cudaExecutionCtxRecordEvent`] for details on what is captured by an event. If the execution context passed to ctx is the device (primary) context obtained via [`cudaDeviceGetExecutionCtx`], all green contexts created on the device will wait for event as well.
    ///
    /// Note:
    ///
    /// * event may be from a different execution context or device than ctx.
    /// * The API will return [cudaErrorStreamCaptureUnsupported](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e0038868e03e02390c8d77f8f60e47038b563) and invalidate the capture if the specified event event is part of an ongoing capture sequence or if the specified execution context ctx has a stream in the capture mode.
    ///
    /// Note:
    ///
    /// * Note that this function may also return error codes from previous, asynchronous launches.
    /// * Note that as specified by [`cudaStreamAddCallback`] no CUDA function may be called from callback. [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e003867b6095ab719b21659a400b553963eb3) may, but is not guaranteed to, be returned as a diagnostic in such case.
    /// * The context parameter is required and the API ignores the context that is current to the calling thread. This enables explicit
    ///   context-based programming without relying on thread-local state. If no context is specified, the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-runtime-api/types.html#group__CUDART__TYPES_1gg3f51e3575c2178246db0a94a430e00383e8aef5398ee38e28ed41e357b48917c).
    ///
    /// **See also:**
    ///
    /// [`cudaExecutionCtxRecordEvent`], [`cudaStreamWaitEvent`], [cuCtxWaitEvent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__CTX.html#group__CUDA__CTX_1gcf64e420275a8141b1f12bfce3f478f9), [cuGreenCtxWaitEvent](https://docs.nvidia.com/cuda/archive/13.2.0/cuda-driver-api/group__CUDA__GREEN__CONTEXTS.html#group__CUDA__GREEN__CONTEXTS_1g6b26172117084fd024f1396fb66a8ffd).
    ///
    /// # Parameters
    ///
    /// - `ctx`: Execution context to wait for (required parameter, see note below).
    /// - `event`: Event to wait on.
    pub fn cudaExecutionCtxWaitEvent(
        ctx: cudaExecutionContext_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Returns the execution context for a device.
    ///
    /// Returns in ctx the execution context for the specified device. This is the device's primary context. The returned context can then be passed
    /// to APIs that take in a cudaExecutionContext_t enabling explicit context-based programming without relying on thread-local
    /// state.
    ///
    /// Passing the returned execution context to [`cudaExecutionCtxDestroy`] is not allowed and will result in undefined behavior.
    ///
    /// **See also:**
    ///
    /// [`cudaExecutionCtxGetDevice`], [`cudaExecutionCtxGetId`].
    ///
    /// # Parameters
    ///
    /// - `ctx`: Returns the device execution context.
    /// - `device`: Device to get the execution context for.
    pub fn cudaDeviceGetExecutionCtx(
        ctx: *mut cudaExecutionContext_t,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
unsafe extern "C" {
    pub fn cudaGetExportTable(
        ppExportTable: *mut *const ::core::ffi::c_void,
        pExportTableId: *const cudaUUID_t,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// Get pointer to device entry function that matches entry function symbolPtr.
    ///
    /// Returns in functionPtr the device entry function corresponding to the symbol symbolPtr.
    ///
    /// # Parameters
    ///
    /// - `functionPtr`: Returns the device entry function.
    /// - `symbolPtr`: Pointer to device entry function to search for.
    pub fn cudaGetFuncBySymbol(
        functionPtr: *mut cudaFunction_t,
        symbolPtr: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
unsafe extern "C" {
    /// # Parameters
    ///
    /// - `kernelPtr`: Returns the device kernel.
    pub fn cudaGetKernel(
        kernelPtr: *mut cudaKernel_t,
        entryFuncAddr: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}