singe-cuda-sys 0.1.0

Low-level FFI bindings for the CUDA driver and runtime APIs and the CUDA libraries that ship with them, such as NVRTC.
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
/* automatically generated by rust-bindgen 0.72.1 */

/// Compile-time CUDA runtime API version code. This identifies the headers used to generate these bindings, which may differ from the loaded library.
pub const CUDART_VERSION: u32 = 13040;
/// Selects a one-dimensional surface resource.
pub const cudaSurfaceType1D: u32 = 1;
/// Selects a two-dimensional surface resource.
pub const cudaSurfaceType2D: u32 = 2;
/// Selects a three-dimensional surface resource.
pub const cudaSurfaceType3D: u32 = 3;
/// Selects a cube-map surface resource.
pub const cudaSurfaceTypeCubemap: u32 = 12;
/// Selects a layered one-dimensional surface resource.
pub const cudaSurfaceType1DLayered: u32 = 241;
/// Selects a layered two-dimensional surface resource.
pub const cudaSurfaceType2DLayered: u32 = 242;
/// Selects a layered cube-map surface resource.
pub const cudaSurfaceTypeCubemapLayered: u32 = 252;
/// Selects a one-dimensional texture resource.
pub const cudaTextureType1D: u32 = 1;
/// Selects a two-dimensional texture resource.
pub const cudaTextureType2D: u32 = 2;
/// Selects a three-dimensional texture resource.
pub const cudaTextureType3D: u32 = 3;
/// Selects a cube-map texture resource.
pub const cudaTextureTypeCubemap: u32 = 12;
/// Selects a layered one-dimensional texture resource.
pub const cudaTextureType1DLayered: u32 = 241;
/// Selects a layered two-dimensional texture resource.
pub const cudaTextureType2DLayered: u32 = 242;
/// Selects a layered cube-map texture resource.
pub const cudaTextureTypeCubemapLayered: u32 = 252;
impl cudaRoundMode {
    /// Rounds to the nearest representable value.
    pub const cudaRoundNearest: cudaRoundMode = cudaRoundMode(0);
    /// Rounds toward zero.
    pub const cudaRoundZero: cudaRoundMode = cudaRoundMode(1);
    /// Rounds toward positive infinity.
    pub const cudaRoundPosInf: cudaRoundMode = cudaRoundMode(2);
    /// Rounds toward negative infinity.
    pub const cudaRoundMinInf: cudaRoundMode = cudaRoundMode(3);
}
/// Floating-point rounding direction for CUDA conversion operations.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct cudaRoundMode(pub ::core::ffi::c_uint);
/// Unsigned C `size_t`, used for byte counts and object sizes in the native ABI.
pub type size_t = ::core::ffi::c_ulong;
impl cudaSurfaceBoundaryMode {
    /// Zero boundary mode.
    pub const cudaBoundaryModeZero: cudaSurfaceBoundaryMode = cudaSurfaceBoundaryMode(0);
    /// Clamp boundary mode.
    pub const cudaBoundaryModeClamp: cudaSurfaceBoundaryMode = cudaSurfaceBoundaryMode(
        1,
    );
    /// Trap boundary mode.
    pub const cudaBoundaryModeTrap: cudaSurfaceBoundaryMode = cudaSurfaceBoundaryMode(2);
}
/// CUDA Surface boundary modes.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct cudaSurfaceBoundaryMode(pub ::core::ffi::c_uint);
impl cudaSurfaceFormatMode {
    /// Forced format mode.
    pub const cudaFormatModeForced: cudaSurfaceFormatMode = cudaSurfaceFormatMode(0);
    /// Auto format mode.
    pub const cudaFormatModeAuto: cudaSurfaceFormatMode = cudaSurfaceFormatMode(1);
}
/// CUDA Surface format modes.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct cudaSurfaceFormatMode(pub ::core::ffi::c_uint);
/// An opaque value that represents a CUDA Surface object.
pub type cudaSurfaceObject_t = ::core::ffi::c_ulonglong;
impl cudaTextureAddressMode {
    /// Wrapping address mode.
    pub const cudaAddressModeWrap: cudaTextureAddressMode = cudaTextureAddressMode(0);
    /// Clamp to edge address mode.
    pub const cudaAddressModeClamp: cudaTextureAddressMode = cudaTextureAddressMode(1);
    /// Mirror address mode.
    pub const cudaAddressModeMirror: cudaTextureAddressMode = cudaTextureAddressMode(2);
    /// Border address mode.
    pub const cudaAddressModeBorder: cudaTextureAddressMode = cudaTextureAddressMode(3);
}
/// CUDA texture address modes.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct cudaTextureAddressMode(pub ::core::ffi::c_uint);
impl cudaTextureFilterMode {
    /// Point filter mode.
    pub const cudaFilterModePoint: cudaTextureFilterMode = cudaTextureFilterMode(0);
    /// Linear filter mode.
    pub const cudaFilterModeLinear: cudaTextureFilterMode = cudaTextureFilterMode(1);
}
/// CUDA texture filter modes.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct cudaTextureFilterMode(pub ::core::ffi::c_uint);
impl cudaTextureReadMode {
    /// Read texture as specified element type.
    pub const cudaReadModeElementType: cudaTextureReadMode = cudaTextureReadMode(0);
    /// Read texture as normalized float.
    pub const cudaReadModeNormalizedFloat: cudaTextureReadMode = cudaTextureReadMode(1);
}
/// CUDA texture read modes.
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct cudaTextureReadMode(pub ::core::ffi::c_uint);
/// 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;
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gae15d9c8b7a240312b533d6122558085a), [cudaEvent_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaea2f543a9fc0e52fe4ae712920fd1247), [cudaArray_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaaf8b3ba752727d996074a71ee997ce68), [cudaMipmappedArray_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga1b03ad14fc0ab86f8b033837f5562d8a), [`cudaPitchedPtr`], [`cudaTextureObject_t`], [`cudaSurfaceObject_t`], ::textureReference, ::surfaceReference, [cudaExternalMemory_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga79a2bf6a3a2aa9011a96dc17d476faf7), [cudaExternalSemaphore_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaf8bc7ab93d638c5835e5289ac7d683c4) and [cudaGraphicsResource_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaf58dd8d3c7a65714ff7f5459adbf7e6f). 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.
    pub fn cudaDeviceReset() -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga057e6912c52708b6aa86e79dd83d007c) flag was set for this device, the host thread will block until the device has finished its work.
    pub fn cudaDeviceSynchronize() -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `limit`: Limit to set.
    /// - `value`: Size of limit.
    pub fn cudaDeviceSetLimit(limit: cudaLimit, value: size_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Return resource limits.
    ///
    /// Returns in `*pValue` the current size of `limit`. The following [`cudaLimit`] values are supported.
    ///
    /// # Parameters
    ///
    /// - `pValue`: Returned size of the limit.
    /// - `limit`: Limit to query.
    pub fn cudaDeviceGetLimit(pValue: *mut size_t, limit: cudaLimit) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggab980f35ed69ee7991704de29a13de49ba3b4b8c65376ce1ca107be413e15981bc) on devices where the size of the L1 cache and shared memory are fixed.
    ///
    /// The supported cache configurations are.
    ///
    /// # Parameters
    ///
    /// - `pCacheConfig`: - Returned cache configuration
    pub fn cudaDeviceGetCacheConfig(pCacheConfig: *mut cudaFuncCache) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`]).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__EXECUTION.html#group__cudart__execution_1ga6699ca1943ac2655effa0d571b2f4f15) or [cudaFuncSetCacheConfig (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga981c8d74d33b21e7fd57609b7337653e) will be preferred over this device-wide setting. Setting the device-wide cache configuration to [cudaFuncCachePreferNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggab980f35ed69ee7991704de29a13de49ba3b4b8c65376ce1ca107be413e15981bc) 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.
    ///
    /// # Parameters
    ///
    /// - `cacheConfig`: - Requested cache configuration
    pub fn cudaDeviceSetCacheConfig(cacheConfig: cudaFuncCache) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a handle to a compute device.
    ///
    /// Returns in `*device` a device ordinal given a PCI bus ID string.
    ///
    /// where `domain`, `bus`, `device`, and `function` are all hexadecimal values.
    ///
    /// # Parameters
    ///
    /// - `device`: Returned device ordinal.
    /// - `pciBusId`: String in one of the following forms.
    pub fn cudaDeviceGetByPCIBusId(
        device: *mut ::core::ffi::c_int,
        pciBusId: *const ::core::ffi::c_char,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// where `domain`, `bus`, `device`, and `function` are all hexadecimal values. pciBusId should be large enough to store 13 characters including the NULL-terminator.
    ///
    /// # Parameters
    ///
    /// - `pciBusId`: Returned identifier string for the device in the following format.
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga49ec9cd742f8a3f6fde4ee72a66326f6) and [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda0ab012a7c597ffbe86090ee2f9e1758c).
    ///
    /// # Parameters
    ///
    /// - `handle`: Pointer to a user allocated cudaIpcEventHandle in which to return the opaque event handle.
    /// - `event`: Event allocated with [cudaEventInterprocess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga49ec9cd742f8a3f6fde4ee72a66326f6) and [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e) flags.
    pub fn cudaIpcGetEventHandle(
        handle: *mut cudaIpcEventHandle_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaea2f543a9fc0e52fe4ae712920fd1247) that behaves like a locally created event with the [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda0ab012a7c597ffbe86090ee2f9e1758c).
    ///
    /// # Parameters
    ///
    /// - `event`: Returns the imported event.
    /// - `handle`: Interprocess handle to open.
    pub fn cudaIpcOpenEventHandle(
        event: *mut cudaEvent_t,
        handle: cudaIpcEventHandle_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda0ab012a7c597ffbe86090ee2f9e1758c).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga60f28a5142ee7ae0336dfa83fd54e006) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda0ab012a7c597ffbe86090ee2f9e1758c).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Returned device pointer.
    /// - `handle`: cudaIpcMemHandle to open.
    /// - `flags`: Flags for this operation. Must be specified as [cudaIpcMemLazyEnablePeerAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga60f28a5142ee7ae0336dfa83fd54e006).
    pub fn cudaIpcOpenMemHandle(
        devPtr: *mut *mut ::core::ffi::c_void,
        handle: cudaIpcMemHandle_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda0ab012a7c597ffbe86090ee2f9e1758c).
    ///
    /// # Parameters
    ///
    /// - `devPtr`: - Device pointer returned by ::cudaIpcOpenMemHandle
    pub fn cudaIpcCloseMemHandle(devPtr: *mut ::core::ffi::c_void) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda881d5b0c5bf7777e382920af4d743bde), 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda7b3462e13705248606f39fb5381446ee).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a67b6095ab719b21659a400b553963eb3). Async notification callbacks execute in an undefined order and may be serialized.
    ///
    /// Returns in `*callback` a handle representing the registered callback instance.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Unregisters an async notification callback.
    ///
    /// Unregisters `callback` so that the corresponding callback function will stop receiving async notifications.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the shared memory configuration for the current device.
    ///
    /// This function will return in `pConfig` the current size of shared memory banks on the current device. On devices with configurable shared memory banks, [`cudaDeviceSetSharedMemConfig`] can be used to change this setting, so that all subsequent kernel launches will by default use the new bank size. When [`cudaDeviceGetSharedMemConfig`] is called on devices without configurable shared memory, it will return the fixed bank size of the hardware.
    ///
    /// The returned bank configurations can be either.
    ///
    /// # Parameters
    ///
    /// - `pConfig`: - Returned cache configuration
    #[deprecated]
    pub fn cudaDeviceGetSharedMemConfig(
        pConfig: *mut cudaSharedMemConfig,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets the shared memory configuration for the current device.
    ///
    /// On devices with configurable shared memory banks, this function will set the shared memory bank size which is used for all subsequent kernel launches. Any per-function setting of shared memory set via [`cudaFuncSetSharedMemConfig`] will override the device wide setting.
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `config`: - Requested cache configuration
    #[deprecated]
    pub fn cudaDeviceSetSharedMemConfig(config: cudaSharedMemConfig) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591).
    ///
    /// Note: Multiple instances of the CUDA Runtime library can be present in an application when using a library that statically links the CUDA Runtime.
    pub fn cudaGetLastError() -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) 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.
    pub fn cudaPeekAtLastError() -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `error`: - Error code to convert to string
    pub fn cudaGetErrorName(error: cudaError_t) -> *const ::core::ffi::c_char;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `error`: - Error code to convert to string
    pub fn cudaGetErrorString(error: cudaError_t) -> *const ::core::ffi::c_char;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns information about the compute-device.
    ///
    /// Returns in `*prop` the properties of device `dev`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns information about the device.
    ///
    /// Returns in `*value` the integer value of the attribute `attr` on device `device`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3ded8497f09d41455ea64acb7a880868) the link supports natively.
    ///
    /// Returns [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a938c6e8b96ecde62e3ab5137156f739a) if `dev` is not valid.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if `*capabilities` or `*operations` is NULL, if `count` is 0, or if any of `*operations` is not valid.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the default mempool of a device.
    ///
    /// The default mempool of a device contains device memory from that device.
    pub fn cudaDeviceGetDefaultMemPool(
        memPool: *mut cudaMemPool_t,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    pub fn cudaDeviceSetMemPool(
        device: ::core::ffi::c_int,
        memPool: cudaMemPool_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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 or [`cudaDeviceSetMemPool`].
    pub fn cudaDeviceGetMemPool(
        memPool: *mut cudaMemPool_t,
        device: ::core::ffi::c_int,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c).
    ///
    /// 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:
    ///
    /// At least one of these flags must be set, failing which the API returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c). 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
    ///
    /// [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591), [cudaErrorDeviceUninitialized](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a9e95927732f0d5a68151c72296581504), [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c), ::cudaErrorInvalidHandle, [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a938c6e8b96ecde62e3ab5137156f739a), [cudaErrorNotSupported](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad846fd9f2e8ba5e2fb4f1695b7ab6164), [cudaErrorMemoryAllocation](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af210f50ae7f17f655e0504929606add9).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// Returns [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a938c6e8b96ecde62e3ab5137156f739a) if `srcDevice` or `dstDevice` are not valid or if they represent the same device.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if `attrib` is not valid or if `value` is a null pointer.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3ded8497f09d41455ea64acb7a880868) the link supports natively.
    ///
    /// Returns [cudaErrorInvalidDevice](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a938c6e8b96ecde62e3ab5137156f739a) if `srcDevice` or `dstDevice` are not valid or if they represent the same device.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if `*capabilities` or `*operations` is NULL, if `count` is 0, or if any of `*operations` is not valid.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Select compute-device which best matches criteria.
    ///
    /// Returns in `*device` the device which has properties that best match `*prop`.
    ///
    /// # Parameters
    ///
    /// - `device`: Device with best match.
    /// - `prop`: Desired device properties.
    pub fn cudaChooseDevice(
        device: *mut ::core::ffi::c_int,
        prop: *const cudaDeviceProp,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga2ff861a477ec064dcf01977194158e49) 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`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `device`: - Device on which the active host thread should execute the device code.
    pub fn cudaSetDevice(device: ::core::ffi::c_int) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns which device is currently being used.
    ///
    /// Returns in `*device` the current device for the calling host thread.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a938c6e8b96ecde62e3ab5137156f739a). 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `flags`: - Parameters for device operation
    pub fn cudaSetDeviceFlags(flags: ::core::ffi::c_uint) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0) 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.
    ///
    /// # Parameters
    ///
    /// - `flags`: - Pointer to store the device flags
    pub fn cudaGetDeviceFlags(flags: *mut ::core::ffi::c_uint) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `pStream`: - Pointer to new stream identifier
    pub fn cudaStreamCreate(pStream: *mut cudaStream_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Query the device of a stream.
    ///
    /// Returns in `*device` the device of the stream.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Resets all persisting lines in cache to normal status.
    ///
    /// Resets all persisting lines in cache to normal status. Takes effect on function return.
    pub fn cudaCtxResetPersistingL2Cache() -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination stream.
    /// - `src`: Source stream For attributes see cudaStreamAttrID.
    pub fn cudaStreamCopyAttributes(dst: cudaStream_t, src: cudaStream_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Queries stream attribute.
    ///
    /// Queries attribute `attr` from `hStream` and stores it in corresponding member of `value_out`.
    pub fn cudaStreamGetAttribute(
        hStream: cudaStream_t,
        attr: cudaLaunchAttributeID,
        value_out: *mut cudaLaunchAttributeValue,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    pub fn cudaStreamSetAttribute(
        hStream: cudaStream_t,
        attr: cudaLaunchAttributeID,
        value: *const cudaLaunchAttributeValue,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`.
    ///
    /// # Parameters
    ///
    /// - `stream`: - Stream identifier
    pub fn cudaStreamDestroy(stream: cudaStream_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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.
///
/// The stream as passed to ::cudaStreamAddCallback, may be NULL.
///
/// ::cudaSuccess or any persistent error on the stream.
///
/// User parameter provided at registration.
pub type cudaStreamCallback_t = ::core::option::Option<
    unsafe extern "C" fn(
        stream: cudaStream_t,
        status: cudaError_t,
        userData: *mut ::core::ffi::c_void,
    ),
>;
singe_loader::functions! { crate::RUNTIME;
    /// Add a callback to a compute stream.
    ///
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) or an error code. In the event of a device error, all subsequently executed callbacks will receive an appropriate [cudaError_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaf599e5b8b829ce7db0f5216928f6ecb6).
    ///
    /// Callbacks must not make any CUDA API calls. Attempting to use CUDA APIs may result in [cudaErrorNotPermitted](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a67b6095ab719b21659a400b553963eb3). 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Waits for stream tasks to complete.
    ///
    /// Blocks until `stream` has completed all operations. If the [cudaDeviceScheduleBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga057e6912c52708b6aa86e79dd83d007c) flag was set for this device, the host thread will block until the stream is finished with all of its tasks.
    ///
    /// # Parameters
    ///
    /// - `stream`: - Stream identifier
    pub fn cudaStreamSynchronize(stream: cudaStream_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Queries an asynchronous stream for completion status.
    ///
    /// Returns [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) if all operations in `stream` have completed, or [cudaErrorNotReady](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a285d0c852ab65b8925505e1065563f6d) if not.
    ///
    /// For the purposes of Unified Memory, a return value of [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) is equivalent to having called [`cudaStreamSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `stream`: - Stream identifier
    pub fn cudaStreamQuery(stream: cudaStream_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Attach memory to a stream asynchronously.
    ///
    /// Enqueues an operation in `stream` to specify stream association of `length` bytes of memory starting from `devPtr`. This function is a stream-ordered operation, meaning that it is dependent on, and will only take effect when, previous work in stream has completed. Any previous association is automatically replaced.
    ///
    /// `devPtr` must point to an one of the following types of memories:
    ///
    /// For managed allocations, `length` must be either zero or the entire allocation’s size. Both indicate that the entire allocation’s stream association is being changed. Currently, it is not possible to change stream association for a portion of a managed allocation.
    ///
    /// For pageable allocations, `length` must be non-zero.
    ///
    /// The stream association is specified using `flags` which must be one of [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff), [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) or [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe). The default value for `flags` is [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe) If the [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff) flag is specified, the memory can be accessed by any stream on any device. If the [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) flag is specified, the program makes a guarantee that it won’t access the memory on the device from any stream on a device that has a zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09). If the [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe) flag is specified and `stream` is associated with a device that has a zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09), the program makes a guarantee that it will only access the memory on the device from `stream`. It is illegal to attach singly to the NULL stream, because the NULL stream is a virtual global stream and not a specific stream. An error will be returned in this case.
    ///
    /// When memory is associated with a single stream, the Unified Memory system will allow CPU access to this memory region so long as all operations in `stream` have completed, regardless of whether other streams are active. In effect, this constrains exclusive ownership of the managed memory region by an active GPU to per-stream activity instead of whole-GPU activity.
    ///
    /// Accessing memory on the device from streams that are not associated with it will produce undefined results. No error checking is performed by the Unified Memory system to ensure that kernels launched into other streams do not access this region.
    ///
    /// It is a program’s responsibility to order calls to [`cudaStreamAttachMemAsync`] via events, synchronization or other means to ensure legal access to memory at all times. Data visibility and coherency will be changed appropriately for all kernels which follow a stream-association change.
    ///
    /// If `stream` is destroyed while data is associated with it, the association is removed and the association reverts to the default visibility of the allocation as specified at [`cudaMallocManaged`]. For **managed** variables, the default association is always [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff). Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won’t happen until all work in the stream has completed.
    ///
    /// # 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff), [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) or [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe) (defaults to [cudaMemAttachSingle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gadc191442d08fc3a9de4cf055edfd2dbe)).
    pub fn cudaStreamAttachMemAsync(
        stream: cudaStream_t,
        devPtr: *mut ::core::ffi::c_void,
        length: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246). 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.
    ///
    /// # 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;
}
/// Callback function invoked when node parameter mismatches are detected while recapturing to an existing graph. Parameter struct pointers are only valid within the callback.
///
/// User parameter provided at beginning of recapture
///
/// Graph node with the parameter mismatch
///
/// The original node parameters from the graph
///
/// The node parameters received during the recapture
///
/// status Status code for the recapture of the node
///
///
///
/// # Return value
///
/// Error code for the callback. Anything other than cudaSuccess will cause the recapture to fail immediately.
pub type cudaGraphRecaptureCallback_t = ::core::option::Option<
    unsafe extern "C" fn(
        data: *mut ::core::ffi::c_void,
        node: cudaGraphNode_t,
        originalParams: *const cudaGraphNodeParams,
        recaptureParams: *const cudaGraphNodeParams,
        status: cudaGraphRecaptureStatus,
    ) -> cudaError_t,
>;
/// Struct of user callback data that is invoked when node parameter mismatches are detected while recapturing to an existing graph.
#[repr(C)]
#[derive(Debug, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)]
pub struct cudaGraphRecaptureCallbackData {
    /// Callback function that will be invoked.
    pub callbackFunc: cudaGraphRecaptureCallback_t,
    /// Generic pointer that is passed to the callback function.
    pub userData: *mut ::core::ffi::c_void,
}
impl Default for cudaGraphRecaptureCallbackData {
    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()
        }
    }
}
singe_loader::functions! { crate::RUNTIME;
    /// Begin graph capture on a stream to an existing graph.
    ///
    /// Begin graph capture on `stream` to the existing `graph`. The node creation order while recapturing the graph must be identical to the original graph. The recapture will fail immediately for:
    ///
    /// Any other node parameter mismatches during recapture can be configured to call the function provided in `callbackFunc`. The recapture will fail immediately if the callback returns anything other than cudaSuccess.
    ///
    /// If the recapture fails for any reason, the `graph` will be in an undefined state and should be destroyed.
    ///
    /// See cudaStreamBeginCapture for additional detail on beginning the capture.
    ///
    /// # 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`].
    /// - `graph`: Existing CUDA graph to be captured into.
    /// - `callbackData`: Optional struct of callback data that will be invoked for all parameter mismatches from the original graph.
    pub fn cudaStreamBeginRecaptureToGraph(
        stream: cudaStream_t,
        mode: cudaStreamCaptureMode,
        graph: cudaGraph_t,
        callbackData: *mut cudaGraphRecaptureCallbackData,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246). 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `mode`: - Pointer to mode value to swap with the current mode
    pub fn cudaThreadExchangeStreamCaptureMode(
        mode: *mut cudaStreamCaptureMode,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`].
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream to query.
    /// - `pGraph`: The captured graph.
    pub fn cudaStreamEndCapture(
        stream: cudaStream_t,
        pGraph: *mut cudaGraph_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// Note that, if this is called on [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246) (the “null stream”) while a blocking stream on the same device is capturing, it will return [cudaErrorStreamCaptureImplicit](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038acf775033deb76dbde57b8df7bd9244e7) 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).
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream to query.
    /// - `pCaptureStatus`: Returns the stream’s capture status.
    pub fn cudaStreamIsCapturing(
        stream: cudaStream_t,
        pCaptureStatus: *mut cudaStreamCaptureStatus,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Query a stream’s capture state.
    ///
    /// Query stream state related to stream capture.
    ///
    /// If called on [cudaStreamLegacy](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4e62d09dde16ba457b0a97f3a5262246) (the “null stream”) while a stream not created with [`cudaStreamNonBlocking`] is capturing, returns [cudaErrorStreamCaptureImplicit](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038acf775033deb76dbde57b8df7bd9244e7).
    ///
    /// Valid data (other than capture status) is returned only if both of the following are true:
    ///
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad484d9d8e8f269cf93d4c111b646f908).
    ///
    /// # 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ace9e4b4b58c1abf9faa1ce8b1079076d).
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ace9e4b4b58c1abf9faa1ce8b1079076d) if they are unreachable from the stream at [`cudaStreamEndCapture`].
    ///
    /// Returns [cudaErrorIllegalState](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a0604022302a2ed15d31bc33546b2e963) if the stream is not capturing.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Creates an event object
    ///
    /// Creates an event object for the current device using ::cudaEventDefault.
    ///
    ///
    ///
    ///
    ///
    /// # Return value
    ///
    /// ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorLaunchFailure, ::cudaErrorMemoryAllocation
    ///
    /// Note: _init_rt
    ///
    /// Note: _callback
    ///
    ///
    ///
    /// See also: `::cudaEventCreate(cudaEvent_t*`, unsigned int) "cudaEventCreate (C++ API)", ::cudaEventCreateWithFlags, ::cudaEventRecord, ::cudaEventQuery, ::cudaEventSynchronize, ::cudaEventDestroy, ::cudaEventElapsedTime, ::cudaStreamWaitEvent, ::cuEventCreate
    ///
    /// # Parameters
    ///
    /// - `event`: - Newly created event
    pub fn cudaEventCreate(event: *mut cudaEvent_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Creates an event object with the specified flags.
    ///
    /// Creates an event object for the current device with the specified flags. Valid flags include.
    ///
    /// # Parameters
    ///
    /// - `event`: Newly created event.
    /// - `flags`: Flags for new event.
    pub fn cudaEventCreateWithFlags(
        event: *mut cudaEvent_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591).
    ///
    /// # Parameters
    ///
    /// - `event`: Event to record.
    /// - `stream`: Stream in which to record event.
    pub fn cudaEventRecord(event: cudaEvent_t, stream: cudaStream_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591).
    ///
    /// flags include.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) if all captured work has been completed, or [cudaErrorNotReady](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a285d0c852ab65b8925505e1065563f6d) if any captured work is incomplete.
    ///
    /// For the purposes of Unified Memory, a return value of [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) is equivalent to having called [`cudaEventSynchronize`].
    ///
    /// # Parameters
    ///
    /// - `event`: - Event to query
    pub fn cudaEventQuery(event: cudaEvent_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga26509a522be9d449aa7c8c279612452d) flag will cause the calling CPU thread to block until the event has been completed by the device. If the [cudaEventBlockingSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga26509a522be9d449aa7c8c279612452d) flag has not been set, then the CPU thread will busy-wait until the event has been completed by the device.
    ///
    /// # Parameters
    ///
    /// - `event`: - Event to wait for
    pub fn cudaEventSynchronize(event: cudaEvent_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a285d0c852ab65b8925505e1065563f6d)). In this case, the call does not block on completion of the event, and any associated resources will automatically be released asynchronously at completion.
    ///
    /// # Parameters
    ///
    /// - `event`: - Event to destroy
    pub fn cudaEventDestroy(event: cudaEvent_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ac4673247aee4d1ab8d07871f376e0273) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a285d0c852ab65b8925505e1065563f6d) on at least one of the events), [cudaErrorNotReady](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a285d0c852ab65b8925505e1065563f6d) is returned. If either event was created with the [cudaEventDisableTiming](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaa5d3eff7c3623e2be533968d9cc1ee7e) flag, then this function will return [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ac4673247aee4d1ab8d07871f376e0273).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// where [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) specifies the type of handle being imported. [`cudaExternalMemoryHandleType`] is defined as:
    ///
    /// If [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) 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
    ///
    /// If [cudaExternalMemoryHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3643166ea40207f6a13f82ebd7b6c2c7) and [cudaExternalSemaphoreSignalSkipNvSciBufMemSync](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga39b71a7aa040658a7a280fcf31eb4a77) for memory synchronization.
    ///
    /// The size of the memory object must be specified in [cudaExternalMemoryHandleDesc::size](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a362086a22da90ac8fba1ca294e65548e).
    ///
    /// Specifying the flag [cudaExternalMemoryDedicated](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaea2031488a28bcdb7695e9bbaf25e149) in [cudaExternalMemoryHandleDesc::flags](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a74412d3d2777ebc856aea0b9158aaafa) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryHandleDesc.html#structcudaexternalmemoryhandledesc_1a8d2b65d3b597280eb9be66ee34c7ee52) is one of the following: [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D12Resource`] [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11Resource`] [`cudaExternalMemoryHandleType::cudaExternalMemoryHandleTypeD3D11ResourceKmt`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// where [cudaExternalMemoryBufferDesc::offset](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryBufferDesc.html#structcudaexternalmemorybufferdesc_1a034839893ecb4e103f82498888157ba6) is the offset in the memory object where the buffer’s base address is. [cudaExternalMemoryBufferDesc::size](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryBufferDesc.html#structcudaexternalmemorybufferdesc_1a56bdddff67c72329350ed4fa4f2cd746) is the size of the buffer. [cudaExternalMemoryBufferDesc::flags](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryBufferDesc.html#structcudaexternalmemorybufferdesc_1a0a7888cacfea49ab9b30ae7e9ab47d32) 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`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// where [cudaExternalMemoryMipmappedArrayDesc::offset](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaexternalmemorymipmappedarraydesc_1a2f9441c3c6e3100f1517ccaf668ffd83) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaexternalmemorymipmappedarraydesc_1a42333e3049cc4a40213b086be45927e1) describes the format of the data. [cudaExternalMemoryMipmappedArrayDesc::extent](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaexternalmemorymipmappedarraydesc_1acba41d5152a8458ac72a24e65ee0f3ac) specifies the dimensions of the base level of the mipmap chain. [cudaExternalMemoryMipmappedArrayDesc::flags](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaexternalmemorymipmappedarraydesc_1ade6d5579b7f13034ea82e06012c8758f) 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gafec2b519ab85854efaa40e12f4e34ad3) must be specified in [cudaExternalMemoryMipmappedArrayDesc::flags](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaexternalmemorymipmappedarraydesc_1ade6d5579b7f13034ea82e06012c8758f). [cudaExternalMemoryMipmappedArrayDesc::numLevels](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalMemoryMipmappedArrayDesc.html#structcudaexternalmemorymipmappedarraydesc_1a4a939b3d6c1fca916dd78679049f36eb) specifies the total number of levels in the mipmap chain.
    ///
    /// The returned CUDA mipmapped array must be freed using [`cudaFreeMipmappedArray`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `extMem`: - External memory object to be destroyed
    pub fn cudaDestroyExternalMemory(extMem: cudaExternalMemory_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// where [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) specifies the type of handle being imported. [`cudaExternalSemaphoreHandleType`] is defined as:
    ///
    /// If [cudaExternalSemaphoreHandleDesc::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaExternalSemaphoreHandleDesc.html#structcudaexternalsemaphorehandledesc_1ae925b19e386170fb3cccf58cfab0fd9c) 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga39b71a7aa040658a7a280fcf31eb4a77), 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3643166ea40207f6a13f82ebd7b6c2c7), 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `extSem`: - External semaphore to be destroyed
    pub fn cudaDestroyExternalSemaphore(extSem: cudaExternalSemaphore_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Launches a device function.
    ///
    /// The function invokes kernel `func` on `gridDim` (`gridDim.x ``gridDim.y ``gridDim.z`) grid of blocks. Each block contains `blockDim` (`blockDim.x ``blockDim.y ``blockDim.z`) threads.
    ///
    /// 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.
    ///
    /// For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
    ///
    /// `sharedMem` sets the amount of dynamic shared memory that will be available to each thread block.
    ///
    /// `stream` specifies a stream the invocation is associated to.
    ///
    /// # Parameters
    ///
    /// - `func`: Device function symbol.
    /// - `gridDim`: Grid dimentions.
    /// - `blockDim`: Block dimentions.
    /// - `args`: Arguments.
    /// - `sharedMem`: Shared memory.
    /// - `stream`: Stream identifier.
    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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Launches a CUDA function with launch-time configuration.
    ///
    /// Note that the functionally equivalent variadic template [cudaLaunchKernelEx](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga7d9168c86a4293639c75ea437465ed53) is available for C++11 and newer.
    ///
    /// Invokes the kernel `func` on `config->gridDim` (`config->gridDim.x ``config->gridDim.y ``config->gridDim.z`) grid of blocks. Each block contains `config->blockDim` (`config->blockDim.x ``config->blockDim.y ``config->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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaLaunchAttribute.html#structcudalaunchattribute) 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Launches a device function where thread blocks can cooperate and synchronize as they execute.
    ///
    /// The function invokes kernel `func` on `gridDim` (`gridDim.x ``gridDim.y ``gridDim.z`) grid of blocks. Each block contains `blockDim` (`blockDim.x ``blockDim.y ``blockDim.z`) threads.
    ///
    /// The device on which this kernel is invoked must have a non-zero value for the device attribute [cudaDevAttrCooperativeLaunch](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda108260813c2eb395a60d4acf08c97595).
    ///
    /// The total number of blocks launched cannot exceed the maximum number of blocks per multiprocessor as returned by [`cudaOccupancyMaxActiveBlocksPerMultiprocessor`] (or [`cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags`]) times the number of multiprocessors as specified by the device attribute [cudaDevAttrMultiProcessorCount](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda74de9ed281f917c8e4ef272da09f338a).
    ///
    /// The kernel cannot make use of CUDA dynamic parallelism.
    ///
    /// 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.
    ///
    /// For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
    ///
    /// `sharedMem` sets the amount of dynamic shared memory that will be available to each thread block.
    ///
    /// `stream` specifies a stream the invocation is associated to.
    ///
    /// # Parameters
    ///
    /// - `func`: Device function symbol.
    /// - `gridDim`: Grid dimentions.
    /// - `blockDim`: Block dimentions.
    /// - `args`: Arguments.
    /// - `sharedMem`: Shared memory.
    /// - `stream`: Stream identifier.
    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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets the preferred cache configuration for a device function.
    ///
    /// On devices where the L1 cache and shared memory use the same hardware resources, this sets through `cacheConfig` the preferred cache configuration for the function specified via `func`. 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 `func`.
    ///
    /// `func` is a device function symbol and must be declared as a `__global__` function. If the specified function does not exist, then [cudaErrorInvalidDeviceFunction](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ab6af535e7e53d3f21e2437e8977b8c2e) is returned. For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `func`: Device function symbol.
    /// - `cacheConfig`: Requested cache configuration.
    pub fn cudaFuncSetCacheConfig(
        func: *const ::core::ffi::c_void,
        cacheConfig: cudaFuncCache,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Find out attributes for a given function.
    ///
    /// This function obtains the attributes of a function specified via `func`. `func` is a device function symbol and must be declared as a `__global__` function. The fetched attributes are placed in `attr`. If the specified function does not exist, then it is assumed to be a [cudaKernel_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga0b33f204b307b3154aa4f005a3c8a46a) and used as is. For templated functions, pass the function symbol as follows: func_name&lt;template_arg_0,…,template_arg_N>
    ///
    /// Note that some function attributes such as [maxThreadsPerBlock](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaFuncAttributes.html#structcudafuncattributes_1ab8350f491105f159ff684f5c59167af0) may vary based on the device that is currently being used.
    ///
    /// # Parameters
    ///
    /// - `attr`: Return pointer to function’s attributes.
    /// - `func`: Device function symbol.
    pub fn cudaFuncGetAttributes(
        attr: *mut cudaFuncAttributes,
        func: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Set attributes for a given function.
    ///
    /// This function sets the attributes of a function specified via `func`. The parameter `func` must be a pointer to a function that executes on the device. The parameter specified by `func` must be declared as a `__global__` function. The enumeration defined by `attr` is set to the value defined by `value`. If the specified function does not exist, then it is assumed to be a [cudaKernel_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga0b33f204b307b3154aa4f005a3c8a46a) and used as is. If the specified attribute cannot be written, or if the value is incorrect, then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// Valid values for `attr` are:
    ///
    /// cudaLaunchKernel (C++ API), [cudaFuncSetCacheConfig (C++ API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__HIGHLEVEL.html#group__cudart__highlevel_1ga981c8d74d33b21e7fd57609b7337653e), [cudaFuncGetAttributes (C API)](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__EXECUTION.html#group__cudart__execution_1gace91ab5ae929d84d16860e4d1a189754),.
    ///
    /// # Parameters
    ///
    /// - `func`: Function to get attributes of.
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the function name for a device entry function pointer.
    ///
    /// Returns in `**name` the function name associated with the symbol `func`. The function name is returned as a null-terminated string. This API may return a mangled name if the function is not declared as having C linkage. If `**name` is NULL, [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned. If `func` is not a device entry function, then it is assumed to be a [cudaKernel_t](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga0b33f204b307b3154aa4f005a3c8a46a) and used as is.
    ///
    /// cudaFuncGetName (C++ API).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__GRAPH.html#group__cudart__graph_1ga9171bc40a4f9be650b3fe867e8bfb549) and [cudaGraphKernelNodeUpdatesApply()](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__GRAPH.html#group__cudart__graph_1ga2d558cf37c9616365c67447e61ac0d6a). `paramIndex` must be less than the number of parameters that `func` takes.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the number of parameters used by the function.
    ///
    /// Queries the number of kernel parameters used by `func` and returns it in `paramCount`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a67b6095ab719b21659a400b553963eb3), 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:
    ///
    /// Note that, in constrast to ::cuStreamAddCallback, the function will not be called in the event of an error in the CUDA context.
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream to enqueue function call in.
    /// - `fn_`: The function to call once preceding stream operations are complete.
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a67b6095ab719b21659a400b553963eb3), 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:
    ///
    /// Note that, in constrast to ::cuStreamAddCallback, the function will not be called in the event of an error in the CUDA context.
    ///
    /// # Parameters
    ///
    /// - `stream`: Stream to enqueue function call in.
    /// - `fn_`: The function to call once preceding stream operations are complete.
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets the shared memory configuration for a device function.
    ///
    /// On devices with configurable shared memory banks, this function will force all subsequent launches of the specified device function to have the given shared memory bank size configuration. On any given launch of the function, the shared memory configuration of the device will be temporarily changed if needed to suit the function’s preferred configuration. Changes in shared memory configuration between subsequent launches of functions, may introduce a device side synchronization point.
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `func`: Device function symbol.
    /// - `config`: Requested shared memory configuration.
    #[deprecated]
    pub fn cudaFuncSetSharedMemConfig(
        func: *const ::core::ffi::c_void,
        config: cudaSharedMemConfig,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns occupancy for a device function.
    ///
    /// Returns in `*numBlocks` the maximum number of active blocks per streaming multiprocessor for the device function.
    ///
    /// # Parameters
    ///
    /// - `numBlocks`: Returned occupancy.
    /// - `func`: Kernel function for which occupancy is calculated.
    /// - `blockSize`: Block size the kernel is intended to be launched with.
    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
    pub fn cudaOccupancyMaxActiveBlocksPerMultiprocessor(
        numBlocks: *mut ::core::ffi::c_int,
        func: *const ::core::ffi::c_void,
        blockSize: ::core::ffi::c_int,
        dynamicSMemSize: size_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns dynamic shared memory available per block when launching `numBlocks` blocks on SM.
    ///
    /// Returns in `*dynamicSmemSize` the maximum size of dynamic shared memory to allow `numBlocks` blocks per SM.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns occupancy for a device function with the specified flags.
    ///
    /// Returns in `*numBlocks` the maximum number of active blocks per streaming multiprocessor for the device function.
    ///
    /// The `flags` parameter controls how special cases are handled. Valid flags include.
    ///
    /// # Parameters
    ///
    /// - `numBlocks`: Returned occupancy.
    /// - `func`: Kernel function for which occupancy is calculated.
    /// - `blockSize`: Block size the kernel is intended to be launched with.
    /// - `dynamicSMemSize`: Per-block dynamic shared memory usage intended, in bytes.
    /// - `flags`: Requested behavior for the occupancy calculator.
    pub fn 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Given the kernel function (`func`) and launch configuration (`config`), return the maximum cluster size in `*clusterSize`.
    ///
    /// The cluster dimensions in `config` are ignored. If func has a required cluster size set (see [`cudaFuncGetAttributes`]),`*clusterSize` will reflect the required cluster size.
    ///
    /// By default this function will always return a value that’s portable on future hardware. A higher value may be returned if the kernel function allows non-portable cluster sizes.
    ///
    /// This function will respect the compile time launch bounds.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Given the kernel function (`func`) and launch configuration (`config`), return the maximum number of clusters that could co-exist on the target device in `*numClusters`.
    ///
    /// If the function has required cluster size already set (see [`cudaFuncGetAttributes`]), the cluster size from config must either be unspecified or match the required size. Without required sizes, the cluster size must be specified in config, else the function will return an error.
    ///
    /// Note that various attributes of the kernel function may affect occupancy calculation. Runtime environment may affect how the hardware schedules the clusters, so the calculated occupancy is not guaranteed to be achievable.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Allocates memory that will be automatically managed by the Unified Memory system.
    ///
    /// Allocates `size` bytes of managed memory on the device and returns in `*devPtr` a pointer to the allocated memory. If the device doesn’t support allocating managed memory, [cudaErrorNotSupported](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad846fd9f2e8ba5e2fb4f1695b7ab6164) is returned. Support for managed memory can be queried using the device attribute [cudaDevAttrManagedMemory](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda5467985f87821a03625ab62e72195ff8). The allocated memory is suitably aligned for any kind of variable. The memory is not cleared. If `size` is 0, [`cudaMallocManaged`] returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c). The pointer is valid on the CPU and on all GPUs in the system that support managed memory. All accesses to this pointer must obey the Unified Memory programming model.
    ///
    /// `flags` specifies the default stream association for this allocation. `flags` must be one of [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff) or [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0). The default value for `flags` is [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff). If [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff) is specified, then this memory is accessible from any stream on any device. If [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) is specified, then the allocation should not be accessed from devices that have a zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09); an explicit call to [`cudaStreamAttachMemAsync`] will be required to enable access on such devices.
    ///
    /// If the association is later changed via [`cudaStreamAttachMemAsync`] to a single stream, the default association, as specifed during [`cudaMallocManaged`], is restored when that stream is destroyed. For **managed** variables, the default association is always [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff). Note that destroying a stream is an asynchronous operation, and as a result, the change to default association won’t happen until all work in the stream has completed.
    ///
    /// Memory allocated with [`cudaMallocManaged`] should be released with [`cudaFree`].
    ///
    /// Device memory oversubscription is possible for GPUs that have a non-zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09). Managed memory on such GPUs may be evicted from device memory to host memory at any time by the Unified Memory driver in order to make room for other allocations.
    ///
    /// In a system where all GPUs have a non-zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09), managed memory may not be populated when this API returns and instead may be populated on access. In such systems, managed memory can migrate to any processor’s memory at any time. The Unified Memory driver will employ heuristics to maintain data locality and prevent excessive page faults to the extent possible. The application can also guide the driver about memory usage patterns via [`cudaMemAdvise`]. The application can also explicitly migrate memory to a desired processor’s memory via [`cudaMemPrefetchAsync`].
    ///
    /// In a multi-GPU system where all of the GPUs have a zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09) and all the GPUs have peer-to-peer support with each other, the physical storage for managed memory is created on the GPU which is active at the time [`cudaMallocManaged`] is called. All other GPUs will reference the data at reduced bandwidth via peer mappings over the PCIe bus. The Unified Memory driver does not migrate memory among such GPUs.
    ///
    /// In a multi-GPU system where not all GPUs have peer-to-peer support with each other and where the value of the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09) is zero for at least one of those GPUs, the location chosen for physical storage of managed memory is system-dependent.
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Pointer to allocated device memory.
    /// - `size`: Requested allocation size in bytes.
    /// - `flags`: Must be either [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff) or [cudaMemAttachHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4f9a428d18fdd89a99441d0dd27131c0) (defaults to [cudaMemAttachGlobal](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga4808e47eba73eb94622ec70a9f9b91ff)).
    pub fn cudaMallocManaged(
        devPtr: *mut *mut ::core::ffi::c_void,
        size: size_t,
        flags: ::core::ffi::c_uint,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038af210f50ae7f17f655e0504929606add9) in case of failure.
    ///
    /// The device version of [`cudaFree`] cannot be used with a `*devPtr` allocated using the host API, and vice versa.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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().
    ///
    /// On systems where ::pageableMemoryAccessUsesHostPageTables is true, ::cudaMallocHost may not page-lock the allocated memory.
    ///
    /// Page-locking excessive amounts of memory with ::cudaMallocHost() 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.
    ///
    ///
    ///
    ///
    ///
    /// # Return value
    ///
    /// ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorMemoryAllocation, ::cudaErrorExternalDevice
    ///
    /// Note: _init_rt
    ///
    /// Note: _callback
    ///
    ///
    ///
    /// See also: ::cudaMalloc, ::cudaMallocPitch, ::cudaMallocArray, ::cudaMalloc3D, ::cudaMalloc3DArray, ::cudaHostAlloc, ::cudaFree, ::cudaFreeArray, `::cudaMallocHost(void**`, size_t, unsigned int) "cudaMallocHost (C++ API)", ::cudaFreeHost, ::cudaHostAlloc, ::cuMemAllocHost
    ///
    /// # Parameters
    ///
    /// - `ptr`: - Pointer to allocated host memory
    /// - `size`: - Requested allocation size in bytes
    pub fn cudaMallocHost(
        ptr: *mut *mut ::core::ffi::c_void,
        size: size_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// 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).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// `width` and `height` must meet certain size requirements. See [`cudaMalloc3DArray`] for more details.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `devPtr`: - Device pointer to memory to free
    pub fn cudaFree(devPtr: *mut ::core::ffi::c_void) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: - Pointer to memory to free
    pub fn cudaFreeHost(ptr: *mut ::core::ffi::c_void) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `array`: - Pointer to array to free
    pub fn cudaFreeArray(array: cudaArray_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `mipmappedArray`: - Pointer to mipmapped array to free
    pub fn cudaFreeMipmappedArray(mipmappedArray: cudaMipmappedArray_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0) flag, which can be checked via [`cudaGetDeviceFlags`]. The [cudaDeviceMapHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0) 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`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda6ea4a004a336c3c95b6ff06ec6269e29).
    ///
    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdab08e379a7a038dc8134914702c223f69), 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`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`].
    ///
    /// # Parameters
    ///
    /// - `ptr`: - Host pointer to memory to unregister
    pub fn cudaHostUnregister(ptr: *mut ::core::ffi::c_void) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga3762be9cccdd809a4ca128354fd134b0) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdab08e379a7a038dc8134914702c223f69), 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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 `height` `extent` 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).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// [`cudaMalloc3DArray`] can allocate the following:
    ///
    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga142b19a14d56a03b1e410430aa5202d1) flag is set. In that case, the valid range for (width, height, depth) is ((1,maxTexture2DGather\[0\]), (1,maxTexture2DGather\[1\]), 0).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// [`cudaMallocMipmappedArray`] can allocate the following:
    ///
    /// The `flags` parameter enables different options to be specified that affect the allocation, as follows.
    ///
    /// The width, height and depth extents must meet certain size requirements as listed in the following table. All values are specified in elements.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// If `mipmappedArray` is NULL, [cudaErrorInvalidResourceHandle](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ac4673247aee4d1ab8d07871f376e0273) is returned.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data between 3D objects.
    ///
    /// [`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:
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `p`: - 3D memory copy parameters
    pub fn cudaMemcpy3D(p: *const cudaMemcpy3DParms) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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).
    ///
    /// # Parameters
    ///
    /// - `p`: - Parameters for the memory copy
    pub fn cudaMemcpy3DPeer(p: *const cudaMemcpy3DPeerParms) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data between 3D objects.
    ///
    /// [`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:
    ///
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga18fa99055ee694244a270e4d5101e95badeec295de8a74ac2a74f98ffb6c5d7c7), [`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.
    ///
    /// # Parameters
    ///
    /// - `p`: 3D memory copy parameters.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpy3DAsync(
        p: *const cudaMemcpy3DParms,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `p`: Parameters for the memory copy.
    /// - `stream`: Stream identifier.
    pub fn cudaMemcpy3DPeerAsync(
        p: *const cudaMemcpy3DPeerParms,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga91a50795515848406a89c2e6cef2fb02) [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// The returned value in [cudaArrayMemoryRequirements::size](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArrayMemoryRequirements.html#structcudaarraymemoryrequirements_1acff0bc12daa05c6c40892a2187befd87) represents the total size of the CUDA array. The returned value in [cudaArrayMemoryRequirements::alignment](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArrayMemoryRequirements.html#structcudaarraymemoryrequirements_1a37898b13b500d39e4a43d0ee04cf0ef3) represents the alignment necessary for mapping the CUDA array.
    ///
    /// # Parameters
    ///
    /// - `memoryRequirements`: Pointer to [cudaArrayMemoryRequirements](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArrayMemoryRequirements.html#structcudaarraymemoryrequirements).
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga91a50795515848406a89c2e6cef2fb02) [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// The returned value in [cudaArrayMemoryRequirements::size](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArrayMemoryRequirements.html#structcudaarraymemoryrequirements_1acff0bc12daa05c6c40892a2187befd87) represents the total size of the CUDA mipmapped array. The returned value in [cudaArrayMemoryRequirements::alignment](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArrayMemoryRequirements.html#structcudaarraymemoryrequirements_1a37898b13b500d39e4a43d0ee04cf0ef3) represents the alignment necessary for mapping the CUDA mipmapped array.
    ///
    /// # Parameters
    ///
    /// - `memoryRequirements`: Pointer to [cudaArrayMemoryRequirements](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArrayMemoryRequirements.html#structcudaarraymemoryrequirements).
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga42c353686a15da063dc7722594ae4bff) [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// If the returned value in [cudaArraySparseProperties::flags](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1a44c8728469d60e511aceb4ba7086c164) contains [cudaArraySparsePropertiesSingleMipTail](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6820071ffa1300699897eab8d319e4d9), then [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1a22cfa4ad83195f0e9585303c988bb886) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1ab6909e5db55b866477b6cc16fb02f9d3) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) will be returned. Instead, [`cudaMipmappedArrayGetSparseProperties`] must be used to obtain the sparse properties of the entire CUDA mipmapped array to which `array` belongs to.
    ///
    /// # Parameters
    ///
    /// - `sparseProperties`: Pointer to return the [cudaArraySparseProperties](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties).
    /// - `array`: The CUDA array to get the sparse properties of.
    pub fn cudaArrayGetSparseProperties(
        sparseProperties: *mut cudaArraySparseProperties,
        array: cudaArray_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga42c353686a15da063dc7722594ae4bff) [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) will be returned.
    ///
    /// For non-layered CUDA mipmapped arrays, [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1a22cfa4ad83195f0e9585303c988bb886) 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1a44c8728469d60e511aceb4ba7086c164) contains [cudaArraySparsePropertiesSingleMipTail](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ga6820071ffa1300699897eab8d319e4d9), then [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1a22cfa4ad83195f0e9585303c988bb886) specifies the size of the mip tail of all layers combined. Otherwise, [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1a22cfa4ad83195f0e9585303c988bb886) specifies mip tail size per layer. The returned value of [cudaArraySparseProperties::miptailFirstLevel](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1ab6909e5db55b866477b6cc16fb02f9d3) is valid only if [cudaArraySparseProperties::miptailSize](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties_1a22cfa4ad83195f0e9585303c988bb886) is non-zero.
    ///
    /// # Parameters
    ///
    /// - `sparseProperties`: Pointer to return [cudaArraySparseProperties](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaArraySparseProperties.html#structcudaarraysparseproperties).
    /// - `mipmap`: The CUDA mipmapped array to get the sparse properties of.
    pub fn cudaMipmappedArrayGetSparseProperties(
        sparseProperties: *mut cudaArraySparseProperties,
        mipmap: cudaMipmappedArray_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data to the given symbol on the device.
    ///
    /// Copies `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `offset` bytes from the start of symbol `symbol`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`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.
    ///
    /// # Parameters
    ///
    /// - `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 cudaMemcpyToSymbol(
        symbol: *const ::core::ffi::c_void,
        src: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data from the given symbol on the device.
    ///
    /// Copies `count` bytes from the memory area pointed to by `offset` bytes from the start of symbol `symbol` to the memory area pointed to by `dst`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`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.
    ///
    /// # Parameters
    ///
    /// - `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 cudaMemcpyFromSymbol(
        dst: *mut ::core::ffi::c_void,
        symbol: *const ::core::ffi::c_void,
        count: size_t,
        offset: size_t,
        kind: cudaMemcpyKind,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// The memory areas may not overlap. Calling [`cudaMemcpyAsync`] with `dst` and `src` pointers that do not match the direction of the copy results in an undefined behavior.
    ///
    /// [`cudaMemcpyAsync`] 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 the `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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Performs a batch of memory copies asynchronously.
    ///
    /// Performs a batch of memory copies. The batch as a whole executes in stream order but copies within a batch are not guaranteed to execute in any specific order. This API only supports pointer-to-pointer copies. For copies involving CUDA arrays, please see [`cudaMemcpy3DBatchAsync`].
    ///
    /// Performs memory copies from source buffers specified in `srcs` to destination buffers specified in `dsts`. The size of each copy is specified in `sizes`. All three arrays must be of the same length as specified by `count`. Since there are no ordering guarantees for copies within a batch, specifying any dependent copies within a batch will result in undefined behavior.
    ///
    /// Every copy in the batch has to be associated with a set of attributes specified in the `attrs` array. Each entry in this array can apply to more than one copy. This can be done by specifying in the `attrsIdxs` array, the index of the first copy that the corresponding entry in the `attrs` array applies to. Both `attrs` and `attrsIdxs` must be of the same length as specified by `numAttrs`. For example, if a batch has 10 copies listed in dst/src/sizes, the first 6 of which have one set of attributes and the remaining 4 another, then `numAttrs` will be 2, `attrsIdxs` will be {0, 6} and `attrs` will contains the two sets of attributes. Note that the first entry in `attrsIdxs` must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than `count`. Furthermore, `numAttrs` must be lesser than or equal to `count`.
    ///
    /// The [cudaMemcpyAttributes::srcAccessOrder](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpyAttributes.html#structcudamemcpyattributes_1a0d466b9b554cfd529fa0d0344c0c391a) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5ab0c0860266a1fe9e640296317e8e32ae), 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5acf1101b874ba5ffe6ad6d89b7e807b29) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5a17b318d18bd58f8bfb6eb4b44a7d6949) then it indicates that access to the source pointer can be out of stream order and the accesses can happen even after the API call returns. This flag is suited for host pointers allocated outside CUDA (ex., via malloc) when it’s known that no prior operations in the stream can be accessing the memory. Specifying this flag allows the driver to optimize the copy on certain platforms. Each memcpy operation in the batch must have a valid [cudaMemcpyAttributes](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpyAttributes.html#structcudamemcpyattributes) corresponding to it including the appropriate srcAccessOrder setting, otherwise the API will return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c).
    ///
    /// The [cudaMemcpyAttributes::srcLocHint](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpyAttributes.html#structcudamemcpyattributes_1a02741caad443491b1a0504c1fda2e495) and [cudaMemcpyAttributes::dstLocHint](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpyAttributes.html#structcudamemcpyattributes_1a1afc02fa1b53087f91d115ee8718dd65) allows applications to specify hint locations for operands of a copy when the operand doesn’t have a fixed location. That is, these hints are only applicable for managed memory pointers on devices where [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09) is true or system-allocated pageable memory on devices where [cudaDevAttrPageableMemoryAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdadc80992427a92713e699953a6d249d6f) is true. For other cases, these hints are ignored.
    ///
    /// The [cudaMemcpyAttributes::flags](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpyAttributes.html#structcudamemcpyattributes_1af18d7011fefaecb0fa72cbdbf8aad0fb) field can be used to specify certain flags for copies. Setting the [cudaMemcpyFlagPreferOverlapWithCompute](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggae21aa0690949b1d1e5360e4edcf75dcfafef0e1bac799cb33d1ee092124ced948) 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.
    ///
    /// # 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.
    /// - `stream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
    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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpy3DBatchOp.html#structcudamemcpy3dbatchop_1a8ffb48e0046cf9c16b1f4b7ad83baa31) and [cudaMemcpy3DBatchOp::dst](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpy3DBatchOp.html#structcudamemcpy3dbatchop_1a0295c551c9a400a93fa5304a864ccfea) 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpy3DBatchOp.html#structcudamemcpy3dbatchop_1a4368cd2ad50ccd13bef8e7a088e63e3f). 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggada2d93832ded1a29fd7cb28a6261ee6ca395369a66615a9cacf1a734334859a67), 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09) is true or system-allocated pageable memory on devices where [cudaDevAttrPageableMemoryAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdadc80992427a92713e699953a6d249d6f) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggada2d93832ded1a29fd7cb28a6261ee6ca468b9e5daeac88a1cddc387310cb2952), 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpyAttributes.html#structcudamemcpyattributes_1a0d466b9b554cfd529fa0d0344c0c391a) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5ab0c0860266a1fe9e640296317e8e32ae), 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5acf1101b874ba5ffe6ad6d89b7e807b29) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga1a0bf7e313a2ef3dcabacefcf8a013b5a17b318d18bd58f8bfb6eb4b44a7d6949) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c).
    ///
    /// The [cudaMemcpyAttributes::flags](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpyAttributes.html#structcudamemcpyattributes_1af18d7011fefaecb0fa72cbdbf8aad0fb) field can be used to specify certain flags for copies. Setting the [cudaMemcpyFlagPreferOverlapWithCompute](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggae21aa0690949b1d1e5360e4edcf75dcfafef0e1bac799cb33d1ee092124ced948) 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.
    ///
    /// # 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.
    /// - `stream`: The stream to enqueue the operations in. Must not be default NULL stream.
    pub fn cudaMemcpy3DBatchAsync(
        numOps: size_t,
        opList: *mut cudaMemcpy3DBatchOp,
        flags: ::core::ffi::c_ulonglong,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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 `stream` specifies the stream to enqueue the operation in.
    ///
    /// For more information regarding the attributes, please refer to [cudaMemcpyAttributes](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpyAttributes.html#structcudamemcpyattributes) and it’s usage desciption in::cudaMemcpyBatchAsync.
    ///
    /// # Parameters
    ///
    /// - `dst`: Destination device pointer.
    /// - `src`: Source device pointer.
    /// - `size`: Number of bytes to copy.
    /// - `attr`: Attributes for the copy.
    /// - `stream`: Stream to enqueue the operation in.
    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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Performs 3D asynchronous memory copy with the specified attributes.
    ///
    /// Performs the copy operation specified in `op`. `flags` specifies the flags for the copy and `stream` specifies the stream to enqueue the operation in.
    ///
    /// For more information regarding the operation, please refer to [cudaMemcpy3DBatchOp](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemcpy3DBatchOp.html#structcudamemcpy3dbatchop) and it’s usage desciption in::cudaMemcpy3DBatchAsync.
    ///
    /// # Parameters
    ///
    /// - `op`: Operation to perform.
    /// - `flags`: Flags for the copy, must be zero now.
    /// - `stream`: Stream to enqueue the operation in.
    pub fn cudaMemcpy3DWithAttributesAsync(
        op: *mut cudaMemcpy3DBatchOp,
        flags: ::core::ffi::c_ulonglong,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// [`cudaMemcpy2DFromArrayAsync`], [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], ::cuMemcpy2DAsync.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// [`cudaMemcpyToSymbolAsync`], [`cudaMemcpyFromSymbolAsync`], ::cuMemcpy2DAsync.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data to the given symbol on the device.
    ///
    /// Copies `count` bytes from the memory area pointed to by `src` to the memory area pointed to by `offset` bytes from the start of symbol `symbol`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`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.
    ///
    /// [`cudaMemcpyToSymbolAsync`] 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`] and `stream` is non-zero, the copy may overlap with operations in other streams.
    ///
    /// # Parameters
    ///
    /// - `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.
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data from the given symbol on the device.
    ///
    /// Copies `count` bytes from the memory area pointed to by `offset` bytes from the start of symbol `symbol` to the memory area pointed to by `dst`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`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.
    ///
    /// [`cudaMemcpyFromSymbolAsync`] 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::cudaMemcpyDeviceToHost`] and `stream` is non-zero, the copy may overlap with operations in other streams.
    ///
    /// # Parameters
    ///
    /// - `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.
    /// - `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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Finds the address associated with a CUDA symbol.
    ///
    /// Returns in `*devPtr` the address of symbol `symbol` on the device. `symbol` is a variable that resides in global or constant memory space. If `symbol` cannot be found, or if `symbol` is not declared in the global or constant memory space, `*devPtr` is unchanged and the error [cudaErrorInvalidSymbol](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a) is returned.
    ///
    /// # Parameters
    ///
    /// - `devPtr`: Return device pointer associated with symbol.
    /// - `symbol`: Device symbol address.
    pub fn cudaGetSymbolAddress(
        devPtr: *mut *mut ::core::ffi::c_void,
        symbol: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Finds the size of the object associated with a CUDA symbol.
    ///
    /// Returns in `*size` the size of symbol `symbol`. `symbol` is a variable that resides in global or constant memory space. If `symbol` cannot be found, or if `symbol` is not declared in global or constant memory space, `*size` is unchanged and the error [cudaErrorInvalidSymbol](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a01a4a97f3060ec714ffa9dd650b9213a) is returned.
    ///
    /// # Parameters
    ///
    /// - `size`: Size of object associated with symbol.
    /// - `symbol`: Device symbol address.
    pub fn cudaGetSymbolSize(
        size: *mut size_t,
        symbol: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4) for [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a6df2243c9f48e48ad92306df676b2fe0) will prefetch memory to GPU specified by device ordinal [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) as [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a6df2243c9f48e48ad92306df676b2fe0) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) for [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a6df2243c9f48e48ad92306df676b2fe0) and a valid host NUMA node id in [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0aa3925690e32332c940cb726ef56a4258) for [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a6df2243c9f48e48ad92306df676b2fe0). Note when [cudaMemLocation::type](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a6df2243c9f48e48ad92306df676b2fe0) is etiher [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) OR [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0aa3925690e32332c940cb726ef56a4258), [cudaMemLocation::id](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemLocation.html#structcudamemlocation_1a1c914cd5c3cc7323b4fde9756458efb0) will be ignored. Prefetching to [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b) locations is not supported.
    ///
    /// 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 as described below:
    ///
    /// If [cudaMemAdviseSetReadMostly](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggac314a8b14091f7e02a7ad15dcb36c857a441d911811beda174627f403142d5ff0) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggac314a8b14091f7e02a7ad15dcb36c857aa4a2bc3c7d218dcd9a1b425b432759eb) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggac314a8b14091f7e02a7ad15dcb36c857a50a22279bce0dc29956ad4f257084623) 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Performs a batch of memory prefetches asynchronously.
    ///
    /// Performs a batch of memory prefetches. The batch as a whole executes in stream order but operations within a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09) otherwise the API will return an error.
    ///
    /// The semantics of the individual prefetch operations are as described in [`cudaMemPrefetchAsync`].
    ///
    /// Performs memory prefetch on address ranges specified in `dptrs` and `sizes`. Both arrays must be of the same length as specified by `count`. Each memory range specified must refer to managed memory allocated via [`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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdadc80992427a92713e699953a6d249d6f). The prefetch location for every operation in the batch is specified in the `prefetchLocs` array. Each entry in this array can apply to more than one operation. This can be done by specifying in the `prefetchLocIdxs` array, the index of the first prefetch operation that the corresponding entry in the `prefetchLocs` array applies to. Both `prefetchLocs` and `prefetchLocIdxs` must be of the same length as specified by `numPrefetchLocs`. For example, if a batch has 10 prefetches listed in dptrs/sizes, the first 4 of which are to be prefetched to one location and the remaining 6 are to be prefetched to another, then `numPrefetchLocs` will be 2, `prefetchLocIdxs` will be {0, 4} and `prefetchLocs` will contain the two locations. Note the first entry in `prefetchLocIdxs` must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than `count`. Furthermore, `numPrefetchLocs` must be lesser than or equal to `count`.
    ///
    /// # Parameters
    ///
    /// - `dptrs`: Array of pointers to be prefetched.
    /// - `sizes`: Array of sizes for memory prefetch operations.
    /// - `count`: Size of `dptrs` and `sizes` arrays.
    /// - `prefetchLocs`: Array of locations to prefetch to.
    /// - `prefetchLocIdxs`: Array of indices to specify which operands each entry in the `prefetchLocs` array applies to. The locations specified in prefetchLocs\[k\] will be applied to copies starting from prefetchLocIdxs\[k\] through prefetchLocIdxs\[k+1\] - 1. Also prefetchLocs\[numPrefetchLocs - 1\] will apply to prefetches starting from prefetchLocIdxs\[numPrefetchLocs - 1\] through count - 1.
    /// - `numPrefetchLocs`: Size of `prefetchLocs` and `prefetchLocIdxs` arrays.
    /// - `flags`: Flags reserved for future use. Must be zero.
    /// - `stream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
    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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdadc80992427a92713e699953a6d249d6f).
    ///
    /// # 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.
    /// - `stream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
    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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Performs a batch of memory discards and prefetches asynchronously.
    ///
    /// Performs a batch of memory discards followed by prefetches. The batch as a whole executes in stream order but operations within a batch are not guaranteed to execute in any specific order. All devices in the system must have a non-zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09) otherwise the API will return an error.
    ///
    /// Calling [`cudaMemDiscardAndPrefetchBatchAsync`] is semantically equivalent to calling [`cudaMemDiscardBatchAsync`] followed by [`cudaMemPrefetchBatchAsync`], but is more optimal. For more details on what discarding and prefetching imply, please refer to [`cudaMemDiscardBatchAsync`] and [`cudaMemPrefetchBatchAsync`] respectively. Note that any reads, writes or prefetches to any part of the memory range that occur simultaneously with this combined discard+prefetch operation result in undefined behavior.
    ///
    /// Performs memory discard and prefetch on address ranges specified in `dptrs` and `sizes`. Both arrays must be of the same length as specified by `count`. Each memory range specified must refer to managed memory allocated via [`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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdadc80992427a92713e699953a6d249d6f). Every operation in the batch has to be associated with a valid location to prefetch the address range to and specified in the `prefetchLocs` array. Each entry in this array can apply to more than one operation. This can be done by specifying in the `prefetchLocIdxs` array, the index of the first operation that the corresponding entry in the `prefetchLocs` array applies to. Both `prefetchLocs` and `prefetchLocIdxs` must be of the same length as specified by `numPrefetchLocs`. For example, if a batch has 10 operations listed in dptrs/sizes, the first 6 of which are to be prefetched to one location and the remaining 4 are to be prefetched to another, then `numPrefetchLocs` will be 2, `prefetchLocIdxs` will be {0, 6} and `prefetchLocs` will contain the two set of locations. Note the first entry in `prefetchLocIdxs` must always be 0. Also, each entry must be greater than the previous entry and the last entry should be less than `count`. Furthermore, `numPrefetchLocs` must be lesser than or equal to `count`.
    ///
    /// # Parameters
    ///
    /// - `dptrs`: Array of pointers to be discarded.
    /// - `sizes`: Array of sizes for memory discard operations.
    /// - `count`: Size of `dptrs` and `sizes` arrays.
    /// - `prefetchLocs`: Array of locations to prefetch to.
    /// - `prefetchLocIdxs`: Array of indices to specify which operands each entry in the `prefetchLocs` array applies to. The locations specified in prefetchLocs\[k\] will be applied to operations starting from prefetchLocIdxs\[k\] through prefetchLocIdxs\[k+1\] - 1. Also prefetchLocs\[numPrefetchLocs - 1\] will apply to copies starting from prefetchLocIdxs\[numPrefetchLocs - 1\] through count - 1.
    /// - `numPrefetchLocs`: Size of `prefetchLocs` and `prefetchLocIdxs` arrays.
    /// - `flags`: Flags reserved for future use. Must be zero.
    /// - `stream`: The stream to enqueue the operations in. Must not be legacy NULL stream.
    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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Gets location information for a memory address range.
    ///
    /// Retrieves memory location information for the specified address range starting at `ptr` with size `size`. The API determines the most common location by sampling memory at intervals defined by `samplingGranularity` within the whole interval.
    ///
    /// The location information is returned in the `location_out` array, with one entry per summary region. The total number of locations returned will be ceil(size/summaryGranularity). The user is expected to allocate the `location_out` array with sufficient memory.
    ///
    /// For example, with an address range of 1GB, a `summaryGranularity` of 128MB, and a `samplingGranularity` of 2MB, the function will:
    ///
    /// When the memory is not resident on any processor, the call returns [cudaSuccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) and the returned location type for that interval is [cudaMemLocationTypeNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49).
    ///
    /// The memory range must refer to one of the following:
    ///
    /// All devices on the system must have non-zero value for the device attribute [cudaDevAttrConcurrentManagedAccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09). If not, this call returns [cudaErrorNotSupported](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad846fd9f2e8ba5e2fb4f1695b7ab6164).
    ///
    /// # Parameters
    ///
    /// - `size`: Size in bytes of the memory range to query.
    /// - `summaryGranularity`: Granularity in bytes at which to summarize location information.
    /// - `samplingGranularity`: Granularity in bytes at which to sample memory within each summary region.
    /// - `location_out`: Array to store location information, one entry per summary region.
    pub fn cudaMemGetLocationInfo(
        devPtr: *mut ::core::ffi::c_void,
        size: size_t,
        summaryGranularity: size_t,
        samplingGranularity: size_t,
        location_out: *mut cudaMemLocation,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `data`: A two-dimensional array containing pointers to memory locations where the result of each attribute query will be written 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data between host and device.
    ///
    /// Copies `count` bytes 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data between host and device.
    ///
    /// Copies `count` bytes 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data between host and device.
    ///
    /// Copies `count` bytes 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data between host and device.
    ///
    /// Copies `count` bytes 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.
    ///
    /// [`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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Copies data between host and device.
    ///
    /// Copies `count` bytes 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.
    ///
    /// [`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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Allocates memory with stream ordered semantics
    ///
    /// Inserts an allocation operation into `hStream`. A pointer to the allocated memory is returned immediately in *dptr. The allocation must not be accessed until the the allocation operation completes. The allocation comes from the memory pool associated with the stream's device.
    ///
    ///
    ///
    /// Note: The default memory pool of a device contains device memory from that device.
    ///
    /// Note: 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.
    ///
    ///
    ///
    ///
    ///
    /// # Return value
    ///
    /// ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorNotSupported, ::cudaErrorOutOfMemory,
    ///
    /// Note: _null_stream
    ///
    /// Note: _init_rt
    ///
    /// Note: _callback
    ///
    ///
    ///
    /// See also: ::cuMemAllocAsync, `::cudaMallocAsync(void**` ptr, size_t size, cudaMemPool_t memPool, cudaStream_t stream)  "cudaMallocAsync (C++ API)", ::cudaMallocFromPoolAsync, ::cudaFreeAsync, ::cudaDeviceSetMemPool, ::cudaDeviceGetDefaultMemPool, ::cudaDeviceGetMemPool, ::cudaMemPoolSetAccess, ::cudaMemPoolSetAttribute, ::cudaMemPoolGetAttribute
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `hStream`: The stream establishing the stream ordering promise.
    pub fn cudaFreeAsync(
        devPtr: *mut ::core::ffi::c_void,
        hStream: cudaStream_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets attributes of a memory pool.
    ///
    /// Supported attributes are.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Gets attributes of a memory pool.
    ///
    /// Supported attributes are:
    ///
    /// The following properties can be also be queried on imported and default pools.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Controls visibility of pools between devices.
    ///
    /// # Parameters
    ///
    /// - `count`: Number of descriptors in the map array.
    pub fn cudaMemPoolSetAccess(
        memPool: cudaMemPool_t,
        descList: *const cudaMemAccessDesc,
        count: size_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the accessibility of a pool from a device.
    ///
    /// Returns the accessibility of the pool’s memory from the specified location.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5). ::cudaMemPoolProps::cudaMemLocation::id is ignored for such pools. Pools created with the type [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) are not IPC capable and [cudaMemPoolProps::handleTypes](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemPoolProps.html#structcudamempoolprops_1a4cf896bffe71384e374c4d2decca9a53) must be 0, any other values will result in [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c). 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) and ::cudaMemPoolProps::cudaMemLocation::id must specify the NUMA ID of the host memory node. Specifying [cudaMemLocationTypeHostNumaCurrent](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0aa3925690e32332c940cb726ef56a4258) as the ::cudaMemPoolProps::cudaMemLocation::type will result in [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c). To create a memory pool targeting a specific device locality domain, applications must set ::cudaMemPoolProps::cudaMemLocation::type to [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b), ::cudaMemPoolProps::cudaMemLocation::localized.deviceId must specify the device ID, and ::cudaMemPoolProps::cudaMemLocation::localized.localityDomainId must specify the locality domain ID. The locality domain ID must be a valid locality domain ID for the specified device. See also [`cudaDeviceGetAttribute`] with the attribute [cudaDevAttrLocalityDomainCount](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cda53544b5a7a807fb2c96f15dda587500d). 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0) or [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5), 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemPoolProps.html#structcudamempoolprops_1a2d90e82afb8d577a2aee847d082e145d). 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 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemPoolProps.html#structcudamempoolprops):cudaMemAllocationType to [`cudaMemAllocationType::cudaMemAllocationTypeManaged`]. ::cudaMemPoolProps::cudaMemAllocationHandleType must also be set to [cudaMemHandleTypeNone](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaabde707dfb8a602b917e0b177f77f365afed45251c1591431e1b9da28c1a04191) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location. [cudaMemPoolProps::maxSize](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemPoolProps.html#structcudamempoolprops_1a2d90e82afb8d577a2aee847d082e145d) must be set to zero for managed memory pools. [cudaMemPoolProps::usage](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaMemPoolProps.html#structcudamempoolprops_1a377241affe79dd0a3c7b40453824bd6b) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad846fd9f2e8ba5e2fb4f1695b7ab6164).
    pub fn cudaMemPoolCreate(
        memPool: *mut cudaMemPool_t,
        poolProps: *const cudaMemPoolProps,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    pub fn cudaMemPoolDestroy(memPool: cudaMemPool_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5), [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0), or [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. [`cudaMemAllocationType::cudaMemAllocationTypeManaged`] can not be used with [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). In all other cases, the call return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c).
    pub fn cudaMemGetDefaultMemPool(
        memPool: *mut cudaMemPool_t,
        location: *mut cudaMemLocation,
        type_: cudaMemAllocationType,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5), [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0), or [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. [`cudaMemAllocationType::cudaMemAllocationTypeManaged`] can not be used with [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). In all other cases, the call return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c)
    ///
    /// 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`].
    pub fn cudaMemGetMemPool(
        memPool: *mut cudaMemPool_t,
        location: *mut cudaMemLocation,
        type_: cudaMemAllocationType,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0ae479b8710f3c5270117ee9d8cf5868d4), [cudaMemLocationTypeHost](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a1ec97ff5f3c715e4b18e39dabf9e31c5) [cudaMemLocationTypeHostNuma](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a24dc63fb938dee27b41e3842da35d2d0), or [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a53b6266fa56e0b7efe6a0b78ed8e8f49) to indicate no preferred location for the managed memory pool. [`cudaMemAllocationType::cudaMemAllocationTypeManaged`] can not be used with [cudaMemLocationTypeDeviceLocalityDomain](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga2279aa08666f329f3ba4afe397fa60f0a88b5d659aa9d7501f0382836eebb125b). In all other cases, the call return [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c)
    ///
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c). The type of memory pool should also match the parameter allocType. Else the call returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c)
    ///
    /// .
    ///
    /// By default, a memory location’s current memory pool is its default memory pool. If the location type is.
    pub fn cudaMemSetMemPool(
        location: *mut cudaMemLocation,
        type_: cudaMemAllocationType,
        memPool: cudaMemPool_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Allocates memory from a specified pool with stream ordered semantics.
    ///
    /// Inserts an allocation operation into `stream`. 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// imports a memory pool from a shared handle.
    ///
    /// Specific allocations can be imported from the imported pool with [`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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `ptr`: pointer to memory being exported.
    pub fn cudaMemPoolExportPointer(
        exportData: *mut cudaMemPoolPtrExportData,
        ptr: *mut ::core::ffi::c_void,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    pub fn cudaMemPoolImportPointer(
        ptr: *mut *mut ::core::ffi::c_void,
        memPool: cudaMemPool_t,
        exportData: *mut cudaMemPoolPtrExportData,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// The [`cudaPointerAttributes`] structure is defined as.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a938c6e8b96ecde62e3ab5137156f739a) if [`cudaDeviceCanAccessPeer`] indicates that the current device cannot directly access memory from `peerDevice`.
    ///
    /// Returns [cudaErrorPeerAccessAlreadyEnabled](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a0bc28e8217afa14b95f907631cb84f33) if direct access of `peerDevice` from the current device has already been enabled.
    ///
    /// Returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if `flags` is not 0.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Disables direct access to memory allocations on a peer device.
    ///
    /// Returns [cudaErrorPeerAccessNotEnabled](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a821b54bce59b87db6efc2ea59a867bf7) if direct access to memory on `peerDevice` has not yet been enabled from the current device.
    ///
    /// # Parameters
    ///
    /// - `peerDevice`: - Peer device to disable direct access to
    pub fn cudaDeviceDisablePeerAccess(peerDevice: ::core::ffi::c_int) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ac4673247aee4d1ab8d07871f376e0273) is returned.
    ///
    /// # Parameters
    ///
    /// - `resource`: - Resource to unregister
    pub fn cudaGraphicsUnregisterResource(
        resource: cudaGraphicsResource_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// If `resource` is presently mapped for access by CUDA then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned. If `flags` is not one of the above values then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ac4673247aee4d1ab8d07871f376e0273) is returned. If any of `resources` are presently mapped for access by CUDA then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ac4673247aee4d1ab8d07871f376e0273) is returned. If any of `resources` are not presently mapped for access by CUDA then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned. If `resource` is not mapped then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned. If `arrayIndex` is not a valid array index for `resource` then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned. If `mipLevel` is not a valid mipmap level for `resource` then [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned. If `resource` is not mapped then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// # 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gabf3ce16a621826a09263b8a58902fee8) 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned. If `resource` is not mapped then [cudaErrorUnknown](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a2e491daacef266c7b3e3c1e140a6133c) is returned.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Get the channel descriptor of an array.
    ///
    /// Returns in `*desc` the channel descriptor of the CUDA array `array`.
    ///
    /// # Parameters
    ///
    /// - `desc`: Channel format.
    /// - `array`: Memory array on device.
    pub fn cudaGetChannelDesc(
        desc: *mut cudaChannelFormatDesc,
        array: cudaArray_const_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a channel descriptor using the specified format
    ///
    /// Returns a channel descriptor with format `f` and number of bits of each component `x`, `y`, `z`, and `w`.  The ::cudaChannelFormatDesc is defined as:
    ///
    ///
    ///
    /// ```text
    ///   struct cudaChannelFormatDesc {
    ///     int x, y, z, w;
    ///     enum cudaChannelFormatKind f;
    ///   };
    /// ```
    ///
    /// where ::cudaChannelFormatKind is one of ::cudaChannelFormatKindSigned, ::cudaChannelFormatKindUnsigned, or ::cudaChannelFormatKindFloat.
    ///
    ///
    ///
    ///
    ///
    /// # Return value
    ///
    /// Channel descriptor with format `f`
    ///
    ///
    ///
    /// See also: `::cudaCreateChannelDesc(void)` "cudaCreateChannelDesc (C++ API)", ::cudaGetChannelDesc, ::cudaCreateTextureObject, ::cudaCreateSurfaceObject
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// The [`cudaTextureDesc`] struct is defined as
    ///
    /// The [`cudaResourceViewDesc`] struct is defined as.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Destroys a texture object.
    ///
    /// Destroys the texture object specified by `texObject`.
    ///
    /// # Parameters
    ///
    /// - `texObject`: - Texture object to destroy
    pub fn cudaDestroyTextureObject(texObject: cudaTextureObject_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a texture object’s resource descriptor.
    ///
    /// Returns the resource descriptor for the texture object specified by `texObject`.
    ///
    /// # Parameters
    ///
    /// - `pResDesc`: Resource descriptor.
    /// - `texObject`: Texture object.
    pub fn cudaGetTextureObjectResourceDesc(
        pResDesc: *mut cudaResourceDesc,
        texObject: cudaTextureObject_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a texture object’s texture descriptor.
    ///
    /// Returns the texture descriptor for the texture object specified by `texObject`.
    ///
    /// # Parameters
    ///
    /// - `pTexDesc`: Texture descriptor.
    /// - `texObject`: Texture object.
    pub fn cudaGetTextureObjectTextureDesc(
        pTexDesc: *mut cudaTextureDesc,
        texObject: cudaTextureObject_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) is returned.
    ///
    /// # Parameters
    ///
    /// - `pResViewDesc`: Resource view descriptor.
    /// - `texObject`: Texture object.
    pub fn cudaGetTextureObjectResourceViewDesc(
        pResViewDesc: *mut cudaResourceViewDesc,
        texObject: cudaTextureObject_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/structcudaResourceDesc.html#structcudaresourcedesc_1aaac8b3bb1d63bd25d8e9af7ee0b9a580) 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.
    ///
    /// # Parameters
    ///
    /// - `pSurfObject`: Surface object to create.
    /// - `pResDesc`: Resource descriptor.
    pub fn cudaCreateSurfaceObject(
        pSurfObject: *mut cudaSurfaceObject_t,
        pResDesc: *const cudaResourceDesc,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Destroys a surface object.
    ///
    /// Destroys the surface object specified by `surfObject`.
    ///
    /// # Parameters
    ///
    /// - `surfObject`: - Surface object to destroy
    pub fn cudaDestroySurfaceObject(surfObject: cudaSurfaceObject_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a surface object’s resource descriptor Returns the resource descriptor for the surface object specified by `surfObject`.
    ///
    /// # Parameters
    ///
    /// - `pResDesc`: Resource descriptor.
    /// - `surfObject`: Surface object.
    pub fn cudaGetSurfaceObjectResourceDesc(
        pResDesc: *mut cudaResourceDesc,
        surfObject: cudaSurfaceObject_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if `driverVersion` is NULL.
    ///
    /// # Parameters
    ///
    /// - `driverVersion`: - Returns the CUDA driver version.
    pub fn cudaDriverGetVersion(driverVersion: *mut ::core::ffi::c_int) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// As of CUDA 13.0, on Windows, the `runtimeVersion` may not be the same as the CUDA Toolkit version the app was built with. Windows will use the CUDA Runtime packaged with the display driver, and that version will be reported.
    ///
    /// This function automatically returns [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if the `runtimeVersion` argument is NULL.
    ///
    /// # 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.
///
/// User parameter provided at registration
///
/// Severity level of the log message
///
/// Error log message being reported
///
/// Length of the message in bytes
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,
    ),
>;
singe_loader::functions! { crate::RUNTIME;
    /// 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Unregister a log message callback.
    ///
    /// # Parameters
    ///
    /// - `callback`: - The callback instance to unregister from receiving log messages
    pub fn cudaLogsUnregisterCallback(callback: cudaLogsCallbackHandle) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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. 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Creates a graph.
    ///
    /// Creates an empty graph, which is returned via `pGraph`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// 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.
    ///
    /// The error [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets a kernel node’s parameters.
    ///
    /// Sets the parameters of kernel node `node` to `pNodeParams`.
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `pNodeParams`: Parameters to copy.
    pub fn cudaGraphKernelNodeSetParams(
        node: cudaGraphNode_t,
        pNodeParams: *const cudaKernelNodeParams,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `hDst`: Destination node.
    /// - `hSrc`: Source node For list of attributes see cudaKernelNodeAttrID.
    pub fn cudaGraphKernelNodeCopyAttributes(
        hDst: cudaGraphNode_t,
        hSrc: cudaGraphNode_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Queries node attribute.
    ///
    /// Queries attribute `attr` from node `hNode` and stores it in corresponding member of `value_out`.
    pub fn cudaGraphKernelNodeGetAttribute(
        hNode: cudaGraphNode_t,
        attr: cudaLaunchAttributeID,
        value_out: *mut cudaLaunchAttributeValue,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets node attribute.
    ///
    /// Sets attribute `attr` on node `hNode` from corresponding attribute of `value`.
    pub fn cudaGraphKernelNodeSetAttribute(
        hNode: cudaGraphNode_t,
        attr: cudaLaunchAttributeID,
        value: *const cudaLaunchAttributeValue,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Creates a memcpy node to copy to a symbol on the device and adds it to a graph.
    ///
    /// Creates a new memcpy node to copy to `symbol` 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 `offset` bytes from the start of symbol `symbol`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`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.
    ///
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Creates a memcpy node to copy from a symbol on the device and adds it to a graph.
    ///
    /// Creates a new memcpy node to copy from `symbol` 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 `offset` bytes from the start of symbol `symbol` to the memory area pointed to by `dst`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`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.
    ///
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga49e2f8c2c0bd6fe264f2fc970912e5cdac88178f29891f2c18fe67361cc80de09).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a memcpy node’s parameters.
    ///
    /// Returns the parameters of memcpy node `node` in `pNodeParams`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets a memcpy node’s parameters.
    ///
    /// Sets the parameters of memcpy node `node` to `pNodeParams`.
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `pNodeParams`: Parameters to copy.
    pub fn cudaGraphMemcpyNodeSetParams(
        node: cudaGraphNode_t,
        pNodeParams: *const cudaMemcpy3DParms,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets a memcpy node’s parameters to copy to a symbol on the device.
    ///
    /// 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 `offset` bytes from the start of symbol `symbol`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`cudaMemcpyKind::cudaMemcpyHostToDevice`], [`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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets a memcpy node’s parameters to copy from a symbol on the device.
    ///
    /// 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 `offset` bytes from the start of symbol `symbol` to the memory area pointed to by `dst`. The memory areas may not overlap. `symbol` is a variable that resides in global or constant memory space. `kind` can be either [`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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a memset node’s parameters.
    ///
    /// Returns the parameters of memset node `node` in `pNodeParams`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets a memset node’s parameters.
    ///
    /// Sets the parameters of memset node `node` to `pNodeParams`.
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `pNodeParams`: Parameters to copy.
    pub fn cudaGraphMemsetNodeSetParams(
        node: cudaGraphNode_t,
        pNodeParams: *const cudaMemsetParams,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a host node’s parameters.
    ///
    /// Returns the parameters of host node `node` in `pNodeParams`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets a host node’s parameters.
    ///
    /// Sets the parameters of host node `node` to `nodeParams`.
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `pNodeParams`: Parameters to copy.
    pub fn cudaGraphHostNodeSetParams(
        node: cudaGraphNode_t,
        pNodeParams: *const cudaHostNodeParams,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the event associated with an event record node.
    ///
    /// Returns the event of event record node `hNode` in `event_out`.
    ///
    /// # Parameters
    ///
    /// - `event_out`: Pointer to return the event.
    pub fn cudaGraphEventRecordNodeGetEvent(
        node: cudaGraphNode_t,
        event_out: *mut cudaEvent_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets an event record node’s event.
    ///
    /// Sets the event of event record node `hNode` to `event`.
    ///
    /// # Parameters
    ///
    /// - `event`: Event to use.
    pub fn cudaGraphEventRecordNodeSetEvent(
        node: cudaGraphNode_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Creates an event wait node and adds it to a graph.
    ///
    /// Creates a new event wait node and adds it to `hGraph` with `numDependencies` dependencies specified via `dependencies` and event specified in `event`. It is possible for `numDependencies` to be 0, in which case the node will be placed at the root of the graph. `dependencies` may not have any duplicate entries. A handle to the new node will be returned in `phGraphNode`.
    ///
    /// The graph node will wait for all work captured in `event`. See ::cuEventRecord() for details on what is captured by an event. 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the event associated with an event wait node.
    ///
    /// Returns the event of event wait node `hNode` in `event_out`.
    ///
    /// # Parameters
    ///
    /// - `event_out`: Pointer to return the event.
    pub fn cudaGraphEventWaitNodeGetEvent(
        node: cudaGraphNode_t,
        event_out: *mut cudaEvent_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets an event wait node’s event.
    ///
    /// Sets the event of event wait node `hNode` to `event`.
    ///
    /// # Parameters
    ///
    /// - `event`: Event to use.
    pub fn cudaGraphEventWaitNodeSetEvent(
        node: cudaGraphNode_t,
        event: cudaEvent_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets an external semaphore signal node’s parameters.
    ///
    /// Sets the parameters of an external semaphore signal node `hNode` to `nodeParams`.
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cudaGraphExternalSemaphoresSignalNodeSetParams(
        hNode: cudaGraphNode_t,
        nodeParams: *const cudaExternalSemaphoreSignalNodeParams,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets an external semaphore wait node’s parameters.
    ///
    /// Sets the parameters of an external semaphore wait node `hNode` to `nodeParams`.
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cudaGraphExternalSemaphoresWaitNodeSetParams(
        hNode: cudaGraphNode_t,
        nodeParams: *const cudaExternalSemaphoreWaitNodeParams,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if the user attempts to free:
    ///
    /// The following restrictions apply to graphs which contain allocation and/or memory free nodes.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a memory free node’s parameters.
    ///
    /// Returns the address of a memory free node `hNode` in `dptr_out`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `device`: - The device for which cached memory should be freed.
    pub fn cudaDeviceGraphMemTrim(device: ::core::ffi::c_int) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Query asynchronous allocation attributes related to graphs.
    ///
    /// Valid attributes are.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Set asynchronous allocation attributes related to graphs.
    ///
    /// Valid attributes are.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `pGraphClone`: Returns newly created cloned graph.
    /// - `originalGraph`: Graph to clone.
    pub fn cudaGraphClone(
        pGraphClone: *mut cudaGraph_t,
        originalGraph: cudaGraph_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a node’s type.
    ///
    /// Returns the node type of `node` in `pType`.
    ///
    /// # Parameters
    ///
    /// - `node`: Node to query.
    /// - `pType`: Pointer to return the node type.
    pub fn cudaGraphNodeGetType(
        node: cudaGraphNode_t,
        pType: *mut cudaGraphNodeType,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    /// - `phGraph`: Pointer to return the containing graph.
    pub fn cudaGraphNodeGetContainingGraph(
        hNode: cudaGraphNode_t,
        phGraph: *mut cudaGraph_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns an id used by tools to identify a given node.
    ///
    /// # Parameters
    ///
    /// - `hNode`: Node to query.
    pub fn cudaGraphNodeGetToolsId(
        hNode: cudaGraphNode_t,
        toolsNodeId: *mut ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the id of a given graph.
    ///
    /// Returns the id of `hGraph` in `*graphId`. The value in `*graphId` matches that referenced by [`cudaGraphDebugDotPrint`].
    ///
    /// # Parameters
    ///
    /// - `hGraph`: Graph to query.
    pub fn cudaGraphGetId(
        hGraph: cudaGraph_t,
        graphID: *mut ::core::ffi::c_uint,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the id of a given graph exec.
    ///
    /// Returns the id of `hGraphExec` in `*graphId`. The value in `*graphId` matches that referenced by [`cudaGraphDebugDotPrint`].
    ///
    /// # Parameters
    ///
    /// - `hGraphExec`: Graph to query.
    pub fn cudaGraphExecGetId(
        hGraphExec: cudaGraphExec_t,
        graphID: *mut ::core::ffi::c_uint,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad484d9d8e8f269cf93d4c111b646f908). If `edgeData` is non-NULL then `from` and `to` must be as well.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad484d9d8e8f269cf93d4c111b646f908). If `edgeData` is non-NULL, then `pDependencies` must be as well.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ad484d9d8e8f269cf93d4c111b646f908). If `edgeData` is non-NULL, then `pDependentNodes` must be as well.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `node`: - Node to remove
    pub fn cudaGraphDestroyNode(node: cudaGraphNode_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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, which configures a graph containing memory allocation nodes to automatically free any unfreed memory allocations before the graph is relaunched.
    ///
    /// - ::cudaGraphInstantiateFlagDeviceLaunch, 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 cannot be used in conjunction with ::cudaGraphInstantiateFlagAutoFreeOnLaunch.
    ///
    /// - ::cudaGraphInstantiateFlagUseNodePriority, 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.
    ///
    /// 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 graph.
    ///
    /// If `graph` is not instantiated for launch on the device but contains kernels which call device-side cudaGraphLaunch() from multiple devices, this will result in an error.
    ///
    ///
    ///
    ///
    ///
    /// # Return value
    ///
    /// ::cudaSuccess, ::cudaErrorInvalidValue
    ///
    /// Note: _graph_thread_safety
    ///
    /// Note: _init_rt
    ///
    /// Note: _callback
    ///
    ///
    ///
    /// See also: ::cudaGraphInstantiateWithFlags, ::cudaGraphCreate, ::cudaGraphUpload, ::cudaGraphLaunch, ::cudaGraphExecDestroy
    ///
    /// # Parameters
    ///
    /// - `pGraphExec`: - Returns instantiated graph
    /// - `graph`: - Graph to instantiate
    /// - `flags`: - Flags to control instantiation.  See ::CUgraphInstantiate_flags.
    pub fn cudaGraphInstantiate(
        pGraphExec: *mut cudaGraphExec_t,
        graph: cudaGraph_t,
        flags: ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `pGraphExec`: Returns instantiated graph.
    /// - `graph`: Graph to instantiate.
    /// - `flags`: Flags to control instantiation. See ::CUgraphInstantiate_flags.
    pub fn cudaGraphInstantiateWithFlags(
        pGraphExec: *mut cudaGraphExec_t,
        graph: cudaGraph_t,
        flags: ::core::ffi::c_ulonglong,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaGraphInstantiateParams.html#structcudagraphinstantiateparams) is defined as:
    ///
    /// The `flags` field controls the behavior of instantiation and subsequent graph launches. Valid flags are:
    ///
    /// 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:
    ///
    /// 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:
    ///
    /// If instantiation is successful, `result_out` will be set to [cudaGraphInstantiateSuccess](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3faefd09000966e3b9d6ca5bcf7b2b9da6b92d94f90110623dafb5fe8081f6f45), and `hErrNode_out` will be set to NULL.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a565872dd74cc9d97125bf43740345238) will not be returned by this API as it does not affect the resulting executable graph.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if the memory operands’ mappings changed or either the original or new memory operands are multidimensional.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets the parameters for a memcpy node in the given graphExec to copy to a symbol on the device.
    ///
    /// 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 `symbol` 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if the memory operands’ mappings changed or the original memory operands are multidimensional.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Sets the parameters for a memcpy node in the given graphExec to copy from a symbol on the device.
    ///
    /// 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.
    ///
    /// `symbol` 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if the memory operands’ mappings changed or the original memory operands are multidimensional.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c) if the memory operands’ mappings changed or the original memory operands are multidimensional.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    ///
    ///
    ///
    ///
    /// # Return value
    ///
    /// ::cudaSuccess, ::cudaErrorGraphExecUpdateFailure,
    ///
    /// Note: _graph_thread_safety
    ///
    /// Note: _init_rt
    ///
    /// Note: _callback
    ///
    ///
    ///
    /// 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Uploads an executable graph in a stream.
    ///
    /// Uploads `graphExec` to the device in `stream` without executing it. Uploads of the same `graphExec` will be serialized. Each upload is ordered behind both any previous work in `stream` and any previous launches of `graphExec`. Uses memory cached by `stream` to back the allocations owned by `graphExec`.
    ///
    /// # Parameters
    ///
    /// - `graphExec`: Executable graph to upload.
    /// - `stream`: Stream in which to upload the graph.
    pub fn cudaGraphUpload(
        graphExec: cudaGraphExec_t,
        stream: cudaStream_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga638577f2b0f6a98b5e6a0e6a72d09004a4258c8d3adc203f97e73e92810e1785f), the launch will fail with [cudaErrorInvalidValue](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Destroys an executable graph.
    ///
    /// Destroys the executable graph specified by `graphExec`.
    ///
    /// # Parameters
    ///
    /// - `graphExec`: - Executable graph to destroy
    pub fn cudaGraphExecDestroy(graphExec: cudaGraphExec_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Destroys a graph.
    ///
    /// Destroys the graph specified by `graph`, as well as all of its nodes.
    ///
    /// # Parameters
    ///
    /// - `graph`: - Graph to destroy
    pub fn cudaGraphDestroy(graph: cudaGraph_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggaf4748f36762263564ca8a7a47fd902bbaca181af9d994c9a5290b509175ea99fe), 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `graph`: The graph to associate the reference with.
    /// - `object`: The user object to retain a reference for.
    /// - `count`: The number of references to add to the graph, typically 1. Must be nonzero and not larger than INT_MAX.
    /// - `flags`: The optional flag [cudaGraphUserObjectMove](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1ggae53f516fc65103fccb14c83184188157a96b13064f28cdb8932c782b94ab5802f) 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `node`: Node to set the parameters for.
    /// - `nodeParams`: Parameters to copy.
    pub fn cudaGraphNodeSetParams(
        node: cudaGraphNode_t,
        nodeParams: *mut cudaGraphNodeParams,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaeb22957eedf779d624069585c25f1d1f) with the following meanings:
    ///
    /// The requested flags can be.
    ///
    /// # 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 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaeb22957eedf779d624069585c25f1d1f) for possible values.
    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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c).
    ///
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaeb22957eedf779d624069585c25f1d1f) with the following meanings:
    ///
    /// The requested flags can be.
    ///
    /// # 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](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gaeb22957eedf779d624069585c25f1d1f) 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// 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`.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Unloads a library.
    ///
    /// Unloads the library specified with `library`.
    ///
    /// # Parameters
    ///
    /// - `library`: - Library to unload
    pub fn cudaLibraryUnload(library: cudaLibrary_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a9d51ecb21a3081d01e078d136c137593).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a global device pointer.
    ///
    /// Returns in `*dptr` and `*bytes` the base pointer and size of the global with name `name` for the requested library `library` and the current device. If no global for the requested name `name` exists, the call returns [cudaErrorSymbolNotFound](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a9d51ecb21a3081d01e078d136c137593). One of the parameters `dptr` or `bytes` (not both) can be NULL in which case it is ignored. The returned `dptr` cannot be passed to the Symbol APIs such as [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaGetSymbolAddress`], or [`cudaGetSymbolSize`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a pointer to managed memory.
    ///
    /// Returns in `*dptr` and `*bytes` the base pointer and size of the managed memory with name `name` for the requested library `library`. If no managed memory with the requested name `name` exists, the call returns [cudaErrorSymbolNotFound](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a9d51ecb21a3081d01e078d136c137593). One of the parameters `dptr` or `bytes` (not both) can be NULL in which case it is ignored. Note that managed memory for library `library` is shared across devices and is registered when the library is loaded. The returned `dptr` cannot be passed to the Symbol APIs such as [`cudaMemcpyToSymbol`], [`cudaMemcpyFromSymbol`], [`cudaGetSymbolAddress`], or [`cudaGetSymbolSize`].
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns a pointer to a unified function.
    ///
    /// Returns in `*fptr` the function pointer to a unified function denoted by `symbol`. If no unified function with name `symbol` exists, the call returns [cudaErrorSymbolNotFound](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a9d51ecb21a3081d01e078d136c137593). If there is no device with attribute [cudaDeviceProp::unifiedFunctionPointers](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaDeviceProp.html#structcudadeviceprop_1a9f94309e6d30a640821cc9de9591e565) present in the system, the call may return [cudaErrorSymbolNotFound](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a9d51ecb21a3081d01e078d136c137593).
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Returns the number of kernels within a library.
    ///
    /// Returns in `count` the number of kernels in `lib`.
    ///
    /// # Parameters
    ///
    /// - `count`: Number of kernels found within the library.
    /// - `lib`: Library to query.
    pub fn cudaLibraryGetKernelCount(
        count: *mut ::core::ffi::c_uint,
        lib: cudaLibrary_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038ae355f04607d824883b4a50662830d591) 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a3e8aef5398ee38e28ed41e357b48917c))
    ///
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `device`: Device to get resource for.
    /// - `resource`: Output pointer to a [cudaDevResource](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaDevResource.html#structcudadevresource) structure.
    /// - `type_`: Type of resource to retrieve.
    pub fn cudaDeviceGetDevResource(
        device: ::core::ffi::c_int,
        resource: *mut cudaDevResource,
        type_: cudaDevResourceType,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Splits [`cudaDevResourceType::cudaDevResourceTypeSm`] resources.
    ///
    /// Splits [`cudaDevResourceType::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:
    ///
    /// A successful API call must either have:
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Splits a [`cudaDevResourceType::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:
    ///
    /// **Example params and their effect:**
    ///
    /// A groupParams array element is defined in the following order:
    ///
    /// The difference between a catch-all param group as the last entry and the remainder is in two aspects:
    ///
    /// 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.
    ///
    /// # 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 [`cudaDevResourceType::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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038adac625035f38851dbb8e21a4b556c141) with the exception of the following APIs:
    ///
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `ctx`: - Execution context to destroy (required parameter, see note below)
    pub fn cudaExecutionCtxDestroy(ctx: cudaExecutionContext_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// Get context resources.
    ///
    /// Get the `type` resources available to context represented by `ctx`.
    ///
    /// Note: The API is not supported on 32-bit platforms.
    ///
    /// # Parameters
    ///
    /// - `ctx`: Execution context to get resource for (required parameter, see note below).
    /// - `resource`: Output pointer to a [cudaDevResource](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaDevResource.html#structcudadevresource) structure.
    /// - `type_`: Type of resource to retrieve.
    pub fn cudaExecutionCtxGetDevResource(
        ctx: cudaExecutionContext_t,
        resource: *mut cudaDevResource,
        type_: cudaDevResourceType,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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:
    ///
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # Parameters
    ///
    /// - `ctx`: - Execution context to synchronize (required parameter, see note below)
    pub fn cudaExecutionCtxSynchronize(ctx: cudaExecutionContext_t) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.4.2/cuda-runtime-api/cuda_runtime_api/group__CUDART__TYPES.html#group__cudart__types_1gga3f51e3575c2178246db0a94a430e0038a4954cdb4893fda9f1a30251a018c32fe) is `type` is [`cudaDevResourceType::cudaDevResourceTypeWorkqueueConfig`] or [`cudaDevResourceType::cudaDevResourceTypeWorkqueue`].
    ///
    /// # Parameters
    ///
    /// - `hStream`: Stream to get resource for.
    /// - `resource`: Output pointer to a [cudaDevResource](https://docs.nvidia.com/cuda/archive/13.4.2/cuda-runtime-api/cuda_runtime_api/structcudaDevResource.html#structcudadevresource) structure.
    /// - `type_`: Type of resource to retrieve.
    pub fn cudaStreamGetDevResource(
        hStream: cudaStream_t,
        resource: *mut cudaDevResource,
        type_: cudaDevResourceType,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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.
    ///
    /// # 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// impl_private
    pub fn cudaGetExportTable(
        ppExportTable: *mut *const ::core::ffi::c_void,
        pExportTableId: *const cudaUUID_t,
    ) -> cudaError_t;
}
singe_loader::functions! { crate::RUNTIME;
    /// 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;
}
singe_loader::functions! { crate::RUNTIME;
    /// Get pointer to device kernel that matches entry function `entryFuncAddr`.
    ///
    /// Returns in `kernelPtr` the device kernel corresponding to the entry function `entryFuncAddr`.
    ///
    /// Note that it is possible that there are multiple symbols belonging to different translation units with the same `entryFuncAddr` registered with this CUDA Runtime and so the order which the translation units are loaded and registered with the CUDA Runtime can lead to differing return pointers in `kernelPtr`. Suggested methods of ensuring uniqueness are to limit visibility of **global** device functions by using static or hidden visibility attribute in the respective translation units.
    ///
    /// # Parameters
    ///
    /// - `kernelPtr`: Returns the device kernel.
    /// - `entryFuncAddr`: Address of device entry function to search kernel for.
    pub fn cudaGetKernel(
        kernelPtr: *mut cudaKernel_t,
        entryFuncAddr: *const ::core::ffi::c_void,
    ) -> cudaError_t;
}