File size: 85,580 Bytes
2f705f7 | 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 | // -*- C++ -*-
//===--------------------------- __config ---------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef _LIBCUDACXX_CONFIG
#define _LIBCUDACXX_CONFIG
#include "__cccl_config"
#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
# pragma clang system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
# pragma system_header
#endif // no system header
#if defined(__INTEL_LLVM_COMPILER)
# define _LIBCUDACXX_COMPILER_ICC_LLVM
#elif defined(__INTEL_COMPILER)
# define _LIBCUDACXX_COMPILER_ICC
#elif defined(__NVCOMPILER)
# define _LIBCUDACXX_COMPILER_NVHPC
#elif defined(__clang__)
# define _LIBCUDACXX_COMPILER_CLANG
# ifndef __apple_build_version__
# define _LIBCUDACXX_CLANG_VER (__clang_major__ * 100 + __clang_minor__)
# endif
#elif defined(__GNUC__)
# define _LIBCUDACXX_COMPILER_GCC
#elif defined(_MSC_VER)
# define _LIBCUDACXX_COMPILER_MSVC
#elif defined(__IBMCPP__)
# define _LIBCUDACXX_COMPILER_IBM
#elif defined(__CUDACC_RTC__)
# define _LIBCUDACXX_COMPILER_NVRTC
#endif
#if defined(_LIBCUDACXX_COMPILER_MSVC)
#if _MSC_VER < 1917
#define _LIBCUDACXX_COMPILER_MSVC_2017
#elif _MSC_VER < 1930
#define _LIBCUDACXX_COMPILER_MSVC_2019
#else
#define _LIBCUDACXX_COMPILER_MSVC_2022
#endif
#endif // defined(_LIBCUDACXX_COMPILER_MSVC)
#if defined(__NVCC__)
// This is not mutually exclusive with other compilers, as NVCC uses a host
// compiler.
# define _LIBCUDACXX_COMPILER_NVCC
#elif defined(_NVHPC_CUDA)
# define _LIBCUDACXX_COMPILER_NVHPC_CUDA
#elif defined(__CUDA__) && defined(_LIBCUDACXX_COMPILER_CLANG)
# define _LIBCUDACXX_COMPILER_CLANG_CUDA
#endif
#ifdef __CUDACC__
# define _LIBCUDACXX_CUDACC
# define _LIBCUDACXX_CUDACC_VER_MAJOR __CUDACC_VER_MAJOR__
# define _LIBCUDACXX_CUDACC_VER_MINOR __CUDACC_VER_MINOR__
# define _LIBCUDACXX_CUDACC_VER_BUILD __CUDACC_VER_BUILD__
# define _LIBCUDACXX_CUDACC_VER \
_LIBCUDACXX_CUDACC_VER_MAJOR * 100000 + _LIBCUDACXX_CUDACC_VER_MINOR * 1000 + \
_LIBCUDACXX_CUDACC_VER_BUILD
// TODO: Determine if this is necessary, I don't know why we automatically include this in <config>
# if defined(__clang__) || defined(__FLT16_MANT_DIG__)
# include <cuda_fp16.h>
# endif
#endif
// Some convenience macros to filter CUDACC versions
#if defined(_LIBCUDACXX_CUDACC) && _LIBCUDACXX_CUDACC_VER < 1102000
#define _LIBCUDACXX_CUDACC_BELOW_11_2
#endif // defined(_LIBCUDACXX_CUDACC) && _LIBCUDACXX_CUDACC_VER < 1102000
#if defined(_LIBCUDACXX_CUDACC) && _LIBCUDACXX_CUDACC_VER < 1103000
#define _LIBCUDACXX_CUDACC_BELOW_11_3
#endif // defined(_LIBCUDACXX_CUDACC) && _LIBCUDACXX_CUDACC_VER < 1103000
#if defined(_LIBCUDACXX_CUDACC) && _LIBCUDACXX_CUDACC_VER < 1108000
#define _LIBCUDACXX_CUDACC_BELOW_11_8
#endif // defined(_LIBCUDACXX_CUDACC) && _LIBCUDACXX_CUDACC_VER < 1108000
#if defined(_LIBCUDACXX_CUDACC) && _LIBCUDACXX_CUDACC_VER < 1203000
#define _LIBCUDACXX_CUDACC_BELOW_12_3
#endif // defined(_LIBCUDACXX_CUDACC) && _LIBCUDACXX_CUDACC_VER < 1203000
#if defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_HAS_PRAGMA_MSVC_WARNING
# if !defined(_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING)
# define _LIBCUDACXX_USE_PRAGMA_MSVC_WARNING
# endif // !_LIBCUDACXX_DISABLE_PRAGMA_MSVC_WARNING
#endif // _LIBCUDACXX_COMPILER_MSVC
#ifdef __cplusplus
// __config may be included in `extern "C"` contexts, switch back to include <nv/target>
extern "C++" {
#include <nv/target>
}
#ifdef __GNUC__
# define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
#else
# define _GNUC_VER 0
#endif
#define _LIBCUDACXX_VERSION 10000
#ifndef _LIBCUDACXX_ABI_VERSION
# define _LIBCUDACXX_ABI_VERSION 1
#endif
#ifndef _LIBCUDACXX_STD_VER
# if defined(_MSC_VER)
# if _MSVC_LANG <= 201103L
# define _LIBCUDACXX_STD_VER 11
# elif _MSVC_LANG <= 201402L
# define _LIBCUDACXX_STD_VER 14
# elif _MSVC_LANG <= 201703L
# define _LIBCUDACXX_STD_VER 17
# elif _MSVC_LANG <= 202002L
# define _LIBCUDACXX_STD_VER 20
# else
# define _LIBCUDACXX_STD_VER 23 // current year, or date of c++2b ratification
# endif
# else
# if __cplusplus <= 201103L
# define _LIBCUDACXX_STD_VER 11
# elif __cplusplus <= 201402L
# define _LIBCUDACXX_STD_VER 14
# elif __cplusplus <= 201703L
# define _LIBCUDACXX_STD_VER 17
# elif __cplusplus <= 202002L
# define _LIBCUDACXX_STD_VER 20
# else
# define _LIBCUDACXX_STD_VER 23 // current year, or date of c++2b ratification
# endif
# endif
#endif // _LIBCUDACXX_STD_VER
#if _LIBCUDACXX_STD_VER < 11
# error libcu++ requires C++11 or later
#endif
#if (defined(_LIBCUDACXX_COMPILER_NVHPC) && defined(__linux__)) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define __ELF__
#endif
#if defined(__ELF__)
# define _LIBCUDACXX_OBJECT_FORMAT_ELF 1
#elif defined(__MACH__)
# define _LIBCUDACXX_OBJECT_FORMAT_MACHO 1
#elif defined(_WIN32)
# define _LIBCUDACXX_OBJECT_FORMAT_COFF 1
#elif defined(__wasm__)
# define _LIBCUDACXX_OBJECT_FORMAT_WASM 1
#else
# error Unknown object file format
#endif
#if defined(_LIBCUDACXX_ABI_UNSTABLE) || _LIBCUDACXX_ABI_VERSION >= 2 || defined(__cuda_std__)
// Change short string representation so that string data starts at offset 0,
// improving its alignment in some cases.
# define _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT
// Fix deque iterator type in order to support incomplete types.
# define _LIBCUDACXX_ABI_INCOMPLETE_TYPES_IN_DEQUE
// Fix undefined behavior in how std::list stores its linked nodes.
# define _LIBCUDACXX_ABI_LIST_REMOVE_NODE_POINTER_UB
// Fix undefined behavior in how __tree stores its end and parent nodes.
# define _LIBCUDACXX_ABI_TREE_REMOVE_NODE_POINTER_UB
// Fix undefined behavior in how __hash_table stores its pointer types.
# define _LIBCUDACXX_ABI_FIX_UNORDERED_NODE_POINTER_UB
# define _LIBCUDACXX_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
# define _LIBCUDACXX_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
// Don't use a nullptr_t simulation type in C++03 instead using C++11 nullptr
// provided under the alternate keyword __nullptr, which changes the mangling
// of nullptr_t. This option is ABI incompatible with GCC in C++03 mode.
# define _LIBCUDACXX_ABI_ALWAYS_USE_CXX11_NULLPTR
// Define the `pointer_safety` enum as a C++11 strongly typed enumeration
// instead of as a class simulating an enum. If this option is enabled
// `pointer_safety` and `get_pointer_safety()` will no longer be available
// in C++03.
# define _LIBCUDACXX_ABI_POINTER_SAFETY_ENUM_TYPE
// Define a key function for `bad_function_call` in the library, to centralize
// its vtable and typeinfo to libc++ rather than having all other libraries
// using that class define their own copies.
# define _LIBCUDACXX_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
// Enable optimized version of __do_get_(un)signed which avoids redundant copies.
# define _LIBCUDACXX_ABI_OPTIMIZED_LOCALE_NUM_GET
// Use the smallest possible integer type to represent the index of the variant.
// Previously libc++ used "unsigned int" exclusively.
# define _LIBCUDACXX_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
// Unstable attempt to provide a more optimized std::function
# define _LIBCUDACXX_ABI_OPTIMIZED_FUNCTION
// All the regex constants must be distinct and nonzero.
# define _LIBCUDACXX_ABI_REGEX_CONSTANTS_NONZERO
#elif _LIBCUDACXX_ABI_VERSION == 1
# if !defined(_LIBCUDACXX_OBJECT_FORMAT_COFF)
// Enable compiling copies of now inline methods into the dylib to support
// applications compiled against older libraries. This is unnecessary with
// COFF dllexport semantics, since dllexport forces a non-inline definition
// of inline functions to be emitted anyway. Our own non-inline copy would
// conflict with the dllexport-emitted copy, so we disable it.
# define _LIBCUDACXX_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
# endif
#endif
#ifndef __has_attribute
#define __has_attribute(__x) 0
#endif
#ifndef __has_builtin
#define __has_builtin(__x) 0
#endif
#ifndef __has_extension
#define __has_extension(__x) 0
#endif
#ifndef __has_feature
#define __has_feature(__x) 0
#endif
#ifndef __has_cpp_attribute
#define __has_cpp_attribute(__x) 0
#endif
// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
// the compiler and '1' otherwise.
#ifndef __is_identifier
#define __is_identifier(__x) 1
#endif
#ifndef __has_declspec_attribute
#define __has_declspec_attribute(__x) 0
#endif
#define __has_keyword(__x) !(__is_identifier(__x))
#ifndef __has_include
#define __has_include(...) 0
#endif
#if !defined(_LIBCUDACXX_COMPILER_NVCC) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
// If NVCC is not being used <complex> can safely use `long double` without warnings
# define _LIBCUDACXX_HAS_COMPLEX_LONG_DOUBLE
// NVCC does not have a way of silencing non '_' prefixed UDLs
# define _LIBCUDACXX_HAS_STL_LITERALS
#endif
#if defined(_LIBCUDACXX_COMPILER_GCC) && __cplusplus < 201103L
#error "libc++ does not support using GCC with C++03. Please enable C++11"
#endif
// FIXME: ABI detection should be done via compiler builtin macros. This
// is just a placeholder until Clang implements such macros. For now assume
// that Windows compilers pretending to be MSVC++ target the Microsoft ABI,
// and allow the user to explicitly specify the ABI to handle cases where this
// heuristic falls short.
#if defined(_LIBCUDACXX_ABI_FORCE_ITANIUM) && defined(_LIBCUDACXX_ABI_FORCE_MICROSOFT)
# error "Only one of _LIBCUDACXX_ABI_FORCE_ITANIUM and _LIBCUDACXX_ABI_FORCE_MICROSOFT can be defined"
#elif defined(_LIBCUDACXX_ABI_FORCE_ITANIUM)
# define _LIBCUDACXX_ABI_ITANIUM
#elif defined(_LIBCUDACXX_ABI_FORCE_MICROSOFT)
# define _LIBCUDACXX_ABI_MICROSOFT
#else
# if defined(_WIN32) && defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_ABI_MICROSOFT
# else
# define _LIBCUDACXX_ABI_ITANIUM
# endif
#endif
#if defined(_LIBCUDACXX_ABI_MICROSOFT) && !defined(_LIBCUDACXX_NO_VCRUNTIME)
# define _LIBCUDACXX_ABI_VCRUNTIME
#endif
// Need to detect which libc we're using if we're on Linux.
#if defined(__linux__)
# include <features.h>
# if defined(__GLIBC_PREREQ)
# define _LIBCUDACXX_GLIBC_PREREQ(a, b) __GLIBC_PREREQ(a, b)
# else
# define _LIBCUDACXX_GLIBC_PREREQ(a, b) 0
# endif // defined(__GLIBC_PREREQ)
#endif // defined(__linux__)
#ifdef __LITTLE_ENDIAN__
# if __LITTLE_ENDIAN__
# define _LIBCUDACXX_LITTLE_ENDIAN
# endif // __LITTLE_ENDIAN__
#endif // __LITTLE_ENDIAN__
#ifdef __BIG_ENDIAN__
# if __BIG_ENDIAN__
# define _LIBCUDACXX_BIG_ENDIAN
# endif // __BIG_ENDIAN__
#endif // __BIG_ENDIAN__
#ifdef __BYTE_ORDER__
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define _LIBCUDACXX_LITTLE_ENDIAN
# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define _LIBCUDACXX_BIG_ENDIAN
# endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#endif // __BYTE_ORDER__
#ifdef __FreeBSD__
# include <sys/endian.h>
# if _BYTE_ORDER == _LITTLE_ENDIAN
# define _LIBCUDACXX_LITTLE_ENDIAN
# else // _BYTE_ORDER == _LITTLE_ENDIAN
# define _LIBCUDACXX_BIG_ENDIAN
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
# ifndef __LONG_LONG_SUPPORTED
# define _LIBCUDACXX_HAS_NO_LONG_LONG
# endif // __LONG_LONG_SUPPORTED
#endif // __FreeBSD__
#ifdef __NetBSD__
# include <sys/endian.h>
# if _BYTE_ORDER == _LITTLE_ENDIAN
# define _LIBCUDACXX_LITTLE_ENDIAN
# else // _BYTE_ORDER == _LITTLE_ENDIAN
# define _LIBCUDACXX_BIG_ENDIAN
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
# define _LIBCUDACXX_HAS_QUICK_EXIT
#endif // __NetBSD__
#if defined(_WIN32)
# define _LIBCUDACXX_WIN32API
# define _LIBCUDACXX_LITTLE_ENDIAN
# define _LIBCUDACXX_SHORT_WCHAR 1
// Both MinGW and native MSVC provide a "MSVC"-like environment
# define _LIBCUDACXX_MSVCRT_LIKE
// If mingw not explicitly detected, assume using MS C runtime only if
// a MS compatibility version is specified.
# if defined(_LIBCUDACXX_COMPILER_MSVC) && !defined(__MINGW32__)
# define _LIBCUDACXX_MSVCRT // Using Microsoft's C Runtime library
# endif
# if (defined(_M_AMD64) || defined(__x86_64__)) || (defined(_M_ARM) || defined(__arm__))
# define _LIBCUDACXX_HAS_BITSCAN64
# endif
# define _LIBCUDACXX_HAS_OPEN_WITH_WCHAR
# if defined(_LIBCUDACXX_MSVCRT)
# define _LIBCUDACXX_HAS_QUICK_EXIT
# endif
// Some CRT APIs are unavailable to store apps
# if defined(WINAPI_FAMILY)
# include <winapifamily.h>
# if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && \
(!defined(WINAPI_PARTITION_SYSTEM) || \
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM))
# define _LIBCUDACXX_WINDOWS_STORE_APP
# endif
# endif
#endif // defined(_WIN32)
#ifdef __sun__
# include <sys/isa_defs.h>
# ifdef _LITTLE_ENDIAN
# define _LIBCUDACXX_LITTLE_ENDIAN
# else
# define _LIBCUDACXX_BIG_ENDIAN
# endif
#endif // __sun__
#if defined(__CloudABI__)
// Certain architectures provide arc4random(). Prefer using
// arc4random() over /dev/{u,}random to make it possible to obtain
// random data even when using sandboxing mechanisms such as chroots,
// Capsicum, etc.
# define _LIBCUDACXX_USING_ARC4_RANDOM
#elif defined(__Fuchsia__) || defined(__wasi__)
# define _LIBCUDACXX_USING_GETENTROPY
#elif defined(__native_client__)
// NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
// including accesses to the special files under /dev. C++11's
// std::random_device is instead exposed through a NaCl syscall.
# define _LIBCUDACXX_USING_NACL_RANDOM
#elif defined(_LIBCUDACXX_WIN32API)
# define _LIBCUDACXX_USING_WIN32_RANDOM
#else
# define _LIBCUDACXX_USING_DEV_RANDOM
#endif
#ifndef _LIBCUDACXX_LITTLE_ENDIAN
#if defined(_LIBCUDACXX_COMPILER_NVRTC)
# define _LIBCUDACXX_LITTLE_ENDIAN
#endif
#endif // _LIBCUDACXX_LITTLE_ENDIAN
#if !defined(_LIBCUDACXX_LITTLE_ENDIAN) && !defined(_LIBCUDACXX_BIG_ENDIAN)
# include <endian.h>
# if __BYTE_ORDER == __LITTLE_ENDIAN
# define _LIBCUDACXX_LITTLE_ENDIAN
# elif __BYTE_ORDER == __BIG_ENDIAN
# define _LIBCUDACXX_BIG_ENDIAN
# else // __BYTE_ORDER == __BIG_ENDIAN
# error unable to determine endian
# endif
#endif // !defined(_LIBCUDACXX_LITTLE_ENDIAN) && !defined(_LIBCUDACXX_BIG_ENDIAN)
#if __has_attribute(__no_sanitize__) && !defined(_LIBCUDACXX_COMPILER_GCC)
# define _LIBCUDACXX_NO_CFI __attribute__((__no_sanitize__("cfi")))
#else
# define _LIBCUDACXX_NO_CFI
#endif
#if (defined(__ISO_C_VISIBLE) && __ISO_C_VISIBLE >= 2011) || __cplusplus >= 201103L
# if defined(__FreeBSD__)
# define _LIBCUDACXX_HAS_QUICK_EXIT
# define _LIBCUDACXX_HAS_C11_FEATURES
# elif defined(__Fuchsia__) || defined(__wasi__)
# define _LIBCUDACXX_HAS_QUICK_EXIT
# define _LIBCUDACXX_HAS_TIMESPEC_GET
# define _LIBCUDACXX_HAS_C11_FEATURES
# elif defined(__linux__)
# if !defined(_LIBCUDACXX_HAS_MUSL_LIBC)
# if _LIBCUDACXX_GLIBC_PREREQ(2, 15) || defined(__BIONIC__)
# define _LIBCUDACXX_HAS_QUICK_EXIT
# endif
# if _LIBCUDACXX_GLIBC_PREREQ(2, 17)
# define _LIBCUDACXX_HAS_C11_FEATURES
# define _LIBCUDACXX_HAS_TIMESPEC_GET
# endif
# else // defined(_LIBCUDACXX_HAS_MUSL_LIBC)
# define _LIBCUDACXX_HAS_QUICK_EXIT
# define _LIBCUDACXX_HAS_TIMESPEC_GET
# define _LIBCUDACXX_HAS_C11_FEATURES
# endif
# endif // __linux__
#endif
#if defined(_LIBCUDACXX_COMPILER_NVRTC)
# define __alignof(x) alignof(x)
#endif // _LIBCUDACXX_COMPILER_NVRTC
#if defined(_LIBCUDACXX_COMPILER_MSVC)
# define __alignof__ __alignof
#endif
#define _LIBCUDACXX_ALIGNOF(_Tp) alignof(_Tp)
#define _LIBCUDACXX_PREFERRED_ALIGNOF(_Tp) __alignof(_Tp)
#if defined(_LIBCUDACXX_COMPILER_MSVC)
# define _ALIGNAS_TYPE(x) alignas(x)
# define _ALIGNAS(x) __declspec(align(x))
#elif __has_feature(cxx_alignas)
# define _ALIGNAS_TYPE(x) alignas(x)
# define _ALIGNAS(x) alignas(x)
#else
# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(_LIBCUDACXX_ALIGNOF(x))))
# define _ALIGNAS(x) __attribute__((__aligned__(x)))
#endif // !_LIBCUDACXX_COMPILER_MSVC && !__has_feature(cxx_alignas)
// This is wrapped in __CUDA_ARCH__ to prevent error: "ignoring '#pragma unroll'
// [-Werror=unknown-pragmas]"
#if defined(__CUDA_ARCH__)
#if defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_PRAGMA_UNROLL(_N) __pragma(_LIBCUDACXX_TOSTRING(unroll _N))
#else // ^^^ _LIBCUDACXX_COMPILER_MSVC ^^^ / vvv !_LIBCUDACXX_COMPILER_MSVC vvv
# define _LIBCUDACXX_PRAGMA_UNROLL(_N) _Pragma(_LIBCUDACXX_TOSTRING(unroll _N))
#endif // !_LIBCUDACXX_COMPILER_MSVC
#else // ^^^ _LIBCUDACXX_CUDACC ^^^ / vvv !_LIBCUDACXX_CUDACCvvv
# define _LIBCUDACXX_PRAGMA_UNROLL(_N)
#endif // !__CUDA_ARCH__
#if defined(_LIBCUDACXX_COMPILER_MSVC)
#define _LIBCUDACXX_ALWAYS_INLINE __forceinline
#else
#define _LIBCUDACXX_ALWAYS_INLINE __attribute__ ((__always_inline__))
#endif // !_LIBCUDACXX_COMPILER_MSVC
#if defined(__cuda_std__)
#define _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(size, ptr) (size <= 8)
#elif defined(_LIBCUDACXX_COMPILER_CLANG) || defined(_LIBCUDACXX_COMPILER_GCC)
#define _LIBCUDACXX_ATOMIC_ALWAYS_LOCK_FREE(...) __atomic_always_lock_free(__VA_ARGS__)
#endif // __cuda_std__
// https://bugs.llvm.org/show_bug.cgi?id=44517
#define __check_builtin(__x) (__has_builtin(__##__x) || \
__has_keyword(__##__x) || \
__has_feature(__x))
// We work around old clang versions (before clang-10) not supporting __has_builtin via __check_builtin
// We work around old intel versions (before 2021.3) not supporting __has_builtin via __check_builtin
// We work around old nvhpc versions (before 2022.11) not supporting __has_builtin via __check_builtin
// MSVC needs manual handling, has no real way of checking builtins so all is manual
// GCC needs manual handling, before gcc-10 as that finally supports __has_builtin
#if __check_builtin(array_rank)
#define _LIBCUDACXX_ARRAY_RANK(...) __array_rank(__VA_ARGS__)
#endif // __check_builtin(array_rank)
// nvhpc has a bug where it supports __builtin_addressof but does not mark it via __check_builtin
#if __check_builtin(builtin_addressof) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 700) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVHPC)
#define _LIBCUDACXX_ADDRESSOF(...) __builtin_addressof(__VA_ARGS__)
#endif // __check_builtin(builtin_addressof)
#if __check_builtin(builtin_bit_cast) \
|| (defined(_LIBCUDACXX_COMPILER_MSVC) && _MSC_VER > 1925)
#define _LIBCUDACXX_BIT_CAST(...) __builtin_bit_cast(__VA_ARGS__)
#endif // __check_builtin(builtin_bit_cast)
#if __check_builtin(builtin_is_constant_evaluated) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 900) \
|| (defined(_LIBCUDACXX_COMPILER_MSVC) && _MSC_VER > 1924 && !defined(_LIBCUDACXX_CUDACC_BELOW_11_3))
#define _LIBCUDACXX_IS_CONSTANT_EVALUATED(...) __builtin_is_constant_evaluated(__VA_ARGS__)
#endif // __check_builtin(builtin_is_constant_evaluated)
// NVCC and NVRTC in C++11 mode freaks out about `__builtin_is_constant_evaluated`.
#if _LIBCUDACXX_STD_VER < 14 \
&& (defined(_LIBCUDACXX_COMPILER_NVCC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC) \
|| defined(_LIBCUDACXX_COMPILER_NVHPC))
#undef _LIBCUDACXX_IS_CONSTANT_EVALUATED
#endif // _LIBCUDACXX_STD_VER < 14 && defined(_LIBCUDACXX_COMPILER_NVCC)
#if __check_builtin(builtin_launder) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 700)
#define _LIBCUDACXX_LAUNDER(...) __builtin_launder(__VA_ARGS__)
#endif // __check_builtin(builtin_launder)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(decay)
#define _LIBCUDACXX_DECAY(...) __decay(__VA_ARGS__)
#endif // __check_builtin(decay)
#if __check_builtin(has_nothrow_assign) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_HAS_NOTHROW_ASSIGN(...) __has_nothrow_assign(__VA_ARGS__)
#endif // __check_builtin(has_nothrow_assign)
#if __check_builtin(has_nothrow_constructor) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_HAS_NOTHROW_CONSTRUCTOR(...) __has_nothrow_constructor(__VA_ARGS__)
#endif // __check_builtin(has_nothrow_constructor)
#if __check_builtin(has_nothrow_copy) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_HAS_NOTHROW_COPY(...) __has_nothrow_copy(__VA_ARGS__)
#endif // __check_builtin(has_nothrow_copy)
#if __check_builtin(has_trivial_constructor) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_HAS_TRIVIAL_CONSTRUCTOR(...) __has_trivial_constructor(__VA_ARGS__)
#endif // __check_builtin(has_trivial_constructor)
#if __check_builtin(has_trivial_destructor) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_HAS_TRIVIAL_DESTRUCTOR(...) __has_trivial_destructor(__VA_ARGS__)
#endif // __check_builtin(has_trivial_destructor)
#if __check_builtin(has_unique_object_representations) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 700)
#define _LIBCUDACXX_HAS_UNIQUE_OBJECT_REPRESENTATIONS(...) __has_unique_object_representations(__VA_ARGS__)
#endif // __check_builtin(has_unique_object_representations)
#if __check_builtin(has_virtual_destructor) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_HAS_VIRTUAL_DESTRUCTOR(...) __has_virtual_destructor(__VA_ARGS__)
#endif // __check_builtin(has_virtual_destructor)
#if __check_builtin(is_aggregate) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 700) \
|| (defined(_LIBCUDACXX_COMPILER_MSVC) && _MSC_VER > 1914) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_AGGREGATE(...) __is_aggregate(__VA_ARGS__)
#endif // __check_builtin(is_aggregate)
#if __check_builtin(is_array)
#define _LIBCUDACXX_IS_ARRAY(...) __is_array(__VA_ARGS__)
#endif // __check_builtin(is_array)
// TODO: Clang incorrectly reports that __is_array is true for T[0].
// Re-enable the branch once https://llvm.org/PR54705 is fixed.
#ifndef _LIBCUDACXX_USE_IS_ARRAY_FALLBACK
#if defined(_LIBCUDACXX_COMPILER_CLANG)
#define _LIBCUDACXX_USE_IS_ARRAY_FALLBACK
#endif // _LIBCUDACXX_COMPILER_CLANG
#endif // !_LIBCUDACXX_USE_IS_ARRAY_FALLBACK
#if __check_builtin(is_assignable) \
|| defined(_LIBCUDACXX_COMPILER_MSVC)
#define _LIBCUDACXX_IS_ASSIGNABLE(...) __is_assignable(__VA_ARGS__)
#endif // __check_builtin(is_assignable)
#if __check_builtin(is_base_of) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_BASE_OF(...) __is_base_of(__VA_ARGS__)
#endif // __check_builtin(is_base_of)
#if __check_builtin(is_class) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_CLASS(...) __is_class(__VA_ARGS__)
#endif // __check_builtin(is_class)
#if __check_builtin(is_constructible) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 800) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_CONSTRUCTIBLE(...) __is_constructible(__VA_ARGS__)
#endif // __check_builtin(is_constructible)
#if __check_builtin(is_convertible_to) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_CONVERTIBLE_TO(...) __is_convertible_to(__VA_ARGS__)
#endif // __check_builtin(is_convertible_to)
#if __check_builtin(is_destructible) \
|| defined(_LIBCUDACXX_COMPILER_MSVC)
#define _LIBCUDACXX_IS_DESTRUCTIBLE(...) __is_destructible(__VA_ARGS__)
#endif // __check_builtin(is_destructible)
#if __check_builtin(is_empty) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_EMPTY(...) __is_empty(__VA_ARGS__)
#endif // __check_builtin(is_empty)
#if __check_builtin(is_enum) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_ENUM(...) __is_enum(__VA_ARGS__)
#endif // __check_builtin(is_enum)
#if __check_builtin(is_final) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 407) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_FINAL(...) __is_final(__VA_ARGS__)
#endif // __check_builtin(is_final)
#if __check_builtin(is_function) \
&& !defined(_LIBCUDACXX_COMPILER_NVCC)
#define _LIBCUDACXX_IS_FUNCTION(...) __is_function(__VA_ARGS__)
#endif // __check_builtin(is_function)
#if __check_builtin(is_literal_type) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 406) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_LITERAL(...) __is_literal_type(__VA_ARGS__)
#endif // __check_builtin(is_literal_type)
#if __check_builtin(is_lvalue_reference)
#define _LIBCUDACXX_IS_LVALUE_REFERENCE(...) __is_lvalue_reference(__VA_ARGS__)
#endif // __check_builtin(is_lvalue_reference)
#ifndef _LIBCUDACXX_USE_IS_LVALUE_REFERENCE_FALLBACK
#if defined(_LIBCUDACXX_CUDACC_BELOW_11_3)
#define _LIBCUDACXX_USE_IS_LVALUE_REFERENCE_FALLBACK
#endif // nvcc < 11.3
#endif // !_LIBCUDACXX_USE_IS_LVALUE_REFERENCE_FALLBACK
#if __check_builtin(is_nothrow_assignable) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_NOTHROW_ASSIGNABLE(...) __is_nothrow_assignable(__VA_ARGS__)
#endif // __check_builtin(is_nothrow_assignable)
#if __check_builtin(is_nothrow_constructible) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_NOTHROW_CONSTRUCTIBLE(...) __is_nothrow_constructible(__VA_ARGS__)
#endif // __check_builtin(is_nothrow_constructible)
#if __check_builtin(is_nothrow_destructible) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_NOTHROW_DESTRUCTIBLE(...) __is_nothrow_destructible(__VA_ARGS__)
#endif // __check_builtin(is_nothrow_destructible)
#if __check_builtin(is_object)
#define _LIBCUDACXX_IS_OBJECT(...) __is_object(__VA_ARGS__)
#endif // __check_builtin(is_object)
#ifndef _LIBCUDACXX_USE_IS_OBJECT_FALLBACK
#if defined(_LIBCUDACXX_CUDACC_BELOW_11_3)
#define _LIBCUDACXX_USE_IS_OBJECT_FALLBACK
#endif // nvcc < 11.3
#endif // !_LIBCUDACXX_USE_IS_OBJECT_FALLBACK
#if __check_builtin(is_pod) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_POD(...) __is_pod(__VA_ARGS__)
#endif // __check_builtin(is_pod)
// libstdc++ defines this as a function, breaking functionality
#if 0 // __check_builtin(is_pointer)
#define _LIBCUDACXX_IS_POINTER(...) __is_pointer(__VA_ARGS__)
#endif // __check_builtin(is_pointer)
#if __check_builtin(is_polymorphic) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_POLYMORPHIC(...) __is_polymorphic(__VA_ARGS__)
#endif // __check_builtin(is_polymorphic)
#if __check_builtin(is_reference)
#define _LIBCUDACXX_IS_REFERENCE(...) __is_reference(__VA_ARGS__)
#endif // __check_builtin(is_reference)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(is_referenceable)
#define _LIBCUDACXX_IS_REFERENCEABLE(...) __is_referenceable(__VA_ARGS__)
#endif // __check_builtin(is_referenceable)
#if __check_builtin(is_rvalue_reference)
#define _LIBCUDACXX_IS_RVALUE_REFERENCE(...) __is_rvalue_reference(__VA_ARGS__)
#endif // __check_builtin(is_rvalue_reference)
#if __check_builtin(is_same) \
&& !defined(_LIBCUDACXX_COMPILER_NVCC)
#define _LIBCUDACXX_IS_SAME(...) __is_same(__VA_ARGS__)
#endif // __check_builtin(is_same)
// libstdc++ defines this as a function, breaking functionality
#if 0 // __check_builtin(is_scalar)
#define _LIBCUDACXX_IS_SCALAR(...) __is_scalar(__VA_ARGS__)
#endif // __check_builtin(is_scalar)
// libstdc++ defines this as a function, breaking functionality
#if 0 // __check_builtin(is_signed)
#define _LIBCUDACXX_IS_SIGNED(...) __is_signed(__VA_ARGS__)
#endif // __check_builtin(is_signed)
#if __check_builtin(is_standard_layout) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 407) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_STANDARD_LAYOUT(...) __is_standard_layout(__VA_ARGS__)
#endif // __check_builtin(is_standard_layout)
#if __check_builtin(is_trivial) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 405) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_TRIVIAL(...) __is_trivial(__VA_ARGS__)
#endif // __check_builtin(is_trivial)
#if __check_builtin(is_trivially_assignable) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 501) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_TRIVIALLY_ASSIGNABLE(...) __is_trivially_assignable(__VA_ARGS__)
#endif // __check_builtin(is_trivially_assignable)
#if __check_builtin(is_trivially_constructible) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 501) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_TRIVIALLY_CONSTRUCTIBLE(...) __is_trivially_constructible(__VA_ARGS__)
#endif // __check_builtin(is_trivially_constructible)
#if __check_builtin(is_trivially_copyable) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 501) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_TRIVIALLY_COPYABLE(...) __is_trivially_copyable(__VA_ARGS__)
#endif // __check_builtin(is_trivially_copyable)
#if __check_builtin(is_trivially_destructible) \
|| defined(_LIBCUDACXX_COMPILER_MSVC)
#define _LIBCUDACXX_IS_TRIVIALLY_DESTRUCTIBLE(...) __is_trivially_destructible(__VA_ARGS__)
#endif // __check_builtin(is_trivially_destructible)
#if __check_builtin(is_union) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 403) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_IS_UNION(...) __is_union(__VA_ARGS__)
#endif // __check_builtin(is_union)
#if __check_builtin(is_unsigned)
#define _LIBCUDACXX_IS_UNSIGNED(...) __is_unsigned(__VA_ARGS__)
#endif // __check_builtin(is_unsigned)
#ifndef _LIBCUDACXX_USE_IS_UNSIGNED_FALLBACK
#if defined(_LIBCUDACXX_CUDACC_BELOW_11_3)
#define _LIBCUDACXX_USE_IS_UNSIGNED_FALLBACK
#endif // nvcc < 11.3
#endif // !_LIBCUDACXX_USE_IS_UNSIGNED_FALLBACK
// libstdc++ defines this as a function, breaking functionality
#if 0 // __check_builtin(is_void)
#define _LIBCUDACXX_IS_VOID(...) __is_void(__VA_ARGS__)
#endif // __check_builtin(is_void)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(make_signed)
#define _LIBCUDACXX_MAKE_SIGNED(...) __make_signed(__VA_ARGS__)
#endif // __check_builtin(make_signed)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(make_unsigned)
#define _LIBCUDACXX_MAKE_UNSIGNED(...) __make_unsigned(__VA_ARGS__)
#endif // __check_builtin(make_unsigned)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(remove_all_extents)
#define _LIBCUDACXX_REMOVE_ALL_EXTENTS(...) __remove_all_extents(__VA_ARGS__)
#endif // __check_builtin(remove_all_extents)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(remove_const)
#define _LIBCUDACXX_REMOVE_CONST(...) __remove_const(__VA_ARGS__)
#endif // __check_builtin(remove_const)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(remove_cv)
#define _LIBCUDACXX_REMOVE_CV(...) __remove_cv(__VA_ARGS__)
#endif // __check_builtin(remove_cv)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(remove_cvref)
#define _LIBCUDACXX_REMOVE_CVREF(...) __remove_cvref(__VA_ARGS__)
#endif // __check_builtin(remove_cvref)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(remove_extent)
#define _LIBCUDACXX_REMOVE_EXTENT(...) __remove_extent(__VA_ARGS__)
#endif // __check_builtin(remove_extent)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(remove_pointer)
#define _LIBCUDACXX_REMOVE_POINTER(...) __remove_pointer(__VA_ARGS__)
#endif // __check_builtin(remove_pointer)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(remove_reference_t)
#define _LIBCUDACXX_REMOVE_REFERENCE_T(...) __remove_reference_t(__VA_ARGS__)
#endif // __check_builtin(remove_reference_t)
// Disabled due to libstdc++ conflict
#if 0 // __check_builtin(remove_volatile)
#define _LIBCUDACXX_REMOVE_VOLATILE(...) __remove_volatile(__VA_ARGS__)
#endif // __check_builtin(remove_volatile)
#if __check_builtin(underlying_type) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && _GNUC_VER >= 407) \
|| defined(_LIBCUDACXX_COMPILER_MSVC) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define _LIBCUDACXX_UNDERLYING_TYPE(...) __underlying_type(__VA_ARGS__)
#endif // __check_builtin(underlying_type)
#define _LIBCUDACXX_TOSTRING2(_STR) #_STR
#define _LIBCUDACXX_TOSTRING(_STR) _LIBCUDACXX_TOSTRING2(_STR)
#if defined(_LIBCUDACXX_CUDACC) && !defined(_LIBCUDACXX_COMPILER_CLANG_CUDA)
# if defined(__NVCC_DIAG_PRAGMA_SUPPORT__)
# if defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_NV_DIAG_SUPPRESS(_WARNING) __pragma(_LIBCUDACXX_TOSTRING(nv_diag_suppress _WARNING))
# define _LIBCUDACXX_NV_DIAG_DEFAULT(_WARNING) __pragma(_LIBCUDACXX_TOSTRING(nv_diag_default _WARNING))
# else // ^^^ MSVC ^^^ / vvv not MSVC
# define _LIBCUDACXX_NV_DIAG_SUPPRESS(_WARNING) \
_Pragma(_LIBCUDACXX_TOSTRING(nv_diagnostic push)) \
_Pragma(_LIBCUDACXX_TOSTRING(nv_diag_suppress _WARNING))
# define _LIBCUDACXX_NV_DIAG_DEFAULT(_WARNING) _Pragma(_LIBCUDACXX_TOSTRING(nv_diagnostic pop))
# endif // not MSVC
# elif defined(_LIBCUDACXX_COMPILER_NVHPC)
# define _LIBCUDACXX_NV_DIAG_SUPPRESS(_WARNING) \
_Pragma(_LIBCUDACXX_TOSTRING(diagnostic push)) \
_Pragma(_LIBCUDACXX_TOSTRING(diag_suppress _WARNING))
# define _LIBCUDACXX_NV_DIAG_DEFAULT(_WARNING) _Pragma(_LIBCUDACXX_TOSTRING(diagnostic pop))
# else // _LIBCUDACXX_CUDACC_BELOW_11_3
# if defined(_LIBCUDACXX_COMPILER_MSVC_2017) // MSVC 2017 has issues with restoring the warning
# define _LIBCUDACXX_NV_DIAG_SUPPRESS(_WARNING) __pragma(_LIBCUDACXX_TOSTRING(diag_suppress _WARNING))
# define _LIBCUDACXX_NV_DIAG_DEFAULT(_WARNING)
# elif defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_NV_DIAG_SUPPRESS(_WARNING) __pragma(_LIBCUDACXX_TOSTRING(diag_suppress _WARNING))
# define _LIBCUDACXX_NV_DIAG_DEFAULT(_WARNING) __pragma(_LIBCUDACXX_TOSTRING(diag_default _WARNING))
# else // ^^^ MSVC ^^^ / vvv not MSVC
# define _LIBCUDACXX_NV_DIAG_SUPPRESS(_WARNING) _Pragma(_LIBCUDACXX_TOSTRING(diag_suppress _WARNING))
# define _LIBCUDACXX_NV_DIAG_DEFAULT(_WARNING) _Pragma(_LIBCUDACXX_TOSTRING(diag_default _WARNING))
# endif // not MSVC
# endif // !__NVCC_DIAG_PRAGMA_SUPPORT__
#else // ^^^ _LIBCUDACXX_CUDACC ^^^ / vvv other compiler vvv
# define _LIBCUDACXX_NV_DIAG_SUPPRESS(_WARNING)
# define _LIBCUDACXX_NV_DIAG_DEFAULT(_WARNING)
#endif // other compilers
#if defined(_LIBCUDACXX_COMPILER_CLANG)
// _LIBCUDACXX_ALTERNATE_STRING_LAYOUT is an old name for
// _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility.
#if defined(_LIBCUDACXX_ALTERNATE_STRING_LAYOUT)
#define _LIBCUDACXX_ABI_ALTERNATE_STRING_LAYOUT
#endif
#if __cplusplus < 201103L
typedef __char16_t char16_t;
typedef __char32_t char32_t;
#endif
#if !(__has_feature(cxx_strong_enums))
#define _LIBCUDACXX_HAS_NO_STRONG_ENUMS
#endif
#if !(__has_feature(cxx_lambdas))
#define _LIBCUDACXX_HAS_NO_LAMBDAS
#endif
#if !(__has_feature(cxx_nullptr))
# if (__has_extension(cxx_nullptr) || __has_keyword(__nullptr)) && defined(_LIBCUDACXX_ABI_ALWAYS_USE_CXX11_NULLPTR)
# define nullptr __nullptr
# else
# define _LIBCUDACXX_HAS_NO_NULLPTR
# endif
#endif
#if !(__has_feature(cxx_rvalue_references))
#define _LIBCUDACXX_HAS_NO_RVALUE_REFERENCES
#endif
#if !(__has_feature(cxx_auto_type))
#define _LIBCUDACXX_HAS_NO_AUTO_TYPE
#endif
#if !(__has_feature(cxx_variadic_templates))
#define _LIBCUDACXX_HAS_NO_VARIADICS
#endif
#if !(__has_feature(cxx_generalized_initializers))
#define _LIBCUDACXX_HAS_NO_GENERALIZED_INITIALIZERS
#endif
// Objective-C++ features (opt-in)
#if __has_feature(objc_arc)
#define _LIBCUDACXX_HAS_OBJC_ARC
#endif
#if __has_feature(objc_arc_weak)
#define _LIBCUDACXX_HAS_OBJC_ARC_WEAK
#endif
#if !(__has_feature(cxx_relaxed_constexpr))
#define _LIBCUDACXX_HAS_NO_CXX14_CONSTEXPR
#endif
#if !(__has_feature(cxx_variable_templates))
#define _LIBCUDACXX_HAS_NO_VARIABLE_TEMPLATES
#endif
#if !(__has_feature(cxx_noexcept))
#define _LIBCUDACXX_HAS_NO_NOEXCEPT
#endif
// Allow for build-time disabling of unsigned integer sanitization
#if !defined(_LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK) && __has_attribute(no_sanitize)
#define _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow")))
#endif
#define _LIBCUDACXX_DISABLE_EXTENSION_WARNING __extension__
#elif defined(_LIBCUDACXX_COMPILER_GCC)
#ifndef _LIBCUDACXX_USE_IS_ASSIGNABLE_FALLBACK
// FIXME: GCC 8.0 supports this trait, but it has a bug.
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91592
// https://godbolt.org/z/IljfIw
#define _LIBCUDACXX_USE_IS_ASSIGNABLE_FALLBACK
#endif // _LIBCUDACXX_USE_IS_ASSIGNABLE_FALLBACK
// Determine if GCC supports relaxed constexpr
#if !defined(__cpp_constexpr) || __cpp_constexpr < 201304L
#define _LIBCUDACXX_HAS_NO_CXX14_CONSTEXPR
#endif
// GCC 5 supports variable templates
#if !defined(__cpp_variable_templates) || __cpp_variable_templates < 201304L
#define _LIBCUDACXX_HAS_NO_VARIABLE_TEMPLATES
#endif
#if _GNUC_VER < 600
#define _LIBCUDACXX_GCC_MATH_IN_STD
#endif
// NVCC cannot properly handle some deductions occuring within NOEXCEPT
// C++17 mode causes reference instatiation errors in tuple
#if (_GNUC_VER >= 702 && _GNUC_VER <= 805)
#if defined(_LIBCUDACXX_COMPILER_NVCC) && _LIBCUDACXX_STD_VER == 17
#define _LIBCUDACXX_NO_TUPLE_NOEXCEPT
#endif
#endif
#define _LIBCUDACXX_DISABLE_EXTENSION_WARNING __extension__
#elif defined(_LIBCUDACXX_COMPILER_MSVC)
#define _LIBCUDACXX_WARNING(x) __pragma(message(__FILE__ "(" _LIBCUDACXX_TOSTRING(__LINE__) ") : warning note: " x))
// https://github.com/microsoft/STL/blob/master/stl/inc/yvals_core.h#L353
// warning C4100: 'quack': unreferenced formal parameter
// warning C4127: conditional expression is constant
// warning C4180: qualifier applied to function type has no meaning; ignored
// warning C4197: 'purr': top-level volatile in cast is ignored
// warning C4324: 'roar': structure was padded due to alignment specifier
// warning C4455: literal suffix identifiers that do not start with an underscore are reserved
// warning C4503: 'hum': decorated name length exceeded, name was truncated
// warning C4522: 'woof' : multiple assignment operators specified
// warning C4668: 'meow' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
// warning C4800: 'boo': forcing value to bool 'true' or 'false' (performance warning)
// warning C4996: 'meow': was declared deprecated
#define _LIBCUDACXX_MSVC_DISABLED_WARNINGS \
4100 \
4127 \
4180 \
4197 \
4296 \
4324 \
4455 \
4503 \
4522 \
4668 \
4800 \
4996 \
/**/
#if _MSC_VER < 1900
#error "MSVC versions prior to Visual Studio 2015 are not supported"
#endif
// MSVC implemented P0030R1 in 15.7, only available under C++17
#if _MSC_VER < 1914
#define _LIBCUDACXX_NO_HOST_CPP17_HYPOT
#endif
#if _MSC_VER < 1920
#define _LIBCUDACXX_HAS_NO_NOEXCEPT_SFINAE
#define _LIBCUDACXX_HAS_NO_LOGICAL_METAFUNCTION_ALIASES
#endif
// MSVC exposed __iso_volatile intrinsics beginning on 1924 for x86
#if _MSC_VER < 1924
#define _LIBCUDACXX_MSVC_HAS_NO_ISO_INTRIN
#endif
#if _LIBCUDACXX_STD_VER < 14
#define _LIBCUDACXX_HAS_NO_CXX14_CONSTEXPR
#define _LIBCUDACXX_HAS_NO_VARIABLE_TEMPLATES
#endif
#define _LIBCUDACXX_WEAK
#define _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION
#define _LIBCUDACXX_DISABLE_EXTENSION_WARNING
#elif defined(_LIBCUDACXX_COMPILER_IBM)
#define _ATTRIBUTE(x) __attribute__((x))
#define _LIBCUDACXX_HAS_NO_UNICODE_CHARS
#define _LIBCUDACXX_HAS_NO_VARIABLE_TEMPLATES
#if defined(_AIX)
#define __MULTILOCALE_API
#endif
#define _LIBCUDACXX_HAS_NO_VECTOR_EXTENSION
#elif defined(_LIBCUDACXX_COMPILER_NVRTC) || defined(_LIBCUDACXX_COMPILER_NVHPC)
#if !defined(__cpp_constexpr) || __cpp_constexpr < 201304L
#define _LIBCUDACXX_HAS_NO_CXX14_CONSTEXPR
#endif
#if !defined(__cpp_variable_templates) || __cpp_variable_templates < 201304L
#define _LIBCUDACXX_HAS_NO_VARIABLE_TEMPLATES
#endif
#define _LIBCUDACXX_DISABLE_EXTENSION_WARNING
#endif // _LIBCUDACXX_COMPILER_[CLANG|GCC|MSVC|IBM|NVRTC]
#if defined(_LIBCUDACXX_COMPILER_NVHPC) && !defined(__cuda_std__)
// Forcefully disable visibility controls when used as the standard library with NVC++.
// TODO: reevaluate.
#define _LIBCUDACXX_HIDE_FROM_ABI
#ifndef _LIBCUDACXX_DISABLE_EXTERN_TEMPLATE
#define _LIBCUDACXX_DISABLE_EXTERN_TEMPLATE
#endif
#endif
#ifndef _LIBCUDACXX_FREESTANDING
#if defined(__cuda_std__) \
|| !defined(__STDC_HOSTED__)
# define _LIBCUDACXX_FREESTANDING
#endif
#endif // !_LIBCUDACXX_FREESTANDING
#ifndef _LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS
#if defined(_LIBCUDACXX_COMPILER_NVRTC) \
|| (defined(_LIBCUDACXX_COMPILER_NVHPC) && !defined(__cuda_std__))
# define _LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS
#endif
#endif // _LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS
#ifndef _LIBCUDACXX_HAS_CUDA_ATOMIC_EXT
#if defined(__cuda_std__)
# define _LIBCUDACXX_HAS_CUDA_ATOMIC_EXT
#endif
#endif // _LIBCUDACXX_HAS_CUDA_ATOMIC_EXT
#ifndef _LIBCUDACXX_HAS_EXTERNAL_ATOMIC_IMP
#if defined(__cuda_std__)
# define _LIBCUDACXX_HAS_EXTERNAL_ATOMIC_IMP
#endif
#endif // _LIBCUDACXX_HAS_EXTERNAL_ATOMIC_IMP
#ifndef _LIBCUDACXX_HAS_NO_ASAN
#if defined(_LIBCUDACXX_COMPILER_GCC)
# if !defined(__SANITIZE_ADDRESS__)
# define _LIBCUDACXX_HAS_NO_ASAN
# endif // !__SANITIZE_ADDRESS__
#elif defined(_LIBCUDACXX_COMPILER_CLANG)
# if !__has_feature(address_sanitizer)
# define _LIBCUDACXX_HAS_NO_ASAN
# endif // !__has_feature(address_sanitizer)
#else
# define _LIBCUDACXX_HAS_NO_ASAN
#endif // _LIBCUDACXX_COMPILER[MSVC|IBM|NVHPC|NVRTC]
#endif // _LIBCUDACXX_HAS_NO_ASAN
#ifndef _LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS
#if defined(__cuda_std__) \
|| (defined(_LIBCUDACXX_COMPILER_CLANG) && _LIBCUDACXX_CLANG_VER < 800)
# define _LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS
#endif // __cuda_std__
#endif // _LIBCUDACXX_HAS_NO_CXX20_CHRONO_LITERALS
#ifndef _LIBCUDACXX_HAS_NO_INT128
#if defined(_LIBCUDACXX_COMPILER_MSVC) \
|| (defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(__CUDACC_RTC_INT128__)) \
|| (defined(_LIBCUDACXX_COMPILER_NVCC) && (_LIBCUDACXX_CUDACC_VER < 1105000)) \
|| !defined(__SIZEOF_INT128__)
# define _LIBCUDACXX_HAS_NO_INT128
#endif
#endif // !_LIBCUDACXX_HAS_NO_INT128
#ifndef _LIBCUDACXX_HAS_NO_LONG_DOUBLE
#if defined(_LIBCUDACXX_CUDACC)
# define _LIBCUDACXX_HAS_NO_LONG_DOUBLE
#endif
#endif // _LIBCUDACXX_HAS_NO_LONG_DOUBLE
#ifndef _LIBCUDACXX_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS
#if __has_cpp_attribute(msvc::no_unique_address)
// MSVC implements [[no_unique_address]] as a silent no-op currently.
// (If/when MSVC breaks its C++ ABI, it will be changed to work as intended.)
// However, MSVC implements [[msvc::no_unique_address]] which does what
// [[no_unique_address]] is supposed to do, in general.
// Clang-cl does not yet (14.0) implement either [[no_unique_address]] or
// [[msvc::no_unique_address]] though. If/when it does implement
// [[msvc::no_unique_address]], this should be preferred though.
# define _LIBCUDACXX_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]]
#elif defined(_LIBCUDACXX_CUDACC_BELOW_11_3) \
|| (__has_cpp_attribute(no_unique_address) < 201803L)
# define _LIBCUDACXX_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS
# define _LIBCUDACXX_NO_UNIQUE_ADDRESS
#elif __has_cpp_attribute(no_unique_address)
# define _LIBCUDACXX_NO_UNIQUE_ADDRESS [[no_unique_address]]
#else
# define _LIBCUDACXX_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS
# define _LIBCUDACXX_NO_UNIQUE_ADDRESS
// Note that this can be replaced by #error as soon as clang-cl
// implements msvc::no_unique_address, since there should be no C++20
// compiler that doesn't support one of the two attributes at that point.
// We generally don't want to use this macro outside of C++20-only code,
// because using it conditionally in one language version only would make
// the ABI inconsistent.
#endif
#endif // _LIBCUDACXX_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS
#ifndef _LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK
#if defined(__cuda_std__)
# define _LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK
#endif
#endif // _LIBCUDACXX_HAS_NO_MONOTONIC_CLOCK
#ifndef _LIBCUDACXX_HAS_NO_PLATFORM_WAIT
#if defined(__cuda_std__)
# define _LIBCUDACXX_HAS_NO_PLATFORM_WAIT
#endif
#endif // _LIBCUDACXX_HAS_NO_PLATFORM_WAIT
#ifndef _LIBCUDACXX_HAS_NO_PRAGMA_PUSH_POP_MACRO
#if (defined(_LIBCUDACXX_COMPILER_MSVC) && _MSC_VER < 1920) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC) \
|| defined(_LIBCUDACXX_COMPILER_IBM)
#define _LIBCUDACXX_HAS_NO_PRAGMA_PUSH_POP_MACRO
#endif
#endif // _LIBCUDACXX_HAS_NO_PRAGMA_PUSH_POP_MACRO
#ifndef _LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE
#if defined(__cuda_std__)
# define _LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE
#endif
#endif // _LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE
#ifndef _LIBCUDACXX_HAS_NO_TREE_BARRIER
#if defined(__cuda_std__)
# define _LIBCUDACXX_HAS_NO_TREE_BARRIER
#endif
#endif // _LIBCUDACXX_HAS_NO_TREE_BARRIER
#ifndef _LIBCUDACXX_HAS_NO_WCHAR_H
#if defined(__cuda_std__)
# define _LIBCUDACXX_HAS_NO_WCHAR_H
#endif
#endif // _LIBCUDACXX_HAS_NO_WCHAR_H
#ifndef _LIBCUDACXX_NO_EXCEPTIONS
#if defined(__cuda_std__) \
|| (defined(_LIBCUDACXX_COMPILER_CLANG) && !(__has_feature(cxx_exceptions))) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && !__EXCEPTIONS)
# define _LIBCUDACXX_NO_EXCEPTIONS
#endif
#endif // !_LIBCUDACXX_NO_EXCEPTIONS
// Try to find out if RTTI is disabled.
// g++ and cl.exe have RTTI on by default and define a macro when it is.
#ifndef _LIBCUDACXX_NO_RTTI
#if defined(__cuda_std__) \
|| (defined(_LIBCUDACXX_COMPILER_CLANG) && !(__has_feature(cxx_rtti))) \
|| (defined(_LIBCUDACXX_COMPILER_GCC) && !defined(__GXX_RTTI)) \
|| (defined(_LIBCUDACXX_COMPILER_MSVC) && !defined(_CPPRTTI))
# define _LIBCUDACXX_NO_RTTI
#endif
#endif // !_LIBCUDACXX_NO_RTTI
#ifndef _LIBCUDACXX_NODEBUG_TYPE
#if defined(__cuda_std__)
# define _LIBCUDACXX_NODEBUG_TYPE
#elif __has_attribute(__nodebug__) \
&& (defined(_LIBCUDACXX_COMPILER_CLANG) && _LIBCUDACXX_CLANG_VER >= 1210)
# define _LIBCUDACXX_NODEBUG_TYPE __attribute__((nodebug))
#else
# define _LIBCUDACXX_NODEBUG_TYPE
#endif
#endif // !_LIBCUDACXX_NODEBUG_TYPE
#if defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_NORETURN __declspec(noreturn)
#elif __has_feature(cxx_attributes)
# define _LIBCUDACXX_NORETURN [[noreturn]]
#else
# define _LIBCUDACXX_NORETURN __attribute__ ((noreturn))
#endif
#if defined(_LIBCUDACXX_OBJECT_FORMAT_COFF)
#ifdef _DLL
# define _LIBCUDACXX_CRT_FUNC __declspec(dllimport)
#else
# define _LIBCUDACXX_CRT_FUNC
#endif
#if defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
# define _LIBCUDACXX_DLL_VIS
# define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS
# define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
# define _LIBCUDACXX_OVERRIDABLE_FUNC_VIS
# define _LIBCUDACXX_EXPORTED_FROM_ABI
#elif defined(_LIBCUDACXX_BUILDING_LIBRARY)
# define _LIBCUDACXX_DLL_VIS __declspec(dllexport)
# if defined(__MINGW32__)
# define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS _LIBCUDACXX_DLL_VIS
# define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
# else
# define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS
# define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS _LIBCUDACXX_DLL_VIS
# endif
# define _LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_DLL_VIS
# define _LIBCUDACXX_EXPORTED_FROM_ABI __declspec(dllexport)
#else
# define _LIBCUDACXX_DLL_VIS __declspec(dllimport)
# define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS _LIBCUDACXX_DLL_VIS
# define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
# define _LIBCUDACXX_OVERRIDABLE_FUNC_VIS
# define _LIBCUDACXX_EXPORTED_FROM_ABI __declspec(dllimport)
#endif
#define _LIBCUDACXX_TYPE_VIS _LIBCUDACXX_DLL_VIS
#define _LIBCUDACXX_FUNC_VIS _LIBCUDACXX_DLL_VIS
#define _LIBCUDACXX_EXCEPTION_ABI _LIBCUDACXX_DLL_VIS
#define _LIBCUDACXX_HIDDEN
#define _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
#define _LIBCUDACXX_TEMPLATE_VIS
#define _LIBCUDACXX_ENUM_VIS
#endif // defined(_LIBCUDACXX_OBJECT_FORMAT_COFF)
#ifndef _LIBCUDACXX_HIDDEN
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
# define _LIBCUDACXX_HIDDEN __attribute__ ((__visibility__("hidden")))
# else
# define _LIBCUDACXX_HIDDEN
# endif
#endif
#ifndef _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
// The inline should be removed once PR32114 is resolved
# define _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS inline _LIBCUDACXX_HIDDEN
# else
# define _LIBCUDACXX_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
# endif
#endif
#ifndef _LIBCUDACXX_FUNC_VIS
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
# define _LIBCUDACXX_FUNC_VIS __attribute__ ((__visibility__("default")))
# else
# define _LIBCUDACXX_FUNC_VIS
# endif
#endif
#ifndef _LIBCUDACXX_TYPE_VIS
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
# define _LIBCUDACXX_TYPE_VIS __attribute__ ((__visibility__("default")))
# else
# define _LIBCUDACXX_TYPE_VIS
# endif
#endif
#ifndef _LIBCUDACXX_TEMPLATE_VIS
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
# if __has_attribute(__type_visibility__)
# define _LIBCUDACXX_TEMPLATE_VIS __attribute__ ((__type_visibility__("default")))
# else
# define _LIBCUDACXX_TEMPLATE_VIS __attribute__ ((__visibility__("default")))
# endif
# else
# define _LIBCUDACXX_TEMPLATE_VIS
# endif
#endif
#ifndef _LIBCUDACXX_EXPORTED_FROM_ABI
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
# define _LIBCUDACXX_EXPORTED_FROM_ABI __attribute__((__visibility__("default")))
# else
# define _LIBCUDACXX_EXPORTED_FROM_ABI
# endif
#endif
#ifndef _LIBCUDACXX_OVERRIDABLE_FUNC_VIS
#define _LIBCUDACXX_OVERRIDABLE_FUNC_VIS _LIBCUDACXX_FUNC_VIS
#endif
#ifndef _LIBCUDACXX_EXCEPTION_ABI
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS)
# define _LIBCUDACXX_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
# else
# define _LIBCUDACXX_EXCEPTION_ABI
# endif
#endif
#ifndef _LIBCUDACXX_ENUM_VIS
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
# define _LIBCUDACXX_ENUM_VIS __attribute__ ((__type_visibility__("default")))
# else
# define _LIBCUDACXX_ENUM_VIS
# endif
#endif
#ifndef _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS
# if !defined(_LIBCUDACXX_DISABLE_VISIBILITY_ANNOTATIONS) && __has_attribute(__type_visibility__)
# define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS __attribute__ ((__visibility__("default")))
# else
# define _LIBCUDACXX_EXTERN_TEMPLATE_TYPE_VIS
# endif
#endif
#ifndef _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
#define _LIBCUDACXX_CLASS_TEMPLATE_INSTANTIATION_VIS
#endif
#if __has_attribute(internal_linkage)
# define _LIBCUDACXX_INTERNAL_LINKAGE __attribute__ ((internal_linkage))
#else
# define _LIBCUDACXX_INTERNAL_LINKAGE _LIBCUDACXX_ALWAYS_INLINE
#endif
#if __has_attribute(exclude_from_explicit_instantiation)
# define _LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION __attribute__ ((__exclude_from_explicit_instantiation__))
#else
// Try to approximate the effect of exclude_from_explicit_instantiation
// (which is that entities are not assumed to be provided by explicit
// template instantiations in the dylib) by always inlining those entities.
# define _LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION _LIBCUDACXX_ALWAYS_INLINE
#endif
#ifndef _LIBCUDACXX_HIDE_FROM_ABI_PER_TU
# ifndef _LIBCUDACXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
# define _LIBCUDACXX_HIDE_FROM_ABI_PER_TU 0
# else
# define _LIBCUDACXX_HIDE_FROM_ABI_PER_TU 1
# endif
#endif
#ifndef _LIBCUDACXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT
# ifdef _LIBCUDACXX_OBJECT_FORMAT_COFF // Windows binaries can't merge typeinfos.
# define _LIBCUDACXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT 0
#else
// TODO: This isn't strictly correct on ELF platforms due to llvm.org/PR37398
// And we should consider defaulting to OFF.
# define _LIBCUDACXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT 1
#endif
#endif
#ifndef _LIBCUDACXX_HIDE_FROM_ABI
# if _LIBCUDACXX_HIDE_FROM_ABI_PER_TU
# define _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_HIDDEN _LIBCUDACXX_INTERNAL_LINKAGE
# else
# define _LIBCUDACXX_HIDE_FROM_ABI _LIBCUDACXX_HIDDEN _LIBCUDACXX_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
# endif
#endif
#ifdef _LIBCUDACXX_BUILDING_LIBRARY
# if _LIBCUDACXX_ABI_VERSION > 1
# define _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1 _LIBCUDACXX_HIDE_FROM_ABI
# else
# define _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1
# endif
#else
# define _LIBCUDACXX_HIDE_FROM_ABI_AFTER_V1 _LIBCUDACXX_HIDE_FROM_ABI
#endif
#ifdef _LIBCUDACXX_CUDACC
# define _LIBCUDACXX_HOST __host__
# define _LIBCUDACXX_DEVICE __device__
# define _LIBCUDACXX_HOST_DEVICE __host__ __device__
# define _LIBCUDACXX_FORCE_INLINE __forceinline__
#else // ^^^ _LIBCUDACXX_CUDACC ^^^ / vvv !_LIBCUDACXX_CUDACC
# define _LIBCUDACXX_HOST
# define _LIBCUDACXX_DEVICE
# define _LIBCUDACXX_HOST_DEVICE
# define _LIBCUDACXX_FORCE_INLINE
#endif // !_LIBCUDACXX_CUDACC
// Just so we can migrate to the new macros gradually.
#ifdef __cuda_std__
# define _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_HOST_DEVICE
#else
# define _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_HIDE_FROM_ABI
#endif // __cuda_std__
#define _LIBCUDACXX_CONCAT1(_LIBCUDACXX_X,_LIBCUDACXX_Y) _LIBCUDACXX_X##_LIBCUDACXX_Y
#define _LIBCUDACXX_CONCAT(_LIBCUDACXX_X,_LIBCUDACXX_Y) _LIBCUDACXX_CONCAT1(_LIBCUDACXX_X,_LIBCUDACXX_Y)
#ifndef _LIBCUDACXX_ABI_NAMESPACE
#ifdef __cuda_std__
# define _LIBCUDACXX_ABI_NAMESPACE _LIBCUDACXX_CONCAT(__,_LIBCUDACXX_CUDA_ABI_VERSION)
#else
# define _LIBCUDACXX_ABI_NAMESPACE _LIBCUDACXX_CONCAT(__,_LIBCUDACXX_ABI_VERSION)
#endif // __cuda_std__
#endif // _LIBCUDACXX_ABI_NAMESPACE
#ifdef __cuda_std__
# define _LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION namespace cuda { namespace std {
# define _LIBCUDACXX_END_NAMESPACE_STD_NOVERSION } }
# define _CUDA_VSTD ::cuda::std::_LIBCUDACXX_ABI_NAMESPACE
# define _CUDA_VRANGES ::cuda::std::ranges::_LIBCUDACXX_ABI_NAMESPACE
#else
# define _LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION namespace std {
# define _LIBCUDACXX_END_NAMESPACE_STD_NOVERSION }
# define _CUDA_VSTD ::std::_LIBCUDACXX_ABI_NAMESPACE
# define _CUDA_VRANGES ::std::ranges::_LIBCUDACXX_ABI_NAMESPACE
#endif
#ifdef __cuda_std__
#define _LIBCUDACXX_BEGIN_NAMESPACE_CUDA namespace cuda { inline namespace _LIBCUDACXX_ABI_NAMESPACE {
#define _LIBCUDACXX_END_NAMESPACE_CUDA } }
#define _LIBCUDACXX_BEGIN_NAMESPACE_CUDA_DEVICE namespace cuda { namespace device { inline namespace _LIBCUDACXX_ABI_NAMESPACE {
#define _LIBCUDACXX_END_NAMESPACE_CUDA_DEVICE } } }
#define _LIBCUDACXX_BEGIN_NAMESPACE_CUDA_PTX namespace cuda { namespace ptx { inline namespace _LIBCUDACXX_ABI_NAMESPACE {
#define _LIBCUDACXX_END_NAMESPACE_CUDA_PTX } } }
#define _CUDA_VPTX ::cuda::ptx::_LIBCUDACXX_ABI_NAMESPACE
#define _LIBCUDACXX_BEGIN_NAMESPACE_CUDA_DEVICE_EXPERIMENTAL namespace cuda { namespace device { namespace experimental { inline namespace _LIBCUDACXX_ABI_NAMESPACE {
#define _LIBCUDACXX_END_NAMESPACE_CUDA_DEVICE_EXPERIMENTAL } } } }
#endif
// Inline namespaces are available in Clang/GCC/MSVC regardless of C++ dialect.
#define _LIBCUDACXX_BEGIN_NAMESPACE_STD _LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION inline namespace _LIBCUDACXX_ABI_NAMESPACE {
#define _LIBCUDACXX_END_NAMESPACE_STD } _LIBCUDACXX_END_NAMESPACE_STD_NOVERSION
#ifndef __cuda_std__
_LIBCUDACXX_BEGIN_NAMESPACE_STD _LIBCUDACXX_END_NAMESPACE_STD
#endif
#define _LIBCUDACXX_BEGIN_NAMESPACE_RANGES _LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION namespace ranges { inline namespace _LIBCUDACXX_ABI_NAMESPACE {
#define _LIBCUDACXX_END_NAMESPACE_RANGES } } _LIBCUDACXX_END_NAMESPACE_STD_NOVERSION
#if !defined(__cuda_std__)
_LIBCUDACXX_BEGIN_NAMESPACE_RANGES _LIBCUDACXX_END_NAMESPACE_RANGES
#endif
#if _LIBCUDACXX_STD_VER > 17
#define _LIBCUDACXX_BEGIN_NAMESPACE_RANGES_ABI inline namespace __cxx20 {
#else
#define _LIBCUDACXX_BEGIN_NAMESPACE_RANGES_ABI inline namespace __cxx17 {
#endif
#define _LIBCUDACXX_END_NAMESPACE_RANGES_ABI }
#define _LIBCUDACXX_BEGIN_NAMESPACE_CPO(_CPO) namespace _CPO { _LIBCUDACXX_BEGIN_NAMESPACE_RANGES_ABI
#define _LIBCUDACXX_END_NAMESPACE_CPO } }
#if _LIBCUDACXX_STD_VER >= 17
#define _LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM \
_LIBCUDACXX_BEGIN_NAMESPACE_STD inline namespace __fs { namespace filesystem {
#else
#define _LIBCUDACXX_BEGIN_NAMESPACE_FILESYSTEM \
_LIBCUDACXX_BEGIN_NAMESPACE_STD namespace __fs { namespace filesystem {
#endif
#define _LIBCUDACXX_END_NAMESPACE_FILESYSTEM \
_LIBCUDACXX_END_NAMESPACE_STD } }
#define _CUDA_VSTD_FS _CUDA_VSTD::__fs::filesystem
#ifndef _LIBCUDACXX_PREFERRED_OVERLOAD
# if __has_attribute(__enable_if__)
# define _LIBCUDACXX_PREFERRED_OVERLOAD __attribute__ ((__enable_if__(true, "")))
# endif
#endif
#ifdef _LIBCUDACXX_HAS_NO_UNICODE_CHARS
typedef unsigned short char16_t;
typedef unsigned int char32_t;
#endif // _LIBCUDACXX_HAS_NO_UNICODE_CHARS
#if defined(_LIBCUDACXX_COMPILER_GCC) \
|| defined(_LIBCUDACXX_COMPILER_CLANG)
# define _LIBCUDACXX_NOALIAS __attribute__((__malloc__))
#else
# define _LIBCUDACXX_NOALIAS
#endif
#if __has_feature(cxx_explicit_conversions) \
|| defined(_LIBCUDACXX_COMPILER_IBM) \
|| defined(_LIBCUDACXX_COMPILER_GCC) \
|| defined(_LIBCUDACXX_COMPILER_CLANG)
# define _LIBCUDACXX_EXPLICIT explicit
#else
# define _LIBCUDACXX_EXPLICIT
#endif
#if !__has_builtin(__builtin_operator_new) || !__has_builtin(__builtin_operator_delete)
#define _LIBCUDACXX_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
#endif
#ifdef _LIBCUDACXX_HAS_NO_STRONG_ENUMS
# define _LIBCUDACXX_DECLARE_STRONG_ENUM(x) struct _LIBCUDACXX_TYPE_VIS x { enum __lx
# define _LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(x) \
__lx __v_; \
_LIBCUDACXX_INLINE_VISIBILITY x(__lx __v) : __v_(__v) {} \
_LIBCUDACXX_INLINE_VISIBILITY explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
_LIBCUDACXX_INLINE_VISIBILITY operator int() const {return __v_;} \
};
#else // _LIBCUDACXX_HAS_NO_STRONG_ENUMS
# define _LIBCUDACXX_DECLARE_STRONG_ENUM(x) enum class _LIBCUDACXX_ENUM_VIS x
# define _LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(x)
#endif // _LIBCUDACXX_HAS_NO_STRONG_ENUMS
#ifdef _LIBCUDACXX_DEBUG
# if _LIBCUDACXX_DEBUG == 0
# define _LIBCUDACXX_DEBUG_LEVEL 1
# elif _LIBCUDACXX_DEBUG == 1
# define _LIBCUDACXX_DEBUG_LEVEL 2
# else
# error Supported values for _LIBCUDACXX_DEBUG are 0 and 1
# endif
# if !defined(_LIBCUDACXX_BUILDING_LIBRARY)
# define _LIBCUDACXX_EXTERN_TEMPLATE(...)
# endif
#endif
#ifdef _LIBCUDACXX_DISABLE_EXTERN_TEMPLATE
#define _LIBCUDACXX_EXTERN_TEMPLATE(...)
#define _LIBCUDACXX_EXTERN_TEMPLATE2(...)
#endif
#ifndef _LIBCUDACXX_EXTERN_TEMPLATE
#define _LIBCUDACXX_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
#endif
#ifndef _LIBCUDACXX_EXTERN_TEMPLATE2
#define _LIBCUDACXX_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;
#endif
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCUDACXX_MSVCRT_LIKE) || \
defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__)
#define _LIBCUDACXX_LOCALE__L_EXTENSIONS 1
#endif
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
// Most unix variants have catopen. These are the specific ones that don't.
# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION)
# define _LIBCUDACXX_HAS_CATOPEN 1
# endif
#endif
#ifdef __FreeBSD__
#define _DECLARE_C99_LDBL_MATH 1
#endif
#if defined(_LIBCUDACXX_ABI_MICROSOFT) && !defined(_LIBCUDACXX_NO_VCRUNTIME)
# define _LIBCUDACXX_DEFER_NEW_TO_VCRUNTIME
#endif
// If we are getting operator new from the MSVC CRT, then allocation overloads
// for align_val_t were added in 19.12, aka VS 2017 version 15.3.
#if defined(_LIBCUDACXX_MSVCRT) && defined(_LIBCUDACXX_COMPILER_MSVC) && _MSC_VER < 1912
# define _LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
#elif defined(_LIBCUDACXX_ABI_VCRUNTIME) && !defined(__cpp_aligned_new)
// We're deferring to Microsoft's STL to provide aligned new et al. We don't
// have it unless the language feature test macro is defined.
# define _LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION
#endif
#if defined(__APPLE__)
# if !defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \
defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
# define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
# endif
#endif // defined(__APPLE__)
#if !defined(_LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION) && \
(defined(_LIBCUDACXX_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) || \
(!defined(__cpp_aligned_new) || __cpp_aligned_new < 201606))
# define _LIBCUDACXX_HAS_NO_ALIGNED_ALLOCATION
#endif
#if defined(__APPLE__) || defined(__FreeBSD__)
#define _LIBCUDACXX_HAS_DEFAULTRUNELOCALE
#endif
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__)
#define _LIBCUDACXX_WCTYPE_IS_MASK
#endif
#if _LIBCUDACXX_STD_VER <= 17 || !defined(__cpp_char8_t)
#define _LIBCUDACXX_NO_HAS_CHAR8_T
#endif
// Deprecation macros.
//
// Deprecations warnings are always enabled, except when users explicitly opt-out
// by defining _LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS.
// NVCC 11.1 and 11.2 are broken with the deprecated attribute, so disable it
#if !defined(_LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS) \
&& !defined(_LIBCUDACXX_CUDACC_BELOW_11_3)
# if __has_attribute(deprecated)
# define _LIBCUDACXX_DEPRECATED __attribute__ ((deprecated))
# elif _LIBCUDACXX_STD_VER > 11
# define _LIBCUDACXX_DEPRECATED [[deprecated]]
# else
# define _LIBCUDACXX_DEPRECATED
# endif
#else
# define _LIBCUDACXX_DEPRECATED
#endif
#define _LIBCUDACXX_DEPRECATED_IN_CXX11 _LIBCUDACXX_DEPRECATED
#if _LIBCUDACXX_STD_VER >= 14
# define _LIBCUDACXX_DEPRECATED_IN_CXX14 _LIBCUDACXX_DEPRECATED
#else
# define _LIBCUDACXX_DEPRECATED_IN_CXX14
#endif
#if _LIBCUDACXX_STD_VER >= 17
# define _LIBCUDACXX_DEPRECATED_IN_CXX17 _LIBCUDACXX_DEPRECATED
#else
# define _LIBCUDACXX_DEPRECATED_IN_CXX17
#endif
#if _LIBCUDACXX_STD_VER <= 11
# define _LIBCUDACXX_EXPLICIT_AFTER_CXX11
#else
# define _LIBCUDACXX_EXPLICIT_AFTER_CXX11 explicit
#endif
#if _LIBCUDACXX_STD_VER > 11 && !defined(_LIBCUDACXX_HAS_NO_CXX14_CONSTEXPR)
# define _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 constexpr
#else
# define _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
#endif
#if _LIBCUDACXX_STD_VER > 14 && !defined(_LIBCUDACXX_HAS_NO_CXX14_CONSTEXPR)
# define _LIBCUDACXX_CONSTEXPR_AFTER_CXX14 constexpr
#else
# define _LIBCUDACXX_CONSTEXPR_AFTER_CXX14
#endif
#if _LIBCUDACXX_STD_VER > 17 && !defined(_LIBCUDACXX_HAS_NO_CXX14_CONSTEXPR)
# define _LIBCUDACXX_CONSTEXPR_AFTER_CXX17 constexpr
#else
# define _LIBCUDACXX_CONSTEXPR_AFTER_CXX17
#endif
// Macros to enter and leave a state where deprecation warnings are suppressed.
#if defined(_LIBCUDACXX_COMPILER_CLANG) || defined(_LIBCUDACXX_COMPILER_GCC)
# define _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated\"") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
# define _LIBCUDACXX_SUPPRESS_DEPRECATED_POP \
_Pragma("GCC diagnostic pop")
#else
# define _LIBCUDACXX_SUPPRESS_DEPRECATED_PUSH
# define _LIBCUDACXX_SUPPRESS_DEPRECATED_POP
#endif
// The _LIBCUDACXX_NODISCARD_ATTRIBUTE should only be used to define other
// NODISCARD macros to the correct attribute.
#if __has_cpp_attribute(nodiscard) || (defined(_LIBCUDACXX_COMPILER_MSVC) && _LIBCUDACXX_STD_VER > 14)
# define _LIBCUDACXX_NODISCARD_ATTRIBUTE [[nodiscard]]
#elif defined(_LIBCUDACXX_COMPILER_CLANG)
# define _LIBCUDACXX_NODISCARD_ATTRIBUTE [[clang::warn_unused_result]]
#else
// We can't use GCC's [[gnu::warn_unused_result]] and
// __attribute__((warn_unused_result)), because GCC does not silence them via
// (void) cast.
# define _LIBCUDACXX_NODISCARD_ATTRIBUTE
#endif
// NVCC below 11.3 does not support nodiscard on friend functions
// It always fails with clang
#if defined(_LIBCUDACXX_CUDACC_BELOW_11_3) \
|| defined(_LIBCUDACXX_COMPILER_CLANG)
# define _LIBCUDACXX_NODISCARD_FRIEND friend
#else // ^^^ _LIBCUDACXX_CUDACC_BELOW_11_3 ^^^ / vvv !_LIBCUDACXX_CUDACC_BELOW_11_3 vvv
# define _LIBCUDACXX_NODISCARD_FRIEND _LIBCUDACXX_NODISCARD_ATTRIBUTE friend
#endif // !_LIBCUDACXX_CUDACC_BELOW_11_3 && !_LIBCUDACXX_COMPILER_CLANG
// _LIBCUDACXX_NODISCARD_EXT may be used to apply [[nodiscard]] to entities not
// specified as such as an extension.
#if defined(_LIBCUDACXX_ENABLE_NODISCARD) && !defined(_LIBCUDACXX_DISABLE_NODISCARD_EXT)
# define _LIBCUDACXX_NODISCARD_EXT _LIBCUDACXX_NODISCARD_ATTRIBUTE
#else
# define _LIBCUDACXX_NODISCARD_EXT
#endif
#if !defined(_LIBCUDACXX_DISABLE_NODISCARD_AFTER_CXX17) && \
(_LIBCUDACXX_STD_VER > 17 || defined(_LIBCUDACXX_ENABLE_NODISCARD))
# define _LIBCUDACXX_NODISCARD_AFTER_CXX17 _LIBCUDACXX_NODISCARD_ATTRIBUTE
#else
# define _LIBCUDACXX_NODISCARD_AFTER_CXX17
#endif
#if _LIBCUDACXX_STD_VER > 14 && defined(__cpp_inline_variables) && (__cpp_inline_variables >= 201606L)
# define _LIBCUDACXX_INLINE_VAR inline
#else
# define _LIBCUDACXX_INLINE_VAR
#endif
#ifdef _LIBCUDACXX_HAS_NO_RVALUE_REFERENCES
# define _LIBCUDACXX_EXPLICIT_MOVE(x) _CUDA_VSTD::move(x)
#else
# define _LIBCUDACXX_EXPLICIT_MOVE(x) (x)
#endif
#ifndef _LIBCUDACXX_CONSTEXPR_IF_NODEBUG
#if defined(_LIBCUDACXX_DEBUG) || defined(_LIBCUDACXX_HAS_NO_CXX14_CONSTEXPR)
#define _LIBCUDACXX_CONSTEXPR_IF_NODEBUG
#else
#define _LIBCUDACXX_CONSTEXPR_IF_NODEBUG _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
#endif
#endif
#if __has_attribute(no_destroy)
# define _LIBCUDACXX_NO_DESTROY __attribute__((__no_destroy__))
#else
# define _LIBCUDACXX_NO_DESTROY
#endif
#ifndef _LIBCUDACXX_HAS_NO_ASAN
extern "C" _LIBCUDACXX_FUNC_VIS void __sanitizer_annotate_contiguous_container(
const void *, const void *, const void *, const void *);
#endif
#ifndef _LIBCUDACXX_WEAK
#define _LIBCUDACXX_WEAK __attribute__((__weak__))
#endif
// Redefine some macros for internal use
#if defined(__cuda_std__)
# undef _LIBCUDACXX_FUNC_VIS
# define _LIBCUDACXX_FUNC_VIS _LIBCUDACXX_INLINE_VISIBILITY
# undef _LIBCUDACXX_TYPE_VIS
# define _LIBCUDACXX_TYPE_VIS
#endif // __cuda_std__
// Thread API
#ifndef _LIBCUDACXX_HAS_THREAD_API_EXTERNAL
#if defined(_LIBCUDACXX_COMPILER_NVRTC) \
|| defined(__EMSCRIPTEN__)
# define _LIBCUDACXX_HAS_THREAD_API_EXTERNAL
#endif
#endif // _LIBCUDACXX_HAS_THREAD_API_EXTERNAL
#ifndef _LIBCUDACXX_HAS_THREAD_API_CUDA
#if defined(__cuda_std__) \
&& (defined(__CUDA_ARCH__) || defined(__EMSCRIPTEN__))
# define _LIBCUDACXX_HAS_THREAD_API_CUDA
#endif // __cuda_std__
#endif // _LIBCUDACXX_HAS_THREAD_API_CUDA
#ifndef _LIBCUDACXX_HAS_THREAD_API_WIN32
#if defined(_LIBCUDACXX_COMPILER_MSVC) \
&& !defined(_LIBCUDACXX_HAS_THREAD_API_CUDA)
# define _LIBCUDACXX_HAS_THREAD_API_WIN32
#endif
#endif // _LIBCUDACXX_HAS_THREAD_API_WIN32
#if !defined(_LIBCUDACXX_HAS_NO_THREADS) \
&& !defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD) \
&& !defined(_LIBCUDACXX_HAS_THREAD_API_WIN32) \
&& !defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
# if defined(__FreeBSD__) || \
defined(__Fuchsia__) || \
defined(__wasi__) || \
defined(__NetBSD__) || \
defined(__linux__) || \
defined(__GNU__) || \
defined(__APPLE__) || \
defined(__CloudABI__) || \
defined(__sun__) || \
(defined(__MINGW32__) && __has_include(<pthread.h>))
# define _LIBCUDACXX_HAS_THREAD_API_PTHREAD
# elif defined(_LIBCUDACXX_WIN32API)
# define _LIBCUDACXX_HAS_THREAD_API_WIN32
# else
# define _LIBCUDACXX_UNSUPPORTED_THREAD_API
# endif // _LIBCUDACXX_HAS_THREAD_API
#endif // _LIBCUDACXX_HAS_NO_THREADS
#if defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD)
#if defined(__ANDROID__) && __ANDROID_API__ >= 30
#define _LIBCUDACXX_HAS_COND_CLOCKWAIT
#elif defined(_LIBCUDACXX_GLIBC_PREREQ)
#if _LIBCUDACXX_GLIBC_PREREQ(2, 30)
#define _LIBCUDACXX_HAS_COND_CLOCKWAIT
#endif
#endif
#endif
#if defined(_LIBCUDACXX_HAS_NO_THREADS) && defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD)
#error _LIBCUDACXX_HAS_THREAD_API_PTHREAD may only be defined when \
_LIBCUDACXX_HAS_NO_THREADS is not defined.
#endif
#if defined(_LIBCUDACXX_HAS_NO_THREADS) && defined(_LIBCUDACXX_HAS_THREAD_API_EXTERNAL)
#error _LIBCUDACXX_HAS_THREAD_API_EXTERNAL may not be defined when \
_LIBCUDACXX_HAS_NO_THREADS is defined.
#endif
#if defined(__STDCPP_THREADS__) && defined(_LIBCUDACXX_HAS_NO_THREADS)
#error _LIBCUDACXX_HAS_NO_THREADS cannot be set when __STDCPP_THREADS__ is set.
#endif
#if !defined(_LIBCUDACXX_HAS_NO_THREADS) && !defined(__STDCPP_THREADS__)
#define __STDCPP_THREADS__ 1
#endif
// The glibc and Bionic implementation of pthreads implements
// pthread_mutex_destroy as nop for regular mutexes. Additionally, Win32
// mutexes have no destroy mechanism.
//
// This optimization can't be performed on Apple platforms, where
// pthread_mutex_destroy can allow the kernel to release resources.
// See https://llvm.org/D64298 for details.
//
// TODO(EricWF): Enable this optimization on Bionic after speaking to their
// respective stakeholders.
#if (defined(_LIBCUDACXX_HAS_THREAD_API_PTHREAD) && defined(__GLIBC__)) \
|| defined(_LIBCUDACXX_HAS_THREAD_API_WIN32)
# define _LIBCUDACXX_HAS_TRIVIAL_MUTEX_DESTRUCTION
#endif
// Destroying a condvar is a nop on Windows.
//
// This optimization can't be performed on Apple platforms, where
// pthread_cond_destroy can allow the kernel to release resources.
// See https://llvm.org/D64298 for details.
//
// TODO(EricWF): This is potentially true for some pthread implementations
// as well.
#if defined(_LIBCUDACXX_HAS_THREAD_API_WIN32)
# define _LIBCUDACXX_HAS_TRIVIAL_CONDVAR_DESTRUCTION
#endif
// Systems that use capability-based security (FreeBSD with Capsicum,
// Nuxi CloudABI) may only provide local filesystem access (using *at()).
// Functions like open(), rename(), unlink() and stat() should not be
// used, as they attempt to access the global filesystem namespace.
#ifdef __CloudABI__
#define _LIBCUDACXX_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
#endif
// CloudABI is intended for running networked services. Processes do not
// have standard input and output channels.
#ifdef __CloudABI__
#define _LIBCUDACXX_HAS_NO_STDIN
#define _LIBCUDACXX_HAS_NO_STDOUT
#endif
// Some systems do not provide gets() in their C library, for security reasons.
#ifndef _LIBCUDACXX_C_HAS_NO_GETS
# if defined(_LIBCUDACXX_MSVCRT) || (defined(__FreeBSD__) && __FreeBSD__ >= 13)
# define _LIBCUDACXX_C_HAS_NO_GETS
# endif
#endif
#if defined(__BIONIC__) || defined(__CloudABI__) || \
defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCUDACXX_HAS_MUSL_LIBC)
#define _LIBCUDACXX_PROVIDES_DEFAULT_RUNE_TABLE
#endif
// Thread-unsafe functions such as strtok() and localtime()
// are not available.
#ifdef __CloudABI__
#define _LIBCUDACXX_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
#endif
// TODO: Support C11 Atomics?
// #if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
// # define _LIBCUDACXX_HAS_C_ATOMIC_IMP
#if defined(_LIBCUDACXX_COMPILER_ICC)
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
#elif defined(_LIBCUDACXX_COMPILER_CLANG)
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
#elif defined(_LIBCUDACXX_COMPILER_GCC)
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
#elif defined(_LIBCUDACXX_COMPILER_NVHPC)
# define _LIBCUDACXX_HAS_GCC_ATOMIC_IMP
#elif defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_HAS_MSVC_ATOMIC_IMPL
#endif
// CUDA Atomics supersede host atomics in order to insert the host/device dispatch layer
#if defined(_LIBCUDACXX_COMPILER_NVCC) || defined(_LIBCUDACXX_COMPILER_NVRTC) || defined(_LIBCUDACXX_COMPILER_NVHPC) || defined(_LIBCUDACXX_CUDACC)
# define _LIBCUDACXX_HAS_CUDA_ATOMIC_IMPL
#endif
#if (!defined(_LIBCUDACXX_HAS_C_ATOMIC_IMP) && \
!defined(_LIBCUDACXX_HAS_GCC_ATOMIC_IMP) && \
!defined(_LIBCUDACXX_HAS_EXTERNAL_ATOMIC_IMP)) \
|| defined(_LIBCUDACXX_HAS_NO_THREADS)
# define _LIBCUDACXX_HAS_NO_ATOMIC_HEADER
#else
# ifdef __cuda_std__
# undef _LIBCUDACXX_ATOMIC_FLAG_TYPE
# define _LIBCUDACXX_ATOMIC_FLAG_TYPE int
# endif
# ifndef _LIBCUDACXX_ATOMIC_FLAG_TYPE
# define _LIBCUDACXX_ATOMIC_FLAG_TYPE bool
# endif
# ifdef _LIBCUDACXX_FREESTANDING
# define _LIBCUDACXX_ATOMIC_ONLY_USE_BUILTINS
# endif
#endif
#ifndef _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
#define _LIBCUDACXX_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
#endif
#if defined(_LIBCUDACXX_ENABLE_THREAD_SAFETY_ANNOTATIONS)
# if defined(_LIBCUDACXX_COMPILER_CLANG) && __has_attribute(acquire_capability)
// Work around the attribute handling in clang. When both __declspec and
// __attribute__ are present, the processing goes awry preventing the definition
// of the types.
# if !defined(_LIBCUDACXX_OBJECT_FORMAT_COFF)
# define _LIBCUDACXX_HAS_THREAD_SAFETY_ANNOTATIONS
# endif
# endif
#endif
#if __has_attribute(require_constant_initialization)
# define _LIBCUDACXX_SAFE_STATIC __attribute__((__require_constant_initialization__))
#else
# define _LIBCUDACXX_SAFE_STATIC
#endif
#if !defined(_LIBCUDACXX_HAS_NO_OFF_T_FUNCTIONS)
# if defined(_LIBCUDACXX_MSVCRT) || defined(_NEWLIB_VERSION)
# define _LIBCUDACXX_HAS_NO_OFF_T_FUNCTIONS
# endif
#endif
#if __has_attribute(diagnose_if) && !defined(_LIBCUDACXX_DISABLE_ADDITIONAL_DIAGNOSTICS)
# define _LIBCUDACXX_DIAGNOSE_WARNING(...) \
__attribute__((diagnose_if(__VA_ARGS__, "warning")))
# define _LIBCUDACXX_DIAGNOSE_ERROR(...) \
__attribute__((diagnose_if(__VA_ARGS__, "error")))
#else
# define _LIBCUDACXX_DIAGNOSE_WARNING(...)
# define _LIBCUDACXX_DIAGNOSE_ERROR(...)
#endif
// Use a function like macro to imply that it must be followed by a semicolon
#if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
# define _LIBCUDACXX_FALLTHROUGH() [[fallthrough]]
#elif defined(_LIBCUDACXX_COMPILER_NVRTC)
# define _LIBCUDACXX_FALLTHROUGH() ((void)0)
#elif __has_cpp_attribute(clang::fallthrough)
# define _LIBCUDACXX_FALLTHROUGH() [[clang::fallthrough]]
#elif defined(_LIBCUDACXX_COMPILER_NVHPC)
# define _LIBCUDACXX_FALLTHROUGH()
#elif __has_attribute(fallthough) || _GNUC_VER >= 700
# define _LIBCUDACXX_FALLTHROUGH() __attribute__((__fallthrough__))
#else
# define _LIBCUDACXX_FALLTHROUGH() ((void)0)
#endif
#if __has_attribute(__nodebug__)
#define _LIBCUDACXX_NODEBUG __attribute__((__nodebug__))
#else
#define _LIBCUDACXX_NODEBUG
#endif
# if __has_attribute(__preferred_name__)
# define _LIBCUDACXX_PREFERRED_NAME(x) __attribute__((__preferred_name__(x)))
# else
# define _LIBCUDACXX_PREFERRED_NAME(x)
# endif
#if defined(_LIBCUDACXX_ABI_MICROSOFT) && \
(defined(_LIBCUDACXX_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
# define _LIBCUDACXX_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
#else
# define _LIBCUDACXX_DECLSPEC_EMPTY_BASES
#endif
#if defined(_LIBCUDACXX_ENABLE_CXX17_REMOVED_FEATURES)
#define _LIBCUDACXX_ENABLE_CXX17_REMOVED_AUTO_PTR
#define _LIBCUDACXX_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
#define _LIBCUDACXX_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
#define _LIBCUDACXX_ENABLE_CXX17_REMOVED_BINDERS
#endif // _LIBCUDACXX_ENABLE_CXX17_REMOVED_FEATURES
#if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611
#define _LIBCUDACXX_HAS_NO_DEDUCTION_GUIDES
#endif
#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
#define _LIBCUDACXX_HAS_NO_COROUTINES
#endif
// We need `is_constant_evaluated` for clang and gcc. MSVC also needs extensive rework
#if !defined(_LIBCUDACXX_IS_CONSTANT_EVALUATED)
#define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS
#elif defined(__CUDACC_RTC__)
#define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS
#elif defined(_MSC_VER)
#define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS
#elif defined(_LIBCUDACXX_CUDACC_BELOW_11_8)
#define _LIBCUDACXX_HAS_NO_CONSTEXPR_COMPLEX_OPERATIONS
#endif
// FIXME: Correct this macro when either (A) a feature test macro for the
// spaceship operator is provided, or (B) a compiler provides a complete
// implementation.
#define _LIBCUDACXX_HAS_NO_SPACESHIP_OPERATOR
#define _LIBCUDACXX_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS
// The stream API was dropped and re-added in the dylib shipped on macOS
// and iOS. We can only assume the dylib to provide these definitions for
// macosx >= 10.9 and ios >= 7.0. Otherwise, the definitions are available
// from the headers, but not from the dylib. Explicit instantiation
// declarations for streams exist conditionally to this; if we provide
// an explicit instantiation declaration and we try to deploy to a dylib
// that does not provide those symbols, we'll get a load-time error.
#if !defined(_LIBCUDACXX_BUILDING_LIBRARY) && \
((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1090) || \
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 70000))
# define _LIBCUDACXX_DO_NOT_ASSUME_STREAMS_EXPLICIT_INSTANTIATION_IN_DYLIB
#endif
#if defined(_LIBCUDACXX_HAS_NO_PRAGMA_PUSH_POP_MACRO)
# define _LIBCUDACXX_PUSH_MACROS
# define _LIBCUDACXX_POP_MACROS
#else
// Don't warn about macro conflicts when we can restore them at the
// end of the header.
# ifndef _LIBCUDACXX_DISABLE_MACRO_CONFLICT_WARNINGS
# define _LIBCUDACXX_DISABLE_MACRO_CONFLICT_WARNINGS
# endif
# if defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_PUSH_MACROS \
__pragma(push_macro("min")) \
__pragma(push_macro("max"))
# define _LIBCUDACXX_POP_MACROS \
__pragma(pop_macro("min")) \
__pragma(pop_macro("max"))
# else
# define _LIBCUDACXX_PUSH_MACROS \
_Pragma("push_macro(\"min\")") \
_Pragma("push_macro(\"max\")")
# define _LIBCUDACXX_POP_MACROS \
_Pragma("pop_macro(\"min\")") \
_Pragma("pop_macro(\"max\")")
# endif
#endif // defined(_LIBCUDACXX_HAS_NO_PRAGMA_PUSH_POP_MACRO)
#if !defined(_LIBCUDACXX_NO_AUTO_LINK) && !defined(__cuda_std__)
# if defined(_LIBCUDACXX_ABI_MICROSOFT) && !defined(_LIBCUDACXX_BUILDING_LIBRARY)
# if defined(_DLL)
# pragma comment(lib, "c++.lib")
# else
# pragma comment(lib, "libc++.lib")
# endif
# endif // defined(_LIBCUDACXX_ABI_MICROSOFT) && !defined(_LIBCUDACXX_BUILDING_LIBRARY)
#endif // !defined(_LIBCUDACXX_NO_AUTO_LINK)
#define _LIBCUDACXX_UNUSED_VAR(x) ((void)(x))
// Configures the fopen close-on-exec mode character, if any. This string will
// be appended to any mode string used by fstream for fopen/fdopen.
//
// Not all platforms support this, but it helps avoid fd-leaks on platforms that
// do.
#if defined(__BIONIC__)
# define _LIBCUDACXX_FOPEN_CLOEXEC_MODE "e"
#else
# define _LIBCUDACXX_FOPEN_CLOEXEC_MODE
#endif
# if __has_attribute(__format__)
// The attribute uses 1-based indices for ordinary and static member functions.
// The attribute uses 2-based indices for non-static member functions.
# define _LIBCUDACXX_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) \
__attribute__((__format__(archetype, format_string_index, first_format_arg_index)))
# else
# define _LIBCUDACXX_ATTRIBUTE_FORMAT(archetype, format_string_index, first_format_arg_index) /* nothing */
# endif
#ifndef _LIBCUDACXX_SYS_CLOCK_DURATION
#if defined(__cuda_std__)
# define _LIBCUDACXX_SYS_CLOCK_DURATION nanoseconds
#else
# define _LIBCUDACXX_SYS_CLOCK_DURATION microseconds
#endif
#endif // _LIBCUDACXX_SYS_CLOCK_DURATION
// There are a handful of public standard library types that are intended to
// support CTAD but don't need any explicit deduction guides to do so. This
// macro is used to mark them as such, which suppresses the
// '-Wctad-maybe-unsupported' compiler warning when CTAD is used in user code
// with these classes.
#if (!defined(_LIBCUDACXX_COMPILER_GCC) || __GNUC__ > 6) \
&& _LIBCUDACXX_STD_VER >= 17
# define _LIBCUDACXX_CTAD_SUPPORTED_FOR_TYPE(_ClassName) \
template <class ..._Tag> \
_ClassName(typename _Tag::__allow_ctad...) -> _ClassName<_Tag...>
#else
# define _LIBCUDACXX_CTAD_SUPPORTED_FOR_TYPE(_ClassName) static_assert(true, "")
#endif
#if (defined(__CUDACC_VER_MAJOR__) && __CUDACC_VER_MAJOR__ <= 11) \
&& (defined(__CUDACC_VER_MINOR__) && __CUDACC_VER_MINOR__ <= 2)
# define _LIBCUDACXX_CONSTEXPR_GLOBAL const
#else
# define _LIBCUDACXX_CONSTEXPR_GLOBAL constexpr
#endif
#if defined(__CUDA_ARCH__)
# define _LIBCUDACXX_CPO_ACCESSIBILITY _LIBCUDACXX_DEVICE _LIBCUDACXX_CONSTEXPR_GLOBAL
#else
# define _LIBCUDACXX_CPO_ACCESSIBILITY _LIBCUDACXX_INLINE_VAR constexpr
#endif
#if _LIBCUDACXX_STD_VER > 14
# define _LIBCUDACXX_TRAIT(__TRAIT, ...) __TRAIT##_v<__VA_ARGS__>
#else
# define _LIBCUDACXX_TRAIT(__TRAIT, ...) __TRAIT<__VA_ARGS__>::value
#endif
// Older nvcc do not handle the constraint of `construct_at` in earlier std modes
// So to preserve our performance optimization we default to the unconstrained
// `__construct_at` and only in C++20 use `construct_at`
#if _LIBCUDACXX_STD_VER > 17
# define _LIBCUDACXX_CONSTRUCT_AT(_LOCATION, ...) \
_CUDA_VSTD::construct_at(_CUDA_VSTD::addressof(_LOCATION), __VA_ARGS__)
#else
# define _LIBCUDACXX_CONSTRUCT_AT(_LOCATION, ...) \
_CUDA_VSTD::__construct_at(_CUDA_VSTD::addressof(_LOCATION), __VA_ARGS__)
#endif
#if !defined(_LIBCUDACXX_DISABLE_EXEC_CHECK)
#if defined(_LIBCUDACXX_CUDACC) \
&& !defined(_LIBCUDACXX_COMPILER_NVRTC) \
&& !defined(_LIBCUDACXX_COMPILER_NVHPC_CUDA) \
&& !defined(_LIBCUDACXX_COMPILER_CLANG_CUDA)
# if defined(_LIBCUDACXX_COMPILER_MSVC)
# define _LIBCUDACXX_DISABLE_EXEC_CHECK __pragma("nv_exec_check_disable")
# else // ^^^ _LIBCUDACXX_COMPILER_MSVC ^^^ / vvv !_LIBCUDACXX_COMPILER_MSVC vvv
# define _LIBCUDACXX_DISABLE_EXEC_CHECK _Pragma("nv_exec_check_disable")
# endif // !_LIBCUDACXX_COMPILER_MSVC
#else // ^^^ !NVRTC && !NVHPC-cuda && !clang-cuda ^^^ / vvv NVRTC || NVHPC-cuda || clang-cuda vvv
# define _LIBCUDACXX_DISABLE_EXEC_CHECK
#endif // NVRTC || NVHPC-cuda || clang-cuda
#endif // !_LIBCUDACXX_DISABLE_EXEC_CHECK
#define _LIBCUDACXX_HAS_NO_INCOMPLETE_RANGES
#endif // __cplusplus
#endif // _LIBCUDACXX_CONFIG
|