hrx-rs 0.8.13

Owned native AMD GPU and NPU execution with Loom compilation
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
/* automatically generated by rust-bindgen 0.73.2 */

pub const LOOMC_STATUS_FEATURE_SOURCE_LOCATION: u32 = 1;
pub const LOOMC_STATUS_FEATURE_ANNOTATIONS: u32 = 2;
pub const LOOMC_STATUS_FEATURE_STACK_TRACE: u32 = 4;
pub const LOOMC_STATUS_MODE: u32 = 3;
pub const LOOMC_STATUS_FEATURES: u32 = 7;
pub const LOOMC_ARTIFACT_FORMAT_LOOM_TEXT: &[u8; 10] = b"loom-text\0";
pub const LOOMC_ARTIFACT_FORMAT_LOOM_BYTECODE: &[u8; 7] = b"loombc\0";
pub const LOOMC_ARTIFACT_FORMAT_JSON: &[u8; 5] = b"json\0";
pub const LOOMC_ARTIFACT_FORMAT_ARTIFACT_MANIFEST_JSON: &[u8; 28] =
    b"loom-artifact-manifest-json\0";
pub const LOOMC_REQUIREMENT_ORDINAL_INVALID: u32 = 4294967295;
pub const LOOMC_REQUEST_ROOT_ORDINAL_INVALID: u32 = 4294967295;
pub const LOOMC_ARTIFACT_FORMAT_COMPILE_REPORT_JSON: &[u8; 25] = b"loom-compile-report-json\0";
pub const LOOMC_EMIT_OPTION_KEY_IDENTIFIER: &[u8; 16] = b"emit.identifier\0";
pub const LOOMC_EMIT_OPTION_KEY_ARTIFACT_MANIFEST_MODE: &[u8; 28] =
    b"emit.artifact_manifest.mode\0";
pub const LOOMC_EMIT_OPTION_KEY_ARTIFACT_MANIFEST_IDENTIFIER: &[u8; 34] =
    b"emit.artifact_manifest.identifier\0";
pub const LOOMC_EMIT_OPTION_KEY_COMPILE_REPORT_MODE: &[u8; 25] = b"emit.compile_report.mode\0";
pub const LOOMC_EMIT_OPTION_KEY_COMPILE_REPORT_IDENTIFIER: &[u8; 31] =
    b"emit.compile_report.identifier\0";
pub const LOOMC_ARTIFACT_FORMAT_LINK_DEPENDENCY_REPORT_JSON: &[u8; 33] =
    b"loom-link-dependency-report-json\0";
pub const LOOMC_ARTIFACT_FORMAT_AMDGPU_HSACO: &[u8; 13] = b"amdgpu-hsaco\0";
pub const LOOMC_ARTIFACT_FORMAT_XDNA: &[u8; 5] = b"xdna\0";
#[doc = " Host allocation and container size type.\n\n Values have the same range as C `size_t`. Public ABI fields use this\n spelling so bindings can mirror one Loom-specific type name rather than\n repeating the C standard library type across the API."]
pub type loomc_host_size_t = usize;
#[repr(C)]
#[derive(Debug)]
pub struct iree_status_handle_t {
    _unused: [u8; 0],
}
#[doc = " Opaque status handle.\n\n Small status codes are encoded directly in the pointer value. Rich status\n modes may allocate storage behind the handle and require\n `loomc_status_free` or `loomc_status_consume_code`."]
pub type loomc_status_t = *mut iree_status_handle_t;
#[doc = " Non-owning string view over bytes that need not be NUL-terminated.\n\n @lifetime\n A string view never owns `data`. The API receiving the view documents\n whether it copies the bytes or how long the caller must keep the bytes\n alive."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_string_view_t {
    #[doc = " First byte of the string, or `NULL` when the view is empty."]
    pub data: *const ::std::os::raw::c_char,
    #[doc = " Number of bytes in `data`."]
    pub size: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_string_view_t"][::std::mem::size_of::<loomc_string_view_t>() - 16usize];
    ["Alignment of loomc_string_view_t"][::std::mem::align_of::<loomc_string_view_t>() - 8usize];
    ["Offset of field: loomc_string_view_t::data"]
        [::std::mem::offset_of!(loomc_string_view_t, data) - 0usize];
    ["Offset of field: loomc_string_view_t::size"]
        [::std::mem::offset_of!(loomc_string_view_t, size) - 8usize];
};
impl Default for loomc_string_view_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Non-owning view over immutable bytes.\n\n @lifetime\n A byte span never owns `data`. The API receiving the span documents whether\n it copies the bytes or how long the caller must keep the bytes alive."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_byte_span_t {
    #[doc = " First byte of the span, or `NULL` when the span is empty."]
    pub data: *const u8,
    #[doc = " Number of bytes in `data`."]
    pub data_length: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_byte_span_t"][::std::mem::size_of::<loomc_byte_span_t>() - 16usize];
    ["Alignment of loomc_byte_span_t"][::std::mem::align_of::<loomc_byte_span_t>() - 8usize];
    ["Offset of field: loomc_byte_span_t::data"]
        [::std::mem::offset_of!(loomc_byte_span_t, data) - 0usize];
    ["Offset of field: loomc_byte_span_t::data_length"]
        [::std::mem::offset_of!(loomc_byte_span_t, data_length) - 8usize];
};
impl Default for loomc_byte_span_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " No structure type was supplied."]
pub const LOOMC_STRUCTURE_TYPE_NONE: loomc_structure_type_e = 0;
#[doc = " `loomc_source_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_SOURCE_OPTIONS: loomc_structure_type_e = 1;
#[doc = " `loomc_workspace_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_WORKSPACE_OPTIONS: loomc_structure_type_e = 2;
#[doc = " `loomc_context_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_CONTEXT_OPTIONS: loomc_structure_type_e = 3;
#[doc = " `loomc_link_index_builder_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_LINK_INDEX_BUILDER_OPTIONS: loomc_structure_type_e = 4;
#[doc = " `loomc_linker_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_LINKER_OPTIONS: loomc_structure_type_e = 5;
#[doc = " `loomc_link_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_LINK_OPTIONS: loomc_structure_type_e = 6;
#[doc = " `loomc_module_serialize_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_MODULE_SERIALIZE_OPTIONS: loomc_structure_type_e = 7;
#[doc = " `loomc_module_deserialize_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_MODULE_DESERIALIZE_OPTIONS: loomc_structure_type_e = 8;
#[doc = " `loomc_compiler_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_COMPILER_OPTIONS: loomc_structure_type_e = 9;
#[doc = " `loomc_compile_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_COMPILE_OPTIONS: loomc_structure_type_e = 10;
#[doc = " `loomc_pass_program_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_PASS_PROGRAM_OPTIONS: loomc_structure_type_e = 11;
#[doc = " `loomc_context_target_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_CONTEXT_TARGET_OPTIONS: loomc_structure_type_e = 12;
#[doc = " `loomc_target_pipeline_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_TARGET_PIPELINE_OPTIONS: loomc_structure_type_e = 13;
#[doc = " `loomc_spirv_emit_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_SPIRV_EMIT_OPTIONS: loomc_structure_type_e = 14;
#[doc = " `loomc_target_specialization_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_TARGET_SPECIALIZATION_OPTIONS: loomc_structure_type_e = 16;
#[doc = " `loomc_spirv_profile_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_SPIRV_PROFILE_OPTIONS: loomc_structure_type_e = 17;
#[doc = " `loomc_emit_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_EMIT_OPTIONS: loomc_structure_type_e = 18;
#[doc = " `loomc_option_dict_t`."]
pub const LOOMC_STRUCTURE_TYPE_OPTION_DICT: loomc_structure_type_e = 19;
#[doc = " `loomc_spirv_vulkaninfo_profile_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_SPIRV_VULKANINFO_PROFILE_OPTIONS: loomc_structure_type_e = 20;
#[doc = " `loomc_source_load_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_SOURCE_LOAD_OPTIONS: loomc_structure_type_e = 21;
#[doc = " `loomc_spirv_vulkan_function_table_t`."]
pub const LOOMC_STRUCTURE_TYPE_SPIRV_VULKAN_FUNCTION_TABLE: loomc_structure_type_e = 22;
#[doc = " `loomc_spirv_vulkan_profile_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_SPIRV_VULKAN_PROFILE_OPTIONS: loomc_structure_type_e = 23;
#[doc = " `loomc_iree_hal_profile_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_IREE_HAL_PROFILE_OPTIONS: loomc_structure_type_e = 24;
#[doc = " `loomc_spirv_iree_hal_profile_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_SPIRV_IREE_HAL_PROFILE_OPTIONS: loomc_structure_type_e = 25;
#[doc = " `loomc_module_function_query_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_MODULE_FUNCTION_QUERY_OPTIONS: loomc_structure_type_e = 26;
#[doc = " `loomc_module_global_query_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_MODULE_GLOBAL_QUERY_OPTIONS: loomc_structure_type_e = 27;
#[doc = " `loomc_amdgpu_profile_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_AMDGPU_PROFILE_OPTIONS: loomc_structure_type_e = 28;
#[doc = " `loomc_amdgpu_emit_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_AMDGPU_EMIT_OPTIONS: loomc_structure_type_e = 29;
#[doc = " `loomc_artifact_manifest_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_ARTIFACT_MANIFEST_OPTIONS: loomc_structure_type_e = 30;
#[doc = " `loomc_compile_report_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_COMPILE_REPORT_OPTIONS: loomc_structure_type_e = 31;
#[doc = " `loomc_sanitizer_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_SANITIZER_OPTIONS: loomc_structure_type_e = 32;
#[doc = " `loomc_launch_config_t`."]
pub const LOOMC_STRUCTURE_TYPE_LAUNCH_CONFIG: loomc_structure_type_e = 34;
#[doc = " `loomc_amdgpu_iree_hal_profile_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_AMDGPU_IREE_HAL_PROFILE_OPTIONS: loomc_structure_type_e = 35;
#[doc = " `loomc_link_dependency_analysis_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_LINK_DEPENDENCY_ANALYSIS_OPTIONS: loomc_structure_type_e = 36;
#[doc = " `loomc_cmd_program_product_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_CMD_PROGRAM_PRODUCT_OPTIONS: loomc_structure_type_e = 37;
#[doc = " `loomc_link_request_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_LINK_REQUEST_OPTIONS: loomc_structure_type_e = 38;
#[doc = " `loomc_cmd_program_request_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_CMD_PROGRAM_REQUEST_OPTIONS: loomc_structure_type_e = 39;
#[doc = " `loomc_task_pool_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_TASK_POOL_OPTIONS: loomc_structure_type_e = 40;
#[doc = " `loomc_cxx_import_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_CXX_IMPORT_OPTIONS: loomc_structure_type_e = 41;
#[doc = " `loomc_amdgpu_profile_execution_options_t`."]
pub const LOOMC_STRUCTURE_TYPE_AMDGPU_PROFILE_EXECUTION_OPTIONS: loomc_structure_type_e = 42;
#[doc = " Structure type values used by extensible public descriptors.\n\n Extensible descriptors store one of these values in their `type` field and\n store `sizeof(descriptor_type)` in `structure_size`. Callers zero-initialize\n descriptors and set the fields they use."]
pub type loomc_structure_type_e = ::std::os::raw::c_uint;
#[doc = " Structure type values used by extensible public descriptors.\n\n Extensible descriptors store one of these values in their `type` field and\n store `sizeof(descriptor_type)` in `structure_size`. Callers zero-initialize\n descriptors and set the fields they use."]
pub use self::loomc_structure_type_e as loomc_structure_type_t;
#[doc = " Controls the behavior of a `loomc_allocator_ctl_fn_t` callback."]
pub type loomc_allocator_command_t = u32;
#[doc = " Allocates memory without requiring zero initialization."]
pub const LOOMC_ALLOCATOR_COMMAND_MALLOC: _bindgen_ty_1 = 0;
#[doc = " Allocates memory and zeros it before returning."]
pub const LOOMC_ALLOCATOR_COMMAND_CALLOC: _bindgen_ty_1 = 1;
#[doc = " Resizes an existing allocation."]
pub const LOOMC_ALLOCATOR_COMMAND_REALLOC: _bindgen_ty_1 = 2;
#[doc = " Frees an existing allocation."]
pub const LOOMC_ALLOCATOR_COMMAND_FREE: _bindgen_ty_1 = 3;
pub type _bindgen_ty_1 = ::std::os::raw::c_uint;
#[doc = " Host allocation control callback.\n\n @param self Callback-owned allocator state pointer.\n @param command Allocation command to perform.\n @param params Command-specific parameter structure.\n @param inout_ptr Pointer to allocation storage. Allocation commands write\n the allocated pointer. Free commands read the pointer to free.\n @return OK on success or a non-OK status when the allocator cannot satisfy\n the command.\n\n @ownership\n Memory returned by an allocator must be freed through the same allocator."]
pub type loomc_allocator_ctl_fn_t = ::std::option::Option<
    unsafe extern "C" fn(
        self_: *mut ::std::os::raw::c_void,
        command: loomc_allocator_command_t,
        params: *const ::std::os::raw::c_void,
        inout_ptr: *mut *mut ::std::os::raw::c_void,
    ) -> loomc_status_t,
>;
#[doc = " Host allocator used for persistent Loom object storage.\n\n APIs that take an allocator require `ctl` to be non-NULL. Callers that want\n the process heap must pass `loomc_allocator_system()` explicitly."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_allocator_t {
    #[doc = " Callback-owned state pointer."]
    pub self_: *mut ::std::os::raw::c_void,
    #[doc = " Callback implementing allocation commands."]
    pub ctl: loomc_allocator_ctl_fn_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_allocator_t"][::std::mem::size_of::<loomc_allocator_t>() - 16usize];
    ["Alignment of loomc_allocator_t"][::std::mem::align_of::<loomc_allocator_t>() - 8usize];
    ["Offset of field: loomc_allocator_t::self_"]
        [::std::mem::offset_of!(loomc_allocator_t, self_) - 0usize];
    ["Offset of field: loomc_allocator_t::ctl"]
        [::std::mem::offset_of!(loomc_allocator_t, ctl) - 8usize];
};
impl Default for loomc_allocator_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Immutable logical sequence of bytes stored in one or more segments.\n\n A sequence has constant contents and length. Retained handles may be shared\n across threads and enumerated concurrently."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_byte_sequence_t {
    _unused: [u8; 0],
}
#[doc = " Immutable source handle.\n\n @thread_safety\n Sources are immutable after creation. Retained source handles may be shared\n across threads."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_source_t {
    _unused: [u8; 0],
}
#[doc = " Source format is unknown and must be inferred by the consumer."]
pub const LOOMC_SOURCE_FORMAT_UNKNOWN: loomc_source_format_e = 0;
#[doc = " Textual `.loom` source."]
pub const LOOMC_SOURCE_FORMAT_TEXT: loomc_source_format_e = 1;
#[doc = " Binary `.loombc` source."]
pub const LOOMC_SOURCE_FORMAT_BYTECODE: loomc_source_format_e = 2;
#[doc = " Source byte format."]
pub type loomc_source_format_e = ::std::os::raw::c_uint;
#[doc = " Source byte format."]
pub use self::loomc_source_format_e as loomc_source_format_t;
#[doc = " Source bytes are borrowed from the caller for the lifetime of the source."]
pub const LOOMC_SOURCE_STORAGE_BORROWED: loomc_source_storage_e = 0;
#[doc = " Source bytes are copied into storage owned by the source."]
pub const LOOMC_SOURCE_STORAGE_COPY: loomc_source_storage_e = 1;
#[doc = " Source bytes are owned externally and released by a caller callback."]
pub const LOOMC_SOURCE_STORAGE_EXTERNAL: loomc_source_storage_e = 2;
#[doc = " Storage policy for source bytes."]
pub type loomc_source_storage_e = ::std::os::raw::c_uint;
#[doc = " Storage policy for source bytes."]
pub use self::loomc_source_storage_e as loomc_source_storage_t;
#[doc = " Callback used to release externally owned source bytes.\n\n @param user_data Caller-provided value from `loomc_source_options_t`.\n @param contents Source bytes being released.\n\n @thread_safety\n The callback is invoked when the last source reference is released. Callers\n that share sources across threads must make the callback safe for whichever\n thread drops the final reference."]
pub type loomc_source_release_fn_t = ::std::option::Option<
    unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void, contents: loomc_byte_span_t),
>;
#[doc = " Source creation options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_SOURCE_OPTIONS`, set `structure_size` to\n `sizeof(loomc_source_options_t)`, and fill the requested fields."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_source_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_SOURCE_OPTIONS` when\n nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for future source options."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Input source format."]
    pub format: loomc_source_format_t,
    #[doc = " Stable identifier used in diagnostics and provider labels."]
    pub identifier: loomc_string_view_t,
    #[doc = " Input bytes."]
    pub contents: loomc_byte_span_t,
    #[doc = " Storage policy for `contents`."]
    pub storage: loomc_source_storage_t,
    #[doc = " Callback used when `storage` is `LOOMC_SOURCE_STORAGE_EXTERNAL`."]
    pub release: loomc_source_release_fn_t,
    #[doc = " User data passed to `release`."]
    pub release_user_data: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_source_options_t"][::std::mem::size_of::<loomc_source_options_t>() - 88usize];
    ["Alignment of loomc_source_options_t"]
        [::std::mem::align_of::<loomc_source_options_t>() - 8usize];
    ["Offset of field: loomc_source_options_t::type_"]
        [::std::mem::offset_of!(loomc_source_options_t, type_) - 0usize];
    ["Offset of field: loomc_source_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_source_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_source_options_t::next"]
        [::std::mem::offset_of!(loomc_source_options_t, next) - 16usize];
    ["Offset of field: loomc_source_options_t::format"]
        [::std::mem::offset_of!(loomc_source_options_t, format) - 24usize];
    ["Offset of field: loomc_source_options_t::identifier"]
        [::std::mem::offset_of!(loomc_source_options_t, identifier) - 32usize];
    ["Offset of field: loomc_source_options_t::contents"]
        [::std::mem::offset_of!(loomc_source_options_t, contents) - 48usize];
    ["Offset of field: loomc_source_options_t::storage"]
        [::std::mem::offset_of!(loomc_source_options_t, storage) - 64usize];
    ["Offset of field: loomc_source_options_t::release"]
        [::std::mem::offset_of!(loomc_source_options_t, release) - 72usize];
    ["Offset of field: loomc_source_options_t::release_user_data"]
        [::std::mem::offset_of!(loomc_source_options_t, release_user_data) - 80usize];
};
impl Default for loomc_source_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Executable or loadable binary artifact."]
pub const LOOMC_ARTIFACT_KIND_EXECUTABLE: loomc_artifact_kind_e = 0;
#[doc = " Human-readable textual artifact."]
pub const LOOMC_ARTIFACT_KIND_TEXT: loomc_artifact_kind_e = 1;
#[doc = " Machine-readable report artifact."]
pub const LOOMC_ARTIFACT_KIND_REPORT: loomc_artifact_kind_e = 2;
#[doc = " Loom module artifact. The format indicates text or bytecode."]
pub const LOOMC_ARTIFACT_KIND_MODULE: loomc_artifact_kind_e = 3;
#[doc = " Compiled kernel launch-configuration program."]
pub const LOOMC_ARTIFACT_KIND_LAUNCH_CONFIG: loomc_artifact_kind_e = 4;
#[doc = " Artifact category."]
pub type loomc_artifact_kind_e = ::std::os::raw::c_uint;
#[doc = " Artifact category."]
pub use self::loomc_artifact_kind_e as loomc_artifact_kind_t;
#[doc = " Borrowed artifact view owned by a producer-specific result or product.\n\n @lifetime\n Artifact strings and the contents reference are owned by the\n operation-specific object that returned this view. They remain valid until\n that owner is released. Callers retaining contents independently use\n `loomc_byte_sequence_retain`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_artifact_t {
    #[doc = " Artifact kind."]
    pub kind: loomc_artifact_kind_t,
    #[doc = " Stable format string, such as `amdgpu-hsaco`, `spirv`,\n `LOOMC_ARTIFACT_FORMAT_LOOM_TEXT`, or `LOOMC_ARTIFACT_FORMAT_JSON`."]
    pub format: loomc_string_view_t,
    #[doc = " Human-readable artifact identifier."]
    pub identifier: loomc_string_view_t,
    #[doc = " Immutable artifact bytes. Valid artifacts always provide a non-NULL\n sequence, including for empty contents."]
    pub contents: *mut loomc_byte_sequence_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_artifact_t"][::std::mem::size_of::<loomc_artifact_t>() - 48usize];
    ["Alignment of loomc_artifact_t"][::std::mem::align_of::<loomc_artifact_t>() - 8usize];
    ["Offset of field: loomc_artifact_t::kind"]
        [::std::mem::offset_of!(loomc_artifact_t, kind) - 0usize];
    ["Offset of field: loomc_artifact_t::format"]
        [::std::mem::offset_of!(loomc_artifact_t, format) - 8usize];
    ["Offset of field: loomc_artifact_t::identifier"]
        [::std::mem::offset_of!(loomc_artifact_t, identifier) - 24usize];
    ["Offset of field: loomc_artifact_t::contents"]
        [::std::mem::offset_of!(loomc_artifact_t, contents) - 40usize];
};
impl Default for loomc_artifact_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Does not request an artifact manifest."]
pub const LOOMC_ARTIFACT_MANIFEST_MODE_NONE: loomc_artifact_manifest_mode_e = 0;
#[doc = " Requests stable artifact, target, function, global, and summary ABI facts."]
pub const LOOMC_ARTIFACT_MANIFEST_MODE_SUMMARY: loomc_artifact_manifest_mode_e = 1;
#[doc = " Requests summary facts plus detail arrays such as function parameters."]
pub const LOOMC_ARTIFACT_MANIFEST_MODE_DETAILS: loomc_artifact_manifest_mode_e = 2;
#[doc = " Requests artifact-bound analysis facts when available."]
pub const LOOMC_ARTIFACT_MANIFEST_MODE_ANALYSIS: loomc_artifact_manifest_mode_e = 3;
#[doc = " Artifact manifest detail mode."]
pub type loomc_artifact_manifest_mode_e = ::std::os::raw::c_uint;
#[doc = " Artifact manifest detail mode."]
pub use self::loomc_artifact_manifest_mode_e as loomc_artifact_manifest_mode_t;
#[doc = " Artifact manifest emission options.\n\n Attach this descriptor through `loomc_emit_options_t::next`. The descriptor\n controls sidecar manifest production for the emitted target artifact. It\n does not compile source, run passes, or write filesystem paths."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_artifact_manifest_options_t {
    #[doc = " Structure type. Must be\n `LOOMC_STRUCTURE_TYPE_ARTIFACT_MANIFEST_OPTIONS` when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Next invocation option extension."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Selected manifest detail mode."]
    pub mode: loomc_artifact_manifest_mode_t,
    #[doc = " Result artifact identifier for the manifest JSON. Empty derives from the\n emitted artifact identifier by appending `.manifest.json`."]
    pub identifier: loomc_string_view_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_artifact_manifest_options_t"]
        [::std::mem::size_of::<loomc_artifact_manifest_options_t>() - 48usize];
    ["Alignment of loomc_artifact_manifest_options_t"]
        [::std::mem::align_of::<loomc_artifact_manifest_options_t>() - 8usize];
    ["Offset of field: loomc_artifact_manifest_options_t::type_"]
        [::std::mem::offset_of!(loomc_artifact_manifest_options_t, type_) - 0usize];
    ["Offset of field: loomc_artifact_manifest_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_artifact_manifest_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_artifact_manifest_options_t::next"]
        [::std::mem::offset_of!(loomc_artifact_manifest_options_t, next) - 16usize];
    ["Offset of field: loomc_artifact_manifest_options_t::mode"]
        [::std::mem::offset_of!(loomc_artifact_manifest_options_t, mode) - 24usize];
    ["Offset of field: loomc_artifact_manifest_options_t::identifier"]
        [::std::mem::offset_of!(loomc_artifact_manifest_options_t, identifier) - 32usize];
};
impl Default for loomc_artifact_manifest_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Single configuration key/value binding.\n\n @lifetime\n Binding strings are borrowed by the descriptor that contains them unless an\n operation explicitly documents that it copies the bindings."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_config_binding_t {
    #[doc = " Config key, with a leading `@` accepted by normalization."]
    pub key: loomc_string_view_t,
    #[doc = " Config value spelling."]
    pub value: loomc_string_view_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_config_binding_t"][::std::mem::size_of::<loomc_config_binding_t>() - 32usize];
    ["Alignment of loomc_config_binding_t"]
        [::std::mem::align_of::<loomc_config_binding_t>() - 8usize];
    ["Offset of field: loomc_config_binding_t::key"]
        [::std::mem::offset_of!(loomc_config_binding_t, key) - 0usize];
    ["Offset of field: loomc_config_binding_t::value"]
        [::std::mem::offset_of!(loomc_config_binding_t, value) - 16usize];
};
impl Default for loomc_config_binding_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Require all final operation config values to be resolved."]
pub const LOOMC_CONFIG_POLICY_FLAG_REQUIRE_RESOLVED: loomc_config_policy_flag_bits_e = 1;
#[doc = " Configuration validation and resolution policy bit values."]
pub type loomc_config_policy_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Bitmask of `loomc_config_policy_flag_bits_t` values."]
pub type loomc_config_policy_flags_t = u32;
#[doc = " Text configuration options attached to a link or command-product operation.\n\n The plain binding array and optional JSON/JSONC object string normalize into\n the same key/value binding set. When both spellings define the same key, the\n explicit `bindings` entry overrides the JSON object entry.\n\n @lifetime\n All views and arrays are borrowed for the duration of the API call unless\n the consuming operation explicitly documents a longer copy."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_config_options_t {
    #[doc = " Plain key/value bindings."]
    pub bindings: *const loomc_config_binding_t,
    #[doc = " Number of entries in `bindings`."]
    pub binding_count: loomc_host_size_t,
    #[doc = " Optional JSON/JSONC object string normalized into the same binding set."]
    pub json_object: loomc_string_view_t,
    #[doc = " Config validation and resolution policy flags."]
    pub flags: loomc_config_policy_flags_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_config_options_t"][::std::mem::size_of::<loomc_config_options_t>() - 40usize];
    ["Alignment of loomc_config_options_t"]
        [::std::mem::align_of::<loomc_config_options_t>() - 8usize];
    ["Offset of field: loomc_config_options_t::bindings"]
        [::std::mem::offset_of!(loomc_config_options_t, bindings) - 0usize];
    ["Offset of field: loomc_config_options_t::binding_count"]
        [::std::mem::offset_of!(loomc_config_options_t, binding_count) - 8usize];
    ["Offset of field: loomc_config_options_t::json_object"]
        [::std::mem::offset_of!(loomc_config_options_t, json_object) - 16usize];
    ["Offset of field: loomc_config_options_t::flags"]
        [::std::mem::offset_of!(loomc_config_options_t, flags) - 32usize];
};
impl Default for loomc_config_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Immutable Loom API context.\n\n @thread_safety\n Contexts are immutable after creation and may be shared across threads.\n Operations that need mutable source-location tables serialize that mutation\n through their owning builder or invocation object rather than exposing it on\n the context API."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_context_t {
    _unused: [u8; 0],
}
#[doc = " Context creation options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_CONTEXT_OPTIONS`, set `structure_size` to\n `sizeof(loomc_context_options_t)`, and fill the requested fields."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_context_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_CONTEXT_OPTIONS` when\n nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for context options such as\n `loomc_context_target_options_t`."]
    pub next: *const ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_context_options_t"][::std::mem::size_of::<loomc_context_options_t>() - 24usize];
    ["Alignment of loomc_context_options_t"]
        [::std::mem::align_of::<loomc_context_options_t>() - 8usize];
    ["Offset of field: loomc_context_options_t::type_"]
        [::std::mem::offset_of!(loomc_context_options_t, type_) - 0usize];
    ["Offset of field: loomc_context_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_context_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_context_options_t::next"]
        [::std::mem::offset_of!(loomc_context_options_t, next) - 16usize];
};
impl Default for loomc_context_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Informational note."]
pub const LOOMC_DIAGNOSTIC_SEVERITY_NOTE: loomc_diagnostic_severity_e = 0;
#[doc = " Warning that does not make the operation fail."]
pub const LOOMC_DIAGNOSTIC_SEVERITY_WARNING: loomc_diagnostic_severity_e = 1;
#[doc = " Error that makes the operation fail."]
pub const LOOMC_DIAGNOSTIC_SEVERITY_ERROR: loomc_diagnostic_severity_e = 2;
#[doc = " Diagnostic severity."]
pub type loomc_diagnostic_severity_e = ::std::os::raw::c_uint;
#[doc = " Diagnostic severity."]
pub use self::loomc_diagnostic_severity_e as loomc_diagnostic_severity_t;
#[doc = " Source range attached to a diagnostic.\n\n Byte offsets are zero-based and line/column values are one-based when\n available. A zero line or column means the location was not computed or is\n not meaningful for the source format. A source can retain its identifier\n without contents; recorded line/column values remain valid in that case.\n Unknown byte offsets are zero.\n\n @lifetime\n The source pointer is retained by the owning result when present. The range\n view remains valid until that result is released."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_source_range_t {
    #[doc = " Source identity with optional contents, or NULL for an unknown source."]
    pub source: *const loomc_source_t,
    #[doc = " First byte in source contents covered by the range."]
    pub start: loomc_host_size_t,
    #[doc = " One-past-last byte in source contents covered by the range."]
    pub end: loomc_host_size_t,
    #[doc = " One-based starting line, or zero when unavailable."]
    pub start_line: u32,
    #[doc = " One-based starting column, or zero when unavailable."]
    pub start_column: u32,
    #[doc = " One-based ending line, or zero when unavailable."]
    pub end_line: u32,
    #[doc = " One-based ending column, or zero when unavailable."]
    pub end_column: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_source_range_t"][::std::mem::size_of::<loomc_source_range_t>() - 40usize];
    ["Alignment of loomc_source_range_t"][::std::mem::align_of::<loomc_source_range_t>() - 8usize];
    ["Offset of field: loomc_source_range_t::source"]
        [::std::mem::offset_of!(loomc_source_range_t, source) - 0usize];
    ["Offset of field: loomc_source_range_t::start"]
        [::std::mem::offset_of!(loomc_source_range_t, start) - 8usize];
    ["Offset of field: loomc_source_range_t::end"]
        [::std::mem::offset_of!(loomc_source_range_t, end) - 16usize];
    ["Offset of field: loomc_source_range_t::start_line"]
        [::std::mem::offset_of!(loomc_source_range_t, start_line) - 24usize];
    ["Offset of field: loomc_source_range_t::start_column"]
        [::std::mem::offset_of!(loomc_source_range_t, start_column) - 28usize];
    ["Offset of field: loomc_source_range_t::end_line"]
        [::std::mem::offset_of!(loomc_source_range_t, end_line) - 32usize];
    ["Offset of field: loomc_source_range_t::end_column"]
        [::std::mem::offset_of!(loomc_source_range_t, end_column) - 36usize];
};
impl Default for loomc_source_range_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " A labeled source location providing context for a primary diagnostic.\n\n Examples include a callee's declaration or the previous use of a value.\n The owning result retains the label and source identity. Source contents\n are optional, as with the primary range."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_diagnostic_related_location_t {
    #[doc = " Human-readable relationship, such as \"contract defined here\"."]
    pub label: loomc_string_view_t,
    #[doc = " Source range of the related location."]
    pub range: loomc_source_range_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_diagnostic_related_location_t"]
        [::std::mem::size_of::<loomc_diagnostic_related_location_t>() - 56usize];
    ["Alignment of loomc_diagnostic_related_location_t"]
        [::std::mem::align_of::<loomc_diagnostic_related_location_t>() - 8usize];
    ["Offset of field: loomc_diagnostic_related_location_t::label"]
        [::std::mem::offset_of!(loomc_diagnostic_related_location_t, label) - 0usize];
    ["Offset of field: loomc_diagnostic_related_location_t::range"]
        [::std::mem::offset_of!(loomc_diagnostic_related_location_t, range) - 16usize];
};
impl Default for loomc_diagnostic_related_location_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Borrowed diagnostic view owned by a result object.\n\n @lifetime\n Diagnostic strings, related locations, and source ranges are owned by the\n result that returned this view. They remain valid until that result is\n released."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_diagnostic_t {
    #[doc = " Diagnostic severity."]
    pub severity: loomc_diagnostic_severity_t,
    #[doc = " Stable diagnostic code."]
    pub code: loomc_string_view_t,
    #[doc = " Human-readable rendered message."]
    pub message: loomc_string_view_t,
    #[doc = " Primary source range."]
    pub range: loomc_source_range_t,
    #[doc = " Related locations in producer order, or NULL when the count is zero."]
    pub related_locations: *const loomc_diagnostic_related_location_t,
    #[doc = " Number of entries in related_locations."]
    pub related_location_count: loomc_host_size_t,
    #[doc = " Number of additional resolved locations omitted by the producer's limit."]
    pub related_location_omitted_count: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_diagnostic_t"][::std::mem::size_of::<loomc_diagnostic_t>() - 104usize];
    ["Alignment of loomc_diagnostic_t"][::std::mem::align_of::<loomc_diagnostic_t>() - 8usize];
    ["Offset of field: loomc_diagnostic_t::severity"]
        [::std::mem::offset_of!(loomc_diagnostic_t, severity) - 0usize];
    ["Offset of field: loomc_diagnostic_t::code"]
        [::std::mem::offset_of!(loomc_diagnostic_t, code) - 8usize];
    ["Offset of field: loomc_diagnostic_t::message"]
        [::std::mem::offset_of!(loomc_diagnostic_t, message) - 24usize];
    ["Offset of field: loomc_diagnostic_t::range"]
        [::std::mem::offset_of!(loomc_diagnostic_t, range) - 40usize];
    ["Offset of field: loomc_diagnostic_t::related_locations"]
        [::std::mem::offset_of!(loomc_diagnostic_t, related_locations) - 80usize];
    ["Offset of field: loomc_diagnostic_t::related_location_count"]
        [::std::mem::offset_of!(loomc_diagnostic_t, related_location_count) - 88usize];
    ["Offset of field: loomc_diagnostic_t::related_location_omitted_count"]
        [::std::mem::offset_of!(loomc_diagnostic_t, related_location_omitted_count) - 96usize];
};
impl Default for loomc_diagnostic_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Immutable operation result.\n\n @thread_safety\n Results are immutable after creation. Retained result handles may be shared\n across threads."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_result_t {
    _unused: [u8; 0],
}
#[doc = " Mutable per-worker scratch workspace.\n\n @thread_safety\n A workspace is not internally synchronized. Calls that mutate the same\n workspace require external synchronization. Distinct workspaces may be used\n concurrently by different threads."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_workspace_t {
    _unused: [u8; 0],
}
#[doc = " Workspace creation options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_WORKSPACE_OPTIONS`, set `structure_size` to\n `sizeof(loomc_workspace_options_t)`, and fill the requested fields."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_workspace_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_WORKSPACE_OPTIONS` when\n nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for future workspace options."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Total bytes acquired from the host allocator per fixed-size arena block.\n Internal tracking metadata consumes part of this capacity."]
    pub block_size: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_workspace_options_t"]
        [::std::mem::size_of::<loomc_workspace_options_t>() - 32usize];
    ["Alignment of loomc_workspace_options_t"]
        [::std::mem::align_of::<loomc_workspace_options_t>() - 8usize];
    ["Offset of field: loomc_workspace_options_t::type_"]
        [::std::mem::offset_of!(loomc_workspace_options_t, type_) - 0usize];
    ["Offset of field: loomc_workspace_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_workspace_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_workspace_options_t::next"]
        [::std::mem::offset_of!(loomc_workspace_options_t, next) - 16usize];
    ["Offset of field: loomc_workspace_options_t::block_size"]
        [::std::mem::offset_of!(loomc_workspace_options_t, block_size) - 24usize];
};
impl Default for loomc_workspace_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Opaque parsed, linked, optimized, or lowered module.\n\n Modules use arena storage from the workspace that created, linked, cloned,\n or deserialized them. Releasing a module returns its active arena blocks to\n that workspace. A module retains the workspace, so release ordering is\n memory-safe, but keeping modules live across `loomc_workspace_trim` keeps\n their storage live too.\n\n @thread_safety\n Retain/release operations are safe from multiple threads. Module contents\n are not internally synchronized. Read-only operations such as serialization\n may run concurrently with other read-only operations when the caller\n guarantees that no mutating module operation is active. Mutating operations\n such as compiling a module require exclusive access to that module handle."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_module_t {
    _unused: [u8; 0],
}
#[doc = " Function symbol is visible outside the module for linking."]
pub const LOOMC_MODULE_FUNCTION_FLAG_PUBLIC: loomc_module_function_flag_bits_e = 1;
#[doc = " `loomc_module_function_try_get_export_info` can return export metadata."]
pub const LOOMC_MODULE_FUNCTION_FLAG_HAS_EXPORT_INFO: loomc_module_function_flag_bits_e = 2;
#[doc = " Module function metadata flag bits."]
pub type loomc_module_function_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " `loomc_module_function_export_info_t::export_symbol` is present."]
pub const LOOMC_MODULE_FUNCTION_EXPORT_FLAG_HAS_SYMBOL: loomc_module_function_export_flag_bits_e =
    1;
#[doc = " Export metadata flag bits."]
pub type loomc_module_function_export_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Global symbol is visible outside the module for linking."]
pub const LOOMC_MODULE_GLOBAL_FLAG_PUBLIC: loomc_module_global_flag_bits_e = 1;
#[doc = " Module global metadata flag bits."]
pub type loomc_module_global_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Prefer target-low assembly syntax using each function's representation\n contract, with canonical text as a lossless fallback."]
pub const LOOMC_MODULE_TEXT_PRESENTATION_DEFAULT: loomc_module_text_presentation_e = 0;
#[doc = " Force canonical text with descriptor-backed target-low operations printed\n as ordinary `low.op<...>` operations."]
pub const LOOMC_MODULE_TEXT_PRESENTATION_GENERIC: loomc_module_text_presentation_e = 1;
#[doc = " Require descriptor-backed target-low assembly syntax for every\n self-describing target-low function. Serialization fails when a function\n has no lossless assembly spelling for its representation contract."]
pub const LOOMC_MODULE_TEXT_PRESENTATION_LOW_ASM: loomc_module_text_presentation_e = 2;
#[doc = " Text presentation policy used when serializing `.loom` text."]
pub type loomc_module_text_presentation_e = ::std::os::raw::c_uint;
#[doc = " Text presentation policy used when serializing `.loom` text."]
pub use self::loomc_module_text_presentation_e as loomc_module_text_presentation_t;
#[doc = " Module serialization options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_MODULE_SERIALIZE_OPTIONS`, set `structure_size` to\n `sizeof(loomc_module_serialize_options_t)`, and fill the requested fields."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_module_serialize_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_MODULE_SERIALIZE_OPTIONS`\n when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for future serialization options."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Output source format. Unknown selects textual `.loom`."]
    pub format: loomc_source_format_t,
    #[doc = " Identifier to attach to a returned source. Empty uses a format-specific\n default. Path and `FILE*` serialization do not interpret this field."]
    pub identifier: loomc_string_view_t,
    #[doc = " Presentation policy for textual `.loom` output."]
    pub text_presentation: loomc_module_text_presentation_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_module_serialize_options_t"]
        [::std::mem::size_of::<loomc_module_serialize_options_t>() - 56usize];
    ["Alignment of loomc_module_serialize_options_t"]
        [::std::mem::align_of::<loomc_module_serialize_options_t>() - 8usize];
    ["Offset of field: loomc_module_serialize_options_t::type_"]
        [::std::mem::offset_of!(loomc_module_serialize_options_t, type_) - 0usize];
    ["Offset of field: loomc_module_serialize_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_module_serialize_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_module_serialize_options_t::next"]
        [::std::mem::offset_of!(loomc_module_serialize_options_t, next) - 16usize];
    ["Offset of field: loomc_module_serialize_options_t::format"]
        [::std::mem::offset_of!(loomc_module_serialize_options_t, format) - 24usize];
    ["Offset of field: loomc_module_serialize_options_t::identifier"]
        [::std::mem::offset_of!(loomc_module_serialize_options_t, identifier) - 32usize];
    ["Offset of field: loomc_module_serialize_options_t::text_presentation"]
        [::std::mem::offset_of!(loomc_module_serialize_options_t, text_presentation) - 48usize];
};
impl Default for loomc_module_serialize_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Prepared immutable pass program.\n\n Pass programs are separate from compilers so JITs and autotuners can cache\n common pipelines, choose among several prepared programs per invocation, or\n sweep pipeline configurations without constructing many compiler handles.\n Pass programs remain target-independent. Target-aware predicates resolve\n each function's durable target when the program executes.\n\n @thread_safety\n Pass programs are immutable after creation and may be shared across worker\n threads. Retain/release operations are safe from multiple threads."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_pass_program_t {
    _unused: [u8; 0],
}
#[doc = " Prepared immutable compiler.\n\n A compiler is intended to be created once and reused across many\n invocations. It must not require repeated filesystem access on the hot path.\n Pass pipelines are prepared as `loomc_pass_program_t` handles and selected\n per invocation.\n\n @thread_safety\n Prepared compilers are immutable after creation and may be shared across\n threads. Invocation-local scratch belongs in `loomc_workspace_t`."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_compiler_t {
    _unused: [u8; 0],
}
#[doc = " Return textual Loom module IR after successful compilation."]
pub const LOOMC_COMPILE_ARTIFACT_FLAG_MODULE_TEXT: loomc_compile_artifact_flag_bits_e = 1;
#[doc = " Return binary Loom bytecode after successful compilation."]
pub const LOOMC_COMPILE_ARTIFACT_FLAG_MODULE_BYTECODE: loomc_compile_artifact_flag_bits_e = 2;
#[doc = " Return a JSON compile report artifact. Reports are emitted for completed\n invocations, including failed results that still returned diagnostics."]
pub const LOOMC_COMPILE_ARTIFACT_FLAG_REPORT_JSON: loomc_compile_artifact_flag_bits_e = 4;
#[doc = " Return the compiled host launch-config program for all kernel entries.\n\n The selected pass program must lower source kernel entries through the\n normal source-to-low boundary. The artifact contains one pure function\n per exported kernel and is loaded with\n `loomc_launch_config_program_load`."]
pub const LOOMC_COMPILE_ARTIFACT_FLAG_LAUNCH_CONFIG: loomc_compile_artifact_flag_bits_e = 8;
#[doc = " Compile artifact request bits."]
pub type loomc_compile_artifact_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Bitmask of `loomc_compile_artifact_flag_bits_t`."]
pub type loomc_compile_artifact_flags_t = u32;
#[doc = " Compiler creation options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_COMPILER_OPTIONS`, set `structure_size` to\n `sizeof(loomc_compiler_options_t)`, and fill the requested fields."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_compiler_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_COMPILER_OPTIONS` when\n nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for future compiler options."]
    pub next: *const ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_compiler_options_t"]
        [::std::mem::size_of::<loomc_compiler_options_t>() - 24usize];
    ["Alignment of loomc_compiler_options_t"]
        [::std::mem::align_of::<loomc_compiler_options_t>() - 8usize];
    ["Offset of field: loomc_compiler_options_t::type_"]
        [::std::mem::offset_of!(loomc_compiler_options_t, type_) - 0usize];
    ["Offset of field: loomc_compiler_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_compiler_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_compiler_options_t::next"]
        [::std::mem::offset_of!(loomc_compiler_options_t, next) - 16usize];
};
impl Default for loomc_compiler_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Compile invocation options.\n\n A compile invocation borrows a mutable module and returns a result with\n diagnostics and artifacts. Exact values from an optional config module\n materialize into the program module before the selected pass program runs.\n Configuration lives here rather than on the prepared compiler so autotuning\n and JIT sweeps can vary config without constructing many compiler handles.\n Per-function target specializations and target-declaration bindings are\n supplied through\n `loomc_target_specialization_options_t` on `next`, so one invocation can\n compile several function versions for different exact targets."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_compile_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_COMPILE_OPTIONS` when\n nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for compile invocation options such as\n `loomc_target_specialization_options_t`."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Runtime artifact module name for this invocation. Empty uses the\n compiler's default."]
    pub module_name: loomc_string_view_t,
    #[doc = " Requested result artifacts. Zero avoids artifact serialization and keeps\n the hot path focused on diagnostics and in-place module transformation."]
    pub artifact_flags: loomc_compile_artifact_flags_t,
    #[doc = " Config validation and final-resolution policy."]
    pub config_flags: loomc_config_policy_flags_t,
    #[doc = " Optional module containing only exact `config.def` operations.\n\n The module is borrowed, remains immutable, must use the compiler context,\n and must be distinct from the mutable program module. Definitions without\n matching program config symbols are ignored so one config module can serve\n several related programs. Load text or bytecode config modules through the\n normal format-specific module deserialization APIs."]
    pub config_module: *const loomc_module_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_compile_options_t"][::std::mem::size_of::<loomc_compile_options_t>() - 56usize];
    ["Alignment of loomc_compile_options_t"]
        [::std::mem::align_of::<loomc_compile_options_t>() - 8usize];
    ["Offset of field: loomc_compile_options_t::type_"]
        [::std::mem::offset_of!(loomc_compile_options_t, type_) - 0usize];
    ["Offset of field: loomc_compile_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_compile_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_compile_options_t::next"]
        [::std::mem::offset_of!(loomc_compile_options_t, next) - 16usize];
    ["Offset of field: loomc_compile_options_t::module_name"]
        [::std::mem::offset_of!(loomc_compile_options_t, module_name) - 24usize];
    ["Offset of field: loomc_compile_options_t::artifact_flags"]
        [::std::mem::offset_of!(loomc_compile_options_t, artifact_flags) - 40usize];
    ["Offset of field: loomc_compile_options_t::config_flags"]
        [::std::mem::offset_of!(loomc_compile_options_t, config_flags) - 44usize];
    ["Offset of field: loomc_compile_options_t::config_module"]
        [::std::mem::offset_of!(loomc_compile_options_t, config_module) - 48usize];
};
impl Default for loomc_compile_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Does not request a compile report."]
pub const LOOMC_COMPILE_REPORT_MODE_NONE: loomc_compile_report_mode_e = 0;
#[doc = " Requests stable target, status, artifact, and summary compiler facts."]
pub const LOOMC_COMPILE_REPORT_MODE_SUMMARY: loomc_compile_report_mode_e = 1;
#[doc = " Requests summary facts plus detail rows when producers support them."]
pub const LOOMC_COMPILE_REPORT_MODE_DETAILS: loomc_compile_report_mode_e = 2;
#[doc = " Compile report detail mode."]
pub type loomc_compile_report_mode_e = ::std::os::raw::c_uint;
#[doc = " Compile report detail mode."]
pub use self::loomc_compile_report_mode_e as loomc_compile_report_mode_t;
#[doc = " Compile report emission options.\n\n Attach this descriptor through `loomc_emit_options_t::next`. The descriptor\n controls JSON report production for the emitted target artifact. It does not\n run compilation passes, force target analyses, or write filesystem paths."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_compile_report_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_COMPILE_REPORT_OPTIONS`\n when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Next invocation option extension."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Selected report detail mode."]
    pub mode: loomc_compile_report_mode_t,
    #[doc = " Result artifact identifier for the compile report JSON. Empty derives\n from the emitted artifact identifier by appending `.compile-report.json`."]
    pub identifier: loomc_string_view_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_compile_report_options_t"]
        [::std::mem::size_of::<loomc_compile_report_options_t>() - 48usize];
    ["Alignment of loomc_compile_report_options_t"]
        [::std::mem::align_of::<loomc_compile_report_options_t>() - 8usize];
    ["Offset of field: loomc_compile_report_options_t::type_"]
        [::std::mem::offset_of!(loomc_compile_report_options_t, type_) - 0usize];
    ["Offset of field: loomc_compile_report_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_compile_report_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_compile_report_options_t::next"]
        [::std::mem::offset_of!(loomc_compile_report_options_t, next) - 16usize];
    ["Offset of field: loomc_compile_report_options_t::mode"]
        [::std::mem::offset_of!(loomc_compile_report_options_t, mode) - 24usize];
    ["Offset of field: loomc_compile_report_options_t::identifier"]
        [::std::mem::offset_of!(loomc_compile_report_options_t, identifier) - 32usize];
};
impl Default for loomc_compile_report_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Prepared immutable target environment.\n\n A target environment owns target provider composition selected by the\n linked binary. It should be created once per target provider set and reused\n across contexts, compilers, pass programs, and worker threads.\n\n @thread_safety\n Target environments are immutable after creation and may be shared across\n threads. Retain/release operations are safe from multiple threads."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_target_environment_t {
    _unused: [u8; 0],
}
#[doc = " Prepared immutable target profile.\n\n A target profile owns normalized target facts and any target-family payload\n needed by compiler passes or emitters. Profiles are separate from contexts\n and compilers so embedders can cache one profile per device, saved hardware\n profile, or cross-compilation bucket.\n\n @thread_safety\n Target profiles are immutable after creation and may be shared across\n threads. Retain/release operations are safe from multiple threads."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_target_profile_t {
    _unused: [u8; 0],
}
#[doc = " Context option extension that registers a target environment.\n\n Put this descriptor on `loomc_context_options_t::next` so target dialects\n are registered before the context is finalized. The context retains the\n target environment on success; the caller may release its reference after\n `loomc_context_create` returns."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_context_target_options_t {
    #[doc = " Structure type. Must be\n `LOOMC_STRUCTURE_TYPE_CONTEXT_TARGET_OPTIONS`."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Next context option extension."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Target environment to register with the context."]
    pub target_environment: *mut loomc_target_environment_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_context_target_options_t"]
        [::std::mem::size_of::<loomc_context_target_options_t>() - 32usize];
    ["Alignment of loomc_context_target_options_t"]
        [::std::mem::align_of::<loomc_context_target_options_t>() - 8usize];
    ["Offset of field: loomc_context_target_options_t::type_"]
        [::std::mem::offset_of!(loomc_context_target_options_t, type_) - 0usize];
    ["Offset of field: loomc_context_target_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_context_target_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_context_target_options_t::next"]
        [::std::mem::offset_of!(loomc_context_target_options_t, next) - 16usize];
    ["Offset of field: loomc_context_target_options_t::target_environment"]
        [::std::mem::offset_of!(loomc_context_target_options_t, target_environment) - 24usize];
};
impl Default for loomc_context_target_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " One function version to specialize to one structured target profile."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_target_specialization_t {
    #[doc = " Function symbol name. A leading `@` is accepted."]
    pub function_symbol: loomc_string_view_t,
    #[doc = " Complete target profile borrowed for the invocation."]
    pub target_profile: *mut loomc_target_profile_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_target_specialization_t"]
        [::std::mem::size_of::<loomc_target_specialization_t>() - 24usize];
    ["Alignment of loomc_target_specialization_t"]
        [::std::mem::align_of::<loomc_target_specialization_t>() - 8usize];
    ["Offset of field: loomc_target_specialization_t::function_symbol"]
        [::std::mem::offset_of!(loomc_target_specialization_t, function_symbol) - 0usize];
    ["Offset of field: loomc_target_specialization_t::target_profile"]
        [::std::mem::offset_of!(loomc_target_specialization_t, target_profile) - 16usize];
};
impl Default for loomc_target_specialization_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " One authored target declaration to bind to one target profile.\n\n Every binding key must resolve to a `target.decl` in the module being\n compiled. The profile seeds all target-assignable functions authored with\n `target(@target_symbol)`. Semantic callgraph specialization propagates that\n target context through reachable callees."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_target_binding_t {
    #[doc = " Target declaration symbol name. A leading `@` is accepted."]
    pub target_symbol: loomc_string_view_t,
    #[doc = " Complete target profile borrowed for the invocation."]
    pub target_profile: *mut loomc_target_profile_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_target_binding_t"][::std::mem::size_of::<loomc_target_binding_t>() - 24usize];
    ["Alignment of loomc_target_binding_t"]
        [::std::mem::align_of::<loomc_target_binding_t>() - 8usize];
    ["Offset of field: loomc_target_binding_t::target_symbol"]
        [::std::mem::offset_of!(loomc_target_binding_t, target_symbol) - 0usize];
    ["Offset of field: loomc_target_binding_t::target_profile"]
        [::std::mem::offset_of!(loomc_target_binding_t, target_profile) - 16usize];
};
impl Default for loomc_target_binding_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Option extension carrying target specialization inputs.\n\n Put this descriptor on `loomc_compile_options_t::next`. Direct function rows\n assign profiles to selected roots. Target binding rows assign profiles to\n authored `target.decl` contexts without enumerating every function using the\n context. The two sets must not assign the same function. Every row is\n validated before any function version is published. The invocation borrows\n the row arrays, symbol strings, and profiles for the duration of the call."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_target_specialization_options_t {
    #[doc = " Structure type. Must be\n `LOOMC_STRUCTURE_TYPE_TARGET_SPECIALIZATION_OPTIONS`."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Additional option extensions in the same unordered chain."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Specialization rows borrowed for the invocation."]
    pub specializations: *const loomc_target_specialization_t,
    #[doc = " Number of rows in `specializations`."]
    pub specialization_count: loomc_host_size_t,
    #[doc = " Target declaration binding rows borrowed for the invocation."]
    pub target_bindings: *const loomc_target_binding_t,
    #[doc = " Number of rows in `target_bindings`."]
    pub target_binding_count: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_target_specialization_options_t"]
        [::std::mem::size_of::<loomc_target_specialization_options_t>() - 56usize];
    ["Alignment of loomc_target_specialization_options_t"]
        [::std::mem::align_of::<loomc_target_specialization_options_t>() - 8usize];
    ["Offset of field: loomc_target_specialization_options_t::type_"]
        [::std::mem::offset_of!(loomc_target_specialization_options_t, type_) - 0usize];
    ["Offset of field: loomc_target_specialization_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_target_specialization_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_target_specialization_options_t::next"]
        [::std::mem::offset_of!(loomc_target_specialization_options_t, next) - 16usize];
    ["Offset of field: loomc_target_specialization_options_t::specializations"]
        [::std::mem::offset_of!(loomc_target_specialization_options_t, specializations) - 24usize];
    ["Offset of field: loomc_target_specialization_options_t::specialization_count"][::std::mem::offset_of!(
        loomc_target_specialization_options_t,
        specialization_count
    ) - 32usize];
    ["Offset of field: loomc_target_specialization_options_t::target_bindings"]
        [::std::mem::offset_of!(loomc_target_specialization_options_t, target_bindings) - 40usize];
    ["Offset of field: loomc_target_specialization_options_t::target_binding_count"][::std::mem::offset_of!(
        loomc_target_specialization_options_t,
        target_binding_count
    ) - 48usize];
};
impl Default for loomc_target_specialization_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Lower source/kernel IR to target-low IR prepared for target emission."]
pub const LOOMC_TARGET_PIPELINE_KIND_PREPARED_LOW: loomc_target_pipeline_kind_e = 0;
#[doc = " Lower source/kernel IR to target-low IR before target ABI/resource\n materialization and packetization preparation."]
pub const LOOMC_TARGET_PIPELINE_KIND_SOURCE_LOW: loomc_target_pipeline_kind_e = 1;
#[doc = " Target lowering pipeline boundary."]
pub type loomc_target_pipeline_kind_e = ::std::os::raw::c_uint;
#[doc = " Target lowering pipeline boundary."]
pub use self::loomc_target_pipeline_kind_e as loomc_target_pipeline_kind_t;
#[doc = " Lower source structured control flow to explicit CFG before source-to-low."]
pub const LOOMC_TARGET_CONTROL_FLOW_LOWERING_CFG: loomc_target_control_flow_lowering_e = 0;
#[doc = " Preserve supported structured control flow into target-low IR."]
pub const LOOMC_TARGET_CONTROL_FLOW_LOWERING_STRUCTURED_LOW: loomc_target_control_flow_lowering_e =
    1;
#[doc = " Control-flow shape selected for source-to-low lowering."]
pub type loomc_target_control_flow_lowering_e = ::std::os::raw::c_uint;
#[doc = " Control-flow shape selected for source-to-low lowering."]
pub use self::loomc_target_control_flow_lowering_e as loomc_target_control_flow_lowering_t;
#[doc = " Target pipeline creation options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_TARGET_PIPELINE_OPTIONS`, set `structure_size` to\n `sizeof(loomc_target_pipeline_options_t)`, and fill the requested fields.\n A zero-initialized descriptor selects the prepared target-low pipeline with\n CFG control-flow lowering."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_target_pipeline_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_TARGET_PIPELINE_OPTIONS`\n when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for target pipeline options such as\n `loomc_sanitizer_options_t`."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Stable identifier used for the synthetic pipeline module and diagnostics.\n Empty selects a library-defined identifier."]
    pub identifier: loomc_string_view_t,
    #[doc = " Target pipeline boundary to build."]
    pub kind: loomc_target_pipeline_kind_t,
    #[doc = " Control-flow shape selected for the source-to-low boundary."]
    pub control_flow_lowering: loomc_target_control_flow_lowering_t,
    #[doc = " Maximum source-to-low diagnostics. Zero uses source-to-low's default."]
    pub source_to_low_max_errors: u32,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_target_pipeline_options_t"]
        [::std::mem::size_of::<loomc_target_pipeline_options_t>() - 56usize];
    ["Alignment of loomc_target_pipeline_options_t"]
        [::std::mem::align_of::<loomc_target_pipeline_options_t>() - 8usize];
    ["Offset of field: loomc_target_pipeline_options_t::type_"]
        [::std::mem::offset_of!(loomc_target_pipeline_options_t, type_) - 0usize];
    ["Offset of field: loomc_target_pipeline_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_target_pipeline_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_target_pipeline_options_t::next"]
        [::std::mem::offset_of!(loomc_target_pipeline_options_t, next) - 16usize];
    ["Offset of field: loomc_target_pipeline_options_t::identifier"]
        [::std::mem::offset_of!(loomc_target_pipeline_options_t, identifier) - 24usize];
    ["Offset of field: loomc_target_pipeline_options_t::kind"]
        [::std::mem::offset_of!(loomc_target_pipeline_options_t, kind) - 40usize];
    ["Offset of field: loomc_target_pipeline_options_t::control_flow_lowering"]
        [::std::mem::offset_of!(loomc_target_pipeline_options_t, control_flow_lowering) - 44usize];
    ["Offset of field: loomc_target_pipeline_options_t::source_to_low_max_errors"][::std::mem::offset_of!(
        loomc_target_pipeline_options_t,
        source_to_low_max_errors
    ) - 48usize];
};
impl Default for loomc_target_pipeline_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Emit artifact request flags."]
pub type loomc_emit_artifact_flags_t = u32;
#[doc = " Request the primary loadable artifact. A zero flag value also requests\n the primary artifact."]
pub const LOOMC_EMIT_ARTIFACT_FLAG_PRIMARY: loomc_emit_artifact_flag_bits_e = 1;
#[doc = " Emit artifact request flag bits."]
pub type loomc_emit_artifact_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Target emission options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_EMIT_OPTIONS`, set `structure_size` to\n `sizeof(loomc_emit_options_t)`, and fill the requested fields. Attach\n `loomc_artifact_manifest_options_t`, `loomc_compile_report_options_t`,\n `loomc_option_dict_t`, and target-specific descriptors through `next`."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_emit_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_EMIT_OPTIONS` when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for emission options."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Artifact format to emit. Empty selects the only linked emitter and fails\n if the target environment has zero or multiple emitters."]
    pub artifact_format: loomc_string_view_t,
    #[doc = " Artifact identifier for the primary output. Empty selects the emitter's\n default identifier."]
    pub identifier: loomc_string_view_t,
    #[doc = " Requested artifact classes. Zero requests the primary artifact."]
    pub artifact_flags: loomc_emit_artifact_flags_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_emit_options_t"][::std::mem::size_of::<loomc_emit_options_t>() - 64usize];
    ["Alignment of loomc_emit_options_t"][::std::mem::align_of::<loomc_emit_options_t>() - 8usize];
    ["Offset of field: loomc_emit_options_t::type_"]
        [::std::mem::offset_of!(loomc_emit_options_t, type_) - 0usize];
    ["Offset of field: loomc_emit_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_emit_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_emit_options_t::next"]
        [::std::mem::offset_of!(loomc_emit_options_t, next) - 16usize];
    ["Offset of field: loomc_emit_options_t::artifact_format"]
        [::std::mem::offset_of!(loomc_emit_options_t, artifact_format) - 24usize];
    ["Offset of field: loomc_emit_options_t::identifier"]
        [::std::mem::offset_of!(loomc_emit_options_t, identifier) - 40usize];
    ["Offset of field: loomc_emit_options_t::artifact_flags"]
        [::std::mem::offset_of!(loomc_emit_options_t, artifact_flags) - 56usize];
};
impl Default for loomc_emit_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Mutable builder used to construct a frozen link index.\n\n @thread_safety\n Reserving slots and finishing a builder require exclusive access. Distinct\n already-reserved slots may be filled concurrently when each slot is filled\n by at most one thread and no thread calls finish until all fills have\n joined."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_link_index_builder_t {
    _unused: [u8; 0],
}
#[doc = " Frozen immutable link index.\n\n @thread_safety\n Frozen indexes are immutable and may be shared by many linker invocations\n across many threads."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_link_index_t {
    _unused: [u8; 0],
}
#[doc = " Direct sources jointly owned by the module being assembled."]
pub const LOOMC_LINK_PROVIDER_ROLE_INPUT: loomc_link_provider_role_e = 0;
#[doc = " Separate libraries contributing exported exact definitions and templates."]
pub const LOOMC_LINK_PROVIDER_ROLE_LIBRARY: loomc_link_provider_role_e = 1;
#[doc = " Linkage role assigned to a source provider in a link index."]
pub type loomc_link_provider_role_e = ::std::os::raw::c_uint;
#[doc = " Linkage role assigned to a source provider in a link index."]
pub use self::loomc_link_provider_role_e as loomc_link_provider_role_t;
#[doc = " Symbol is publicly visible in its source module."]
pub const LOOMC_LINK_SYMBOL_FLAG_PUBLIC: loomc_link_symbol_flag_bits_e = 1;
#[doc = " Symbol is an import declaration supplied by another provider/module."]
pub const LOOMC_LINK_SYMBOL_FLAG_IMPORT: loomc_link_symbol_flag_bits_e = 2;
#[doc = " Symbol is exported from its provider/module."]
pub const LOOMC_LINK_SYMBOL_FLAG_EXPORT: loomc_link_symbol_flag_bits_e = 4;
#[doc = " Symbol is declaration-like and may be superseded by a concrete definition."]
pub const LOOMC_LINK_SYMBOL_FLAG_DECLARATION: loomc_link_symbol_flag_bits_e = 8;
#[doc = " Symbol is a concrete definition owned by its provider."]
pub const LOOMC_LINK_SYMBOL_FLAG_CONCRETE_DEFINITION: loomc_link_symbol_flag_bits_e = 16;
#[doc = " Symbol implements the config symbol interface."]
pub const LOOMC_LINK_SYMBOL_FLAG_CONFIG: loomc_link_symbol_flag_bits_e = 32;
#[doc = " Symbol exists only for test or benchmark tooling."]
pub const LOOMC_LINK_SYMBOL_FLAG_TEST_ONLY: loomc_link_symbol_flag_bits_e = 64;
#[doc = " Source symbol is explicitly preserved by ordinary symbol pruning."]
pub const LOOMC_LINK_SYMBOL_FLAG_RETAIN: loomc_link_symbol_flag_bits_e = 128;
#[doc = " Link-index symbol flag bit values."]
pub type loomc_link_symbol_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Link-index builder creation options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_LINK_INDEX_BUILDER_OPTIONS`, set `structure_size` to\n `sizeof(loomc_link_index_builder_options_t)`, and fill the requested fields."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_link_index_builder_options_t {
    #[doc = " Structure type. Must be\n `LOOMC_STRUCTURE_TYPE_LINK_INDEX_BUILDER_OPTIONS` when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for future builder options."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Total bytes acquired from the host allocator per persistent frozen-index\n block. Internal tracking metadata consumes part of this capacity."]
    pub block_size: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_link_index_builder_options_t"]
        [::std::mem::size_of::<loomc_link_index_builder_options_t>() - 32usize];
    ["Alignment of loomc_link_index_builder_options_t"]
        [::std::mem::align_of::<loomc_link_index_builder_options_t>() - 8usize];
    ["Offset of field: loomc_link_index_builder_options_t::type_"]
        [::std::mem::offset_of!(loomc_link_index_builder_options_t, type_) - 0usize];
    ["Offset of field: loomc_link_index_builder_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_link_index_builder_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_link_index_builder_options_t::next"]
        [::std::mem::offset_of!(loomc_link_index_builder_options_t, next) - 16usize];
    ["Offset of field: loomc_link_index_builder_options_t::block_size"]
        [::std::mem::offset_of!(loomc_link_index_builder_options_t, block_size) - 24usize];
};
impl Default for loomc_link_index_builder_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Deterministic source slot reserved by a link-index builder.\n\n Slots are stable within a builder. Parallel workers fill distinct slots so\n provider order and diagnostics do not depend on fill scheduling order."]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct loomc_link_index_source_slot_t {
    #[doc = " Deterministic provider slot ordinal reserved by the builder."]
    pub ordinal: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_link_index_source_slot_t"]
        [::std::mem::size_of::<loomc_link_index_source_slot_t>() - 8usize];
    ["Alignment of loomc_link_index_source_slot_t"]
        [::std::mem::align_of::<loomc_link_index_source_slot_t>() - 8usize];
    ["Offset of field: loomc_link_index_source_slot_t::ordinal"]
        [::std::mem::offset_of!(loomc_link_index_source_slot_t, ordinal) - 0usize];
};
#[doc = " Source provider options used when adding sources to a link index.\n\n @lifetime\n String views are borrowed for the duration of the builder call that consumes\n this descriptor unless that call explicitly documents a copy."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_link_index_source_options_t {
    #[doc = " Stable provider label for diagnostics and private-name determinism."]
    pub provider_name: loomc_string_view_t,
    #[doc = " Provider linkage role."]
    pub role: loomc_link_provider_role_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_link_index_source_options_t"]
        [::std::mem::size_of::<loomc_link_index_source_options_t>() - 24usize];
    ["Alignment of loomc_link_index_source_options_t"]
        [::std::mem::align_of::<loomc_link_index_source_options_t>() - 8usize];
    ["Offset of field: loomc_link_index_source_options_t::provider_name"]
        [::std::mem::offset_of!(loomc_link_index_source_options_t, provider_name) - 0usize];
    ["Offset of field: loomc_link_index_source_options_t::role"]
        [::std::mem::offset_of!(loomc_link_index_source_options_t, role) - 16usize];
};
impl Default for loomc_link_index_source_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Prepared immutable linker.\n\n A linker owns validated link-time configuration. Frozen indexes carry\n reusable provider state and are supplied per invocation.\n\n @thread_safety\n Prepared linkers are immutable after creation and may be shared across\n threads. Invocation-local scratch belongs in `loomc_workspace_t`."]
#[repr(C)]
#[derive(Debug)]
pub struct loomc_linker_t {
    _unused: [u8; 0],
}
#[doc = " Linker creation options.\n\n Callers zero-initialize this descriptor, set `type` to\n `LOOMC_STRUCTURE_TYPE_LINKER_OPTIONS`, set `structure_size` to\n `sizeof(loomc_linker_options_t)`, and fill the requested fields."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_linker_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_LINKER_OPTIONS` when\n nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Extension chain for future linker options."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Default output module name for invocations that do not override it."]
    pub module_name: loomc_string_view_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_linker_options_t"][::std::mem::size_of::<loomc_linker_options_t>() - 40usize];
    ["Alignment of loomc_linker_options_t"]
        [::std::mem::align_of::<loomc_linker_options_t>() - 8usize];
    ["Offset of field: loomc_linker_options_t::type_"]
        [::std::mem::offset_of!(loomc_linker_options_t, type_) - 0usize];
    ["Offset of field: loomc_linker_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_linker_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_linker_options_t::next"]
        [::std::mem::offset_of!(loomc_linker_options_t, next) - 16usize];
    ["Offset of field: loomc_linker_options_t::module_name"]
        [::std::mem::offset_of!(loomc_linker_options_t, module_name) - 24usize];
};
impl Default for loomc_linker_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Select exported INPUT-provider symbols as roots and compute their closure."]
pub const LOOMC_LINK_FLAG_INCLUDE_INPUT_EXPORTS: loomc_link_flag_bits_e = 1;
#[doc = " Preserve reachable unresolved symbol references for a later link.\n Template applicability remains open to later specialization independently\n of this flag."]
pub const LOOMC_LINK_FLAG_ALLOW_UNRESOLVED_SYMBOLS: loomc_link_flag_bits_e = 2;
#[doc = " Strip symbols used only by test or benchmark tooling."]
pub const LOOMC_LINK_FLAG_STRIP_TEST_SYMBOLS: loomc_link_flag_bits_e = 4;
#[doc = " Link operation flags."]
pub type loomc_link_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Bitmask of `loomc_link_flag_bits_t` values."]
pub type loomc_link_flags_t = u32;
#[doc = " Merge every primary-input symbol into one relocatable module. Library\n providers are not materialized."]
pub const LOOMC_LINK_MODE_MERGE: loomc_link_mode_e = 0;
#[doc = " Retain explicit roots or exported primary-input roots and their reachable\n closure through the complete supplied library universe. Selected root\n providers contribute all of their exported symbols as roots without\n changing provider visibility."]
pub const LOOMC_LINK_MODE_LINK: loomc_link_mode_e = 1;
#[doc = " Link product selection mode."]
pub type loomc_link_mode_e = ::std::os::raw::c_uint;
#[doc = " Link product selection mode."]
pub use self::loomc_link_mode_e as loomc_link_mode_t;
#[doc = " Link invocation options.\n\n A link invocation consumes a frozen index and returns either a retained\n module or a failed result with diagnostics. Merge mode materializes only\n primary INPUT providers and preserves unresolved contracts. Link mode\n selects a dependency closure from explicit roots or exported primary roots\n plus the exports of selected root providers across the complete supplied\n library universe. Linking preserves every target carried by the selected\n symbols. Target-specialization extensions participate in template-provider\n selection and project exact target facts into the standalone linked output.\n Config options materialize on the linked output for this invocation; frozen\n indexes and reusable input/library modules are never mutated by link-time\n specialization.\n Template choices that depend on unavailable caller or target facts retain\n their viable providers until compilation. A closed library universe does\n not require template applicability to be resolved at the link boundary."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_link_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_LINK_OPTIONS` when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Optional invocation extensions such as\n `loomc_target_specialization_options_t`."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Frozen provider index to link."]
    pub link_index: *mut loomc_link_index_t,
    #[doc = " Output module name for this invocation. Empty uses the linker's default."]
    pub module_name: loomc_string_view_t,
    #[doc = " Product selection mode. Zero defaults to `LOOMC_LINK_MODE_MERGE`."]
    pub mode: loomc_link_mode_t,
    #[doc = " Root symbol names for link mode. Function-like roots are retained as\n module-boundary entries in the linked output."]
    pub root_symbols: *const loomc_string_view_t,
    #[doc = " Number of entries in `root_symbols`."]
    pub root_symbol_count: loomc_host_size_t,
    #[doc = " Link operation flags."]
    pub flags: loomc_link_flags_t,
    #[doc = " Per-invocation config bindings materialized into the linked output module."]
    pub config: loomc_config_options_t,
    #[doc = " Provider ordinals whose exported symbols are roots in link mode. This\n selects public API surfaces without changing provider linkage roles or\n making private symbols visible across provider boundaries."]
    pub root_provider_ordinals: *const loomc_host_size_t,
    #[doc = " Number of entries in `root_provider_ordinals`."]
    pub root_provider_count: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_link_options_t"][::std::mem::size_of::<loomc_link_options_t>() - 136usize];
    ["Alignment of loomc_link_options_t"][::std::mem::align_of::<loomc_link_options_t>() - 8usize];
    ["Offset of field: loomc_link_options_t::type_"]
        [::std::mem::offset_of!(loomc_link_options_t, type_) - 0usize];
    ["Offset of field: loomc_link_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_link_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_link_options_t::next"]
        [::std::mem::offset_of!(loomc_link_options_t, next) - 16usize];
    ["Offset of field: loomc_link_options_t::link_index"]
        [::std::mem::offset_of!(loomc_link_options_t, link_index) - 24usize];
    ["Offset of field: loomc_link_options_t::module_name"]
        [::std::mem::offset_of!(loomc_link_options_t, module_name) - 32usize];
    ["Offset of field: loomc_link_options_t::mode"]
        [::std::mem::offset_of!(loomc_link_options_t, mode) - 48usize];
    ["Offset of field: loomc_link_options_t::root_symbols"]
        [::std::mem::offset_of!(loomc_link_options_t, root_symbols) - 56usize];
    ["Offset of field: loomc_link_options_t::root_symbol_count"]
        [::std::mem::offset_of!(loomc_link_options_t, root_symbol_count) - 64usize];
    ["Offset of field: loomc_link_options_t::flags"]
        [::std::mem::offset_of!(loomc_link_options_t, flags) - 72usize];
    ["Offset of field: loomc_link_options_t::config"]
        [::std::mem::offset_of!(loomc_link_options_t, config) - 80usize];
    ["Offset of field: loomc_link_options_t::root_provider_ordinals"]
        [::std::mem::offset_of!(loomc_link_options_t, root_provider_ordinals) - 120usize];
    ["Offset of field: loomc_link_options_t::root_provider_count"]
        [::std::mem::offset_of!(loomc_link_options_t, root_provider_count) - 128usize];
};
impl Default for loomc_link_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Emits a schema-versioned JSON dependency report on success or failure."]
pub const LOOMC_LINK_DEPENDENCY_ARTIFACT_FLAG_REPORT_JSON:
    loomc_link_dependency_artifact_flag_bits_e = 1;
#[doc = " Dependency-analysis artifact flag bit values."]
pub type loomc_link_dependency_artifact_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " No AMDGPU runtime support globals are emitted."]
pub const LOOMC_AMDGPU_RUNTIME_GLOBAL_NONE: loomc_amdgpu_runtime_global_flag_bits_e = 0;
#[doc = " Emits the common kernel-to-runtime feedback-channel configuration global."]
pub const LOOMC_AMDGPU_RUNTIME_GLOBAL_FEEDBACK_CONFIG: loomc_amdgpu_runtime_global_flag_bits_e = 1;
#[doc = " Emits the AMDGPU ASAN configuration global consumed by access checks."]
pub const LOOMC_AMDGPU_RUNTIME_GLOBAL_ASAN_CONFIG: loomc_amdgpu_runtime_global_flag_bits_e = 2;
#[doc = " AMDGPU runtime support global option bits."]
pub type loomc_amdgpu_runtime_global_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Bitset of `loomc_amdgpu_runtime_global_flag_bits_t` values."]
pub type loomc_amdgpu_runtime_global_flags_t = u32;
#[doc = " AMDGPU HSACO emission options.\n\n AMDGPU emission uses the generic artifact format and artifact identifier on\n `loomc_emit_options_t`. Emitted functions carry their targets in prepared\n IR. The target-specific descriptor carries AMDGPU code-object data globals\n required by prepared-low IR that references HAL runtime support."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_amdgpu_emit_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_AMDGPU_EMIT_OPTIONS` when\n nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Next invocation option extension."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " AMDGPU runtime support globals to emit into the HSACO."]
    pub runtime_globals: loomc_amdgpu_runtime_global_flags_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_amdgpu_emit_options_t"]
        [::std::mem::size_of::<loomc_amdgpu_emit_options_t>() - 32usize];
    ["Alignment of loomc_amdgpu_emit_options_t"]
        [::std::mem::align_of::<loomc_amdgpu_emit_options_t>() - 8usize];
    ["Offset of field: loomc_amdgpu_emit_options_t::type_"]
        [::std::mem::offset_of!(loomc_amdgpu_emit_options_t, type_) - 0usize];
    ["Offset of field: loomc_amdgpu_emit_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_amdgpu_emit_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_amdgpu_emit_options_t::next"]
        [::std::mem::offset_of!(loomc_amdgpu_emit_options_t, next) - 16usize];
    ["Offset of field: loomc_amdgpu_emit_options_t::runtime_globals"]
        [::std::mem::offset_of!(loomc_amdgpu_emit_options_t, runtime_globals) - 24usize];
};
impl Default for loomc_amdgpu_emit_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " The target identity does not constrain the feature."]
pub const LOOMC_AMDGPU_TARGET_FEATURE_ANY: loomc_amdgpu_target_feature_state_e = 0;
#[doc = " The selected target is known not to support the feature."]
pub const LOOMC_AMDGPU_TARGET_FEATURE_UNSUPPORTED: loomc_amdgpu_target_feature_state_e = 1;
#[doc = " The feature is explicitly disabled, such as `xnack-`."]
pub const LOOMC_AMDGPU_TARGET_FEATURE_OFF: loomc_amdgpu_target_feature_state_e = 2;
#[doc = " The feature is explicitly enabled, such as `sramecc+`."]
pub const LOOMC_AMDGPU_TARGET_FEATURE_ON: loomc_amdgpu_target_feature_state_e = 3;
#[doc = " Normalized state of one AMDHSA target-ID feature."]
pub type loomc_amdgpu_target_feature_state_e = ::std::os::raw::c_uint;
#[doc = " Normalized state of one AMDHSA target-ID feature."]
pub use self::loomc_amdgpu_target_feature_state_e as loomc_amdgpu_target_feature_state_t;
#[doc = " Structured AMDHSA target-ID feature states."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_amdgpu_amdhsa_feature_states_t {
    #[doc = " SRAM ECC target-ID feature state."]
    pub sramecc: loomc_amdgpu_target_feature_state_t,
    #[doc = " XNACK target-ID feature state."]
    pub xnack: loomc_amdgpu_target_feature_state_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_amdgpu_amdhsa_feature_states_t"]
        [::std::mem::size_of::<loomc_amdgpu_amdhsa_feature_states_t>() - 8usize];
    ["Alignment of loomc_amdgpu_amdhsa_feature_states_t"]
        [::std::mem::align_of::<loomc_amdgpu_amdhsa_feature_states_t>() - 4usize];
    ["Offset of field: loomc_amdgpu_amdhsa_feature_states_t::sramecc"]
        [::std::mem::offset_of!(loomc_amdgpu_amdhsa_feature_states_t, sramecc) - 0usize];
    ["Offset of field: loomc_amdgpu_amdhsa_feature_states_t::xnack"]
        [::std::mem::offset_of!(loomc_amdgpu_amdhsa_feature_states_t, xnack) - 4usize];
};
impl Default for loomc_amdgpu_amdhsa_feature_states_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Complete structured AMDGPU identity used to construct a target profile."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_amdgpu_target_identity_t {
    #[doc = " Exact, generic, or overlay AMDGPU target selector, such as `gfx1151`,\n `gfx11-generic`, or `gfx1250-a0`."]
    pub target: loomc_string_view_t,
    #[doc = " Structured AMDHSA target-ID feature states."]
    pub amdhsa_features: loomc_amdgpu_amdhsa_feature_states_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_amdgpu_target_identity_t"]
        [::std::mem::size_of::<loomc_amdgpu_target_identity_t>() - 24usize];
    ["Alignment of loomc_amdgpu_target_identity_t"]
        [::std::mem::align_of::<loomc_amdgpu_target_identity_t>() - 8usize];
    ["Offset of field: loomc_amdgpu_target_identity_t::target"]
        [::std::mem::offset_of!(loomc_amdgpu_target_identity_t, target) - 0usize];
    ["Offset of field: loomc_amdgpu_target_identity_t::amdhsa_features"]
        [::std::mem::offset_of!(loomc_amdgpu_target_identity_t, amdhsa_features) - 16usize];
};
impl Default for loomc_amdgpu_target_identity_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub const LOOMC_AMDGPU_PROCESSOR_MODE_DEFAULT: loomc_amdgpu_processor_mode_e = 0;
pub const LOOMC_AMDGPU_PROCESSOR_MODE_CU: loomc_amdgpu_processor_mode_e = 1;
pub const LOOMC_AMDGPU_PROCESSOR_MODE_WGP: loomc_amdgpu_processor_mode_e = 2;
#[doc = " Workgroup scheduling domain. Explicit modes require a GFX11/GFX12 target."]
pub type loomc_amdgpu_processor_mode_e = ::std::os::raw::c_uint;
#[doc = " Workgroup scheduling domain. Explicit modes require a GFX11/GFX12 target."]
pub use self::loomc_amdgpu_processor_mode_e as loomc_amdgpu_processor_mode_t;
#[doc = " Optional execution policy attached to AMDGPU profile options.\n This controls both occupancy calculations and the emitted kernel descriptor.\n It does not change the physical target identity or floating-point semantics."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_amdgpu_profile_execution_options_t {
    #[doc = " Must be LOOMC_STRUCTURE_TYPE_AMDGPU_PROFILE_EXECUTION_OPTIONS."]
    pub type_: loomc_structure_type_t,
    #[doc = " Must be at least sizeof(loomc_amdgpu_profile_execution_options_t)."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Reserved; must be NULL."]
    pub next: *const ::std::os::raw::c_void,
    pub processor_mode: loomc_amdgpu_processor_mode_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_amdgpu_profile_execution_options_t"]
        [::std::mem::size_of::<loomc_amdgpu_profile_execution_options_t>() - 32usize];
    ["Alignment of loomc_amdgpu_profile_execution_options_t"]
        [::std::mem::align_of::<loomc_amdgpu_profile_execution_options_t>() - 8usize];
    ["Offset of field: loomc_amdgpu_profile_execution_options_t::type_"]
        [::std::mem::offset_of!(loomc_amdgpu_profile_execution_options_t, type_) - 0usize];
    ["Offset of field: loomc_amdgpu_profile_execution_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_amdgpu_profile_execution_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_amdgpu_profile_execution_options_t::next"]
        [::std::mem::offset_of!(loomc_amdgpu_profile_execution_options_t, next) - 16usize];
    ["Offset of field: loomc_amdgpu_profile_execution_options_t::processor_mode"][::std::mem::offset_of!(
        loomc_amdgpu_profile_execution_options_t,
        processor_mode
    ) - 24usize];
};
impl Default for loomc_amdgpu_profile_execution_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " AMDGPU target profile creation options."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_amdgpu_profile_options_t {
    #[doc = " Structure type. Must be `LOOMC_STRUCTURE_TYPE_AMDGPU_PROFILE_OPTIONS`\n when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Optional loomc_amdgpu_profile_execution_options_t, or NULL."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Stable profile identifier used in diagnostics.\n\n Empty uses `identity.target`."]
    pub identifier: loomc_string_view_t,
    #[doc = " Structured AMDGPU target identity."]
    pub identity: loomc_amdgpu_target_identity_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_amdgpu_profile_options_t"]
        [::std::mem::size_of::<loomc_amdgpu_profile_options_t>() - 64usize];
    ["Alignment of loomc_amdgpu_profile_options_t"]
        [::std::mem::align_of::<loomc_amdgpu_profile_options_t>() - 8usize];
    ["Offset of field: loomc_amdgpu_profile_options_t::type_"]
        [::std::mem::offset_of!(loomc_amdgpu_profile_options_t, type_) - 0usize];
    ["Offset of field: loomc_amdgpu_profile_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_amdgpu_profile_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_amdgpu_profile_options_t::next"]
        [::std::mem::offset_of!(loomc_amdgpu_profile_options_t, next) - 16usize];
    ["Offset of field: loomc_amdgpu_profile_options_t::identifier"]
        [::std::mem::offset_of!(loomc_amdgpu_profile_options_t, identifier) - 24usize];
    ["Offset of field: loomc_amdgpu_profile_options_t::identity"]
        [::std::mem::offset_of!(loomc_amdgpu_profile_options_t, identity) - 40usize];
};
impl Default for loomc_amdgpu_profile_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " 32-bit int; 64-bit long and pointers."]
pub const LOOMC_CXX_DATA_MODEL_LP64: loomc_cxx_data_model_e = 0;
#[doc = " 32-bit int and long; 64-bit pointers."]
pub const LOOMC_CXX_DATA_MODEL_LLP64: loomc_cxx_data_model_e = 1;
#[doc = " 32-bit int, long, and pointers."]
pub const LOOMC_CXX_DATA_MODEL_ILP32: loomc_cxx_data_model_e = 2;
#[doc = " Source integer and pointer layout, independent of the importing process."]
pub type loomc_cxx_data_model_e = ::std::os::raw::c_uint;
#[doc = " Source integer and pointer layout, independent of the importing process."]
pub use self::loomc_cxx_data_model_e as loomc_cxx_data_model_t;
#[doc = " Permit approximate mathematical functions (Loom's AFN contract)."]
pub const LOOMC_CXX_IMPORT_FLAG_APPROXIMATE_FUNCTIONS: loomc_cxx_import_flag_bits_e = 1;
#[doc = " Omit the embedded system include root; use caller paths/providers only."]
pub const LOOMC_CXX_IMPORT_FLAG_NO_BUILTIN_INCLUDES: loomc_cxx_import_flag_bits_e = 2;
#[doc = " Explicit source permissions and include delivery policy."]
pub type loomc_cxx_import_flag_bits_e = ::std::os::raw::c_uint;
#[doc = " Bitmask of loomc_cxx_import_flag_bits_t values."]
pub type loomc_cxx_import_flags_t = u32;
#[doc = " Resolves a candidate include path to immutable source bytes.\n\n Paths follow ordinary quote, user, system, and include_next search rules.\n Candidate paths use generic '/' separators on every host.\n Return OK with a NULL output for a missing candidate. Other failures return\n status with a NULL output. A found source uses UNKNOWN format; its contents\n supply the header and the candidate path determines include identity.\n\n @param user_data Caller state from the provider descriptor.\n @param path Candidate path borrowed for this callback.\n @param out_source Receives one retained source or NULL for a missing path.\n @return OK for found/missing candidates, or a provider failure status.\n\n @ownership\n A successful non-NULL output transfers one retained reference to the\n importer. A cache can retain its own reference and return another. The\n importer releases the reference once it has copied the bytes.\n\n @thread_safety\n Calls are synchronous and sequential within one import. A provider shared\n by concurrent imports must synchronize its own mutable state."]
pub type loomc_cxx_source_provider_fn_t = ::std::option::Option<
    unsafe extern "C" fn(
        user_data: *mut ::std::os::raw::c_void,
        path: loomc_string_view_t,
        out_source: *mut *mut loomc_source_t,
    ) -> loomc_status_t,
>;
#[doc = " Optional source provider replacing filesystem include reads."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_cxx_source_provider_t {
    #[doc = " Callback, or NULL to read ordinary filesystem paths."]
    pub fn_: loomc_cxx_source_provider_fn_t,
    #[doc = " Caller-owned state borrowed until import returns."]
    pub user_data: *mut ::std::os::raw::c_void,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_cxx_source_provider_t"]
        [::std::mem::size_of::<loomc_cxx_source_provider_t>() - 16usize];
    ["Alignment of loomc_cxx_source_provider_t"]
        [::std::mem::align_of::<loomc_cxx_source_provider_t>() - 8usize];
    ["Offset of field: loomc_cxx_source_provider_t::fn_"]
        [::std::mem::offset_of!(loomc_cxx_source_provider_t, fn_) - 0usize];
    ["Offset of field: loomc_cxx_source_provider_t::user_data"]
        [::std::mem::offset_of!(loomc_cxx_source_provider_t, user_data) - 8usize];
};
impl Default for loomc_cxx_source_provider_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Preprocessor definition applied after the frontend's predefined macros."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_cxx_define_t {
    #[doc = " Macro name, including parameters for a function-like macro."]
    pub name: loomc_string_view_t,
    #[doc = " Replacement token text; empty defines an empty macro."]
    pub value: loomc_string_view_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_cxx_define_t"][::std::mem::size_of::<loomc_cxx_define_t>() - 32usize];
    ["Alignment of loomc_cxx_define_t"][::std::mem::align_of::<loomc_cxx_define_t>() - 8usize];
    ["Offset of field: loomc_cxx_define_t::name"]
        [::std::mem::offset_of!(loomc_cxx_define_t, name) - 0usize];
    ["Offset of field: loomc_cxx_define_t::value"]
        [::std::mem::offset_of!(loomc_cxx_define_t, value) - 16usize];
};
impl Default for loomc_cxx_define_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
#[doc = " Configuration for one source translation unit.\n\n Zero initialization selects C++26, LP64, strict math, visible definitions\n as roots, and the embedded facade system root when built into the library.\n All strings, arrays, and callback state are borrowed until import returns."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct loomc_cxx_import_options_t {
    #[doc = " Structure type; LOOMC_STRUCTURE_TYPE_CXX_IMPORT_OPTIONS when nonzero."]
    pub type_: loomc_structure_type_t,
    #[doc = " Size of this structure in bytes, or zero."]
    pub structure_size: loomc_host_size_t,
    #[doc = " Reserved extension chain. Must be NULL."]
    pub next: *const ::std::os::raw::c_void,
    #[doc = " Frontend standard spelling, such as c23 or c++26. Empty selects c++26."]
    pub standard: loomc_string_view_t,
    #[doc = " Source ABI triple, independent of output target selection."]
    pub triple: loomc_string_view_t,
    #[doc = " Source integer and pointer layout."]
    pub data_model: loomc_cxx_data_model_t,
    #[doc = " Source permissions and include delivery flags."]
    pub flags: loomc_cxx_import_flags_t,
    #[doc = " Optional include provider; embedded headers are resolved separately."]
    pub source_provider: loomc_cxx_source_provider_t,
    #[doc = " User include directories, searched after quoted local includes."]
    pub include_paths: *const loomc_string_view_t,
    #[doc = " Number of user include directories."]
    pub include_path_count: loomc_host_size_t,
    #[doc = " System include directories, searched before the embedded system root."]
    pub system_include_paths: *const loomc_string_view_t,
    #[doc = " Number of system include directories."]
    pub system_include_path_count: loomc_host_size_t,
    #[doc = " Ordered macro definitions."]
    pub defines: *const loomc_cxx_define_t,
    #[doc = " Number of macro definitions."]
    pub define_count: loomc_host_size_t,
    #[doc = " Qualified source function names to export. Empty exports visible concrete\n definitions; reached helpers remain private when roots are explicit."]
    pub roots: *const loomc_string_view_t,
    #[doc = " Number of explicitly selected roots."]
    pub root_count: loomc_host_size_t,
}
#[allow(clippy::unnecessary_operation, clippy::identity_op)]
const _: () = {
    ["Size of loomc_cxx_import_options_t"]
        [::std::mem::size_of::<loomc_cxx_import_options_t>() - 144usize];
    ["Alignment of loomc_cxx_import_options_t"]
        [::std::mem::align_of::<loomc_cxx_import_options_t>() - 8usize];
    ["Offset of field: loomc_cxx_import_options_t::type_"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, type_) - 0usize];
    ["Offset of field: loomc_cxx_import_options_t::structure_size"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, structure_size) - 8usize];
    ["Offset of field: loomc_cxx_import_options_t::next"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, next) - 16usize];
    ["Offset of field: loomc_cxx_import_options_t::standard"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, standard) - 24usize];
    ["Offset of field: loomc_cxx_import_options_t::triple"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, triple) - 40usize];
    ["Offset of field: loomc_cxx_import_options_t::data_model"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, data_model) - 56usize];
    ["Offset of field: loomc_cxx_import_options_t::flags"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, flags) - 60usize];
    ["Offset of field: loomc_cxx_import_options_t::source_provider"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, source_provider) - 64usize];
    ["Offset of field: loomc_cxx_import_options_t::include_paths"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, include_paths) - 80usize];
    ["Offset of field: loomc_cxx_import_options_t::include_path_count"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, include_path_count) - 88usize];
    ["Offset of field: loomc_cxx_import_options_t::system_include_paths"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, system_include_paths) - 96usize];
    ["Offset of field: loomc_cxx_import_options_t::system_include_path_count"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, system_include_path_count) - 104usize];
    ["Offset of field: loomc_cxx_import_options_t::defines"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, defines) - 112usize];
    ["Offset of field: loomc_cxx_import_options_t::define_count"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, define_count) - 120usize];
    ["Offset of field: loomc_cxx_import_options_t::roots"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, roots) - 128usize];
    ["Offset of field: loomc_cxx_import_options_t::root_count"]
        [::std::mem::offset_of!(loomc_cxx_import_options_t, root_count) - 136usize];
};
impl Default for loomc_cxx_import_options_t {
    fn default() -> Self {
        let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
        unsafe {
            ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
            s.assume_init()
        }
    }
}
pub struct Loomc {
    __library: ::libloading::Library,
    pub loomc_allocator_system: unsafe extern "C" fn() -> loomc_allocator_t,
    pub loomc_allocator_free:
        unsafe extern "C" fn(allocator: loomc_allocator_t, ptr: *mut ::std::os::raw::c_void),
    pub loomc_byte_sequence_length:
        unsafe extern "C" fn(sequence: *const loomc_byte_sequence_t) -> u64,
    pub loomc_byte_sequence_clone: unsafe extern "C" fn(
        sequence: *const loomc_byte_sequence_t,
        allocator: loomc_allocator_t,
        out_span: *mut loomc_byte_span_t,
    ) -> loomc_status_t,
    pub loomc_status_free: unsafe extern "C" fn(status: loomc_status_t),
    pub loomc_status_format: unsafe extern "C" fn(
        status: loomc_status_t,
        buffer_capacity: loomc_host_size_t,
        buffer: *mut ::std::os::raw::c_char,
        out_length: *mut loomc_host_size_t,
    ) -> bool,
    pub loomc_source_create: unsafe extern "C" fn(
        options: *const loomc_source_options_t,
        allocator: loomc_allocator_t,
        out_source: *mut *mut loomc_source_t,
    ) -> loomc_status_t,
    pub loomc_source_release: unsafe extern "C" fn(source: *mut loomc_source_t),
    pub loomc_source_identifier:
        unsafe extern "C" fn(source: *const loomc_source_t) -> loomc_string_view_t,
    pub loomc_context_create: unsafe extern "C" fn(
        options: *const loomc_context_options_t,
        allocator: loomc_allocator_t,
        out_context: *mut *mut loomc_context_t,
    ) -> loomc_status_t,
    pub loomc_context_release: unsafe extern "C" fn(context: *mut loomc_context_t),
    pub loomc_result_release: unsafe extern "C" fn(result: *mut loomc_result_t),
    pub loomc_result_succeeded: unsafe extern "C" fn(result: *const loomc_result_t) -> bool,
    pub loomc_result_diagnostic_count:
        unsafe extern "C" fn(result: *const loomc_result_t) -> loomc_host_size_t,
    pub loomc_result_diagnostic_at: unsafe extern "C" fn(
        result: *const loomc_result_t,
        index: loomc_host_size_t,
    ) -> *const loomc_diagnostic_t,
    pub loomc_result_artifact_count:
        unsafe extern "C" fn(result: *const loomc_result_t) -> loomc_host_size_t,
    pub loomc_result_artifact_at: unsafe extern "C" fn(
        result: *const loomc_result_t,
        index: loomc_host_size_t,
    ) -> *const loomc_artifact_t,
    pub loomc_workspace_create: unsafe extern "C" fn(
        options: *const loomc_workspace_options_t,
        allocator: loomc_allocator_t,
        out_workspace: *mut *mut loomc_workspace_t,
    ) -> loomc_status_t,
    pub loomc_workspace_trim: unsafe extern "C" fn(workspace: *mut loomc_workspace_t),
    pub loomc_workspace_release: unsafe extern "C" fn(workspace: *mut loomc_workspace_t),
    pub loomc_module_release: unsafe extern "C" fn(module: *mut loomc_module_t),
    pub loomc_module_serialize_to_source: unsafe extern "C" fn(
        module: *const loomc_module_t,
        options: *const loomc_module_serialize_options_t,
        allocator: loomc_allocator_t,
        out_source: *mut *mut loomc_source_t,
    ) -> loomc_status_t,
    pub loomc_pass_program_release: unsafe extern "C" fn(pass_program: *mut loomc_pass_program_t),
    pub loomc_compiler_create: unsafe extern "C" fn(
        context: *mut loomc_context_t,
        options: *const loomc_compiler_options_t,
        allocator: loomc_allocator_t,
        out_compiler: *mut *mut loomc_compiler_t,
    ) -> loomc_status_t,
    pub loomc_compile_module: unsafe extern "C" fn(
        compiler: *mut loomc_compiler_t,
        workspace: *mut loomc_workspace_t,
        pass_program: *const loomc_pass_program_t,
        module: *mut loomc_module_t,
        options: *const loomc_compile_options_t,
        allocator: loomc_allocator_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t,
    pub loomc_compiler_release: unsafe extern "C" fn(compiler: *mut loomc_compiler_t),
    pub loomc_pass_program_create_from_target_pipeline: unsafe extern "C" fn(
        context: *mut loomc_context_t,
        options: *const loomc_target_pipeline_options_t,
        allocator: loomc_allocator_t,
        out_pass_program: *mut *mut loomc_pass_program_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t,
    pub loomc_target_profile_release: unsafe extern "C" fn(profile: *mut loomc_target_profile_t),
    pub loomc_target_environment_release:
        unsafe extern "C" fn(target_environment: *mut loomc_target_environment_t),
    pub loomc_emit_module: unsafe extern "C" fn(
        target_environment: *mut loomc_target_environment_t,
        workspace: *mut loomc_workspace_t,
        module: *mut loomc_module_t,
        options: *const loomc_emit_options_t,
        allocator: loomc_allocator_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t,
    pub loomc_link_index_builder_create: unsafe extern "C" fn(
        context: *mut loomc_context_t,
        options: *const loomc_link_index_builder_options_t,
        allocator: loomc_allocator_t,
        out_builder: *mut *mut loomc_link_index_builder_t,
    ) -> loomc_status_t,
    pub loomc_link_index_builder_release:
        unsafe extern "C" fn(builder: *mut loomc_link_index_builder_t),
    pub loomc_link_index_builder_add_source: unsafe extern "C" fn(
        builder: *mut loomc_link_index_builder_t,
        source: *mut loomc_source_t,
        options: *const loomc_link_index_source_options_t,
        out_slot: *mut loomc_link_index_source_slot_t,
    ) -> loomc_status_t,
    pub loomc_link_index_builder_finish: unsafe extern "C" fn(
        builder: *mut loomc_link_index_builder_t,
        out_link_index: *mut *mut loomc_link_index_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t,
    pub loomc_link_index_release: unsafe extern "C" fn(link_index: *mut loomc_link_index_t),
    pub loomc_linker_create: unsafe extern "C" fn(
        context: *mut loomc_context_t,
        options: *const loomc_linker_options_t,
        allocator: loomc_allocator_t,
        out_linker: *mut *mut loomc_linker_t,
    ) -> loomc_status_t,
    pub loomc_link_module: unsafe extern "C" fn(
        linker: *mut loomc_linker_t,
        workspace: *mut loomc_workspace_t,
        options: *const loomc_link_options_t,
        out_module: *mut *mut loomc_module_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t,
    pub loomc_linker_release: unsafe extern "C" fn(linker: *mut loomc_linker_t),
    pub loomc_target_environment_create_amdgpu: unsafe extern "C" fn(
        allocator: loomc_allocator_t,
        out_target_environment: *mut *mut loomc_target_environment_t,
    ) -> loomc_status_t,
    pub loomc_target_profile_create_amdgpu: unsafe extern "C" fn(
        target_environment: *mut loomc_target_environment_t,
        options: *const loomc_amdgpu_profile_options_t,
        allocator: loomc_allocator_t,
        out_profile: *mut *mut loomc_target_profile_t,
    ) -> loomc_status_t,
    pub loomc_target_environment_create_xdna: unsafe extern "C" fn(
        allocator: loomc_allocator_t,
        out_target_environment: *mut *mut loomc_target_environment_t,
    ) -> loomc_status_t,
    pub loomc_target_profile_create_xdna: unsafe extern "C" fn(
        target_environment: *mut loomc_target_environment_t,
        device_key: loomc_string_view_t,
        allocator: loomc_allocator_t,
        out_profile: *mut *mut loomc_target_profile_t,
    ) -> loomc_status_t,
    pub loomc_module_import_cxx: unsafe extern "C" fn(
        context: *mut loomc_context_t,
        workspace: *mut loomc_workspace_t,
        source: *const loomc_source_t,
        options: *const loomc_cxx_import_options_t,
        allocator: loomc_allocator_t,
        out_module: *mut *mut loomc_module_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t,
}
impl Loomc {
    pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
    where
        P: AsRef<::std::ffi::OsStr>,
    {
        let path = path.as_ref();
        let library = ::libloading::Library::new(path)?;
        Self::from_library(library)
    }
    pub unsafe fn from_library<L>(library: L) -> Result<Self, ::libloading::Error>
    where
        L: Into<::libloading::Library>,
    {
        let __library = library.into();
        let loomc_allocator_system = __library.get(b"loomc_allocator_system\0").map(|sym| *sym)?;
        let loomc_allocator_free = __library.get(b"loomc_allocator_free\0").map(|sym| *sym)?;
        let loomc_byte_sequence_length = __library
            .get(b"loomc_byte_sequence_length\0")
            .map(|sym| *sym)?;
        let loomc_byte_sequence_clone = __library
            .get(b"loomc_byte_sequence_clone\0")
            .map(|sym| *sym)?;
        let loomc_status_free = __library.get(b"loomc_status_free\0").map(|sym| *sym)?;
        let loomc_status_format = __library.get(b"loomc_status_format\0").map(|sym| *sym)?;
        let loomc_source_create = __library.get(b"loomc_source_create\0").map(|sym| *sym)?;
        let loomc_source_release = __library.get(b"loomc_source_release\0").map(|sym| *sym)?;
        let loomc_source_identifier = __library
            .get(b"loomc_source_identifier\0")
            .map(|sym| *sym)?;
        let loomc_context_create = __library.get(b"loomc_context_create\0").map(|sym| *sym)?;
        let loomc_context_release = __library.get(b"loomc_context_release\0").map(|sym| *sym)?;
        let loomc_result_release = __library.get(b"loomc_result_release\0").map(|sym| *sym)?;
        let loomc_result_succeeded = __library.get(b"loomc_result_succeeded\0").map(|sym| *sym)?;
        let loomc_result_diagnostic_count = __library
            .get(b"loomc_result_diagnostic_count\0")
            .map(|sym| *sym)?;
        let loomc_result_diagnostic_at = __library
            .get(b"loomc_result_diagnostic_at\0")
            .map(|sym| *sym)?;
        let loomc_result_artifact_count = __library
            .get(b"loomc_result_artifact_count\0")
            .map(|sym| *sym)?;
        let loomc_result_artifact_at = __library
            .get(b"loomc_result_artifact_at\0")
            .map(|sym| *sym)?;
        let loomc_workspace_create = __library.get(b"loomc_workspace_create\0").map(|sym| *sym)?;
        let loomc_workspace_trim = __library.get(b"loomc_workspace_trim\0").map(|sym| *sym)?;
        let loomc_workspace_release = __library
            .get(b"loomc_workspace_release\0")
            .map(|sym| *sym)?;
        let loomc_module_release = __library.get(b"loomc_module_release\0").map(|sym| *sym)?;
        let loomc_module_serialize_to_source = __library
            .get(b"loomc_module_serialize_to_source\0")
            .map(|sym| *sym)?;
        let loomc_pass_program_release = __library
            .get(b"loomc_pass_program_release\0")
            .map(|sym| *sym)?;
        let loomc_compiler_create = __library.get(b"loomc_compiler_create\0").map(|sym| *sym)?;
        let loomc_compile_module = __library.get(b"loomc_compile_module\0").map(|sym| *sym)?;
        let loomc_compiler_release = __library.get(b"loomc_compiler_release\0").map(|sym| *sym)?;
        let loomc_pass_program_create_from_target_pipeline = __library
            .get(b"loomc_pass_program_create_from_target_pipeline\0")
            .map(|sym| *sym)?;
        let loomc_target_profile_release = __library
            .get(b"loomc_target_profile_release\0")
            .map(|sym| *sym)?;
        let loomc_target_environment_release = __library
            .get(b"loomc_target_environment_release\0")
            .map(|sym| *sym)?;
        let loomc_emit_module = __library.get(b"loomc_emit_module\0").map(|sym| *sym)?;
        let loomc_link_index_builder_create = __library
            .get(b"loomc_link_index_builder_create\0")
            .map(|sym| *sym)?;
        let loomc_link_index_builder_release = __library
            .get(b"loomc_link_index_builder_release\0")
            .map(|sym| *sym)?;
        let loomc_link_index_builder_add_source = __library
            .get(b"loomc_link_index_builder_add_source\0")
            .map(|sym| *sym)?;
        let loomc_link_index_builder_finish = __library
            .get(b"loomc_link_index_builder_finish\0")
            .map(|sym| *sym)?;
        let loomc_link_index_release = __library
            .get(b"loomc_link_index_release\0")
            .map(|sym| *sym)?;
        let loomc_linker_create = __library.get(b"loomc_linker_create\0").map(|sym| *sym)?;
        let loomc_link_module = __library.get(b"loomc_link_module\0").map(|sym| *sym)?;
        let loomc_linker_release = __library.get(b"loomc_linker_release\0").map(|sym| *sym)?;
        let loomc_target_environment_create_amdgpu = __library
            .get(b"loomc_target_environment_create_amdgpu\0")
            .map(|sym| *sym)?;
        let loomc_target_profile_create_amdgpu = __library
            .get(b"loomc_target_profile_create_amdgpu\0")
            .map(|sym| *sym)?;
        let loomc_target_environment_create_xdna = __library
            .get(b"loomc_target_environment_create_xdna\0")
            .map(|sym| *sym)?;
        let loomc_target_profile_create_xdna = __library
            .get(b"loomc_target_profile_create_xdna\0")
            .map(|sym| *sym)?;
        let loomc_module_import_cxx = __library
            .get(b"loomc_module_import_cxx\0")
            .map(|sym| *sym)?;
        Ok(Loomc {
            __library,
            loomc_allocator_system,
            loomc_allocator_free,
            loomc_byte_sequence_length,
            loomc_byte_sequence_clone,
            loomc_status_free,
            loomc_status_format,
            loomc_source_create,
            loomc_source_release,
            loomc_source_identifier,
            loomc_context_create,
            loomc_context_release,
            loomc_result_release,
            loomc_result_succeeded,
            loomc_result_diagnostic_count,
            loomc_result_diagnostic_at,
            loomc_result_artifact_count,
            loomc_result_artifact_at,
            loomc_workspace_create,
            loomc_workspace_trim,
            loomc_workspace_release,
            loomc_module_release,
            loomc_module_serialize_to_source,
            loomc_pass_program_release,
            loomc_compiler_create,
            loomc_compile_module,
            loomc_compiler_release,
            loomc_pass_program_create_from_target_pipeline,
            loomc_target_profile_release,
            loomc_target_environment_release,
            loomc_emit_module,
            loomc_link_index_builder_create,
            loomc_link_index_builder_release,
            loomc_link_index_builder_add_source,
            loomc_link_index_builder_finish,
            loomc_link_index_release,
            loomc_linker_create,
            loomc_link_module,
            loomc_linker_release,
            loomc_target_environment_create_amdgpu,
            loomc_target_profile_create_amdgpu,
            loomc_target_environment_create_xdna,
            loomc_target_profile_create_xdna,
            loomc_module_import_cxx,
        })
    }
    #[doc = " Returns a process-global system allocator.\n\n @return Allocator backed by the process heap."]
    pub unsafe fn loomc_allocator_system(&self) -> loomc_allocator_t {
        (self.loomc_allocator_system)()
    }
    #[doc = " Frees memory previously returned by `allocator`.\n\n @param allocator Allocator that returned `ptr`.\n @param ptr Allocation to free. Passing `NULL` is allowed.\n\n When `ptr` is non-NULL, `allocator.ctl` must also be non-NULL. Invalid\n allocator values are programmer errors because this function has no status\n channel."]
    pub unsafe fn loomc_allocator_free(
        &self,
        allocator: loomc_allocator_t,
        ptr: *mut ::std::os::raw::c_void,
    ) {
        (self.loomc_allocator_free)(allocator, ptr)
    }
    #[doc = " Returns the logical byte length of `sequence`.\n\n @param sequence Sequence to inspect, or NULL.\n @return Sequence length, or zero for a NULL sequence."]
    pub unsafe fn loomc_byte_sequence_length(&self, sequence: *const loomc_byte_sequence_t) -> u64 {
        (self.loomc_byte_sequence_length)(sequence)
    }
    #[doc = " Clones `sequence` into one contiguous allocator-owned span.\n\n @param sequence Sequence to clone.\n @param allocator Host allocator owning the returned storage.\n @param out_span Receives the contiguous clone on success.\n @return OK when the complete sequence was cloned.\n\n The caller frees `out_span->data` with `allocator`. Empty sequences return\n an empty span without allocating. On failure `out_span` is empty."]
    pub unsafe fn loomc_byte_sequence_clone(
        &self,
        sequence: *const loomc_byte_sequence_t,
        allocator: loomc_allocator_t,
        out_span: *mut loomc_byte_span_t,
    ) -> loomc_status_t {
        (self.loomc_byte_sequence_clone)(sequence, allocator, out_span)
    }
    #[doc = " Frees status storage, if any.\n\n @param status Status to free. Passing OK or a code-only status is allowed."]
    pub unsafe fn loomc_status_free(&self, status: loomc_status_t) {
        (self.loomc_status_free)(status)
    }
    #[doc = " Formats `status` into `buffer` using the two-pass pattern.\n\n @param status Status to format.\n @param buffer_capacity Number of bytes available in `buffer`.\n @param buffer Output buffer, or `NULL` when querying the required length.\n @param out_length Receives the number of bytes required or written,\n excluding any trailing NUL byte.\n @return True when `buffer` was large enough and formatting completed.\n\n @lifetime\n Formatted bytes are owned by the caller-provided buffer."]
    pub unsafe fn loomc_status_format(
        &self,
        status: loomc_status_t,
        buffer_capacity: loomc_host_size_t,
        buffer: *mut ::std::os::raw::c_char,
        out_length: *mut loomc_host_size_t,
    ) -> bool {
        (self.loomc_status_format)(status, buffer_capacity, buffer, out_length)
    }
    #[doc = " Creates an immutable source handle.\n\n @param options Source format, identity, bytes, and storage policy.\n @param allocator Host allocator used for source-owned storage.\n @param out_source Receives one retained source on success.\n @return OK when the source was created. Invalid argument is returned for\n malformed descriptors or impossible storage/release combinations.\n\n @ownership\n The caller owns the returned reference and releases it with\n `loomc_source_release`.\n\n @lifetime\n The source always copies `options->identifier`. Source contents are\n borrowed, copied, or externally released according to `options->storage`.\n Borrowed contents must outlive the source.\n\n @thread_safety\n The returned source is immutable and may be shared across threads."]
    pub unsafe fn loomc_source_create(
        &self,
        options: *const loomc_source_options_t,
        allocator: loomc_allocator_t,
        out_source: *mut *mut loomc_source_t,
    ) -> loomc_status_t {
        (self.loomc_source_create)(options, allocator, out_source)
    }
    #[doc = " Releases `source` from one owner.\n\n @param source Source to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are safe to perform from multiple threads. The\n source is destroyed when the final reference is released."]
    pub unsafe fn loomc_source_release(&self, source: *mut loomc_source_t) {
        (self.loomc_source_release)(source)
    }
    #[doc = " Returns the source identifier.\n\n @param source Source to inspect.\n @return Borrowed identifier view owned by `source`.\n\n @lifetime\n The returned view remains valid until `source` is released."]
    pub unsafe fn loomc_source_identifier(
        &self,
        source: *const loomc_source_t,
    ) -> loomc_string_view_t {
        (self.loomc_source_identifier)(source)
    }
    #[doc = " Creates a reusable Loom API context.\n\n @param options Context options, or `NULL` for defaults.\n @param allocator Host allocator used for context-owned storage.\n @param out_context Receives one retained context on success.\n @return OK when the context was created.\n\n @ownership\n The caller owns the returned reference and releases it with\n `loomc_context_release`.\n\n @thread_safety\n The returned context is immutable and may be shared across prepared tools\n and worker threads."]
    pub unsafe fn loomc_context_create(
        &self,
        options: *const loomc_context_options_t,
        allocator: loomc_allocator_t,
        out_context: *mut *mut loomc_context_t,
    ) -> loomc_status_t {
        (self.loomc_context_create)(options, allocator, out_context)
    }
    #[doc = " Releases `context` from one owner.\n\n @param context Context to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are safe to perform from multiple threads. The\n context is destroyed when the final reference is released."]
    pub unsafe fn loomc_context_release(&self, context: *mut loomc_context_t) {
        (self.loomc_context_release)(context)
    }
    #[doc = " Releases `result` from one owner.\n\n @param result Result to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are safe to perform from multiple threads. The\n result is destroyed when the final reference is released."]
    pub unsafe fn loomc_result_release(&self, result: *mut loomc_result_t) {
        (self.loomc_result_release)(result)
    }
    #[doc = " Returns true when `result` succeeded.\n\n @param result Result to inspect.\n @return True when `loomc_result_state(result)` is\n `LOOMC_RESULT_STATE_SUCCEEDED`."]
    pub unsafe fn loomc_result_succeeded(&self, result: *const loomc_result_t) -> bool {
        (self.loomc_result_succeeded)(result)
    }
    #[doc = " Returns the number of diagnostics attached to `result`.\n\n @param result Result to inspect.\n @return Diagnostic count."]
    pub unsafe fn loomc_result_diagnostic_count(
        &self,
        result: *const loomc_result_t,
    ) -> loomc_host_size_t {
        (self.loomc_result_diagnostic_count)(result)
    }
    #[doc = " Returns a diagnostic by index.\n\n @param result Result to inspect.\n @param index Zero-based diagnostic index.\n @return Borrowed diagnostic view, or `NULL` when `index` is out of range.\n\n @lifetime\n The returned pointer remains valid until `result` is released."]
    pub unsafe fn loomc_result_diagnostic_at(
        &self,
        result: *const loomc_result_t,
        index: loomc_host_size_t,
    ) -> *const loomc_diagnostic_t {
        (self.loomc_result_diagnostic_at)(result, index)
    }
    #[doc = " Returns the number of artifacts attached to `result`.\n\n @param result Result to inspect.\n @return Artifact count."]
    pub unsafe fn loomc_result_artifact_count(
        &self,
        result: *const loomc_result_t,
    ) -> loomc_host_size_t {
        (self.loomc_result_artifact_count)(result)
    }
    #[doc = " Returns an artifact by index.\n\n @param result Result to inspect.\n @param index Zero-based artifact index.\n @return Borrowed artifact view, or `NULL` when `index` is out of range.\n\n @lifetime\n The returned pointer remains valid until `result` is released."]
    pub unsafe fn loomc_result_artifact_at(
        &self,
        result: *const loomc_result_t,
        index: loomc_host_size_t,
    ) -> *const loomc_artifact_t {
        (self.loomc_result_artifact_at)(result, index)
    }
    #[doc = " Creates a mutable workspace for one worker at a time.\n\n @param options Workspace allocation options, or `NULL` for defaults.\n @param allocator Host allocator used for workspace-owned storage.\n @param out_workspace Receives the created workspace on success.\n @return OK when the workspace was created.\n\n @ownership\n The caller owns the returned workspace and releases it with\n `loomc_workspace_release`.\n\n @lifetime\n Sources, retained results, frozen link indexes, prepared linkers, and\n prepared compilers do not use workspace arena storage unless an operation\n descriptor explicitly says so. Modules created, linked, cloned, or\n deserialized with a workspace retain that workspace and return their arena\n blocks when released.\n\n @thread_safety\n The returned workspace is mutable scratch and is intended for one worker at\n a time."]
    pub unsafe fn loomc_workspace_create(
        &self,
        options: *const loomc_workspace_options_t,
        allocator: loomc_allocator_t,
        out_workspace: *mut *mut loomc_workspace_t,
    ) -> loomc_status_t {
        (self.loomc_workspace_create)(options, allocator, out_workspace)
    }
    #[doc = " Trims idle arena blocks owned by `workspace`.\n\n @param workspace Workspace to trim.\n\n @lifetime\n Trim returns blocks that are already idle in the workspace block pool to the\n host allocator. Retained modules created from this workspace remain valid\n across trim, but their active arena blocks cannot be reused until those\n modules are released. Results, sources, frozen indexes, and prepared tools\n remain valid.\n\n @thread_safety\n External synchronization is required if another thread may be using the same\n workspace."]
    pub unsafe fn loomc_workspace_trim(&self, workspace: *mut loomc_workspace_t) {
        (self.loomc_workspace_trim)(workspace)
    }
    #[doc = " Releases `workspace` and all storage it owns.\n\n @param workspace Workspace to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are safe from multiple threads. The workspace is\n destroyed when the final reference is released; no thread may be mutating it\n at that moment."]
    pub unsafe fn loomc_workspace_release(&self, workspace: *mut loomc_workspace_t) {
        (self.loomc_workspace_release)(workspace)
    }
    #[doc = " Releases an opaque module from one owner.\n\n @param module Module to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are intended to be safe from multiple threads. The\n module is destroyed when the final reference is released."]
    pub unsafe fn loomc_module_release(&self, module: *mut loomc_module_t) {
        (self.loomc_module_release)(module)
    }
    #[doc = " Serializes a module into an immutable source handle.\n\n @param module Module to serialize.\n @param options Serialization options. `NULL` selects textual `.loom`.\n @param allocator Host allocator used for source-owned storage.\n @param out_source Receives one retained source on success.\n @return OK when serialization succeeded.\n\n @ownership\n The caller owns the returned source and releases it with\n `loomc_source_release`. Serialized bytes are owned by that source and remain\n valid until the source is released.\n\n @par Resolved Targets\n When a prior compilation retained resolved function targets outside the\n module IR, serialization first projects them into a derived module without\n mutating the source. The resulting source is self-contained and can be\n deserialized in a fresh context without the original profiles.\n Serialization fails when an exact target definition cannot be materialized;\n it never silently emits the less-specific authored target.\n\n @thread_safety\n Serialization is read-only with respect to `module`. Concurrent\n serialization of the same module is valid when the caller guarantees that no\n mutating operation is active."]
    pub unsafe fn loomc_module_serialize_to_source(
        &self,
        module: *const loomc_module_t,
        options: *const loomc_module_serialize_options_t,
        allocator: loomc_allocator_t,
        out_source: *mut *mut loomc_source_t,
    ) -> loomc_status_t {
        (self.loomc_module_serialize_to_source)(module, options, allocator, out_source)
    }
    #[doc = " Releases a pass program from one owner.\n\n @param pass_program Pass program to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are safe from multiple threads. The pass program\n is destroyed when the final reference is released."]
    pub unsafe fn loomc_pass_program_release(&self, pass_program: *mut loomc_pass_program_t) {
        (self.loomc_pass_program_release)(pass_program)
    }
    #[doc = " Creates a prepared immutable compiler.\n\n @param context Context shared with modules compiled by this compiler.\n @param options Compiler configuration, or `NULL` for defaults.\n @param allocator Host allocator used for compiler-owned storage.\n @param out_compiler Receives one retained compiler on success.\n @return OK when the compiler was created.\n\n @ownership\n The caller owns the returned reference and releases it with\n `loomc_compiler_release`.\n\n @thread_safety\n The returned compiler is immutable and may be shared across worker threads."]
    pub unsafe fn loomc_compiler_create(
        &self,
        context: *mut loomc_context_t,
        options: *const loomc_compiler_options_t,
        allocator: loomc_allocator_t,
        out_compiler: *mut *mut loomc_compiler_t,
    ) -> loomc_status_t {
        (self.loomc_compiler_create)(context, options, allocator, out_compiler)
    }
    #[doc = " Compiles a mutable module into in-memory artifacts.\n\n @param compiler Prepared compiler.\n @param workspace Invocation-local scratch workspace.\n @param pass_program Prepared pass program selected for this invocation.\n @param module Module produced by deserialization, linking, or another module\n operation. The invocation borrows the module for the duration of the call\n and may rewrite its IR in place.\n @param options Compile invocation options, or `NULL` for defaults.\n @param allocator Host allocator used for result-owned storage.\n @param out_result Receives a retained result for the operation.\n @return OK when the invocation ran to a result. Non-OK statuses represent\n API misuse or infrastructure failures before a result could be produced.\n\n @ownership\n The caller owns `out_result` on an OK return and releases it with\n `loomc_result_release`.\n\n @par Postcondition\n The caller retains ownership of `module`, and the module handle remains\n valid after the call. Its IR contents may have been transformed by the\n selected pass program. Callers needing independent later invocations of\n the original IR provide independent module storage before compilation.\n A successful target-specialized invocation also retains its concrete\n function-version facts in the module handle for a later\n `loomc_emit_module` call. Applied configuration bindings are copied into the\n module for later emission reports, even when compilation requests no report.\n Continuing compilation carries these products with their live functions;\n explicit target specialization refines the requested function contexts.\n A failed mutation clears the products. Cloning preserves the function\n products and applied bindings; IR serialization does not persist them.\n\n @lifetime\n Returned results and artifacts do not borrow from `workspace` and remain\n valid after `loomc_workspace_trim`. The invocation borrows\n `options->config_module` only for the duration of the call and does not\n mutate or retain it.\n\n @par Artifact Requests\n Artifact emission is opt-in through `loomc_compile_options_t`. Requesting\n module text or bytecode serializes the transformed module into result-owned\n bytes. Requesting a report returns a JSON artifact with invocation metadata,\n result state, diagnostic count, and the count of other artifacts emitted by\n the invocation.\n\n @thread_safety\n Calls using the same compiler and pass program may run concurrently when\n each call uses a distinct workspace and distinct module, or when access to\n shared workspaces and modules is synchronized externally. The compiler and\n pass program are immutable after creation.\n\n @par Target Specialization\n `loomc_target_specialization_options_t` may be attached to\n `loomc_compile_options_t::next`. Direct specialization rows bind selected\n function versions to complete profiles. Target binding rows bind authored\n `target.decl` contexts and seed every function assigned to the declaration.\n All profiles must be compatible with the compiler context's target\n environment. Unrequested functions retain their authored targets, including\n generic targets, and targetless functions remain targetless."]
    pub unsafe fn loomc_compile_module(
        &self,
        compiler: *mut loomc_compiler_t,
        workspace: *mut loomc_workspace_t,
        pass_program: *const loomc_pass_program_t,
        module: *mut loomc_module_t,
        options: *const loomc_compile_options_t,
        allocator: loomc_allocator_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t {
        (self.loomc_compile_module)(
            compiler,
            workspace,
            pass_program,
            module,
            options,
            allocator,
            out_result,
        )
    }
    #[doc = " Releases a prepared compiler from one owner.\n\n @param compiler Compiler to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are intended to be safe from multiple threads. The\n compiler is destroyed when the final reference is released."]
    pub unsafe fn loomc_compiler_release(&self, compiler: *mut loomc_compiler_t) {
        (self.loomc_compiler_release)(compiler)
    }
    #[doc = " Creates a prepared target lowering pass program.\n\n The context must have been created with a target environment using\n `loomc_context_target_options_t`. The returned pass program is an ordinary\n `loomc_pass_program_t` and is passed to `loomc_compile_module` like any\n other prepared pipeline.\n\n @param context Context whose target environment selects the target package.\n @param options Target pipeline options, or `NULL` for defaults.\n @param allocator Host allocator used for pass-program and result storage.\n @param out_pass_program Receives one retained pass program when the result\n succeeds. Receives `NULL` when target pipeline preparation fails.\n @param out_result Receives a retained result containing pipeline\n preparation diagnostics and operation state.\n @return OK when the creation operation completed far enough to report a\n result. Non-OK statuses represent API misuse or infrastructure failures\n before a result could be produced.\n\n @ownership\n The caller owns `out_result` on an OK return and releases it with\n `loomc_result_release`. When a pass program is produced, the caller owns the\n returned reference and releases it with `loomc_pass_program_release`.\n\n @thread_safety\n The returned pass program is immutable and may be shared across worker\n threads.\n\n @par Sanitizer Assertions\n `loomc_sanitizer_options_t` may be attached to\n `loomc_target_pipeline_options_t::next`. Nonzero check bits insert\n sanitizer pass slots at the target pipeline's semantic assertion boundary."]
    pub unsafe fn loomc_pass_program_create_from_target_pipeline(
        &self,
        context: *mut loomc_context_t,
        options: *const loomc_target_pipeline_options_t,
        allocator: loomc_allocator_t,
        out_pass_program: *mut *mut loomc_pass_program_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t {
        (self.loomc_pass_program_create_from_target_pipeline)(
            context,
            options,
            allocator,
            out_pass_program,
            out_result,
        )
    }
    #[doc = " Releases a target profile from one owner.\n\n @param profile Target profile to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are safe from multiple threads. The profile is\n destroyed when the final reference is released."]
    pub unsafe fn loomc_target_profile_release(&self, profile: *mut loomc_target_profile_t) {
        (self.loomc_target_profile_release)(profile)
    }
    #[doc = " Releases a target environment from one owner.\n\n @param target_environment Target environment to release. Passing `NULL` is\n allowed.\n\n @thread_safety\n Retain/release operations are safe from multiple threads. The environment\n is destroyed when the final reference is released."]
    pub unsafe fn loomc_target_environment_release(
        &self,
        target_environment: *mut loomc_target_environment_t,
    ) {
        (self.loomc_target_environment_release)(target_environment)
    }
    #[doc = " Emits target artifacts from a prepared module.\n\n The module must already be in the target-low form expected by the selected\n emitter. This function does not run compile passes or link additional\n modules, and target specialization options are not accepted. When the\n module was prepared by `loomc_compile_module`, emission consumes the\n concrete function-version facts retained by that successful invocation.\n Other functions resolve their authored target witnesses from IR. A\n targetless or generic Low function that requires more precise target facts\n must be compiled with specialization before emission. The operation may\n mutate invocation-local scratch state inside `module`; callers that need to\n emit the same module concurrently should pass distinct module handles.\n\n @param target_environment Target environment that contains one or more\n linked emitters.\n @param workspace Invocation-local scratch workspace.\n @param module Mutable module containing prepared target IR.\n @param options Emission options, or `NULL` for defaults.\n @param allocator Host allocator used for result-owned storage.\n @param out_result Receives a retained result containing diagnostics and\n artifacts when the operation completes far enough to report them.\n @return OK when the emission operation produced a result. Non-OK statuses\n represent API misuse or infrastructure failures before a result could be\n produced.\n\n @ownership\n The caller owns `out_result` on an OK return and releases it with\n `loomc_result_release`.\n\n @lifetime\n Returned artifacts and diagnostics are owned by the result and remain valid\n until the result is released. They do not borrow from `workspace` or\n `module`.\n\n @thread_safety\n The target environment is immutable and may be shared across threads. The\n workspace and module are invocation-local mutable objects and must not be\n used concurrently by multiple emission calls."]
    pub unsafe fn loomc_emit_module(
        &self,
        target_environment: *mut loomc_target_environment_t,
        workspace: *mut loomc_workspace_t,
        module: *mut loomc_module_t,
        options: *const loomc_emit_options_t,
        allocator: loomc_allocator_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t {
        (self.loomc_emit_module)(
            target_environment,
            workspace,
            module,
            options,
            allocator,
            out_result,
        )
    }
    #[doc = " Creates an empty link-index builder.\n\n @param context Reusable Loom API context retained by the builder.\n @param options Builder options, or `NULL` for defaults.\n @param allocator Host allocator used for builder and frozen-index storage.\n @param out_builder Receives the mutable builder on success.\n @return OK when the builder was created.\n\n @ownership\n The caller owns the returned builder and releases it with\n `loomc_link_index_builder_release`."]
    pub unsafe fn loomc_link_index_builder_create(
        &self,
        context: *mut loomc_context_t,
        options: *const loomc_link_index_builder_options_t,
        allocator: loomc_allocator_t,
        out_builder: *mut *mut loomc_link_index_builder_t,
    ) -> loomc_status_t {
        (self.loomc_link_index_builder_create)(context, options, allocator, out_builder)
    }
    #[doc = " Releases a link-index builder.\n\n @param builder Builder to release. Passing `NULL` is allowed.\n\n @thread_safety\n No other thread may be reserving, filling, or finishing `builder`."]
    pub unsafe fn loomc_link_index_builder_release(
        &self,
        builder: *mut loomc_link_index_builder_t,
    ) {
        (self.loomc_link_index_builder_release)(builder)
    }
    #[doc = " Reserves and fills the next source slot.\n\n @param builder Builder to mutate.\n @param source Source retained by the builder on success.\n @param options Provider options copied by this call, or `NULL` for defaults.\n @param out_slot Receives the source slot, or `NULL` if not needed.\n @return OK when the source was queued for indexing."]
    pub unsafe fn loomc_link_index_builder_add_source(
        &self,
        builder: *mut loomc_link_index_builder_t,
        source: *mut loomc_source_t,
        options: *const loomc_link_index_source_options_t,
        out_slot: *mut loomc_link_index_source_slot_t,
    ) -> loomc_status_t {
        (self.loomc_link_index_builder_add_source)(builder, source, options, out_slot)
    }
    #[doc = " Finishes a builder into a frozen immutable link index.\n\n @param builder Builder to finish. The builder becomes finished after this\n call returns OK, whether the operation result succeeded or failed.\n @param out_link_index Receives one retained frozen index when the result\n state is succeeded.\n @param out_result Receives one retained result describing indexing outcome.\n @return OK when a result was produced. Non-OK status means API or\n infrastructure failure prevented result production.\n\n @ownership\n Finishing does not consume `builder`; the caller still releases it with\n `loomc_link_index_builder_release` after the call returns. The caller owns\n `out_link_index` on successful result state and releases it with\n `loomc_link_index_release`. The caller owns `out_result` and releases it\n with `loomc_result_release`.\n\n @error_contract\n Invalid Loom text, malformed bytecode, empty reserved slots, and unsupported\n source formats produce OK status plus a failed result with diagnostics."]
    pub unsafe fn loomc_link_index_builder_finish(
        &self,
        builder: *mut loomc_link_index_builder_t,
        out_link_index: *mut *mut loomc_link_index_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t {
        (self.loomc_link_index_builder_finish)(builder, out_link_index, out_result)
    }
    #[doc = " Releases a frozen link index from one owner.\n\n @param link_index Link index to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations for frozen indexes are intended to be safe from\n multiple threads. No mutation occurs after the index is frozen."]
    pub unsafe fn loomc_link_index_release(&self, link_index: *mut loomc_link_index_t) {
        (self.loomc_link_index_release)(link_index)
    }
    #[doc = " Creates a prepared immutable linker.\n\n @param context Context shared with all link indexes used by this linker.\n @param options Linker configuration, or `NULL` for defaults.\n @param allocator Host allocator used for linker-owned storage.\n @param out_linker Receives one retained linker on success.\n @return OK when the linker was created.\n\n @ownership\n The caller owns the returned reference and releases it with\n `loomc_linker_release`.\n\n @thread_safety\n The returned linker is immutable and may be shared across worker threads."]
    pub unsafe fn loomc_linker_create(
        &self,
        context: *mut loomc_context_t,
        options: *const loomc_linker_options_t,
        allocator: loomc_allocator_t,
        out_linker: *mut *mut loomc_linker_t,
    ) -> loomc_status_t {
        (self.loomc_linker_create)(context, options, allocator, out_linker)
    }
    #[doc = " Links a frozen index into an opaque module.\n\n @param linker Prepared linker.\n @param workspace Invocation-local scratch workspace.\n @param options Link invocation options.\n @param out_module Receives a retained linked module when the result\n succeeds. Receives `NULL` when the result fails.\n @param out_result Receives a retained result for the operation.\n @return OK when the invocation ran to a result. Non-OK statuses represent\n API misuse or infrastructure failures before a result could be produced.\n\n @ownership\n The caller owns `out_module` when non-NULL and releases it with\n `loomc_module_release`. The caller always owns `out_result` on an OK return\n and releases it with `loomc_result_release`.\n\n @lifetime\n Returned results do not borrow from `workspace` and remain valid after\n `loomc_workspace_trim`. Returned modules retain `workspace` and keep their\n arena blocks live until released.\n\n @thread_safety\n Calls using the same linker may run concurrently when each call uses a\n distinct workspace. The same workspace requires external synchronization.\n"]
    pub unsafe fn loomc_link_module(
        &self,
        linker: *mut loomc_linker_t,
        workspace: *mut loomc_workspace_t,
        options: *const loomc_link_options_t,
        out_module: *mut *mut loomc_module_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t {
        (self.loomc_link_module)(linker, workspace, options, out_module, out_result)
    }
    #[doc = " Releases a prepared linker from one owner.\n\n @param linker Linker to release. Passing `NULL` is allowed.\n\n @thread_safety\n Retain/release operations are intended to be safe from multiple threads. The\n linker is destroyed when the final reference is released."]
    pub unsafe fn loomc_linker_release(&self, linker: *mut loomc_linker_t) {
        (self.loomc_linker_release)(linker)
    }
    #[doc = " Creates a target environment containing the AMDGPU target package.\n\n @param allocator Host allocator used for target-environment storage.\n @param out_target_environment Receives one retained target environment on\n success.\n @return OK when the target environment was created.\n\n @ownership\n The caller owns the returned reference and releases it with\n `loomc_target_environment_release`."]
    pub unsafe fn loomc_target_environment_create_amdgpu(
        &self,
        allocator: loomc_allocator_t,
        out_target_environment: *mut *mut loomc_target_environment_t,
    ) -> loomc_status_t {
        (self.loomc_target_environment_create_amdgpu)(allocator, out_target_environment)
    }
    #[doc = " Creates an AMDGPU target profile from a canonical target selector.\n\n @param target_environment AMDGPU-capable target environment.\n @param options Profile options. Required.\n @param allocator Host allocator used for profile storage.\n @param out_profile Receives one retained profile on success.\n @return OK when the target is known, HSACO-capable, and has a supported Loom\n descriptor-family bundle.\n\n @ownership\n The caller owns the returned profile and releases it with\n `loomc_target_profile_release`."]
    pub unsafe fn loomc_target_profile_create_amdgpu(
        &self,
        target_environment: *mut loomc_target_environment_t,
        options: *const loomc_amdgpu_profile_options_t,
        allocator: loomc_allocator_t,
        out_profile: *mut *mut loomc_target_profile_t,
    ) -> loomc_status_t {
        (self.loomc_target_profile_create_amdgpu)(
            target_environment,
            options,
            allocator,
            out_profile,
        )
    }
    #[doc = " Creates a target environment containing the AIE2P XDNA compiler and emitter.\n\n @param allocator Host allocator used for target-environment storage.\n @param out_target_environment Receives one retained environment on success.\n @return OK when the target environment was created.\n\n @ownership\n The caller releases the returned reference with\n `loomc_target_environment_release`. The environment can be shared by\n compiler instances and workspaces across JIT invocations."]
    pub unsafe fn loomc_target_environment_create_xdna(
        &self,
        allocator: loomc_allocator_t,
        out_target_environment: *mut *mut loomc_target_environment_t,
    ) -> loomc_status_t {
        (self.loomc_target_environment_create_xdna)(allocator, out_target_environment)
    }
    #[doc = " Creates an immutable profile for a supported AIE2P device key.\n\n The key identifies the array geometry and register/configuration ABI, for\n example `amd.xdna.strix_halo.17f0_11`. This is an offline lookup; it does\n not probe hardware. Unknown keys fail instead of assuming a compatible\n device. Supply the profile through ordinary\n `loomc_target_specialization_options_t` function or target-declaration\n bindings. The compiled function versions retain their device facts through\n emission, so no separate emit profile is needed.\n\n @param target_environment Environment containing the AIE2P target package.\n @param device_key Exact device key; the view need not be NUL-terminated.\n @param allocator Host allocator used for the profile handle.\n @param out_profile Receives one retained profile on success, NULL on\n failure.\n @return OK on success; invalid argument for an unsupported key or\n environment.\n\n @ownership\n The caller releases the returned reference with\n `loomc_target_profile_release`. The profile copies the device key and\n retains the target environment. The profile is immutable and may be reused\n across threads and compilations."]
    pub unsafe fn loomc_target_profile_create_xdna(
        &self,
        target_environment: *mut loomc_target_environment_t,
        device_key: loomc_string_view_t,
        allocator: loomc_allocator_t,
        out_profile: *mut *mut loomc_target_profile_t,
    ) -> loomc_status_t {
        (self.loomc_target_profile_create_xdna)(
            target_environment,
            device_key,
            allocator,
            out_profile,
        )
    }
    #[doc = " Imports C/C++ source into a verified High IR module, without cleanup passes.\n\n @param context Immutable context containing the core dialects.\n @param workspace Workspace backing the returned module's arena storage.\n @param source Source with UNKNOWN format. Its identifier labels diagnostics\n and supplies the main file's path for quoted include lookup.\n @param options Source configuration, or NULL for defaults.\n @param allocator Host allocator for public handles and temporary adapters.\n @param out_module Receives one owned module on successful source admission.\n @param out_result Receives one owned result with retained diagnostics.\n @return OK for successful import or diagnosed source rejection. Rejection\n returns a failed result and NULL module. Infrastructure/API failures return\n non-OK status and NULL outputs. C++ exceptions never cross this boundary.\n\n @ownership\n Release outputs with loomc_module_release and loomc_result_release. The\n module retains its context/workspace. The result owns diagnostic contents.\n\n @lifetime\n Source/include bytes, options, and callback state may be released on return.\n Neither the module nor the result retains borrowed frontend or AST storage.\n\n @thread_safety\n Each import requires exclusive access to its workspace. Concurrent imports\n may share an immutable context and immutable source handles."]
    pub unsafe fn loomc_module_import_cxx(
        &self,
        context: *mut loomc_context_t,
        workspace: *mut loomc_workspace_t,
        source: *const loomc_source_t,
        options: *const loomc_cxx_import_options_t,
        allocator: loomc_allocator_t,
        out_module: *mut *mut loomc_module_t,
        out_result: *mut *mut loomc_result_t,
    ) -> loomc_status_t {
        (self.loomc_module_import_cxx)(
            context, workspace, source, options, allocator, out_module, out_result,
        )
    }
}