From 613b062ed6fb3deb63182e0e1f6e1c304785a0e8 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Wed, 13 Nov 2024 20:42:12 +0100 Subject: [PATCH 01/29] backport std integer comparison functions to C++11 --- libcudacxx/include/cuda/std/__utility/cmp.h | 93 ++++++++++++------- libcudacxx/include/cuda/std/version | 3 +- .../intcmp.cmp_equal/cmp_equal.pass.cpp | 4 +- .../intcmp.cmp_greater/cmp_greater.pass.cpp | 4 +- .../cmp_greater_equal.pass.cpp | 4 +- .../intcmp.cmp_less/cmp_less.pass.cpp | 4 +- .../cmp_less_equal.pass.cpp | 4 +- .../cmp_not_equal.pass.cpp | 4 +- .../utility/utility.intcmp/intcmp.fail.cpp | 16 ++-- .../intcmp.in_range/in_range.pass.cpp | 4 +- 10 files changed, 75 insertions(+), 65 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 6aecd0a1e5c..bd277b45dee 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -33,94 +33,119 @@ _CCCL_PUSH_MACROS _LIBCUDACXX_BEGIN_NAMESPACE_STD -#if _CCCL_STD_VER > 2017 template struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {}; template -concept __is_safe_integral_cmp = - is_integral_v<_Tp> - && !_IsSameAsAny<_Tp, - bool, - char, - char16_t, - char32_t -# ifndef _LIBCUDACXX_NO_HAS_CHAR8_T - , - char8_t -# endif -# ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS - , - wchar_t -# endif - >::value; - -template <__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> -_LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept +struct __is_safe_integral_cmp + : bool_constant::value + && !_IsSameAsAny<_Tp, + bool, + char, + char16_t, + char32_t +#ifndef _LIBCUDACXX_NO_HAS_CHAR8_T + , + char8_t +#endif +#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS + , + wchar_t +#endif + >::value> +{}; + +struct __cmp_equal_impl { - if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>) + template ::value && is_signed<_Up>::value, int> = 0> + static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t == __u; } - else if constexpr (is_signed_v<_Tp>) + + template ::value, int> = 0> + static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u; } - else + + template + static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); } +}; + +template +_LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept +{ + static_assert(__is_safe_integral_cmp<_Tp>::value && __is_safe_integral_cmp<_Up>::value, + "comparison operands must be integral types"); + + return __cmp_equal_impl::__do_cmp(__t, __u); } -template <__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +template _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_equal(__t, __u); } -template <__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> -_LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept +struct __cmp_less_impl { - if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>) + template ::value == is_signed<_Up>::value, int> = 0> + static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < __u; } - else if constexpr (is_signed_v<_Tp>) + + template ::value, int> = 0> + static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u; } - else + + template + static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); } +}; + +template +_LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept +{ + static_assert(__is_safe_integral_cmp<_Tp>::value && __is_safe_integral_cmp<_Up>::value, + "comparison operands must be integral types"); + + return __cmp_less_impl::__do_cmp(__t, __u); } -template <__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +template _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept { return _CUDA_VSTD::cmp_less(__u, __t); } -template <__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +template _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_greater(__t, __u); } -template <__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +template _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_less(__t, __u); } -template <__is_safe_integral_cmp _Tp, __is_safe_integral_cmp _Up> +template _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept { return _CUDA_VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) && _CUDA_VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min()); } -#endif // _CCCL_STD_VER > 2017 _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/version b/libcudacxx/include/cuda/std/version index 0d7240b2a69..e869bb21226 100644 --- a/libcudacxx/include/cuda/std/version +++ b/libcudacxx/include/cuda/std/version @@ -29,6 +29,8 @@ # include // otherwise go for the smallest possible header #endif +#define __cccl_lib_integer_comparison_functions 202002L + #if _CCCL_STD_VER >= 2014 # define __cccl_lib_bit_cast 201806L # define __cccl_lib_chrono_udls 201304L @@ -171,7 +173,6 @@ // # define __cccl_lib_format 202106L // # define __cccl_lib_generic_unordered_lookup 201811L // # define __cccl_lib_int_pow2 202002L -// # define __cccl_lib_integer_comparison_functions 202002L // # define __cccl_lib_interpolate 201902L # ifdef _CCCL_BUILTIN_IS_CONSTANT_EVALUATED # define __cccl_lib_is_constant_evaluated 201811L diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp index 4d715ff6940..b08330061f3 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp @@ -7,12 +7,10 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - // // template -// constexpr bool cmp_equal(T t, U u) noexcept; // C++20 +// constexpr bool cmp_equal(T t, U u) noexcept; #include #include diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp index 5ac4ed3cd0d..8d2c440b1be 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp @@ -6,11 +6,9 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - // -// constexpr bool cmp_greater(T t, U u) noexcept; // C++20 +// constexpr bool cmp_greater(T t, U u) noexcept; #include #include diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp index 38405a7a305..9ae3ec75c46 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp @@ -6,11 +6,9 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - // -// constexpr bool cmp_greater_equal(T t, U u) noexcept; // C++20 +// constexpr bool cmp_greater_equal(T t, U u) noexcept; #include #include diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp index 158c07a0c42..432aecdf129 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp @@ -6,12 +6,10 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - // // template -// constexpr bool cmp_less(T t, U u) noexcept; // C++20 +// constexpr bool cmp_less(T t, U u) noexcept; #include #include diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp index cce292b20e2..5524d3c3a9f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp @@ -6,11 +6,9 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - // -// constexpr bool cmp_less_equal(T t, U u) noexcept; // C++20 +// constexpr bool cmp_less_equal(T t, U u) noexcept; #include #include diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp index c53781c23ba..bc9f1b2f579 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp @@ -6,12 +6,10 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - // // template -// constexpr bool cmp_not_equal(T t, U u) noexcept; // C++20 +// constexpr bool cmp_not_equal(T t, U u) noexcept; #include #include diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp index 8cdc1d755a0..6cd15e96236 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp @@ -6,30 +6,28 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - // // template -// constexpr bool cmp_equal(T t, U u) noexcept; // C++20 +// constexpr bool cmp_equal(T t, U u) noexcept; // template -// constexpr bool cmp_not_equal(T t, U u) noexcept; // C++20 +// constexpr bool cmp_not_equal(T t, U u) noexcept; // template -// constexpr bool cmp_less(T t, U u) noexcept; // C++20 +// constexpr bool cmp_less(T t, U u) noexcept; // template -// constexpr bool cmp_less_equal(T t, U u) noexcept; // C++20 +// constexpr bool cmp_less_equal(T t, U u) noexcept; // template -// constexpr bool cmp_greater(T t, U u) noexcept; // C++20 +// constexpr bool cmp_greater(T t, U u) noexcept; // template -// constexpr bool cmp_greater_equal(T t, U u) noexcept; // C++20 +// constexpr bool cmp_greater_equal(T t, U u) noexcept; // template -// constexpr bool in_range(T t) noexcept; // C++20 +// constexpr bool in_range(T t) noexcept; #include #include diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp index 634fee7b584..93328290862 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp @@ -6,12 +6,10 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17 - // // template -// constexpr bool in_range(T t) noexcept; // C++20 +// constexpr bool in_range(T t) noexcept; #include #include From 76c88ba5a97681471348d3dc259918f3b3d154eb Mon Sep 17 00:00:00 2001 From: David Bayer Date: Wed, 13 Nov 2024 21:32:31 +0100 Subject: [PATCH 02/29] fix sfinae --- libcudacxx/include/cuda/std/__utility/cmp.h | 53 ++++++++++++++------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index bd277b45dee..27604d1e644 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -21,6 +21,7 @@ #endif // no system header #include +#include #include #include #include @@ -64,29 +65,34 @@ struct __cmp_equal_impl return __t == __u; } - template ::value, int> = 0> + template < + class _Tp, + class _Up, + enable_if_t<(is_signed<_Tp>::value && !is_signed<_Up>::value) || (!is_signed<_Tp>::value && is_signed<_Up>::value), + int> = 0> static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u; } - template + template ::value && !is_signed<_Up>::value, int> = 0> static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); } }; -template +template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { - static_assert(__is_safe_integral_cmp<_Tp>::value && __is_safe_integral_cmp<_Up>::value, - "comparison operands must be integral types"); - return __cmp_equal_impl::__do_cmp(__t, __u); } -template +template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_equal(__t, __u); @@ -94,53 +100,64 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcep struct __cmp_less_impl { - template ::value == is_signed<_Up>::value, int> = 0> + template ::value && is_signed<_Up>::value, int> = 0> static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < __u; } - template ::value, int> = 0> + template < + class _Tp, + class _Up, + enable_if_t<(is_signed<_Tp>::value && !is_signed<_Up>::value) || (!is_signed<_Tp>::value && is_signed<_Up>::value), + int> = 0> static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u; } - template + template ::value && !is_signed<_Up>::value, int> = 0> static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); } }; -template +template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { - static_assert(__is_safe_integral_cmp<_Tp>::value && __is_safe_integral_cmp<_Up>::value, - "comparison operands must be integral types"); - return __cmp_less_impl::__do_cmp(__t, __u); } -template +template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept { return _CUDA_VSTD::cmp_less(__u, __t); } -template +template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_greater(__t, __u); } -template +template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_less(__t, __u); } -template +template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept { return _CUDA_VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) From e14acb24ccae3b24881ae1a8e5bd880c5498a41e Mon Sep 17 00:00:00 2001 From: David Bayer Date: Wed, 13 Nov 2024 21:36:45 +0100 Subject: [PATCH 03/29] add missing `integral_constant.h` include --- libcudacxx/include/cuda/std/__utility/cmp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 27604d1e644..1665ef8ea5e 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -22,6 +22,7 @@ #include #include +#include #include #include #include From d8d3df9ef7050eae068022d0226971f8d9d9b465 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Wed, 13 Nov 2024 21:41:30 +0100 Subject: [PATCH 04/29] add missing `_LIBCUDACXX_HIDE_FROM_ABI` --- libcudacxx/include/cuda/std/__utility/cmp.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 1665ef8ea5e..8907148288a 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -61,7 +61,7 @@ struct __is_safe_integral_cmp struct __cmp_equal_impl { template ::value && is_signed<_Up>::value, int> = 0> - static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t == __u; } @@ -71,13 +71,13 @@ struct __cmp_equal_impl class _Up, enable_if_t<(is_signed<_Tp>::value && !is_signed<_Up>::value) || (!is_signed<_Tp>::value && is_signed<_Up>::value), int> = 0> - static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u; } template ::value && !is_signed<_Up>::value, int> = 0> - static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); } @@ -102,7 +102,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcep struct __cmp_less_impl { template ::value && is_signed<_Up>::value, int> = 0> - static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < __u; } @@ -112,13 +112,13 @@ struct __cmp_less_impl class _Up, enable_if_t<(is_signed<_Tp>::value && !is_signed<_Up>::value) || (!is_signed<_Tp>::value && is_signed<_Up>::value), int> = 0> - static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u; } template ::value && !is_signed<_Up>::value, int> = 0> - static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); } From 0812f592c78274c2530be935e53aaa745b8e4ebf Mon Sep 17 00:00:00 2001 From: David Bayer Date: Thu, 14 Nov 2024 11:13:15 +0100 Subject: [PATCH 05/29] change target c++ version to 14, use `_CCCL_TRAIT` for standard type traits --- libcudacxx/include/cuda/std/__utility/cmp.h | 68 +++++++-------------- 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 8907148288a..bd49daed209 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -35,60 +35,47 @@ _CCCL_PUSH_MACROS _LIBCUDACXX_BEGIN_NAMESPACE_STD +#if _CCCL_STD_VER >= 2014 template struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {}; template struct __is_safe_integral_cmp - : bool_constant::value + : bool_constant<_CCCL_TRAIT(is_integral, _Tp) && !_IsSameAsAny<_Tp, bool, char, char16_t, char32_t -#ifndef _LIBCUDACXX_NO_HAS_CHAR8_T +# ifndef _LIBCUDACXX_NO_HAS_CHAR8_T , char8_t -#endif -#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS +# endif +# ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS , wchar_t -#endif +# endif >::value> {}; -struct __cmp_equal_impl +template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { - template ::value && is_signed<_Up>::value, int> = 0> - _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, Tp) == _CCCL_TRAIT(is_signed, _Up)) { return __t == __u; } - - template < - class _Tp, - class _Up, - enable_if_t<(is_signed<_Tp>::value && !is_signed<_Up>::value) || (!is_signed<_Tp>::value && is_signed<_Up>::value), - int> = 0> - _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _CCCL_ELSE_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp)) { return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u; } - - template ::value && !is_signed<_Up>::value, int> = 0> - _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + else { return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); } -}; - -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> -_LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept -{ - return __cmp_equal_impl::__do_cmp(__t, __u); } template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { - template ::value && is_signed<_Up>::value, int> = 0> - _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) { return __t < __u; } - - template < - class _Tp, - class _Up, - enable_if_t<(is_signed<_Tp>::value && !is_signed<_Up>::value) || (!is_signed<_Tp>::value && is_signed<_Up>::value), - int> = 0> - _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + _CCCL_ELSE_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp)) { return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u; } - - template ::value && !is_signed<_Up>::value, int> = 0> - _LIBCUDACXX_HIDE_FROM_ABI static constexpr bool __do_cmp(_Tp __t, _Up __u) noexcept + else { return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); } -}; - -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> -_LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept -{ - return __cmp_less_impl::__do_cmp(__t, __u); } template ::max()) && _CUDA_VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min()); } +#endif // _CCCL_STD_VER >= 2014 _LIBCUDACXX_END_NAMESPACE_STD From 7783358e449bb68fb6e6bf435b2492e9dc028c6c Mon Sep 17 00:00:00 2001 From: David Bayer Date: Thu, 14 Nov 2024 11:39:39 +0100 Subject: [PATCH 06/29] fix typo --- libcudacxx/include/cuda/std/__utility/cmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index bd49daed209..3856e070566 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -64,7 +64,7 @@ template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { - _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, Tp) == _CCCL_TRAIT(is_signed, _Up)) + _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) { return __t == __u; } From f6dc313a0353f2f9b32f02aab573ebb7eb9fc7e9 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Thu, 14 Nov 2024 12:17:41 +0100 Subject: [PATCH 07/29] suppress MSVC warnings --- libcudacxx/include/cuda/std/__utility/cmp.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 3856e070566..2f91c7b216c 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -36,6 +36,19 @@ _CCCL_PUSH_MACROS _LIBCUDACXX_BEGIN_NAMESPACE_STD #if _CCCL_STD_VER >= 2014 + +_CCCL_DIAG_PUSH + +// Suppress NVHPC's warnings about signed/unsigned comparisons when -Wsign-compare is specified +// TODO: find out the warning number +// _CCCL_DIAG_SUPPRESS_NVHPC() + +// Suppress MSVC's warnings about signed/unsigned comparisons +// C4018: 'token' : signed/unsigned mismatch +// C4127: conditional expression is constant +// C4389: 'equality-operator' : signed/unsigned mismatch +_CCCL_DIAG_SUPPRESS_MSVC(4018 4127 4389) + template struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> {}; @@ -137,6 +150,9 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept return _CUDA_VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) && _CUDA_VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min()); } + +_CCCL_DIAG_POP + #endif // _CCCL_STD_VER >= 2014 _LIBCUDACXX_END_NAMESPACE_STD From d1360b72441adddd037c24de2c013b6366e4b05c Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 14:42:26 +0100 Subject: [PATCH 08/29] Address review feedback --- libcudacxx/include/cuda/std/__utility/cmp.h | 62 ++++++++----------- libcudacxx/include/cuda/std/version | 13 ++-- .../intcmp.cmp_equal/cmp_equal.pass.cpp | 2 + .../intcmp.cmp_greater/cmp_greater.pass.cpp | 2 + .../cmp_greater_equal.pass.cpp | 2 + .../intcmp.cmp_less/cmp_less.pass.cpp | 2 + .../cmp_less_equal.pass.cpp | 2 + .../cmp_not_equal.pass.cpp | 2 + .../utility/utility.intcmp/intcmp.fail.cpp | 2 + .../intcmp.in_range/in_range.pass.cpp | 2 + 10 files changed, 49 insertions(+), 42 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 2f91c7b216c..5fbacf61461 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -50,31 +50,29 @@ _CCCL_DIAG_PUSH _CCCL_DIAG_SUPPRESS_MSVC(4018 4127 4389) template -struct _IsSameAsAny : _Or<_IsSame<_Tp, _Up>...> -{}; +using __is_same_as_any = __fold_or<_CCCL_TRAIT(is_same, _Tp, _Up)...>; template struct __is_safe_integral_cmp : bool_constant<_CCCL_TRAIT(is_integral, _Tp) - && !_IsSameAsAny<_Tp, - bool, - char, - char16_t, - char32_t + && !__is_same_as_any<_Tp, + bool, + char, + char16_t, + char32_t # ifndef _LIBCUDACXX_NO_HAS_CHAR8_T - , - char8_t -# endif + , + char8_t +# endif // _LIBCUDACXX_NO_HAS_CHAR8_T # ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS - , - wchar_t -# endif - >::value> + , + wchar_t +# endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS + >::value> {}; -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) +_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) @@ -91,17 +89,15 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept } } -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) +_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_equal(__t, __u); } -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) +_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) @@ -118,33 +114,29 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept } } -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) +_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept { return _CUDA_VSTD::cmp_less(__u, __t); } -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) +_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_greater(__t, __u); } -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) +_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_less(__t, __u); } -template ::value && __is_safe_integral_cmp<_Up>::value, int> = 0> +_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) +_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept { return _CUDA_VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) diff --git a/libcudacxx/include/cuda/std/version b/libcudacxx/include/cuda/std/version index f9ac17145f3..50afd4a176f 100644 --- a/libcudacxx/include/cuda/std/version +++ b/libcudacxx/include/cuda/std/version @@ -29,8 +29,6 @@ # include // otherwise go for the smallest possible header #endif -#define __cccl_lib_integer_comparison_functions 202002L - #if _CCCL_STD_VER >= 2014 # define __cccl_lib_bit_cast 201806L # define __cccl_lib_chrono_udls 201304L @@ -42,11 +40,12 @@ # define __cccl_lib_exchange_function 201304L # define __cccl_lib_expected 202211L // # define __cccl_lib_generic_associative_lookup 201304L -# define __cccl_lib_integer_sequence 201304L -# define __cccl_lib_integral_constant_callable 201304L -# define __cccl_lib_is_final 201402L -# define __cccl_lib_is_null_pointer 201309L -# define __cccl_lib_make_reverse_iterator 201402L +# define __cccl_lib_integer_sequence 201304L +# define __cccl_lib_integer_comparison_functions 202002L +# define __cccl_lib_integral_constant_callable 201304L +# define __cccl_lib_is_final 201402L +# define __cccl_lib_is_null_pointer 201309L +# define __cccl_lib_make_reverse_iterator 201402L // # define __cccl_lib_make_unique 201304L # if !defined(_CCCL_COMPILER_MSVC) || _CCCL_STD_VER >= 2020 # define __cccl_lib_mdspan 202207L diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp index b08330061f3..af624a1cc3f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++11 + // // template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp index 8d2c440b1be..962794360d1 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++11 + // // constexpr bool cmp_greater(T t, U u) noexcept; diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp index 9ae3ec75c46..8ca7f7cc60f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++11 + // // constexpr bool cmp_greater_equal(T t, U u) noexcept; diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp index 432aecdf129..06231b303ec 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++11 + // // template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp index 5524d3c3a9f..e3c415782b9 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++11 + // // constexpr bool cmp_less_equal(T t, U u) noexcept; diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp index bc9f1b2f579..80e41104fd7 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++11 + // // template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp index 6cd15e96236..43f74d2fbbc 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++11 + // // template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp index 93328290862..faf42968635 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++11 + // // template From dd928c6c5aac78b3ab2b9d72a44778785f416335 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 16:00:36 +0100 Subject: [PATCH 09/29] Add missing include --- libcudacxx/include/cuda/std/__utility/cmp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 5fbacf61461..451faf56c39 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -20,6 +20,7 @@ # pragma system_header #endif // no system header +#include #include #include #include From 518920f7b6d30f3e061cc1b7979749ca9c823ab1 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 16:40:22 +0100 Subject: [PATCH 10/29] Fix invalid initialization issue with helper struct --- .../intcmp.cmp_equal/cmp_equal.pass.cpp | 27 +++++-------------- .../intcmp.cmp_greater/cmp_greater.pass.cpp | 23 ++++------------ .../cmp_greater_equal.pass.cpp | 23 ++++------------ .../intcmp.cmp_less/cmp_less.pass.cpp | 23 ++++------------ .../cmp_less_equal.pass.cpp | 23 ++++------------ .../cmp_not_equal.pass.cpp | 23 ++++------------ .../intcmp.in_range/in_range.pass.cpp | 27 +++++-------------- 7 files changed, 39 insertions(+), 130 deletions(-) diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp index af624a1cc3f..2142deccaf2 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp @@ -24,28 +24,15 @@ template struct Tuple { - T min; - T max; - T mid; - __host__ __device__ constexpr Tuple() - { - min = cuda::std::numeric_limits::min(); - max = cuda::std::numeric_limits::max(); - if constexpr (cuda::std::is_signed_v) - { - mid = T(-1); - } - else - { - mid = max >> 1; - } - } + T min = cuda::std::numeric_limits::min(); + T max = cuda::std::numeric_limits::max(); + T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; }; template __host__ __device__ constexpr void test_cmp_equal1() { - constexpr Tuple tup; + constexpr Tuple tup{}; assert(cuda::std::cmp_equal(T(0), T(0))); assert(cuda::std::cmp_equal(T(10), T(10))); assert(cuda::std::cmp_equal(tup.min, tup.min)); @@ -70,8 +57,8 @@ __host__ __device__ constexpr void test_cmp_equal1() template __host__ __device__ constexpr void test_cmp_equal2() { - constexpr Tuple ttup; - constexpr Tuple utup; + constexpr Tuple ttup{}; + constexpr Tuple utup{}; assert(cuda::std::cmp_equal(T(0), U(0))); assert(cuda::std::cmp_equal(T(10), U(10))); assert(!cuda::std::cmp_equal(T(0), U(1))); @@ -127,6 +114,6 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_equal(0, 0)); test(); - static_assert(test()); + static_assert(test(), ""); return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp index 962794360d1..b6149999ced 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp @@ -22,28 +22,15 @@ template struct Tuple { - T min; - T max; - T mid; - __host__ __device__ constexpr Tuple() - { - min = cuda::std::numeric_limits::min(); - max = cuda::std::numeric_limits::max(); - if constexpr (cuda::std::is_signed_v) - { - mid = T(-1); - } - else - { - mid = max >> 1; - } - } + T min = cuda::std::numeric_limits::min(); + T max = cuda::std::numeric_limits::max(); + T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; }; template __host__ __device__ constexpr void test_cmp_greater1() { - constexpr Tuple tup; + constexpr Tuple tup{}; assert(!cuda::std::cmp_greater(T(0), T(1))); assert(!cuda::std::cmp_greater(T(1), T(2))); assert(!cuda::std::cmp_greater(tup.min, tup.max)); @@ -117,6 +104,6 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_greater(1, 0)); test(); - static_assert(test()); + static_assert(test(), ""); return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp index 8ca7f7cc60f..128627d59c7 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp @@ -22,28 +22,15 @@ template struct Tuple { - T min; - T max; - T mid; - __host__ __device__ constexpr Tuple() - { - min = cuda::std::numeric_limits::min(); - max = cuda::std::numeric_limits::max(); - if constexpr (cuda::std::is_signed_v) - { - mid = T(-1); - } - else - { - mid = max >> 1; - } - } + T min = cuda::std::numeric_limits::min(); + T max = cuda::std::numeric_limits::max(); + T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; }; template __host__ __device__ constexpr void test_cmp_greater_equal1() { - constexpr Tuple tup; + constexpr Tuple tup{}; assert(!cuda::std::cmp_greater_equal(T(0), T(1))); assert(!cuda::std::cmp_greater_equal(T(1), T(2))); assert(!cuda::std::cmp_greater_equal(tup.min, tup.max)); @@ -119,6 +106,6 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_greater_equal(1, 0)); test(); - static_assert(test()); + static_assert(test(), ""); return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp index 06231b303ec..49c67529f77 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp @@ -23,28 +23,15 @@ template struct Tuple { - T min; - T max; - T mid; - __host__ __device__ constexpr Tuple() - { - min = cuda::std::numeric_limits::min(); - max = cuda::std::numeric_limits::max(); - if constexpr (cuda::std::is_signed_v) - { - mid = T(-1); - } - else - { - mid = max >> 1; - } - } + T min = cuda::std::numeric_limits::min(); + T max = cuda::std::numeric_limits::max(); + T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; }; template __host__ __device__ constexpr void test_cmp_less1() { - constexpr Tuple tup; + constexpr Tuple tup{}; assert(cuda::std::cmp_less(T(0), T(1))); assert(cuda::std::cmp_less(T(1), T(2))); assert(cuda::std::cmp_less(tup.min, tup.max)); @@ -118,6 +105,6 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_less(0, 1)); test(); - static_assert(test()); + static_assert(test(), ""); return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp index e3c415782b9..bda495b4899 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp @@ -22,28 +22,15 @@ template struct Tuple { - T min; - T max; - T mid; - __host__ __device__ constexpr Tuple() - { - min = cuda::std::numeric_limits::min(); - max = cuda::std::numeric_limits::max(); - if constexpr (cuda::std::is_signed_v) - { - mid = T(-1); - } - else - { - mid = max >> 1; - } - } + T min = cuda::std::numeric_limits::min(); + T max = cuda::std::numeric_limits::max(); + T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; }; template __host__ __device__ constexpr void test_cmp_less_equal1() { - constexpr Tuple tup; + constexpr Tuple tup{}; assert(cuda::std::cmp_less_equal(T(0), T(0))); assert(cuda::std::cmp_less_equal(T(0), T(1))); assert(cuda::std::cmp_less_equal(tup.min, tup.max)); @@ -118,6 +105,6 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_less_equal(0, 1)); test(); - static_assert(test()); + static_assert(test(), ""); return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp index 80e41104fd7..c8dac65c989 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp @@ -23,28 +23,15 @@ template struct Tuple { - T min; - T max; - T mid; - __host__ __device__ constexpr Tuple() - { - min = cuda::std::numeric_limits::min(); - max = cuda::std::numeric_limits::max(); - if constexpr (cuda::std::is_signed_v) - { - mid = T(-1); - } - else - { - mid = max >> 1; - } - } + T min = cuda::std::numeric_limits::min(); + T max = cuda::std::numeric_limits::max(); + T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; }; template __host__ __device__ constexpr void test_cmp_not_equal1() { - constexpr Tuple tup; + constexpr Tuple tup{}; assert(!cuda::std::cmp_not_equal(T(0), T(0))); assert(!cuda::std::cmp_not_equal(T(10), T(10))); assert(!cuda::std::cmp_not_equal(tup.min, tup.min)); @@ -125,6 +112,6 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_not_equal(0, 0)); test(); - static_assert(test()); + static_assert(test(), ""); return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp index faf42968635..d67bf4f9666 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp @@ -24,28 +24,15 @@ template struct Tuple { - T min; - T max; - T mid; - __host__ __device__ constexpr Tuple() - { - min = cuda::std::numeric_limits::min(); - max = cuda::std::numeric_limits::max(); - if constexpr (cuda::std::is_signed_v) - { - mid = T(-1); - } - else - { - mid = max >> 1; - } - } + T min = cuda::std::numeric_limits::min(); + T max = cuda::std::numeric_limits::max(); + T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; }; template __host__ __device__ constexpr void test_in_range1() { - constexpr Tuple tup; + constexpr Tuple tup{}; assert(cuda::std::in_range(tup.min)); assert(cuda::std::in_range(tup.min + 1)); assert(cuda::std::in_range(tup.max)); @@ -57,8 +44,8 @@ __host__ __device__ constexpr void test_in_range1() __host__ __device__ constexpr void test_in_range() { - constexpr Tuple utup8; - constexpr Tuple stup8; + constexpr Tuple utup8{}; + constexpr Tuple stup8{}; assert(!cuda::std::in_range(utup8.max)); assert(cuda::std::in_range(utup8.max)); assert(!cuda::std::in_range(stup8.min)); @@ -100,6 +87,6 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::in_range(-1)); test(); - static_assert(test()); + static_assert(test(), ""); return 0; } From b2aacd82ae9e3aacd17fb50817d91a7177e5cbb1 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 16:48:50 +0100 Subject: [PATCH 11/29] Make tests work in C++14 --- .../intcmp.cmp_equal/cmp_equal.pass.cpp | 66 +++++++++---------- .../intcmp.cmp_greater/cmp_greater.pass.cpp | 66 +++++++++---------- .../cmp_greater_equal.pass.cpp | 66 +++++++++---------- .../intcmp.cmp_less/cmp_less.pass.cpp | 66 +++++++++---------- .../cmp_less_equal.pass.cpp | 66 +++++++++---------- .../cmp_not_equal.pass.cpp | 66 +++++++++---------- .../intcmp.in_range/in_range.pass.cpp | 37 ++++------- 7 files changed, 206 insertions(+), 227 deletions(-) diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp index 2142deccaf2..dd1ee4f1fc3 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp @@ -30,7 +30,7 @@ struct Tuple }; template -__host__ __device__ constexpr void test_cmp_equal1() +__host__ __device__ constexpr void test1() { constexpr Tuple tup{}; assert(cuda::std::cmp_equal(T(0), T(0))); @@ -55,7 +55,7 @@ __host__ __device__ constexpr void test_cmp_equal1() } template -__host__ __device__ constexpr void test_cmp_equal2() +__host__ __device__ constexpr void test2() { constexpr Tuple ttup{}; constexpr Tuple utup{}; @@ -69,44 +69,42 @@ __host__ __device__ constexpr void test_cmp_equal2() assert(!cuda::std::cmp_equal(utup.min, ttup.max)); } -template -__host__ __device__ constexpr void test1(const cuda::std::tuple&) +template +__host__ __device__ constexpr void test() { - (test_cmp_equal1(), ...); -} - -template -__host__ __device__ constexpr void test2_impl(const cuda::std::tuple&) -{ - (test_cmp_equal2(), ...); -} - -template -__host__ __device__ constexpr void test2(const cuda::std::tuple&, const UTuple& utuple) -{ - (test2_impl(utuple), ...); + test1(); +#ifndef TEST_HAS_NO_INT128_T + test2(); + test2(); +#endif // TEST_HAS_NO_INT128_T + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); } __host__ __device__ constexpr bool test() { - cuda::std::tuple< #ifndef TEST_HAS_NO_INT128_T - __int128_t, - __uint128_t, -#endif - unsigned long long, - long long, - unsigned long, - long, - unsigned int, - int, - unsigned short, - short, - unsigned char, - signed char> - types; - test1(types); - test2(types, types); + test<__int128_t>(); + test<__uint128_t>(); +#endif // TEST_HAS_NO_INT128_T + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); return true; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp index b6149999ced..1eccf50c1e7 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp @@ -28,7 +28,7 @@ struct Tuple }; template -__host__ __device__ constexpr void test_cmp_greater1() +__host__ __device__ constexpr void test1() { constexpr Tuple tup{}; assert(!cuda::std::cmp_greater(T(0), T(1))); @@ -53,50 +53,48 @@ __host__ __device__ constexpr void test_cmp_greater1() } template -__host__ __device__ constexpr void test_cmp_greater2() +__host__ __device__ constexpr void test2() { assert(!cuda::std::cmp_greater(T(0), U(1))); assert(cuda::std::cmp_greater(T(1), U(0))); } -template -__host__ __device__ constexpr void test1(const cuda::std::tuple&) +template +__host__ __device__ constexpr void test() { - (test_cmp_greater1(), ...); -} - -template -__host__ __device__ constexpr void test2_impl(const cuda::std::tuple&) -{ - (test_cmp_greater2(), ...); -} - -template -__host__ __device__ constexpr void test2(const cuda::std::tuple&, const UTuple& utuple) -{ - (test2_impl(utuple), ...); + test1(); +#ifndef TEST_HAS_NO_INT128_T + test2(); + test2(); +#endif // TEST_HAS_NO_INT128_T + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); } __host__ __device__ constexpr bool test() { - cuda::std::tuple< #ifndef TEST_HAS_NO_INT128_T - __int128_t, - __uint128_t, -#endif - unsigned long long, - long long, - unsigned long, - long, - unsigned int, - int, - unsigned short, - short, - unsigned char, - signed char> - types; - test1(types); - test2(types, types); + test<__int128_t>(); + test<__uint128_t>(); +#endif // TEST_HAS_NO_INT128_T + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); return true; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp index 128627d59c7..0bcb3451b16 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp @@ -28,7 +28,7 @@ struct Tuple }; template -__host__ __device__ constexpr void test_cmp_greater_equal1() +__host__ __device__ constexpr void test1() { constexpr Tuple tup{}; assert(!cuda::std::cmp_greater_equal(T(0), T(1))); @@ -53,7 +53,7 @@ __host__ __device__ constexpr void test_cmp_greater_equal1() } template -__host__ __device__ constexpr void test_cmp_greater_equal2() +__host__ __device__ constexpr void test2() { assert(!cuda::std::cmp_greater_equal(T(0), U(1))); assert(cuda::std::cmp_greater_equal(T(1), U(0))); @@ -61,44 +61,42 @@ __host__ __device__ constexpr void test_cmp_greater_equal2() assert(cuda::std::cmp_greater_equal(T(1), U(1))); } -template -__host__ __device__ constexpr void test1(const cuda::std::tuple&) +template +__host__ __device__ constexpr void test() { - (test_cmp_greater_equal1(), ...); -} - -template -__host__ __device__ constexpr void test2_impl(const cuda::std::tuple&) -{ - (test_cmp_greater_equal2(), ...); -} - -template -__host__ __device__ constexpr void test2(const cuda::std::tuple&, const UTuple& utuple) -{ - (test2_impl(utuple), ...); + test1(); +#ifndef TEST_HAS_NO_INT128_T + test2(); + test2(); +#endif // TEST_HAS_NO_INT128_T + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); } __host__ __device__ constexpr bool test() { - cuda::std::tuple< #ifndef TEST_HAS_NO_INT128_T - __int128_t, - __uint128_t, -#endif - unsigned long long, - long long, - unsigned long, - long, - unsigned int, - int, - unsigned short, - short, - unsigned char, - signed char> - types; - test1(types); - test2(types, types); + test<__int128_t>(); + test<__uint128_t>(); +#endif // TEST_HAS_NO_INT128_T + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); return true; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp index 49c67529f77..981af709bdf 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp @@ -29,7 +29,7 @@ struct Tuple }; template -__host__ __device__ constexpr void test_cmp_less1() +__host__ __device__ constexpr void test1() { constexpr Tuple tup{}; assert(cuda::std::cmp_less(T(0), T(1))); @@ -54,50 +54,48 @@ __host__ __device__ constexpr void test_cmp_less1() } template -__host__ __device__ constexpr void test_cmp_less2() +__host__ __device__ constexpr void test2() { assert(cuda::std::cmp_less(T(0), U(1))); assert(!cuda::std::cmp_less(T(1), U(0))); } -template -__host__ __device__ constexpr void test1(const cuda::std::tuple&) +template +__host__ __device__ constexpr void test() { - (test_cmp_less1(), ...); -} - -template -__host__ __device__ constexpr void test2_impl(const cuda::std::tuple&) -{ - (test_cmp_less2(), ...); -} - -template -__host__ __device__ constexpr void test2(const cuda::std::tuple&, const UTuple& utuple) -{ - (test2_impl(utuple), ...); + test1(); +#ifndef TEST_HAS_NO_INT128_T + test2(); + test2(); +#endif // TEST_HAS_NO_INT128_T + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); } __host__ __device__ constexpr bool test() { - cuda::std::tuple< #ifndef TEST_HAS_NO_INT128_T - __int128_t, - __uint128_t, -#endif - unsigned long long, - long long, - unsigned long, - long, - unsigned int, - int, - unsigned short, - short, - unsigned char, - signed char> - types; - test1(types); - test2(types, types); + test<__int128_t>(); + test<__uint128_t>(); +#endif // TEST_HAS_NO_INT128_T + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); return true; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp index bda495b4899..0f9574cddc7 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp @@ -28,7 +28,7 @@ struct Tuple }; template -__host__ __device__ constexpr void test_cmp_less_equal1() +__host__ __device__ constexpr void test1() { constexpr Tuple tup{}; assert(cuda::std::cmp_less_equal(T(0), T(0))); @@ -53,51 +53,49 @@ __host__ __device__ constexpr void test_cmp_less_equal1() } template -__host__ __device__ constexpr void test_cmp_less_equal2() +__host__ __device__ constexpr void test2() { assert(cuda::std::cmp_less_equal(T(0), U(1))); assert(cuda::std::cmp_less_equal(T(0), U(0))); assert(!cuda::std::cmp_less_equal(T(1), U(0))); } -template -__host__ __device__ constexpr void test1(const cuda::std::tuple&) +template +__host__ __device__ constexpr void test() { - (test_cmp_less_equal1(), ...); -} - -template -__host__ __device__ constexpr void test2_impl(const cuda::std::tuple&) -{ - (test_cmp_less_equal2(), ...); -} - -template -__host__ __device__ constexpr void test2(const cuda::std::tuple&, const UTuple& utuple) -{ - (test2_impl(utuple), ...); + test1(); +#ifndef TEST_HAS_NO_INT128_T + test2(); + test2(); +#endif // TEST_HAS_NO_INT128_T + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); } __host__ __device__ constexpr bool test() { - cuda::std::tuple< #ifndef TEST_HAS_NO_INT128_T - __int128_t, - __uint128_t, -#endif - unsigned long long, - long long, - unsigned long, - long, - unsigned int, - int, - unsigned short, - short, - unsigned char, - signed char> - types; - test1(types); - test2(types, types); + test<__int128_t>(); + test<__uint128_t>(); +#endif // TEST_HAS_NO_INT128_T + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); return true; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp index c8dac65c989..65d37e016f5 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp @@ -29,7 +29,7 @@ struct Tuple }; template -__host__ __device__ constexpr void test_cmp_not_equal1() +__host__ __device__ constexpr void test1() { constexpr Tuple tup{}; assert(!cuda::std::cmp_not_equal(T(0), T(0))); @@ -53,7 +53,7 @@ __host__ __device__ constexpr void test_cmp_not_equal1() } template -__host__ __device__ constexpr void test_cmp_not_equal2() +__host__ __device__ constexpr void test2() { constexpr Tuple ttup; constexpr Tuple utup; @@ -67,44 +67,42 @@ __host__ __device__ constexpr void test_cmp_not_equal2() assert(cuda::std::cmp_not_equal(utup.min, ttup.max)); } -template -__host__ __device__ constexpr void test1(const cuda::std::tuple&) +template +__host__ __device__ constexpr void test() { - (test_cmp_not_equal1(), ...); -} - -template -__host__ __device__ constexpr void test2_impl(const cuda::std::tuple&) -{ - (test_cmp_not_equal2(), ...); -} - -template -__host__ __device__ constexpr void test2(const cuda::std::tuple&, const UTuple& utuple) -{ - (test2_impl(utuple), ...); + test1(); +#ifndef TEST_HAS_NO_INT128_T + test2(); + test2(); +#endif // TEST_HAS_NO_INT128_T + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); + test2(); } __host__ __device__ constexpr bool test() { - cuda::std::tuple< #ifndef TEST_HAS_NO_INT128_T - __int128_t, - __uint128_t, -#endif - unsigned long long, - long long, - unsigned long, - long, - unsigned int, - int, - unsigned short, - short, - unsigned char, - signed char> - types; - test1(types); - test2(types, types); + test<__int128_t>(); + test<__uint128_t>(); +#endif // TEST_HAS_NO_INT128_T + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); + test(); return true; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp index d67bf4f9666..36f9f89ba6f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp @@ -54,32 +54,23 @@ __host__ __device__ constexpr void test_in_range() assert(!cuda::std::in_range(-1)); } -template -__host__ __device__ constexpr void test1(const cuda::std::tuple&) -{ - (test_in_range1(), ...); -} - __host__ __device__ constexpr bool test() { - cuda::std::tuple< -#ifndef TEST_HAS_NO_INT128_T - __int128_t, - __uint128_t, -#endif - unsigned long long, - long long, - unsigned long, - long, - unsigned int, - int, - unsigned short, - short, - unsigned char, - signed char> - types; - test1(types); test_in_range(); +#ifndef TEST_HAS_NO_INT128_T + test_in_range1<__int128_t>(); + test_in_range1<__uint128_t>(); +#endif // TEST_HAS_NO_INT128_T + test_in_range1(); + test_in_range1(); + test_in_range1(); + test_in_range1(); + test_in_range1(); + test_in_range1(); + test_in_range1(); + test_in_range1(); + test_in_range1(); + test_in_range1(); return true; } From d560a77d77424a099f0fb2d33f17a29484999bea Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 16:51:18 +0100 Subject: [PATCH 12/29] Try and inhibit warning --- libcudacxx/include/cuda/std/__utility/cmp.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 451faf56c39..331b1265ebe 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -50,6 +50,9 @@ _CCCL_DIAG_PUSH // C4389: 'equality-operator' : signed/unsigned mismatch _CCCL_DIAG_SUPPRESS_MSVC(4018 4127 4389) +// pointless comparison of unsigned integer with zero +_CCCL_NV_DIAG_SUPPRESS(186) + template using __is_same_as_any = __fold_or<_CCCL_TRAIT(is_same, _Tp, _Up)...>; @@ -144,6 +147,8 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept && _CUDA_VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min()); } +_CCCL_NV_DIAG_DEFAULT(186) + _CCCL_DIAG_POP #endif // _CCCL_STD_VER >= 2014 From 5e4be4a2525b29f95234fb05cdab80932d352445 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 16:13:28 +0100 Subject: [PATCH 13/29] Move implementation of `_LIBCUDACXX_TEMPLATE` to CCCL We have emulation for concepts in LIBCUDACXX that was guarded behind C++14 But there is nothing that requires C++14 for just the template headers and we want to use them universally throughout the codebase Consequently move them to CCCL proper and enable them unconditionally. To ensure that we do not add any hidden dependencies this also adds a barebones implementation of `enable_if_t` and a trailing `enable_if_t` --- .clang-format | 4 +- .../cuda/experimental/__algorithm/copy.cuh | 4 +- .../cuda/experimental/__algorithm/fill.cuh | 4 +- .../uninitialized_async_buffer.cuh | 13 +- .../__container/uninitialized_buffer.cuh | 13 +- .../__memory_resource/any_resource.cuh | 46 +-- .../device_memory_resource.cuh | 36 +- .../__memory_resource/shared_resource.cuh | 16 +- .../cuda/experimental/__stream/get_stream.cuh | 14 +- docs/repo.toml | 8 +- .../device_memory_resource.h | 28 +- .../cuda/__memory_resource/get_property.h | 10 +- .../managed_memory_resource.h | 16 +- .../pinned_memory_resource.h | 16 +- .../cuda/__memory_resource/resource_ref.h | 64 ++- libcudacxx/include/cuda/std/__cccl/dialect.h | 40 ++ .../cuda/std/__concepts/__concept_macros.h | 23 -- .../include/cuda/std/__concepts/swappable.h | 12 +- .../include/cuda/std/__expected/expected.h | 368 +++++++++--------- .../cuda/std/__expected/expected_base.h | 40 +- .../include/cuda/std/__expected/unexpected.h | 20 +- .../cuda/std/__functional/bind_front.h | 4 +- .../include/cuda/std/__functional/not_fn.h | 4 +- .../cuda/std/__functional/perfect_forward.h | 36 +- .../cuda/std/__functional/ranges_operations.h | 24 +- .../include/cuda/std/__iterator/advance.h | 12 +- .../include/cuda/std/__iterator/distance.h | 12 +- .../include/cuda/std/__iterator/iter_move.h | 12 +- .../include/cuda/std/__iterator/iter_swap.h | 12 +- .../cuda/std/__iterator/move_iterator.h | 50 +-- .../cuda/std/__iterator/move_sentinel.h | 8 +- libcudacxx/include/cuda/std/__iterator/next.h | 16 +- libcudacxx/include/cuda/std/__iterator/prev.h | 12 +- .../include/cuda/std/__iterator/projected.h | 4 +- .../cuda/std/__iterator/reverse_iterator.h | 4 +- .../std/__iterator/unreachable_sentinel.h | 16 +- .../cuda/std/__mdspan/default_accessor.h | 4 +- .../include/cuda/std/__mdspan/extents.h | 53 ++- .../include/cuda/std/__mdspan/layout_left.h | 22 +- .../include/cuda/std/__mdspan/layout_right.h | 22 +- .../include/cuda/std/__mdspan/layout_stride.h | 51 ++- libcudacxx/include/cuda/std/__mdspan/mdspan.h | 110 +++--- .../include/cuda/std/__mdspan/static_array.h | 4 +- .../include/cuda/std/__mdspan/submdspan.h | 13 +- libcudacxx/include/cuda/std/__ranges/access.h | 52 +-- libcudacxx/include/cuda/std/__ranges/data.h | 16 +- libcudacxx/include/cuda/std/__ranges/empty.h | 12 +- .../include/cuda/std/__ranges/enable_view.h | 4 +- libcudacxx/include/cuda/std/__ranges/rbegin.h | 24 +- libcudacxx/include/cuda/std/__ranges/rend.h | 24 +- libcudacxx/include/cuda/std/__ranges/size.h | 16 +- .../include/cuda/std/__ranges/subrange.h | 62 +-- .../include/cuda/std/__ranges/unwrap_end.h | 4 +- .../cuda/std/__ranges/view_interface.h | 57 ++- .../cuda/std/detail/libcxx/include/optional | 60 ++- .../cuda/std/detail/libcxx/include/span | 91 +++-- libcudacxx/include/cuda/std/inplace_vector | 175 ++++----- .../async_resource_ref/inheritance.pass.cpp | 9 +- .../async_resource_ref/properties.pass.cpp | 16 +- .../async_resource_ref/types.h | 8 +- .../resource_ref/inheritance.pass.cpp | 9 +- .../resource_ref/properties.pass.cpp | 16 +- .../cuda/memory_resource/resource_ref/types.h | 8 +- .../totally_ordered.pass.cpp | 4 +- .../convertible_to.pass.cpp | 12 +- .../concept.same/same_as.pass.cpp | 8 +- .../concept.swappable/swappable.pass.cpp | 12 +- .../swappable_with.compile.pass.cpp | 8 +- .../views/mdspan/foo_customizations.hpp | 17 +- .../ctor/ctor.convert.copy.pass.cpp | 8 +- .../ctor/ctor.convert.move.pass.cpp | 8 +- .../ctor/ctor.inplace_init_list.pass.cpp | 4 +- .../ctor/ctor.unexpect_init_list.pass.cpp | 4 +- .../ctor/ctor.convert.copy.pass.cpp | 4 +- .../ctor/ctor.convert.move.pass.cpp | 4 +- libcudacxx/test/support/test_iterators.h | 106 ++--- 76 files changed, 1071 insertions(+), 1091 deletions(-) diff --git a/.clang-format b/.clang-format index 342eb344057..d081c43b219 100644 --- a/.clang-format +++ b/.clang-format @@ -128,8 +128,8 @@ IndentWidth: 2 KeepEmptyLinesAtTheStartOfBlocks: false MaxEmptyLinesToKeep: 1 Macros: -- _LIBCUDACXX_TEMPLATE(...)=template<...> -- _LIBCUDACXX_REQUIRES(...)=requires (...) +- _CCCL_TEMPLATE(...)=template<...> +- _CCCL_REQUIRES(...)=requires (...) WhitespaceSensitiveMacros: - _CCCL_HAS_INCLUDE NamespaceIndentation: None diff --git a/cudax/include/cuda/experimental/__algorithm/copy.cuh b/cudax/include/cuda/experimental/__algorithm/copy.cuh index 9054bf0ea5e..caa2e55ccf4 100644 --- a/cudax/include/cuda/experimental/__algorithm/copy.cuh +++ b/cudax/include/cuda/experimental/__algorithm/copy.cuh @@ -63,8 +63,8 @@ void __copy_bytes_impl(stream_ref __stream, _CUDA_VSTD::span<_SrcTy> __src, _CUD //! @param __stream Stream that the copy should be inserted into //! @param __src Source to copy from //! @param __dst Destination to copy into -_LIBCUDACXX_TEMPLATE(typename _SrcTy, typename _DstTy) -_LIBCUDACXX_REQUIRES(__valid_copy_fill_argument<_SrcTy> _LIBCUDACXX_AND __valid_copy_fill_argument<_DstTy>) +_CCCL_TEMPLATE(typename _SrcTy, typename _DstTy) +_CCCL_REQUIRES(__valid_copy_fill_argument<_SrcTy> _CCCL_AND __valid_copy_fill_argument<_DstTy>) void copy_bytes(stream_ref __stream, _SrcTy&& __src, _DstTy&& __dst) { __copy_bytes_impl( diff --git a/cudax/include/cuda/experimental/__algorithm/fill.cuh b/cudax/include/cuda/experimental/__algorithm/fill.cuh index 4fef2777e87..5628c655013 100644 --- a/cudax/include/cuda/experimental/__algorithm/fill.cuh +++ b/cudax/include/cuda/experimental/__algorithm/fill.cuh @@ -49,8 +49,8 @@ void __fill_bytes_impl(stream_ref __stream, _CUDA_VSTD::span<_DstTy, _DstSize> _ //! @param __stream Stream that the copy should be inserted into //! @param __dst Destination memory to fill //! @param __value Value to fill into every byte in the destination -_LIBCUDACXX_TEMPLATE(typename _DstTy) -_LIBCUDACXX_REQUIRES(__valid_copy_fill_argument<_DstTy>) +_CCCL_TEMPLATE(typename _DstTy) +_CCCL_REQUIRES(__valid_copy_fill_argument<_DstTy>) void fill_bytes(stream_ref __stream, _DstTy&& __dst, uint8_t __value) { __fill_bytes_impl(__stream, diff --git a/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh b/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh index 5bad25bd46e..4bcd93d259f 100644 --- a/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh +++ b/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh @@ -117,7 +117,7 @@ private: template _CCCL_NODISCARD_FRIEND _CCCL_HIDE_FROM_ABI auto __cudax_launch_transform(::cuda::stream_ref, uninitialized_async_buffer& __self) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(_CUDA_VSTD::span<_Tp>)( + _CCCL_TRAILING_REQUIRES(_CUDA_VSTD::span<_Tp>)( _CUDA_VSTD::same_as<_Tp, _Tp2>&& _CUDA_VSTD::__is_included_in_v<_CUDA_VMR::device_accessible, _Properties...>) { // TODO add auto synchronization @@ -129,7 +129,7 @@ private: template _CCCL_NODISCARD_FRIEND _CCCL_HIDE_FROM_ABI auto __cudax_launch_transform(::cuda::stream_ref, const uninitialized_async_buffer& __self) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(_CUDA_VSTD::span)( + _CCCL_TRAILING_REQUIRES(_CUDA_VSTD::span)( _CUDA_VSTD::same_as<_Tp, _Tp2>&& _CUDA_VSTD::__is_included_in_v<_CUDA_VMR::device_accessible, _Properties...>) { // TODO add auto synchronization @@ -173,8 +173,8 @@ public: //! @brief Move-constructs a \c uninitialized_async_buffer from \p __other //! @param __other Another \c uninitialized_async_buffer with matching properties //! Takes ownership of the allocation in \p __other and resets it - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES(__properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES(__properties_match<_OtherProperties...>) _CCCL_HIDE_FROM_ABI uninitialized_async_buffer(uninitialized_async_buffer<_Tp, _OtherProperties...>&& __other) noexcept : __mr_(_CUDA_VSTD::move(__other.__mr_)) , __stream_(_CUDA_VSTD::exchange(__other.__stream_, {})) @@ -275,9 +275,8 @@ public: # ifndef DOXYGEN_SHOULD_SKIP_THIS // friend functions are currently broken //! @brief Forwards the passed properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - (!property_with_value<_Property>) _LIBCUDACXX_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) _CCCL_HIDE_FROM_ABI friend constexpr void get_property(const uninitialized_async_buffer&, _Property) noexcept {} # endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh b/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh index 0388074514e..d480ded4588 100644 --- a/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh +++ b/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh @@ -107,7 +107,7 @@ private: template _CCCL_NODISCARD_FRIEND _CCCL_HIDE_FROM_ABI auto __cudax_launch_transform(::cuda::stream_ref, uninitialized_buffer& __self) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(_CUDA_VSTD::span<_Tp>)( + _CCCL_TRAILING_REQUIRES(_CUDA_VSTD::span<_Tp>)( _CUDA_VSTD::same_as<_Tp, _Tp2>&& _CUDA_VSTD::__is_included_in_v<_CUDA_VMR::device_accessible, _Properties...>) { return {__self.__get_data(), __self.size()}; @@ -118,7 +118,7 @@ private: template _CCCL_NODISCARD_FRIEND _CCCL_HIDE_FROM_ABI auto __cudax_launch_transform(::cuda::stream_ref, const uninitialized_buffer& __self) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(_CUDA_VSTD::span)( + _CCCL_TRAILING_REQUIRES(_CUDA_VSTD::span)( _CUDA_VSTD::same_as<_Tp, _Tp2>&& _CUDA_VSTD::__is_included_in_v<_CUDA_VMR::device_accessible, _Properties...>) { return {__self.__get_data(), __self.size()}; @@ -158,8 +158,8 @@ public: //! @brief Move-constructs a \c uninitialized_buffer from another \c uninitialized_buffer with matching properties //! @param __other Another \c uninitialized_buffer //! Takes ownership of the allocation in \p __other and resets it - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES(__properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES(__properties_match<_OtherProperties...>) _CCCL_HIDE_FROM_ABI uninitialized_buffer(uninitialized_buffer<_Tp, _OtherProperties...>&& __other) noexcept : __mr_(_CUDA_VSTD::move(__other.__mr_)) , __count_(_CUDA_VSTD::exchange(__other.__count_, 0)) @@ -240,9 +240,8 @@ public: # ifndef DOXYGEN_SHOULD_SKIP_THIS // friend functions are currently broken //! @brief Forwards the passed Properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - (!property_with_value<_Property>) _LIBCUDACXX_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) _CCCL_HIDE_FROM_ABI friend constexpr void get_property(const uninitialized_buffer&, _Property) noexcept {} # endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh index 0c0578f68a7..cf3877b91f0 100644 --- a/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh @@ -101,8 +101,8 @@ public: //! @brief Constructs a \c basic_any_resource from a type that satisfies the \c resource or \c async_resource //! concept as well as all properties. //! @param __res The resource to be wrapped within the \c basic_any_resource. - _LIBCUDACXX_TEMPLATE(class _Resource, class __resource_t = _CUDA_VSTD::remove_cvref_t<_Resource>) - _LIBCUDACXX_REQUIRES((!__is_basic_any_resource<_Resource>) _LIBCUDACXX_AND __valid_resource<__resource_t>) + _CCCL_TEMPLATE(class _Resource, class __resource_t = _CUDA_VSTD::remove_cvref_t<_Resource>) + _CCCL_REQUIRES((!__is_basic_any_resource<_Resource>) _CCCL_AND __valid_resource<__resource_t>) basic_any_resource(_Resource&& __res) noexcept : _CUDA_VMR::_Resource_base<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning>( nullptr, &_CUDA_VMR::__alloc_vtable<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning, __resource_t>) @@ -123,9 +123,8 @@ public: //! concept, and it must provide all properties in \c _Properties... . //! @param __args The arguments used to construct the instance of \c _Resource to be wrapped within the //! \c basic_any_resource. - _LIBCUDACXX_TEMPLATE(class _Resource, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, _Resource, _Args...) - _LIBCUDACXX_AND __valid_resource<_Resource>) + _CCCL_TEMPLATE(class _Resource, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, _Resource, _Args...) _CCCL_AND __valid_resource<_Resource>) basic_any_resource(_CUDA_VSTD::in_place_type_t<_Resource>, _Args&&... __args) noexcept : _CUDA_VMR::_Resource_base<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning>( nullptr, &_CUDA_VMR::__alloc_vtable<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning, _Resource>) @@ -144,11 +143,11 @@ public: //! @brief Conversion from a \c basic_any_resource with the same set of properties but in a different order. //! This constructor also handles conversion from \c any_async_resource to \c any_resource //! @param __other The other \c basic_any_resource. - _LIBCUDACXX_TEMPLATE(_CUDA_VMR::_AllocType _OtherAllocType, class... _OtherProperties) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(_CUDA_VMR::_AllocType _OtherAllocType, class... _OtherProperties) + _CCCL_REQUIRES( (_CUDA_VSTD::_IsNotSame>::value) - _LIBCUDACXX_AND(_OtherAllocType == _Alloc_type || _OtherAllocType == _CUDA_VMR::_AllocType::_Async) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_AND(_OtherAllocType == _Alloc_type || _OtherAllocType == _CUDA_VMR::_AllocType::_Async) + _CCCL_AND __properties_match<_OtherProperties...>) basic_any_resource(basic_any_resource<_OtherAllocType, _OtherProperties...> __other) noexcept : _CUDA_VMR::_Resource_base<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning>( nullptr, _CUDA_VSTD::exchange(__other.__static_vtable, nullptr)) @@ -216,10 +215,9 @@ public: //! @brief Converts a \c basic_any_resource to a \c resource_ref with a potential subset of properties. //! @return The \c resource_ref to this resource. - _LIBCUDACXX_TEMPLATE(_CUDA_VMR::_AllocType _OtherAllocType, class... _OtherProperties) - _LIBCUDACXX_REQUIRES( - (_OtherAllocType == _CUDA_VMR::_AllocType::_Default || _OtherAllocType == _Alloc_type) _LIBCUDACXX_AND( - _CUDA_VSTD::__type_set_contains_v<_CUDA_VSTD::__make_type_set<_Properties...>, _OtherProperties...>)) + _CCCL_TEMPLATE(_CUDA_VMR::_AllocType _OtherAllocType, class... _OtherProperties) + _CCCL_REQUIRES((_OtherAllocType == _CUDA_VMR::_AllocType::_Default || _OtherAllocType == _Alloc_type) _CCCL_AND( + _CUDA_VSTD::__type_set_contains_v<_CUDA_VSTD::__make_type_set<_Properties...>, _OtherProperties...>)) operator _CUDA_VMR::basic_resource_ref<_OtherAllocType, _OtherProperties...>() noexcept { return _CUDA_VMR::_Resource_ref_helper::_Construct<_Alloc_type, _OtherProperties...>( @@ -239,9 +237,9 @@ public: //! @param __rhs The other \c basic_any_resource //! @return Checks whether both resources have the same equality function stored in their vtable and if so returns //! the result of that equality comparison. Otherwise returns false. - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) + _CCCL_AND __properties_match<_OtherProperties...>) _CCCL_NODISCARD bool operator==(const basic_any_resource<_Alloc_type, _OtherProperties...>& __rhs) const { return (this->__static_vtable->__equal_fn == __rhs.__static_vtable->__equal_fn) @@ -252,24 +250,22 @@ public: //! @param __rhs The other \c basic_any_resource //! @return Checks whether both resources have the same equality function stored in their vtable and if so returns //! the inverse result of that equality comparison. Otherwise returns true. - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) + _CCCL_AND __properties_match<_OtherProperties...>) _CCCL_NODISCARD bool operator!=(const basic_any_resource<_Alloc_type, _OtherProperties...>& __rhs) const { return !(*this == __rhs); } //! @brief Forwards the stateless properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - (!property_with_value<_Property>) _LIBCUDACXX_AND(_CUDA_VSTD::__is_included_in_v<_Property, _Properties...>)) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND(_CUDA_VSTD::__is_included_in_v<_Property, _Properties...>)) friend void get_property(const basic_any_resource&, _Property) noexcept {} //! @brief Forwards the stateful properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - property_with_value<_Property> _LIBCUDACXX_AND(_CUDA_VSTD::__is_included_in_v<_Property, _Properties...>)) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES(property_with_value<_Property> _CCCL_AND(_CUDA_VSTD::__is_included_in_v<_Property, _Properties...>)) _CCCL_NODISCARD_FRIEND __property_value_t<_Property> get_property(const basic_any_resource& __res, _Property) noexcept { _CUDA_VMR::_Property_vtable<_Property> const& __prop = __res; diff --git a/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh index 4869bc31672..46c8c44528e 100644 --- a/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh @@ -315,8 +315,8 @@ public: //! @param __rhs The resource to compare to. //! @returns If the underlying types are equality comparable, returns the result of equality comparison of both //! resources. Otherwise, returns false. - _LIBCUDACXX_TEMPLATE(class _Resource) - _LIBCUDACXX_REQUIRES((_CUDA_VMR::__different_resource) ) + _CCCL_TEMPLATE(class _Resource) + _CCCL_REQUIRES((_CUDA_VMR::__different_resource) ) _CCCL_NODISCARD bool operator==(_Resource const& __rhs) const noexcept { if constexpr (has_property<_Resource, _CUDA_VMR::device_accessible>) @@ -332,8 +332,8 @@ public: # else // ^^^ C++20 ^^^ / vvv C++17 template _CCCL_NODISCARD_FRIEND auto operator==(device_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& - has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& + has_property<_Resource, _CUDA_VMR::device_accessible>) { return _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast(__lhs)} == _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast<_Resource&>(__rhs)}; @@ -341,16 +341,16 @@ public: template _CCCL_NODISCARD_FRIEND auto operator==(device_memory_resource const&, _Resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource - && !has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource + && !has_property<_Resource, _CUDA_VMR::device_accessible>) { return false; } template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const& __rhs, device_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& - has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& + has_property<_Resource, _CUDA_VMR::device_accessible>) { return _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast(__lhs)} == _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast<_Resource&>(__rhs)}; @@ -358,16 +358,16 @@ public: template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const&, device_memory_resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource - && !has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource + && !has_property<_Resource, _CUDA_VMR::device_accessible>) { return false; } template _CCCL_NODISCARD_FRIEND auto operator!=(device_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& - has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& + has_property<_Resource, _CUDA_VMR::device_accessible>) { return _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast(__lhs)} != _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast<_Resource&>(__rhs)}; @@ -375,16 +375,16 @@ public: template _CCCL_NODISCARD_FRIEND auto operator!=(device_memory_resource const&, _Resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource - && !has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource + && !has_property<_Resource, _CUDA_VMR::device_accessible>) { return true; } template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const& __rhs, device_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& - has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& + has_property<_Resource, _CUDA_VMR::device_accessible>) { return _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast(__lhs)} != _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast<_Resource&>(__rhs)}; @@ -392,8 +392,8 @@ public: template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const&, device_memory_resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource - && !has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource + && !has_property<_Resource, _CUDA_VMR::device_accessible>) { return true; } diff --git a/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh index bdd774f2169..e2cd76940db 100644 --- a/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh @@ -172,8 +172,8 @@ struct shared_resource //! @return Pointer to the newly allocated memory. //! @note The caller is responsible for ensuring that the memory is not accessed until the //! operation has completed. - _LIBCUDACXX_TEMPLATE(class _ThisResource = _Resource) - _LIBCUDACXX_REQUIRES(_CUDA_VMR::async_resource<_ThisResource>) + _CCCL_TEMPLATE(class _ThisResource = _Resource) + _CCCL_REQUIRES(_CUDA_VMR::async_resource<_ThisResource>) _CCCL_NODISCARD void* async_allocate(size_t __bytes, size_t __alignment, ::cuda::stream_ref __stream) { return this->__control_block->__resource.async_allocate(__bytes, __alignment, __stream); @@ -188,8 +188,8 @@ struct shared_resource //! \p __ptr. //! @note The caller is responsible for ensuring that the memory is not accessed after the //! operation has completed. - _LIBCUDACXX_TEMPLATE(class _ThisResource = _Resource) - _LIBCUDACXX_REQUIRES(_CUDA_VMR::async_resource<_ThisResource>) + _CCCL_TEMPLATE(class _ThisResource = _Resource) + _CCCL_REQUIRES(_CUDA_VMR::async_resource<_ThisResource>) void async_deallocate(void* __ptr, size_t __bytes, size_t __alignment, ::cuda::stream_ref __stream) { this->__control_block->__resource.async_deallocate(__ptr, __bytes, __alignment, __stream); @@ -224,13 +224,13 @@ struct shared_resource } //! @brief Forwards the stateless properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES((!property_with_value<_Property>) _LIBCUDACXX_AND(has_property<_Resource, _Property>)) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND(has_property<_Resource, _Property>)) friend void get_property(const shared_resource&, _Property) noexcept {} //! @brief Forwards the stateful properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES(property_with_value<_Property> _LIBCUDACXX_AND(has_property<_Resource, _Property>)) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES(property_with_value<_Property> _CCCL_AND(has_property<_Resource, _Property>)) _CCCL_NODISCARD_FRIEND __property_value_t<_Property> get_property(const shared_resource& __self, _Property) noexcept { return get_property(__self.__control_block->__resource, _Property{}); diff --git a/cudax/include/cuda/experimental/__stream/get_stream.cuh b/cudax/include/cuda/experimental/__stream/get_stream.cuh index 0f2848b12fa..87d8158be3e 100644 --- a/cudax/include/cuda/experimental/__stream/get_stream.cuh +++ b/cudax/include/cuda/experimental/__stream/get_stream.cuh @@ -49,25 +49,25 @@ _LIBCUDACXX_CONCEPT __has_member_get_stream = _LIBCUDACXX_FRAGMENT(__has_member_ //! @brief `get_stream` is a customization point object that queries a type `T` for an associated stream struct get_stream_t { - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__convertible_to_stream_ref<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__convertible_to_stream_ref<_Tp>) _CCCL_NODISCARD _CCCL_HIDE_FROM_ABI constexpr ::cuda::stream_ref operator()(const _Tp& __t) const noexcept(noexcept(static_cast<::cuda::stream_ref>(__t))) { return static_cast<::cuda::stream_ref>(__t); } // namespace __get_stream - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__has_member_get_stream<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__has_member_get_stream<_Tp>) _CCCL_NODISCARD _CCCL_HIDE_FROM_ABI constexpr ::cuda::stream_ref operator()(const _Tp& __t) const noexcept(noexcept(__t.get_stream())) { return __t.get_stream(); } - _LIBCUDACXX_TEMPLATE( - class _Env, class _Ret = decltype(_CUDA_VSTD::declval().query(_CUDA_VSTD::declval()))) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Ret, ::cuda::stream_ref)) + _CCCL_TEMPLATE(class _Env, + class _Ret = decltype(_CUDA_VSTD::declval().query(_CUDA_VSTD::declval()))) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Ret, ::cuda::stream_ref)) _CCCL_NODISCARD _CCCL_HIDE_FROM_ABI constexpr ::cuda::stream_ref operator()(const _Env& __env) const noexcept { static_assert(noexcept(__env.query(*this)), ""); diff --git a/docs/repo.toml b/docs/repo.toml index ed00fa8c4f2..d9302440ec4 100644 --- a/docs/repo.toml +++ b/docs/repo.toml @@ -435,12 +435,12 @@ doxygen_predefined = [ "_CUDAX_TRIVIAL_HOST_API", "_CUDAX_TRIVIAL_DEVICE_API", "_CUDAX_PUBLIC_API", - "_LIBCUDACXX_AND=&&", + "_CCCL_AND=&&", "_LIBCUDACXX_EAT_REST(x)=", "_LIBCUDACXX_GLOBAL_CONSTANT=inline", - "_LIBCUDACXX_REQUIRES(x)= ::cuda::std::enable_if_t = 0>", - "_LIBCUDACXX_TEMPLATE(x)=template x _LIBCUDACXX_EAT_REST", + "_CCCL_REQUIRES(x)= ::cuda::std::enable_if_t = 0>", + "_CCCL_TEMPLATE(x)=template x _LIBCUDACXX_EAT_REST", "LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE=", ] diff --git a/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h index 5910e272041..9061adfc3d1 100644 --- a/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h @@ -112,8 +112,8 @@ class device_memory_resource //! @param __rhs The resource to compare to //! @return If the underlying types are equality comparable, returns the result of equality comparison of both //! resources. Otherwise, returns false. - _LIBCUDACXX_TEMPLATE(class _Resource) - _LIBCUDACXX_REQUIRES((__different_resource) ) + _CCCL_TEMPLATE(class _Resource) + _CCCL_REQUIRES((__different_resource) ) _CCCL_NODISCARD bool operator==(_Resource const& __rhs) const noexcept { if constexpr (has_property<_Resource, device_accessible>) @@ -129,7 +129,7 @@ class device_memory_resource # else // ^^^ C++20 ^^^ / vvv C++17 template _CCCL_NODISCARD_FRIEND auto operator==(device_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, device_accessible>) { return resource_ref{const_cast(__lhs)} @@ -138,15 +138,15 @@ class device_memory_resource template _CCCL_NODISCARD_FRIEND auto operator==(device_memory_resource const&, _Resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource - && !has_property<_Resource, device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource + && !has_property<_Resource, device_accessible>) { return false; } template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const& __rhs, device_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, device_accessible>) { return resource_ref{const_cast(__lhs)} @@ -155,15 +155,15 @@ class device_memory_resource template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const&, device_memory_resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource - && !has_property<_Resource, device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource + && !has_property<_Resource, device_accessible>) { return false; } template _CCCL_NODISCARD_FRIEND auto operator!=(device_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, device_accessible>) { return resource_ref{const_cast(__lhs)} @@ -172,15 +172,15 @@ class device_memory_resource template _CCCL_NODISCARD_FRIEND auto operator!=(device_memory_resource const&, _Resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource - && !has_property<_Resource, device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource + && !has_property<_Resource, device_accessible>) { return true; } template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const& __rhs, device_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, device_accessible>) { return resource_ref{const_cast(__lhs)} @@ -189,8 +189,8 @@ class device_memory_resource template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const&, device_memory_resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource - && !has_property<_Resource, device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource + && !has_property<_Resource, device_accessible>) { return true; } diff --git a/libcudacxx/include/cuda/__memory_resource/get_property.h b/libcudacxx/include/cuda/__memory_resource/get_property.h index 3fea72da9da..12be348a01d 100644 --- a/libcudacxx/include/cuda/__memory_resource/get_property.h +++ b/libcudacxx/include/cuda/__memory_resource/get_property.h @@ -139,15 +139,15 @@ template struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES((!property_with_value<_Property>) _LIBCUDACXX_AND has_property<_Upstream, _Property>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND has_property<_Upstream, _Property>) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr void get_property(const _Derived&, _Property) noexcept {} // The indirection is needed, otherwise the compiler might believe that _Derived is an incomplete type _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Property, class _Derived2 = _Derived) - _LIBCUDACXX_REQUIRES(property_with_value<_Property> _LIBCUDACXX_AND has_property<_Upstream, _Property> _LIBCUDACXX_AND - __has_upstream_resource<_Derived2, _Upstream>) + _CCCL_TEMPLATE(class _Property, class _Derived2 = _Derived) + _CCCL_REQUIRES(property_with_value<_Property> _CCCL_AND has_property<_Upstream, _Property> _CCCL_AND + __has_upstream_resource<_Derived2, _Upstream>) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr __property_value_t<_Property> get_property(const _Derived& __res, _Property __prop) { diff --git a/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h index 0ceb686c170..24132149e08 100644 --- a/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h @@ -107,8 +107,8 @@ class managed_memory_resource //! @param __rhs The resource to compare to //! @return If the underlying types are equality comparable, returns the result of equality comparison of both //! resources. Otherwise, returns false. - _LIBCUDACXX_TEMPLATE(class _Resource) - _LIBCUDACXX_REQUIRES(__different_resource) + _CCCL_TEMPLATE(class _Resource) + _CCCL_REQUIRES(__different_resource) _CCCL_NODISCARD bool operator==(_Resource const& __rhs) const noexcept { if constexpr (has_property<_Resource, host_accessible>) @@ -129,7 +129,7 @@ class managed_memory_resource # else // ^^^ C++20 ^^^ / vvv C++17 template _CCCL_NODISCARD_FRIEND auto operator==(managed_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, host_accessible>) { return resource_ref{const_cast(__lhs)} @@ -137,7 +137,7 @@ class managed_memory_resource } template _CCCL_NODISCARD_FRIEND auto operator==(managed_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource && !has_property<_Resource, host_accessible> && has_property<_Resource, device_accessible>) { @@ -146,7 +146,7 @@ class managed_memory_resource } template _CCCL_NODISCARD_FRIEND auto operator==(managed_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource && !has_property<_Resource, host_accessible> && !has_property<_Resource, device_accessible>) { @@ -155,21 +155,21 @@ class managed_memory_resource template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const& __lhs, managed_memory_resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return __rhs == __lhs; } template _CCCL_NODISCARD_FRIEND auto operator!=(managed_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return !(__lhs == __rhs); } template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const& __rhs, managed_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return !(__rhs == __lhs); } diff --git a/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h index c0c0aa101bf..c2ad95bc7cc 100644 --- a/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h @@ -110,8 +110,8 @@ class pinned_memory_resource //! @param __rhs The resource to compare to //! @return If the underlying types are equality comparable, returns the result of equality comparison of both //! resources. Otherwise, returns false. - _LIBCUDACXX_TEMPLATE(class _Resource) - _LIBCUDACXX_REQUIRES(__different_resource) + _CCCL_TEMPLATE(class _Resource) + _CCCL_REQUIRES(__different_resource) _CCCL_NODISCARD bool operator==(_Resource const& __rhs) const noexcept { if constexpr (has_property<_Resource, host_accessible>) @@ -132,7 +132,7 @@ class pinned_memory_resource # else // ^^^ C++20 ^^^ / vvv C++17 template _CCCL_NODISCARD_FRIEND auto operator==(pinned_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, host_accessible>) { return resource_ref{const_cast(__lhs)} @@ -140,7 +140,7 @@ class pinned_memory_resource } template _CCCL_NODISCARD_FRIEND auto operator==(pinned_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource && !has_property<_Resource, host_accessible> && has_property<_Resource, device_accessible>) { @@ -149,7 +149,7 @@ class pinned_memory_resource } template _CCCL_NODISCARD_FRIEND auto operator==(pinned_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource && !has_property<_Resource, host_accessible> && !has_property<_Resource, device_accessible>) { @@ -158,21 +158,21 @@ class pinned_memory_resource template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const& __lhs, pinned_memory_resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return __rhs == __lhs; } template _CCCL_NODISCARD_FRIEND auto operator!=(pinned_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return !(__lhs == __rhs); } template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const& __rhs, pinned_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return !(__rhs == __lhs); } diff --git a/libcudacxx/include/cuda/__memory_resource/resource_ref.h b/libcudacxx/include/cuda/__memory_resource/resource_ref.h index c6187b80ddc..560f58fa0f3 100644 --- a/libcudacxx/include/cuda/__memory_resource/resource_ref.h +++ b/libcudacxx/include/cuda/__memory_resource/resource_ref.h @@ -262,8 +262,8 @@ struct _Resource_vtable_builder _Copy_impl<_Resource>(__object, __other, __wrapper_type<_Wrapper_type>{}); } - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type, _WrapperType _Wrapper_type) - _LIBCUDACXX_REQUIRES((_Alloc_type == _AllocType::_Default)) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type, _WrapperType _Wrapper_type) + _CCCL_REQUIRES((_Alloc_type == _AllocType::_Default)) static constexpr _Alloc_vtable _Create() noexcept { return {_IsSmall<_Resource>(), @@ -275,8 +275,8 @@ struct _Resource_vtable_builder &_Resource_vtable_builder::_Copy<_Resource, _Wrapper_type>}; } - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type, _WrapperType _Wrapper_type) - _LIBCUDACXX_REQUIRES((_Alloc_type == _AllocType::_Async)) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type, _WrapperType _Wrapper_type) + _CCCL_REQUIRES((_Alloc_type == _AllocType::_Async)) static constexpr _Async_alloc_vtable _Create() noexcept { return {_IsSmall<_Resource>(), @@ -521,9 +521,9 @@ class basic_resource_ref //! @brief Constructs a \c basic_resource_ref from a type that satisfies the \c resource or \c async_resource concept //! as well as all properties //! @param __res The resource to be wrapped within the \c basic_resource_ref - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) - _LIBCUDACXX_REQUIRES((!_Is_resource_base<_Resource>) _LIBCUDACXX_AND(_Alloc_type2 == _AllocType::_Default) - _LIBCUDACXX_AND resource_with<_Resource, _Properties...>) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) + _CCCL_REQUIRES((!_Is_resource_base<_Resource>) _CCCL_AND(_Alloc_type2 == _AllocType::_Default) + _CCCL_AND resource_with<_Resource, _Properties...>) basic_resource_ref(_Resource& __res) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>( _CUDA_VSTD::addressof(__res), &__alloc_vtable<_Alloc_type, _WrapperType::_Reference, _Resource>) @@ -533,9 +533,9 @@ class basic_resource_ref //! @brief Constructs a \c resource_ref from a type that satisfies the \c async_resource concept as well as all //! properties. This ignores the async interface of the passed in resource //! @param __res The resource to be wrapped within the \c resource_ref - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) - _LIBCUDACXX_REQUIRES((!_Is_resource_base<_Resource>) _LIBCUDACXX_AND(_Alloc_type2 == _AllocType::_Async) - _LIBCUDACXX_AND async_resource_with<_Resource, _Properties...>) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) + _CCCL_REQUIRES((!_Is_resource_base<_Resource>) _CCCL_AND(_Alloc_type2 == _AllocType::_Async) + _CCCL_AND async_resource_with<_Resource, _Properties...>) basic_resource_ref(_Resource& __res) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>( _CUDA_VSTD::addressof(__res), &__alloc_vtable<_Alloc_type, _WrapperType::_Reference, _Resource>) @@ -545,9 +545,9 @@ class basic_resource_ref //! @brief Constructs a \c basic_resource_ref from a type that satisfies the \c resource or \c async_resource concept //! as well as all properties //! @param __res Pointer to a resource to be wrapped within the \c basic_resource_ref - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) - _LIBCUDACXX_REQUIRES((!_Is_resource_base<_Resource>) _LIBCUDACXX_AND(_Alloc_type2 == _AllocType::_Default) - _LIBCUDACXX_AND resource_with<_Resource, _Properties...>) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) + _CCCL_REQUIRES((!_Is_resource_base<_Resource>) _CCCL_AND(_Alloc_type2 == _AllocType::_Default) + _CCCL_AND resource_with<_Resource, _Properties...>) basic_resource_ref(_Resource* __res) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>( __res, &__alloc_vtable<_Alloc_type, _WrapperType::_Reference, _Resource>) @@ -557,9 +557,9 @@ class basic_resource_ref //! @brief Constructs a \c resource_ref from a type that satisfies the \c async_resource concept as well as all //! properties. This ignores the async interface of the passed in resource //! @param __res Pointer to a resource to be wrapped within the \c resource_ref - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) - _LIBCUDACXX_REQUIRES((!_Is_resource_base<_Resource>) _LIBCUDACXX_AND(_Alloc_type2 == _AllocType::_Async) - _LIBCUDACXX_AND async_resource_with<_Resource, _Properties...>) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) + _CCCL_REQUIRES((!_Is_resource_base<_Resource>) _CCCL_AND(_Alloc_type2 == _AllocType::_Async) + _CCCL_AND async_resource_with<_Resource, _Properties...>) basic_resource_ref(_Resource* __res) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>( __res, &__alloc_vtable<_Alloc_type, _WrapperType::_Reference, _Resource>) @@ -568,8 +568,8 @@ class basic_resource_ref //! @brief Conversion from a \c basic_resource_ref with the same set of properties but in a different order //! @param __ref The other \c basic_resource_ref - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES(__properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES(__properties_match<_OtherProperties...>) basic_resource_ref(basic_resource_ref<_Alloc_type, _OtherProperties...> __ref) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>(__ref.__object, __ref.__static_vtable) , __vtable(static_cast&>(__ref)) @@ -578,9 +578,9 @@ class basic_resource_ref //! @brief Conversion from a \c async_resource_ref with the same set of properties but in a different order to a //! \c resource_ref //! @param __ref The other \c async_resource_ref - _LIBCUDACXX_TEMPLATE(_AllocType _OtherAllocType, class... _OtherProperties) - _LIBCUDACXX_REQUIRES((_OtherAllocType == _AllocType::_Async) _LIBCUDACXX_AND(_OtherAllocType != _Alloc_type) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(_AllocType _OtherAllocType, class... _OtherProperties) + _CCCL_REQUIRES((_OtherAllocType == _AllocType::_Async) _CCCL_AND(_OtherAllocType != _Alloc_type) + _CCCL_AND __properties_match<_OtherProperties...>) basic_resource_ref(basic_resource_ref<_OtherAllocType, _OtherProperties...> __ref) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>(__ref.__object, __ref.__static_vtable) , __vtable(static_cast&>(__ref)) @@ -590,9 +590,9 @@ class basic_resource_ref //! @param __rhs The other \c basic_resource_ref //! @return Checks whether both resources have the same equality function stored in their vtable and if so returns //! the result of that equality comparison. Otherwise returns false. - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) + _CCCL_AND __properties_match<_OtherProperties...>) _CCCL_NODISCARD bool operator==(const basic_resource_ref<_Alloc_type, _OtherProperties...>& __rhs) const { // BUGBUG: comparing function pointers like this can lead to false negatives: @@ -604,24 +604,22 @@ class basic_resource_ref //! @param __rhs The other \c basic_resource_ref //! @return Checks whether both resources have the same equality function stored in their vtable and if so returns //! the inverse result of that equality comparison. Otherwise returns true. - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) + _CCCL_AND __properties_match<_OtherProperties...>) _CCCL_NODISCARD bool operator!=(const basic_resource_ref<_Alloc_type, _OtherProperties...>& __rhs) const { return !(*this == __rhs); } //! @brief Forwards the stateless properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - (!property_with_value<_Property>) _LIBCUDACXX_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) friend void get_property(const basic_resource_ref&, _Property) noexcept {} //! @brief Forwards the stateful properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - property_with_value<_Property> _LIBCUDACXX_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES(property_with_value<_Property> _CCCL_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) _CCCL_NODISCARD_FRIEND __property_value_t<_Property> get_property(const basic_resource_ref& __res, _Property) noexcept { return __res._Property_vtable<_Property>::__property_fn(__res.__object); diff --git a/libcudacxx/include/cuda/std/__cccl/dialect.h b/libcudacxx/include/cuda/std/__cccl/dialect.h index 4b96695de73..80a0612c82a 100644 --- a/libcudacxx/include/cuda/std/__cccl/dialect.h +++ b/libcudacxx/include/cuda/std/__cccl/dialect.h @@ -126,4 +126,44 @@ # define _CCCL_GLOBAL_CONSTANT _CCCL_INLINE_VAR constexpr #endif // __CUDA_ARCH__ +//////////////////////////////////////////////////////////////////////////////// +// _CCCL_TEMPLATE +// Usage: +// _CCCL_TEMPLATE(typename A, typename _Bp) +// _CCCL_REQUIRES( Concept1 _CCCL_AND Concept2<_Bp>) +// void foo(A a, _Bp b) +// {} + +// Barebones enable if implementation to use outside of cuda::std +template +struct __cccl_select +{}; + +template <> +struct __cccl_select +{ + template + using type = _Tp; +}; + +template +using __cccl_enable_if_t = typename __cccl_select<_Bp>::template type<_Tp>; + +template +using __cccl_requires_t = typename __cccl_select<_Bp>::template type<_Tp>; + +#if (defined(__cpp_concepts) && _CCCL_STD_VER >= 2020) +# define _CCCL_TEMPLATE(...) template <__VA_ARGS__> +# define _CCCL_REQUIRES(...) requires __VA_ARGS__ +# define _CCCL_AND && +# define _CCCL_TRAILING_REQUIRES_AUX_(...) requires __VA_ARGS__ +# define _CCCL_TRAILING_REQUIRES(...) ->__VA_ARGS__ _CCCL_TRAILING_REQUIRES_AUX_ +#else // ^^^ __cpp_concepts ^^^ / vvv !__cpp_concepts vvv +# define _CCCL_TEMPLATE(...) template <__VA_ARGS__ +# define _CCCL_REQUIRES(...) , bool _CCCL_true_ = true, __cccl_enable_if_t < __VA_ARGS__ && _CCCL_true_, int > = 0 > +# define _CCCL_AND &&_CCCL_true_, int > = 0, __cccl_enable_if_t < +# define _CCCL_TRAILING_REQUIRES_AUX_(...) , __VA_ARGS__ > +# define _CCCL_TRAILING_REQUIRES(...) ->__cccl_requires_t < __VA_ARGS__ _CCCL_TRAILING_REQUIRES_AUX_ +#endif // !__cpp_concepts + #endif // __CCCL_DIALECT_H diff --git a/libcudacxx/include/cuda/std/__concepts/__concept_macros.h b/libcudacxx/include/cuda/std/__concepts/__concept_macros.h index 6c845260ed3..5472bcc8bba 100644 --- a/libcudacxx/include/cuda/std/__concepts/__concept_macros.h +++ b/libcudacxx/include/cuda/std/__concepts/__concept_macros.h @@ -316,29 +316,6 @@ # endif -//////////////////////////////////////////////////////////////////////////////// -// _LIBCUDACXX_TEMPLATE -// Usage: -// _LIBCUDACXX_TEMPLATE(typename A, typename _Bp) -// _LIBCUDACXX_REQUIRES( Concept1 _LIBCUDACXX_AND Concept2<_Bp>) -// void foo(A a, _Bp b) -// {} -# if (defined(__cpp_concepts) && _CCCL_STD_VER >= 2020) -# define _LIBCUDACXX_TEMPLATE(...) template <__VA_ARGS__> -# define _LIBCUDACXX_REQUIRES(...) requires __VA_ARGS__ -# define _LIBCUDACXX_AND && -# define _LIBCUDACXX_TRAILING_REQUIRES(...) \ - ->__VA_ARGS__ \ - requires _LIBCUDACXX_PP_EXPAND -# else -# define _LIBCUDACXX_TEMPLATE(...) template <__VA_ARGS__ -# define _LIBCUDACXX_REQUIRES(...) \ - , bool _LIBCUDACXX_true_ = true, _Concept::_Enable_if_t < __VA_ARGS__ && _LIBCUDACXX_true_, int > = 0 > /**/ -# define _LIBCUDACXX_AND &&_LIBCUDACXX_true_, int > = 0, _Concept::_Enable_if_t < -# define _LIBCUDACXX_TRAILING_REQUIRES_AUX_(...) , __VA_ARGS__ > -# define _LIBCUDACXX_TRAILING_REQUIRES(...) ->_Concept::_Requires_t < __VA_ARGS__ _LIBCUDACXX_TRAILING_REQUIRES_AUX_ -# endif - //////////////////////////////////////////////////////////////////////////////// // _LIBCUDACXX_REQUIRES_EXPR // Usage: diff --git a/libcudacxx/include/cuda/std/__concepts/swappable.h b/libcudacxx/include/cuda/std/__concepts/swappable.h index 4d41338c428..aaddf1a9ee3 100644 --- a/libcudacxx/include/cuda/std/__concepts/swappable.h +++ b/libcudacxx/include/cuda/std/__concepts/swappable.h @@ -105,8 +105,8 @@ struct __fn { // 2.1 `S` is `(void)swap(E1, E2)`* if `E1` or `E2` has class or enumeration type and... // *The name `swap` is used here unqualified. - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(__unqualified_swappable_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(__unqualified_swappable_with<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(swap(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))) { @@ -114,8 +114,8 @@ struct __fn } // 2.2 Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and... - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up, size_t _Size) - _LIBCUDACXX_REQUIRES(__swappable_arrays<_Tp, _Up, _Size>) + _CCCL_TEMPLATE(class _Tp, class _Up, size_t _Size) + _CCCL_REQUIRES(__swappable_arrays<_Tp, _Up, _Size>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Tp (&__t)[_Size], _Up (&__u)[_Size]) const noexcept(__noexcept_swappable_arrays<_Tp, _Up>) { @@ -127,8 +127,8 @@ struct __fn } // 2.3 Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models... - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__exchangeable<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__exchangeable<_Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Tp& __x, _Tp& __y) const noexcept(_CCCL_TRAIT(is_nothrow_move_constructible, _Tp) && _CCCL_TRAIT(is_nothrow_move_assignable, _Tp)) { diff --git a/libcudacxx/include/cuda/std/__expected/expected.h b/libcudacxx/include/cuda/std/__expected/expected.h index 523d9c73eda..cc5ddfc03f0 100644 --- a/libcudacxx/include/cuda/std/__expected/expected.h +++ b/libcudacxx/include/cuda/std/__expected/expected.h @@ -124,8 +124,8 @@ class expected : private __expected_move_assign<_Tp, _Err> using rebind = expected<_Up, error_type>; // [expected.object.ctor], constructors - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected() noexcept(_CCCL_TRAIT(is_nothrow_default_constructible, _Tp2)) : __base(true) {} @@ -154,9 +154,9 @@ class expected : private __expected_move_assign<_Tp, _Err> _Not, const expected<_Up, _OtherErr>>>>; public: - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, const _Up&, const _OtherErr&>::value _LIBCUDACXX_AND _CCCL_TRAIT( - is_convertible, const _Up&, _Tp) _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, const _Up&, const _OtherErr&>::value _CCCL_AND _CCCL_TRAIT( + is_convertible, const _Up&, _Tp) _CCCL_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected(const expected<_Up, _OtherErr>& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, const _Up&) && _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened @@ -172,8 +172,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, const _Up&, const _OtherErr&>::value _LIBCUDACXX_AND( + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, const _Up&, const _OtherErr&>::value _CCCL_AND( !_CCCL_TRAIT(is_convertible, const _Up&, _Tp) || !_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 explicit expected(const expected<_Up, _OtherErr>& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, const _Up&) @@ -190,9 +190,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, _Up, _OtherErr>::value _LIBCUDACXX_AND _CCCL_TRAIT( - is_convertible, _Up, _Tp) _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, _Up, _OtherErr>::value _CCCL_AND _CCCL_TRAIT(is_convertible, _Up, _Tp) + _CCCL_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected(expected<_Up, _OtherErr>&& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up) && _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened @@ -208,8 +208,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, _Up, _OtherErr>::value _LIBCUDACXX_AND( + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, _Up, _OtherErr>::value _CCCL_AND( !_CCCL_TRAIT(is_convertible, _Up, _Tp) || !_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 explicit expected(expected<_Up, _OtherErr>&& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up) @@ -226,67 +226,64 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Up = _Tp) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Up>, in_place_t)) _LIBCUDACXX_AND(!_CCCL_TRAIT( - is_same, expected, remove_cvref_t<_Up>)) _LIBCUDACXX_AND(!__unexpected::__is_unexpected>) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _Up, _Tp)) + _CCCL_TEMPLATE(class _Up = _Tp) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Up>, in_place_t)) _CCCL_AND( + !_CCCL_TRAIT(is_same, expected, remove_cvref_t<_Up>)) _CCCL_AND(!__unexpected::__is_unexpected>) + _CCCL_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) _CCCL_AND _CCCL_TRAIT(is_convertible, _Up, _Tp)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(_Up&& __u) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up)) // strengthened : __base(in_place, _CUDA_VSTD::forward<_Up>(__u)) {} - _LIBCUDACXX_TEMPLATE(class _Up = _Tp) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Up>, in_place_t)) _LIBCUDACXX_AND(!_CCCL_TRAIT( - is_same, expected, remove_cvref_t<_Up>)) _LIBCUDACXX_AND(!__unexpected::__is_unexpected>) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, _Up, _Tp))) + _CCCL_TEMPLATE(class _Up = _Tp) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Up>, in_place_t)) _CCCL_AND( + !_CCCL_TRAIT(is_same, expected, remove_cvref_t<_Up>)) _CCCL_AND(!__unexpected::__is_unexpected>) + _CCCL_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) _CCCL_AND(!_CCCL_TRAIT(is_convertible, _Up, _Tp))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(_Up&& __u) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up)) // strengthened : __base(in_place, _CUDA_VSTD::forward<_Up>(__u)) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(const unexpected<_OtherErr>& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened : __base(unexpect, __unex.error()) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND(!_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(const unexpected<_OtherErr>& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened : __base(unexpect, __unex.error()) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) _CCCL_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(unexpected<_OtherErr>&& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(unexpect, _CUDA_VSTD::move(__unex.error())) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) + _CCCL_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(unexpected<_OtherErr>&& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(unexpect, _CUDA_VSTD::move(__unex.error())) {} - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(in_place_t, _Args&&... __args) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Args...)) // strengthened : __base(in_place, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected( in_place_t, initializer_list<_Up> __il, @@ -297,15 +294,15 @@ class expected : private __expected_move_assign<_Tp, _Err> : __base(in_place, __il, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(unexpect_t, _Args&&... __args) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _Args...)) // strengthened : __base(unexpect, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected( unexpect_t, initializer_list<_Up> __il, @@ -343,14 +340,12 @@ class expected : private __expected_move_assign<_Tp, _Err> public: // [expected.object.assign], assignment - _LIBCUDACXX_TEMPLATE(class _Up = _Tp) - _LIBCUDACXX_REQUIRES( - (!_CCCL_TRAIT(is_same, expected, remove_cvref_t<_Up>)) - _LIBCUDACXX_AND(!__unexpected::__is_unexpected>) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) _LIBCUDACXX_AND _CCCL_TRAIT(is_assignable, _Tp&, _Up) - _LIBCUDACXX_AND(_CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up) - || _CCCL_TRAIT(is_nothrow_move_constructible, _Tp) - || _CCCL_TRAIT(is_nothrow_move_constructible, _Err))) + _CCCL_TEMPLATE(class _Up = _Tp) + _CCCL_REQUIRES( + (!_CCCL_TRAIT(is_same, expected, remove_cvref_t<_Up>)) _CCCL_AND(!__unexpected::__is_unexpected>) + _CCCL_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) _CCCL_AND _CCCL_TRAIT(is_assignable, _Tp&, _Up) + _CCCL_AND(_CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up) || _CCCL_TRAIT(is_nothrow_move_constructible, _Tp) + || _CCCL_TRAIT(is_nothrow_move_constructible, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(_Up&& __v) { if (this->__has_val_) @@ -376,8 +371,8 @@ class expected : private __expected_move_assign<_Tp, _Err> is_nothrow_move_constructible<_Err>>>::value; public: - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_assign_from_unexpected) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(__can_assign_from_unexpected) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(const unexpected<_OtherErr>& __un) { if (this->__has_val_) @@ -392,8 +387,8 @@ class expected : private __expected_move_assign<_Tp, _Err> return *this; } - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_assign_from_unexpected<_OtherErr>) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(__can_assign_from_unexpected<_OtherErr>) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(unexpected<_OtherErr>&& __un) { if (this->__has_val_) @@ -408,8 +403,8 @@ class expected : private __expected_move_assign<_Tp, _Err> return *this; } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _Tp, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _Tp, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 _Tp& emplace(_Args&&... __args) noexcept { if (this->__has_val_) @@ -424,8 +419,8 @@ class expected : private __expected_move_assign<_Tp, _Err> return *_LIBCUDACXX_CONSTRUCT_AT(this->__union_.__val_, _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _Tp, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _Tp, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) noexcept { if (this->__has_val_) @@ -442,8 +437,8 @@ class expected : private __expected_move_assign<_Tp, _Err> public: // [expected.object.swap], swap - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(__expected::__can_swap<_Tp2, _Err2>) + _CCCL_TEMPLATE(class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(__expected::__can_swap<_Tp2, _Err2>) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void swap(expected<_Tp2, _Err>& __rhs) noexcept( _CCCL_TRAIT(is_nothrow_move_constructible, _Tp2) && _CCCL_TRAIT(is_nothrow_swappable, _Tp2) && _CCCL_TRAIT(is_nothrow_move_constructible, _Err) && _CCCL_TRAIT(is_nothrow_swappable, _Err)) @@ -478,7 +473,7 @@ class expected : private __expected_move_assign<_Tp, _Err> friend _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 auto swap(expected& __x, expected& __y) noexcept( _CCCL_TRAIT(is_nothrow_move_constructible, _Tp2) && _CCCL_TRAIT(is_nothrow_swappable, _Tp2) && _CCCL_TRAIT(is_nothrow_move_constructible, _Err2) && _CCCL_TRAIT(is_nothrow_swappable, _Err2)) - _LIBCUDACXX_TRAILING_REQUIRES(void)(__expected::__can_swap<_Tp2, _Err2>) + _CCCL_TRAILING_REQUIRES(void)(__expected::__can_swap<_Tp2, _Err2>) { return __x.swap(__y); // some compiler warn about non void function without return } @@ -617,8 +612,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } // [expected.object.monadic] - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) & { using _Res = remove_cvref_t>; @@ -637,8 +632,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) const& { using _Res = remove_cvref_t>; @@ -657,8 +652,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) && { using _Res = remove_cvref_t>; @@ -677,8 +672,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) const&& { using _Res = remove_cvref_t>; @@ -697,8 +692,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, _Tp2&)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, _Tp2&)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto or_else(_Fun&& __fun) & { using _Res = remove_cvref_t>; @@ -718,8 +713,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto or_else(_Fun&& __fun) const& { using _Res = remove_cvref_t>; @@ -739,8 +734,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto or_else(_Fun&& __fun) && { using _Res = remove_cvref_t>; @@ -760,8 +755,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, const _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, const _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto or_else(_Fun&& __fun) const&& { using _Res = remove_cvref_t>; @@ -781,9 +776,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) & { static_assert(invocable<_Fun, _Tp&>, "std::expected::transform requires that F must be invocable with T."); @@ -800,9 +795,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) & { static_assert(invocable<_Fun, _Tp&>, "std::expected::transform requires that F must be invocable with T."); @@ -826,9 +821,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const& { static_assert(invocable<_Fun, const _Tp&>, "std::expected::transform requires that F must be invocable with T."); @@ -845,9 +840,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const& { static_assert(invocable<_Fun, const _Tp&>, "std::expected::transform requires that F must be invocable with T"); @@ -871,9 +866,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) && { static_assert(invocable<_Fun, _Tp>, "std::expected::transform requires that F must be invocable with T."); @@ -889,9 +884,9 @@ class expected : private __expected_move_assign<_Tp, _Err> return expected<_Res, _Err>{unexpect, _CUDA_VSTD::move(this->__union_.__unex_)}; } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) && { static_assert(invocable<_Fun, _Tp>, "std::expected::transform requires that F must be invocable with T"); @@ -918,9 +913,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const&& { static_assert(invocable<_Fun, const _Tp>, "std::expected::transform requires that F must be invocable with T."); @@ -937,9 +932,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const&& { static_assert(invocable<_Fun, const _Tp>, "std::expected::transform requires that F must be invocable with T"); @@ -966,8 +961,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, _Tp2&)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, _Tp2&)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform_error(_Fun&& __fun) & { static_assert(invocable<_Fun, _Err&>, "std::expected::transform_error requires that F must be invocable with E"); @@ -991,8 +986,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform_error(_Fun&& __fun) const& { static_assert(invocable<_Fun, const _Err&>, @@ -1017,8 +1012,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform_error(_Fun&& __fun) && { static_assert(invocable<_Fun, _Err>, "std::expected::transform_error requires that F must be invocable with E"); @@ -1045,8 +1040,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, const _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, const _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform_error(_Fun&& __fun) const&& { static_assert(invocable<_Fun, const _Err>, @@ -1101,8 +1096,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } # endif // _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _T2, class _E2) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_void, _T2))) + _CCCL_TEMPLATE(class _T2, class _E2) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_void, _T2))) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const expected& __x, const expected<_T2, _E2>& __y) { if (__x.__has_val_ != __y.has_value()) @@ -1123,35 +1118,35 @@ class expected : private __expected_move_assign<_Tp, _Err> } # if _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _T2, class _E2) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_void, _T2))) + _CCCL_TEMPLATE(class _T2, class _E2) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_void, _T2))) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const expected& __x, const expected<_T2, _E2>& __y) { return !(__x == __y); } # endif // _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _T2) - _LIBCUDACXX_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) + _CCCL_TEMPLATE(class _T2) + _CCCL_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const expected& __x, const _T2& __v) { return __x.__has_val_ && static_cast(__x.__union_.__val_ == __v); } # if _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _T2) - _LIBCUDACXX_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) + _CCCL_TEMPLATE(class _T2) + _CCCL_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const _T2& __v, const expected& __x) { return __x.__has_val_ && static_cast(__x.__union_.__val_ == __v); } - _LIBCUDACXX_TEMPLATE(class _T2) - _LIBCUDACXX_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) + _CCCL_TEMPLATE(class _T2) + _CCCL_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const expected& __x, const _T2& __v) { return !__x.__has_val_ || static_cast(__x.__union_.__val_ != __v); } - _LIBCUDACXX_TEMPLATE(class _T2) - _LIBCUDACXX_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) + _CCCL_TEMPLATE(class _T2) + _CCCL_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const _T2& __v, const expected& __x) { return !__x.__has_val_ || static_cast(__x.__union_.__val_ != __v); @@ -1217,8 +1212,8 @@ class expected : private __expected_move_assign _CCCL_HIDE_FROM_ABI constexpr expected& operator=(const expected&) = default; _CCCL_HIDE_FROM_ABI constexpr expected& operator=(expected&&) = default; - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, const _OtherErr&>::value _LIBCUDACXX_AND _CCCL_TRAIT( + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, const _OtherErr&>::value _CCCL_AND _CCCL_TRAIT( is_convertible, const _OtherErr&, _Err)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected(const expected<_Up, _OtherErr>& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened @@ -1230,8 +1225,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, const _OtherErr&>::value _LIBCUDACXX_AND( + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, const _OtherErr&>::value _CCCL_AND( !_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 explicit expected(const expected<_Up, _OtherErr>& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened @@ -1243,9 +1238,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES( - __can_convert<_Up, _OtherErr, _OtherErr>::value _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, _OtherErr>::value _CCCL_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected(expected<_Up, _OtherErr>&& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(__other.__has_val_) @@ -1256,9 +1250,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES( - __can_convert<_Up, _OtherErr, _OtherErr>::value _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES( + __can_convert<_Up, _OtherErr, _OtherErr>::value _CCCL_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 explicit expected(expected<_Up, _OtherErr>&& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(__other.__has_val_) @@ -1269,33 +1263,32 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(const unexpected<_OtherErr>& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened : __base(unexpect, __unex.error()) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND(!_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(const unexpected<_OtherErr>& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened : __base(unexpect, __unex.error()) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) _CCCL_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(unexpected<_OtherErr>&& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(unexpect, _CUDA_VSTD::move(__unex.error())) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) + _CCCL_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(unexpected<_OtherErr>&& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(unexpect, _CUDA_VSTD::move(__unex.error())) @@ -1305,15 +1298,15 @@ class expected : private __expected_move_assign : __base(true) {} - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(unexpect_t, _Args&&... __args) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _Args...)) // strengthened : __base(unexpect, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected( unexpect_t, initializer_list<_Up> __il, @@ -1340,9 +1333,9 @@ class expected : private __expected_move_assign public: // [expected.void.dtor], destructor // [expected.void.assign], assignment - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_assignable, _Err&, const _OtherErr&)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND _CCCL_TRAIT(is_assignable, _Err&, const _OtherErr&)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(const unexpected<_OtherErr>& __un) noexcept( _CCCL_TRAIT(is_nothrow_assignable, _Err&, const _OtherErr&) && _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened @@ -1359,9 +1352,8 @@ class expected : private __expected_move_assign return *this; } - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND _CCCL_TRAIT(is_assignable, _Err&, _OtherErr)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) _CCCL_AND _CCCL_TRAIT(is_assignable, _Err&, _OtherErr)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(unexpected<_OtherErr>&& __un) noexcept( _CCCL_TRAIT(is_nothrow_assignable, _Err&, _OtherErr) && _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) { @@ -1387,8 +1379,8 @@ class expected : private __expected_move_assign } // [expected.void.swap], swap - _LIBCUDACXX_TEMPLATE(class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(__expected::__can_swap) + _CCCL_TEMPLATE(class _Err2 = _Err) + _CCCL_REQUIRES(__expected::__can_swap) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void swap(expected& __rhs) noexcept( _CCCL_TRAIT(is_nothrow_move_constructible, _Err2) && _CCCL_TRAIT(is_nothrow_swappable, _Err2)) { @@ -1416,7 +1408,7 @@ class expected : private __expected_move_assign template friend _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 auto swap(expected& __x, expected& __y) noexcept( _CCCL_TRAIT(is_nothrow_move_constructible, _Err2) && _CCCL_TRAIT(is_nothrow_swappable, _Err2)) - _LIBCUDACXX_TRAILING_REQUIRES(void)(__expected::__can_swap) + _CCCL_TRAILING_REQUIRES(void)(__expected::__can_swap) { return __x.swap(__y); // some compiler warn about non void function without return } @@ -1482,8 +1474,8 @@ class expected : private __expected_move_assign } // [expected.void.monadic] - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) & { using _Res = remove_cvref_t>; @@ -1502,8 +1494,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) const& { using _Res = remove_cvref_t>; @@ -1522,8 +1514,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) && { using _Res = remove_cvref_t>; @@ -1542,8 +1534,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) const&& { using _Res = remove_cvref_t>; @@ -1642,9 +1634,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) & { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1659,9 +1651,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) & { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1684,9 +1676,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const& { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1701,9 +1693,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const& { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T"); @@ -1726,9 +1718,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) && { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1742,9 +1734,9 @@ class expected : private __expected_move_assign return expected{unexpect, _CUDA_VSTD::move(this->__union_.__unex_)}; } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) && { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T"); @@ -1767,9 +1759,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const&& { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1784,9 +1776,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const&& { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T"); diff --git a/libcudacxx/include/cuda/std/__expected/expected_base.h b/libcudacxx/include/cuda/std/__expected/expected_base.h index 9c675a90456..f2eaa804196 100644 --- a/libcudacxx/include/cuda/std/__expected/expected_base.h +++ b/libcudacxx/include/cuda/std/__expected/expected_base.h @@ -71,14 +71,14 @@ union __expected_union_t struct __empty_t {}; - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr __expected_union_t() noexcept(_CCCL_TRAIT(is_nothrow_default_constructible, _Tp2)) : __val_() {} - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_default_constructible, _Tp2))) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_default_constructible, _Tp2))) _LIBCUDACXX_HIDE_FROM_ABI constexpr __expected_union_t() noexcept : __empty_() {} @@ -128,14 +128,14 @@ union __expected_union_t<_Tp, _Err, true> struct __empty_t {}; - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr __expected_union_t() noexcept(_CCCL_TRAIT(is_nothrow_default_constructible, _Tp2)) : __val_() {} - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_default_constructible, _Tp2))) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_default_constructible, _Tp2))) _LIBCUDACXX_HIDE_FROM_ABI constexpr __expected_union_t() noexcept : __empty_() {} @@ -436,8 +436,8 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> { _LIBCUDACXX_DELEGATE_CONSTRUCTORS(__expected_storage, __expected_destruct, _Tp, _Err); - _LIBCUDACXX_TEMPLATE(class _T1, class _T2, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) + _CCCL_TEMPLATE(class _T1, class _T2, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __reinit_expected(_T1& __newval, _T2& __oldval, _Args&&... __args) noexcept { @@ -445,9 +445,9 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> _LIBCUDACXX_CONSTRUCT_AT(__newval, _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class _T1, class _T2, class... _Args) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) _LIBCUDACXX_AND _CCCL_TRAIT( - is_nothrow_move_constructible, _T1)) + _CCCL_TEMPLATE(class _T1, class _T2, class... _Args) + _CCCL_REQUIRES( + (!_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) _CCCL_AND _CCCL_TRAIT(is_nothrow_move_constructible, _T1)) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __reinit_expected(_T1& __newval, _T2& __oldval, _Args&&... __args) { @@ -456,9 +456,9 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> _LIBCUDACXX_CONSTRUCT_AT(__newval, _CUDA_VSTD::move(__tmp)); } - _LIBCUDACXX_TEMPLATE(class _T1, class _T2, class... _Args) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) _LIBCUDACXX_AND( - !_CCCL_TRAIT(is_nothrow_move_constructible, _T1))) + _CCCL_TEMPLATE(class _T1, class _T2, class... _Args) + _CCCL_REQUIRES( + (!_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) _CCCL_AND(!_CCCL_TRAIT(is_nothrow_move_constructible, _T1))) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __reinit_expected(_T1& __newval, _T2& __oldval, _Args&&... __args) { @@ -475,8 +475,8 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> __trans.__complete(); } - _LIBCUDACXX_TEMPLATE(class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_nothrow_move_constructible, _Err2)) + _CCCL_TEMPLATE(class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_nothrow_move_constructible, _Err2)) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __swap_val_unex_impl(__expected_storage<_Tp, _Err2>& __with_val, __expected_storage& __with_err) { @@ -493,8 +493,8 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> __with_err.__has_val_ = true; } - _LIBCUDACXX_TEMPLATE(class _Err2 = _Err) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_nothrow_move_constructible, _Err2))) + _CCCL_TEMPLATE(class _Err2 = _Err) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_nothrow_move_constructible, _Err2))) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __swap_val_unex_impl(__expected_storage<_Tp, _Err2>& __with_val, __expected_storage& __with_err) { diff --git a/libcudacxx/include/cuda/std/__expected/unexpected.h b/libcudacxx/include/cuda/std/__expected/unexpected.h index 2bcf32cfa87..215a38d346c 100644 --- a/libcudacxx/include/cuda/std/__expected/unexpected.h +++ b/libcudacxx/include/cuda/std/__expected/unexpected.h @@ -73,24 +73,24 @@ class unexpected _CCCL_HIDE_FROM_ABI unexpected(const unexpected&) = default; _CCCL_HIDE_FROM_ABI unexpected(unexpected&&) = default; - _LIBCUDACXX_TEMPLATE(class _Error = _Err) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Error>, unexpected) - && !_CCCL_TRAIT(is_same, remove_cvref_t<_Error>, in_place_t) - && _CCCL_TRAIT(is_constructible, _Err, _Error))) + _CCCL_TEMPLATE(class _Error = _Err) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Error>, unexpected) + && !_CCCL_TRAIT(is_same, remove_cvref_t<_Error>, in_place_t) + && _CCCL_TRAIT(is_constructible, _Err, _Error))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit unexpected(_Error&& __error) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _Error)) : __unex_(_CUDA_VSTD::forward<_Error>(__error)) {} - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit unexpected(in_place_t, _Args&&... __args) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _Args...)) : __unex_(_CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit unexpected( in_place_t, initializer_list<_Up> __il, @@ -130,8 +130,8 @@ class unexpected swap(__unex_, __other.__unex_); } - _LIBCUDACXX_TEMPLATE(class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_swappable, _Err2)) + _CCCL_TEMPLATE(class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_swappable, _Err2)) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr void swap(unexpected& __lhs, unexpected& __rhs) noexcept(_CCCL_TRAIT(is_nothrow_swappable, _Err2)) { diff --git a/libcudacxx/include/cuda/std/__functional/bind_front.h b/libcudacxx/include/cuda/std/__functional/bind_front.h index 5ddbff62d33..68423e73772 100644 --- a/libcudacxx/include/cuda/std/__functional/bind_front.h +++ b/libcudacxx/include/cuda/std/__functional/bind_front.h @@ -68,8 +68,8 @@ _LIBCUDACXX_CONCEPT __can_bind_front = is_constructible_v, _Fn> && is_move_constructible_v> && (is_constructible_v, _Args> && ...) && (is_move_constructible_v> && ...); -_LIBCUDACXX_TEMPLATE(class _Fn, class... _Args) -_LIBCUDACXX_REQUIRES(__can_bind_front<_Fn, _Args...>) +_CCCL_TEMPLATE(class _Fn, class... _Args) +_CCCL_REQUIRES(__can_bind_front<_Fn, _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto bind_front(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_constructible_v...>, _Args&&...>) { diff --git a/libcudacxx/include/cuda/std/__functional/not_fn.h b/libcudacxx/include/cuda/std/__functional/not_fn.h index b2ee6abc17e..b146b13416f 100644 --- a/libcudacxx/include/cuda/std/__functional/not_fn.h +++ b/libcudacxx/include/cuda/std/__functional/not_fn.h @@ -51,8 +51,8 @@ struct __not_fn_t : __perfect_forward<__not_fn_op, _Fn> # if defined(_CCCL_COMPILER_NVRTC) // nvbug 3961621 _CCCL_HIDE_FROM_ABI constexpr __not_fn_t() noexcept = default; - _LIBCUDACXX_TEMPLATE(class _OrigFn) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_same, _Fn, decay_t<_OrigFn>)) + _CCCL_TEMPLATE(class _OrigFn) + _CCCL_REQUIRES(_CCCL_TRAIT(is_same, _Fn, decay_t<_OrigFn>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr __not_fn_t(_OrigFn&& __fn) noexcept( noexcept(__base(_CUDA_VSTD::declval<_OrigFn>()))) : __base(_CUDA_VSTD::forward<_OrigFn>(__fn)) diff --git a/libcudacxx/include/cuda/std/__functional/perfect_forward.h b/libcudacxx/include/cuda/std/__functional/perfect_forward.h index dc281d78e3a..4f7630ae7b6 100644 --- a/libcudacxx/include/cuda/std/__functional/perfect_forward.h +++ b/libcudacxx/include/cuda/std/__functional/perfect_forward.h @@ -46,8 +46,8 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> tuple<_BoundArgs...> __bound_args_; public: - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_constructible_v, _Args&&...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_constructible_v, _Args&&...>) _LIBCUDACXX_HIDE_FROM_ABI explicit constexpr __perfect_forward_impl(_Args&&... __bound_args) noexcept( is_nothrow_constructible_v, _Args&&...>) : __bound_args_(_CUDA_VSTD::forward<_Args>(__bound_args)...) @@ -59,8 +59,8 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> _CCCL_HIDE_FROM_ABI __perfect_forward_impl& operator=(__perfect_forward_impl const&) = default; _CCCL_HIDE_FROM_ABI __perfect_forward_impl& operator=(__perfect_forward_impl&&) = default; - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_invocable_v<_Op, _BoundArgs&..., _Args...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_invocable_v<_Op, _BoundArgs&..., _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) & noexcept( noexcept(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...))) -> decltype(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...)) @@ -68,12 +68,12 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> return _Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES((!is_invocable_v<_Op, _BoundArgs&..., _Args...>) ) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES((!is_invocable_v<_Op, _BoundArgs&..., _Args...>) ) _LIBCUDACXX_HIDE_FROM_ABI auto operator()(_Args&&...) & = delete; - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_invocable_v<_Op, _BoundArgs const&..., _Args...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_invocable_v<_Op, _BoundArgs const&..., _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const& noexcept( noexcept(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...))) -> decltype(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...)) @@ -81,12 +81,12 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> return _Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES((!is_invocable_v<_Op, _BoundArgs const&..., _Args...>) ) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES((!is_invocable_v<_Op, _BoundArgs const&..., _Args...>) ) _LIBCUDACXX_HIDE_FROM_ABI auto operator()(_Args&&...) const& = delete; - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_invocable_v<_Op, _BoundArgs..., _Args...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_invocable_v<_Op, _BoundArgs..., _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) && noexcept( noexcept(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...))) -> decltype(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...)) @@ -94,12 +94,12 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> return _Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES((!is_invocable_v<_Op, _BoundArgs..., _Args...>) ) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES((!is_invocable_v<_Op, _BoundArgs..., _Args...>) ) _LIBCUDACXX_HIDE_FROM_ABI auto operator()(_Args&&...) && = delete; - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_invocable_v<_Op, _BoundArgs const..., _Args...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_invocable_v<_Op, _BoundArgs const..., _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const&& noexcept( noexcept(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...))) -> decltype(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...)) @@ -107,8 +107,8 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> return _Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES((!is_invocable_v<_Op, _BoundArgs const..., _Args...>) ) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES((!is_invocable_v<_Op, _BoundArgs const..., _Args...>) ) _LIBCUDACXX_HIDE_FROM_ABI auto operator()(_Args&&...) const&& = delete; }; diff --git a/libcudacxx/include/cuda/std/__functional/ranges_operations.h b/libcudacxx/include/cuda/std/__functional/ranges_operations.h index 6db42a3eee7..059eda975f4 100644 --- a/libcudacxx/include/cuda/std/__functional/ranges_operations.h +++ b/libcudacxx/include/cuda/std/__functional/ranges_operations.h @@ -31,8 +31,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES_ABI struct equal_to { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(equality_comparable_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(equality_comparable_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u)))) { @@ -44,8 +44,8 @@ struct equal_to struct not_equal_to { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(equality_comparable_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(equality_comparable_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u))))) { @@ -57,8 +57,8 @@ struct not_equal_to struct less { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(totally_ordered_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(totally_ordered_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(_CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u)))) { @@ -70,8 +70,8 @@ struct less struct less_equal { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(totally_ordered_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(totally_ordered_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t))))) { @@ -83,8 +83,8 @@ struct less_equal struct greater { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(totally_ordered_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(totally_ordered_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(_CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t)))) { @@ -96,8 +96,8 @@ struct greater struct greater_equal { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(totally_ordered_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(totally_ordered_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u))))) { diff --git a/libcudacxx/include/cuda/std/__iterator/advance.h b/libcudacxx/include/cuda/std/__iterator/advance.h index aeb3c6993c1..17ba093634a 100644 --- a/libcudacxx/include/cuda/std/__iterator/advance.h +++ b/libcudacxx/include/cuda/std/__iterator/advance.h @@ -123,8 +123,8 @@ struct __fn public: // Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative. - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, iter_difference_t<_Ip> __n) const { _CCCL_ASSERT(__n >= 0 || bidirectional_iterator<_Ip>, "If `n < 0`, then `bidirectional_iterator` must be true."); @@ -151,8 +151,8 @@ struct __fn } } - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip> _LIBCUDACXX_AND sentinel_for<_Sp, _Ip>) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES(input_or_output_iterator<_Ip> _CCCL_AND sentinel_for<_Sp, _Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, _Sp __bound_sentinel) const { // If `I` and `S` model `assignable_from`, equivalent to `i = std::move(bound_sentinel)`. @@ -182,8 +182,8 @@ struct __fn // * If `n < 0`, [bound_sentinel, i) denotes a range, `I` models `bidirectional_iterator`, // and `I` and `S` model `same_as`. // Returns: `n - M`, where `M` is the difference between the ending and starting position. - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip> _LIBCUDACXX_AND sentinel_for<_Sp, _Ip>) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES(input_or_output_iterator<_Ip> _CCCL_AND sentinel_for<_Sp, _Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip& __i, iter_difference_t<_Ip> __n, _Sp __bound_sentinel) const { diff --git a/libcudacxx/include/cuda/std/__iterator/distance.h b/libcudacxx/include/cuda/std/__iterator/distance.h index 3623a6dcf0d..1e6fae1c988 100644 --- a/libcudacxx/include/cuda/std/__iterator/distance.h +++ b/libcudacxx/include/cuda/std/__iterator/distance.h @@ -67,8 +67,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__distance) struct __fn { - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES((sentinel_for<_Sp, _Ip> && !sized_sentinel_for<_Sp, _Ip>) ) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES((sentinel_for<_Sp, _Ip> && !sized_sentinel_for<_Sp, _Ip>) ) _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip __first, _Sp __last) const { iter_difference_t<_Ip> __n = 0; @@ -80,8 +80,8 @@ struct __fn return __n; } - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES((sized_sentinel_for<_Sp, decay_t<_Ip>>) ) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES((sized_sentinel_for<_Sp, decay_t<_Ip>>) ) _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip&& __first, _Sp __last) const { if constexpr (sized_sentinel_for<_Sp, remove_cvref_t<_Ip>>) @@ -95,8 +95,8 @@ struct __fn _CCCL_UNREACHABLE(); } - _LIBCUDACXX_TEMPLATE(class _Rp) - _LIBCUDACXX_REQUIRES((range<_Rp>) ) + _CCCL_TEMPLATE(class _Rp) + _CCCL_REQUIRES((range<_Rp>) ) _LIBCUDACXX_HIDE_FROM_ABI constexpr range_difference_t<_Rp> operator()(_Rp&& __r) const { if constexpr (sized_range<_Rp>) diff --git a/libcudacxx/include/cuda/std/__iterator/iter_move.h b/libcudacxx/include/cuda/std/__iterator/iter_move.h index 45192440a53..e956ea5ee86 100644 --- a/libcudacxx/include/cuda/std/__iterator/iter_move.h +++ b/libcudacxx/include/cuda/std/__iterator/iter_move.h @@ -92,24 +92,24 @@ _LIBCUDACXX_CONCEPT __just_deref = _LIBCUDACXX_FRAGMENT(__just_deref_, _Tp); struct __fn { - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(__unqualified_iter_move<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(__unqualified_iter_move<_Ip>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Ip&& __i) const noexcept(noexcept(iter_move(_CUDA_VSTD::forward<_Ip>(__i)))) { return iter_move(_CUDA_VSTD::forward<_Ip>(__i)); } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(__move_deref<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(__move_deref<_Ip>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Ip&& __i) const noexcept(noexcept( _CUDA_VSTD::move(*_CUDA_VSTD::forward<_Ip>(__i)))) -> decltype(_CUDA_VSTD::move(*_CUDA_VSTD::forward<_Ip>(__i))) { return _CUDA_VSTD::move(*_CUDA_VSTD::forward<_Ip>(__i)); } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(__just_deref<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(__just_deref<_Ip>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Ip&& __i) const noexcept(noexcept(*_CUDA_VSTD::forward<_Ip>(__i))) -> decltype(*_CUDA_VSTD::forward<_Ip>(__i)) { diff --git a/libcudacxx/include/cuda/std/__iterator/iter_swap.h b/libcudacxx/include/cuda/std/__iterator/iter_swap.h index a5d42ff0316..05e13f3240f 100644 --- a/libcudacxx/include/cuda/std/__iterator/iter_swap.h +++ b/libcudacxx/include/cuda/std/__iterator/iter_swap.h @@ -87,24 +87,24 @@ _LIBCUDACXX_CONCEPT __moveable_storable = _LIBCUDACXX_FRAGMENT(__moveable_storab struct __fn { - _LIBCUDACXX_TEMPLATE(class _T1, class _T2) - _LIBCUDACXX_REQUIRES(__unqualified_iter_swap<_T1, _T2>) + _CCCL_TEMPLATE(class _T1, class _T2) + _CCCL_REQUIRES(__unqualified_iter_swap<_T1, _T2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_T1&& __x, _T2&& __y) const noexcept(noexcept(iter_swap(_CUDA_VSTD::forward<_T1>(__x), _CUDA_VSTD::forward<_T2>(__y)))) { (void) iter_swap(_CUDA_VSTD::forward<_T1>(__x), _CUDA_VSTD::forward<_T2>(__y)); } - _LIBCUDACXX_TEMPLATE(class _T1, class _T2) - _LIBCUDACXX_REQUIRES(__readable_swappable<_T1, _T2>) + _CCCL_TEMPLATE(class _T1, class _T2) + _CCCL_REQUIRES(__readable_swappable<_T1, _T2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_T1&& __x, _T2&& __y) const noexcept(noexcept(_CUDA_VRANGES::swap(*_CUDA_VSTD::forward<_T1>(__x), *_CUDA_VSTD::forward<_T2>(__y)))) { _CUDA_VRANGES::swap(*_CUDA_VSTD::forward<_T1>(__x), *_CUDA_VSTD::forward<_T2>(__y)); } - _LIBCUDACXX_TEMPLATE(class _T1, class _T2) - _LIBCUDACXX_REQUIRES(__moveable_storable<_T2, _T1>) + _CCCL_TEMPLATE(class _T1, class _T2) + _CCCL_REQUIRES(__moveable_storable<_T2, _T1>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_T1&& __x, _T2&& __y) const noexcept(noexcept(iter_value_t<_T2>(_CUDA_VRANGES::iter_move(__y))) && noexcept(*__y = _CUDA_VRANGES::iter_move(__x)) diff --git a/libcudacxx/include/cuda/std/__iterator/move_iterator.h b/libcudacxx/include/cuda/std/__iterator/move_iterator.h index db072903f2f..05efe454467 100644 --- a/libcudacxx/include/cuda/std/__iterator/move_iterator.h +++ b/libcudacxx/include/cuda/std/__iterator/move_iterator.h @@ -185,22 +185,22 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator : __current_() {} # else // ^^^ _CCCL_STD_VER > 2017 ^^^ / vvv _CCCL_STD_VER < 2020 vvv - _LIBCUDACXX_TEMPLATE(class _It2 = _Iter) - _LIBCUDACXX_REQUIRES(is_constructible_v<_It2>) + _CCCL_TEMPLATE(class _It2 = _Iter) + _CCCL_REQUIRES(is_constructible_v<_It2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_iterator() : __current_() {} # endif // _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES((!_IsSame<_Up, _Iter>::value) && convertible_to) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES((!_IsSame<_Up, _Iter>::value) && convertible_to) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_iterator(const move_iterator<_Up>& __u) : __current_(__u.base()) {} - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES((!_IsSame<_Up, _Iter>::value) - && convertible_to && assignable_from<_Iter&, const _Up&>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES((!_IsSame<_Up, _Iter>::value) + && convertible_to && assignable_from<_Iter&, const _Up&>) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_iterator& operator=(const move_iterator<_Up>& __u) { __current_ = __u.base(); @@ -225,8 +225,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator return _CUDA_VRANGES::iter_move(__current_ + __n); } - _LIBCUDACXX_TEMPLATE(class _It2 = _Iter) - _LIBCUDACXX_REQUIRES(forward_iterator<_It2>) + _CCCL_TEMPLATE(class _It2 = _Iter) + _CCCL_REQUIRES(forward_iterator<_It2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator++(int) { move_iterator __tmp(*this); @@ -234,8 +234,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator return __tmp; } - _LIBCUDACXX_TEMPLATE(class _It2 = _Iter) - _LIBCUDACXX_REQUIRES((!forward_iterator<_It2>) ) + _CCCL_TEMPLATE(class _It2 = _Iter) + _CCCL_REQUIRES((!forward_iterator<_It2>) ) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator++(int) { ++__current_; @@ -318,46 +318,46 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator } #if _CCCL_STD_VER > 2014 - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sentinel_for<_Sent, _Iter> _LIBCUDACXX_AND __move_iter_comparable<_Iter, _Sent>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sentinel_for<_Sent, _Iter> _CCCL_AND __move_iter_comparable<_Iter, _Sent>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const move_iterator& __x, const move_sentinel<_Sent>& __y) { return __x.base() == __y.base(); } # if _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sentinel_for<_Sent, _Iter> _LIBCUDACXX_AND __move_iter_comparable<_Iter, _Sent>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sentinel_for<_Sent, _Iter> _CCCL_AND __move_iter_comparable<_Iter, _Sent>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const move_sentinel<_Sent>& __y, const move_iterator& __x) { return __y.base() == __x.base(); } - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sentinel_for<_Sent, _Iter> _LIBCUDACXX_AND __move_iter_comparable<_Iter, _Sent>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sentinel_for<_Sent, _Iter> _CCCL_AND __move_iter_comparable<_Iter, _Sent>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const move_iterator& __x, const move_sentinel<_Sent>& __y) { return __x.base() != __y.base(); } - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sentinel_for<_Sent, _Iter> _LIBCUDACXX_AND __move_iter_comparable<_Iter, _Sent>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sentinel_for<_Sent, _Iter> _CCCL_AND __move_iter_comparable<_Iter, _Sent>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const move_sentinel<_Sent>& __y, const move_iterator& __x) { return __y.base() != __x.base(); } # endif // _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sized_sentinel_for<_Sent, _Iter>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sized_sentinel_for<_Sent, _Iter>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> operator-(const move_sentinel<_Sent>& __x, const move_iterator& __y) { return __x.base() - __y.base(); } - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sized_sentinel_for<_Sent, _Iter>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sized_sentinel_for<_Sent, _Iter>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> operator-(const move_iterator& __x, const move_sentinel<_Sent>& __y) { @@ -374,7 +374,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator template _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap( const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) noexcept(__noexcept_swappable<_Iter1, _Iter2>) - _LIBCUDACXX_TRAILING_REQUIRES(void)(same_as<_Iter1, _Iter>&& indirectly_swappable<_Iter2, _Iter1>) + _CCCL_TRAILING_REQUIRES(void)(same_as<_Iter1, _Iter>&& indirectly_swappable<_Iter2, _Iter1>) { return _CUDA_VRANGES::iter_swap(__x.__current_, __y.__current_); } @@ -382,7 +382,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator template _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const move_iterator& __x, const move_iterator<_Iter2>& __y) noexcept(__noexcept_swappable<_Iter, _Iter2>) - _LIBCUDACXX_TRAILING_REQUIRES(void)(indirectly_swappable<_Iter2, _Iter>) + _CCCL_TRAILING_REQUIRES(void)(indirectly_swappable<_Iter2, _Iter>) { return _CUDA_VRANGES::iter_swap(__x.__current_, __y.__current_); } diff --git a/libcudacxx/include/cuda/std/__iterator/move_sentinel.h b/libcudacxx/include/cuda/std/__iterator/move_sentinel.h index 29bcaae141f..2bdef0bf59e 100644 --- a/libcudacxx/include/cuda/std/__iterator/move_sentinel.h +++ b/libcudacxx/include/cuda/std/__iterator/move_sentinel.h @@ -43,14 +43,14 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_sentinel : __last_(_CUDA_VSTD::move(__s)) {} - _LIBCUDACXX_TEMPLATE(class _S2) - _LIBCUDACXX_REQUIRES(convertible_to) + _CCCL_TEMPLATE(class _S2) + _CCCL_REQUIRES(convertible_to) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_sentinel(const move_sentinel<_S2>& __s) : __last_(__s.base()) {} - _LIBCUDACXX_TEMPLATE(class _S2) - _LIBCUDACXX_REQUIRES(assignable_from) + _CCCL_TEMPLATE(class _S2) + _CCCL_REQUIRES(assignable_from) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_sentinel& operator=(const move_sentinel<_S2>& __s) { __last_ = __s.base(); diff --git a/libcudacxx/include/cuda/std/__iterator/next.h b/libcudacxx/include/cuda/std/__iterator/next.h index dee2d94b232..4651214e4bd 100644 --- a/libcudacxx/include/cuda/std/__iterator/next.h +++ b/libcudacxx/include/cuda/std/__iterator/next.h @@ -50,32 +50,32 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__next) struct __fn { - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x) const { ++__x; return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const { _CUDA_VRANGES::advance(__x, __n); return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>&& sentinel_for<_Sp, _Ip>) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>&& sentinel_for<_Sp, _Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, _Sp __bound_sentinel) const { _CUDA_VRANGES::advance(__x, __bound_sentinel); return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>&& sentinel_for<_Sp, _Ip>) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>&& sentinel_for<_Sp, _Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Sp __bound_sentinel) const { _CUDA_VRANGES::advance(__x, __n, __bound_sentinel); diff --git a/libcudacxx/include/cuda/std/__iterator/prev.h b/libcudacxx/include/cuda/std/__iterator/prev.h index d87d8a91706..f28098d9e45 100644 --- a/libcudacxx/include/cuda/std/__iterator/prev.h +++ b/libcudacxx/include/cuda/std/__iterator/prev.h @@ -49,24 +49,24 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__prev) struct __fn { - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(bidirectional_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(bidirectional_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x) const { --__x; return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(bidirectional_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(bidirectional_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const { _CUDA_VRANGES::advance(__x, -__n); return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(bidirectional_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(bidirectional_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Ip __bound_iter) const { _CUDA_VRANGES::advance(__x, -__n, __bound_iter); diff --git a/libcudacxx/include/cuda/std/__iterator/projected.h b/libcudacxx/include/cuda/std/__iterator/projected.h index 0882b15c3d5..d5cb94ced04 100644 --- a/libcudacxx/include/cuda/std/__iterator/projected.h +++ b/libcudacxx/include/cuda/std/__iterator/projected.h @@ -29,8 +29,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD #if _CCCL_STD_VER > 2014 -_LIBCUDACXX_TEMPLATE(class _It, class _Proj) -_LIBCUDACXX_REQUIRES(indirectly_readable<_It> _LIBCUDACXX_AND indirectly_regular_unary_invocable<_Proj, _It>) +_CCCL_TEMPLATE(class _It, class _Proj) +_CCCL_REQUIRES(indirectly_readable<_It> _CCCL_AND indirectly_regular_unary_invocable<_Proj, _It>) struct projected { using value_type = remove_cvref_t>; diff --git a/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h b/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h index b89c096ba30..6f2b0cce65e 100644 --- a/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h +++ b/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h @@ -253,7 +253,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT reverse_iterator _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) noexcept(__noexcept_rev_iter_iter_swap<_Iter1, _Iter2>) - _LIBCUDACXX_TRAILING_REQUIRES(void)(same_as<_Iter1, _Iter>&& indirectly_swappable<_Iter2, _Iter1>) + _CCCL_TRAILING_REQUIRES(void)(same_as<_Iter1, _Iter>&& indirectly_swappable<_Iter2, _Iter1>) { auto __xtmp = __x.base(); auto __ytmp = __y.base(); @@ -264,7 +264,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT reverse_iterator _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const reverse_iterator& __x, const reverse_iterator<_Iter2>& __y) noexcept(__noexcept_rev_iter_iter_swap<_Iter, _Iter2>) - _LIBCUDACXX_TRAILING_REQUIRES(void)(indirectly_swappable<_Iter2, _Iter>) + _CCCL_TRAILING_REQUIRES(void)(indirectly_swappable<_Iter2, _Iter>) { auto __xtmp = __x.base(); auto __ytmp = __y.base(); diff --git a/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h b/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h index d4e5504b69c..785c6d149c9 100644 --- a/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h +++ b/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h @@ -42,30 +42,30 @@ namespace __unreachable_sentinel_detail struct __unreachable_base # endif // _CCCL_COMPILER_MSVC { - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(weakly_incrementable<_Iter>) _CCCL_NODISCARD_FRIEND _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const unreachable_sentinel_t&, const _Iter&) noexcept { return false; } # if _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(weakly_incrementable<_Iter>) _CCCL_NODISCARD_FRIEND _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const _Iter&, const unreachable_sentinel_t&) noexcept { return false; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(weakly_incrementable<_Iter>) _CCCL_NODISCARD_FRIEND _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const unreachable_sentinel_t&, const _Iter&) noexcept { return true; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(weakly_incrementable<_Iter>) _CCCL_NODISCARD_FRIEND _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const _Iter&, const unreachable_sentinel_t&) noexcept { diff --git a/libcudacxx/include/cuda/std/__mdspan/default_accessor.h b/libcudacxx/include/cuda/std/__mdspan/default_accessor.h index 777eb8c97a4..ccba021aa99 100644 --- a/libcudacxx/include/cuda/std/__mdspan/default_accessor.h +++ b/libcudacxx/include/cuda/std/__mdspan/default_accessor.h @@ -72,8 +72,8 @@ struct default_accessor _CCCL_HIDE_FROM_ABI constexpr default_accessor() noexcept = default; - _LIBCUDACXX_TEMPLATE(class _OtherElementType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _OtherElementType (*)[], element_type (*)[])) + _CCCL_TEMPLATE(class _OtherElementType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _OtherElementType (*)[], element_type (*)[])) _LIBCUDACXX_HIDE_FROM_ABI constexpr default_accessor(default_accessor<_OtherElementType>) noexcept {} _LIBCUDACXX_HIDE_FROM_ABI constexpr data_handle_type offset(data_handle_type __p, size_t __i) const noexcept diff --git a/libcudacxx/include/cuda/std/__mdspan/extents.h b/libcudacxx/include/cuda/std/__mdspan/extents.h index 846759e395d..302cc26894a 100644 --- a/libcudacxx/include/cuda/std/__mdspan/extents.h +++ b/libcudacxx/include/cuda/std/__mdspan/extents.h @@ -246,8 +246,8 @@ class extents _CCCL_HIDE_FROM_ABI constexpr extents() noexcept = default; // Converting constructor - _LIBCUDACXX_TEMPLATE(class _OtherIndexType, size_t... _OtherExtents) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _OtherIndexType, size_t... _OtherExtents) + _CCCL_REQUIRES( /* multi-stage check to protect from invalid pack expansion when sizes don't match? */ (decltype(__detail::__check_compatible_extents( integral_constant{}, @@ -281,23 +281,22 @@ class extents } # ifdef __NVCC__ - _LIBCUDACXX_TEMPLATE(class... _Integral) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _Integral) + _CCCL_REQUIRES( // TODO: check whether the other version works with newest NVCC, doesn't with 11.4 // NVCC seems to pick up rank_dynamic from the wrong extents type??? __MDSPAN_FOLD_AND(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Integral, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND( - _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Integral) /* && ... */) _LIBCUDACXX_AND + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Integral) /* && ... */) + _CCCL_AND // NVCC chokes on the fold thingy here so wrote the workaround ((sizeof...(_Integral) == __detail::__count_dynamic_extents<_Extents...>::val) || (sizeof...(_Integral) == sizeof...(_Extents)))) # else - _LIBCUDACXX_TEMPLATE(class... _Integral) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _Integral) + _CCCL_REQUIRES( __MDSPAN_FOLD_AND(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Integral, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND( - _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Integral) /* && ... */) - _LIBCUDACXX_AND((sizeof...(_Integral) == rank_dynamic()) || (sizeof...(_Integral) == rank()))) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Integral) /* && ... */) + _CCCL_AND((sizeof...(_Integral) == rank_dynamic()) || (sizeof...(_Integral) == rank()))) # endif _LIBCUDACXX_HIDE_FROM_ABI explicit constexpr extents(_Integral... __exts) noexcept # ifndef _CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS @@ -330,16 +329,16 @@ class extents # ifdef __NVCC__ // NVCC seems to pick up rank_dynamic from the wrong extents type??? // NVCC chokes on the fold thingy here so wrote the workaround - _LIBCUDACXX_TEMPLATE(class _IndexType, size_t _Np) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _IndexType, size_t _Np) + _CCCL_REQUIRES( _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) - _LIBCUDACXX_AND((_Np == __detail::__count_dynamic_extents<_Extents...>::val) || (_Np == sizeof...(_Extents)))) + _CCCL_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) + _CCCL_AND((_Np == __detail::__count_dynamic_extents<_Extents...>::val) || (_Np == sizeof...(_Extents)))) # else - _LIBCUDACXX_TEMPLATE(class _IndexType, size_t _Np) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) - _LIBCUDACXX_AND(_Np == rank() || _Np == rank_dynamic())) + _CCCL_TEMPLATE(class _IndexType, size_t _Np) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) + _CCCL_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) + _CCCL_AND(_Np == rank() || _Np == rank_dynamic())) # endif __MDSPAN_CONDITIONAL_EXPLICIT(_Np != rank_dynamic()) _LIBCUDACXX_HIDE_FROM_ABI constexpr extents(_CUDA_VSTD::array<_IndexType, _Np> const& __exts) noexcept @@ -373,16 +372,16 @@ class extents # ifdef __NVCC__ // NVCC seems to pick up rank_dynamic from the wrong extents type??? // NVCC chokes on the fold thingy here so wrote the workaround - _LIBCUDACXX_TEMPLATE(class _IndexType, size_t _Np) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _IndexType, size_t _Np) + _CCCL_REQUIRES( _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) - _LIBCUDACXX_AND((_Np == __detail::__count_dynamic_extents<_Extents...>::val) || (_Np == sizeof...(_Extents)))) + _CCCL_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) + _CCCL_AND((_Np == __detail::__count_dynamic_extents<_Extents...>::val) || (_Np == sizeof...(_Extents)))) # else - _LIBCUDACXX_TEMPLATE(class _IndexType, size_t _Np) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) - _LIBCUDACXX_AND(_Np == rank() || _Np == rank_dynamic())) + _CCCL_TEMPLATE(class _IndexType, size_t _Np) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) + _CCCL_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) + _CCCL_AND(_Np == rank() || _Np == rank_dynamic())) # endif __MDSPAN_CONDITIONAL_EXPLICIT(_Np != rank_dynamic()) _LIBCUDACXX_HIDE_FROM_ABI constexpr extents(_CUDA_VSTD::span<_IndexType, _Np> __exts) noexcept diff --git a/libcudacxx/include/cuda/std/__mdspan/layout_left.h b/libcudacxx/include/cuda/std/__mdspan/layout_left.h index f20ffc89bef..8a11107f390 100644 --- a/libcudacxx/include/cuda/std/__mdspan/layout_left.h +++ b/libcudacxx/include/cuda/std/__mdspan/layout_left.h @@ -120,8 +120,8 @@ class layout_left::mapping : __extents(__exts) {} - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((!_CUDA_VSTD::is_convertible<_OtherExtents, extents_type>::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -134,9 +134,9 @@ class layout_left::mapping */ } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents) - _LIBCUDACXX_AND(extents_type::rank() <= 1)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents) + _CCCL_AND(extents_type::rank() <= 1)) __MDSPAN_CONDITIONAL_EXPLICIT((!_CUDA_VSTD::is_convertible<_OtherExtents, extents_type>::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -149,8 +149,8 @@ class layout_left::mapping */ } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((extents_type::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( layout_stride::mapping<_OtherExtents> const& __other) // NOLINT(google-explicit-constructor) @@ -186,8 +186,8 @@ class layout_left::mapping //-------------------------------------------------------------------------------- - _LIBCUDACXX_TEMPLATE(class... _Indices) - _LIBCUDACXX_REQUIRES((sizeof...(_Indices) == extents_type::rank()) _LIBCUDACXX_AND __MDSPAN_FOLD_AND( + _CCCL_TEMPLATE(class... _Indices) + _CCCL_REQUIRES((sizeof...(_Indices) == extents_type::rank()) _CCCL_AND __MDSPAN_FOLD_AND( (_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Indices, index_type) && _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Indices)))) _CCCL_HOST_DEVICE constexpr index_type operator()(_Indices... __idxs) const noexcept @@ -222,8 +222,8 @@ class layout_left::mapping return true; } - _LIBCUDACXX_TEMPLATE(class _Ext = _Extents) - _LIBCUDACXX_REQUIRES((_Ext::rank() > 0)) + _CCCL_TEMPLATE(class _Ext = _Extents) + _CCCL_REQUIRES((_Ext::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr index_type stride(rank_type __i) const noexcept { index_type __value = 1; diff --git a/libcudacxx/include/cuda/std/__mdspan/layout_right.h b/libcudacxx/include/cuda/std/__mdspan/layout_right.h index 463c7fc41d6..bd61461ab82 100644 --- a/libcudacxx/include/cuda/std/__mdspan/layout_right.h +++ b/libcudacxx/include/cuda/std/__mdspan/layout_right.h @@ -125,8 +125,8 @@ class layout_right::mapping : __extents(__exts) {} - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((!_CUDA_VSTD::is_convertible<_OtherExtents, extents_type>::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -139,9 +139,9 @@ class layout_right::mapping */ } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents) - _LIBCUDACXX_AND(extents_type::rank() <= 1)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents) + _CCCL_AND(extents_type::rank() <= 1)) __MDSPAN_CONDITIONAL_EXPLICIT((!_CUDA_VSTD::is_convertible<_OtherExtents, extents_type>::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -154,8 +154,8 @@ class layout_right::mapping */ } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((extents_type::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( layout_stride::mapping<_OtherExtents> const& __other) // NOLINT(google-explicit-constructor) @@ -191,8 +191,8 @@ class layout_right::mapping //-------------------------------------------------------------------------------- - _LIBCUDACXX_TEMPLATE(class... _Indices) - _LIBCUDACXX_REQUIRES((sizeof...(_Indices) == extents_type::rank()) _LIBCUDACXX_AND __MDSPAN_FOLD_AND( + _CCCL_TEMPLATE(class... _Indices) + _CCCL_REQUIRES((sizeof...(_Indices) == extents_type::rank()) _CCCL_AND __MDSPAN_FOLD_AND( (_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Indices, index_type) && _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Indices)))) _CCCL_HOST_DEVICE constexpr index_type operator()(_Indices... __idxs) const noexcept @@ -225,8 +225,8 @@ class layout_right::mapping return true; } - _LIBCUDACXX_TEMPLATE(class _Ext = _Extents) - _LIBCUDACXX_REQUIRES((_Ext::rank() > 0)) + _CCCL_TEMPLATE(class _Ext = _Extents) + _CCCL_REQUIRES((_Ext::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr index_type stride(rank_type __i) const noexcept { index_type __value = 1; diff --git a/libcudacxx/include/cuda/std/__mdspan/layout_stride.h b/libcudacxx/include/cuda/std/__mdspan/layout_stride.h index 723d2e816cd..3f31820cf49 100644 --- a/libcudacxx/include/cuda/std/__mdspan/layout_stride.h +++ b/libcudacxx/include/cuda/std/__mdspan/layout_stride.h @@ -294,7 +294,7 @@ struct layout_stride _CCCL_HIDE_FROM_ABI constexpr mapping() noexcept = default; _CCCL_HIDE_FROM_ABI constexpr mapping(mapping const&) noexcept = default; - // nvcc cannot deduce this constructor when using _LIBCUDACXX_REQUIRES + // nvcc cannot deduce this constructor when using _CCCL_REQUIRES template < class _IntegralTypes, enable_if_t<_CCCL_TRAIT(is_convertible, const remove_const_t<_IntegralTypes>&, index_type), int> = 0, @@ -323,7 +323,7 @@ struct layout_stride */ } - // nvcc cannot deduce this constructor when using _LIBCUDACXX_REQUIRES + // nvcc cannot deduce this constructor when using _CCCL_REQUIRES template < class _IntegralTypes, enable_if_t<_CCCL_TRAIT(is_convertible, const remove_const_t<_IntegralTypes>&, index_type), int> = 0, @@ -353,12 +353,11 @@ struct layout_stride } # if !(__MDSPAN_USE_CONCEPTS && __MDSPAN_HAS_CXX_20) - _LIBCUDACXX_TEMPLATE(class _StridedLayoutMapping) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _StridedLayoutMapping) + _CCCL_REQUIRES( _CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, typename _StridedLayoutMapping::extents_type) - _LIBCUDACXX_AND __detail::__is_mapping_of - _LIBCUDACXX_AND(_StridedLayoutMapping::is_always_unique()) - _LIBCUDACXX_AND(_StridedLayoutMapping::is_always_strided())) + _CCCL_AND __detail::__is_mapping_of + _CCCL_AND(_StridedLayoutMapping::is_always_unique()) _CCCL_AND(_StridedLayoutMapping::is_always_strided())) # else template requires(__detail::__layout_mapping_alike<_StridedLayoutMapping> @@ -425,11 +424,11 @@ struct layout_stride return __span_size; } - _LIBCUDACXX_TEMPLATE(class... _Indices) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _Indices) + _CCCL_REQUIRES( (sizeof...(_Indices) == _Extents::rank()) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _Indices, index_type) /*&& ...*/) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _Indices) /*&& ...*/)) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _Indices, index_type) /*&& ...*/) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _Indices) /*&& ...*/)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr index_type operator()(_Indices... __idxs) const noexcept { @@ -464,19 +463,18 @@ struct layout_stride return true; } - _LIBCUDACXX_TEMPLATE(class _Ext = _Extents) - _LIBCUDACXX_REQUIRES((_Ext::rank() > 0)) + _CCCL_TEMPLATE(class _Ext = _Extents) + _CCCL_REQUIRES((_Ext::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr index_type stride(rank_type __r) const noexcept { return __strides_storage()[__r]; } # if !(__MDSPAN_USE_CONCEPTS && __MDSPAN_HAS_CXX_20) - _LIBCUDACXX_TEMPLATE(class _StridedLayoutMapping) - _LIBCUDACXX_REQUIRES( - __detail::__is_mapping_of _LIBCUDACXX_AND( - extents_type::rank() == _StridedLayoutMapping::extents_type::rank()) - _LIBCUDACXX_AND(_StridedLayoutMapping::is_always_strided())) + _CCCL_TEMPLATE(class _StridedLayoutMapping) + _CCCL_REQUIRES(__detail::__is_mapping_of + _CCCL_AND(extents_type::rank() == _StridedLayoutMapping::extents_type::rank()) + _CCCL_AND(_StridedLayoutMapping::is_always_strided())) # else template requires(__detail::__layout_mapping_alike<_StridedLayoutMapping> @@ -496,8 +494,8 @@ struct layout_stride } // This one is not technically part of the proposal. Just here to make implementation a bit more optimal hopefully - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES((extents_type::rank() == _OtherExtents::rank())) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES((extents_type::rank() == _OtherExtents::rank())) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool operator==(mapping const& __lhs, mapping<_OtherExtents> const& __rhs) noexcept { @@ -505,19 +503,18 @@ struct layout_stride } # if !__MDSPAN_HAS_CXX_20 - _LIBCUDACXX_TEMPLATE(class _StridedLayoutMapping) - _LIBCUDACXX_REQUIRES( - __detail::__is_mapping_of _LIBCUDACXX_AND( - extents_type::rank() == _StridedLayoutMapping::extents_type::rank()) - _LIBCUDACXX_AND(_StridedLayoutMapping::is_always_strided())) + _CCCL_TEMPLATE(class _StridedLayoutMapping) + _CCCL_REQUIRES(__detail::__is_mapping_of + _CCCL_AND(extents_type::rank() == _StridedLayoutMapping::extents_type::rank()) + _CCCL_AND(_StridedLayoutMapping::is_always_strided())) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool operator!=(const mapping& __x, const _StridedLayoutMapping& __y) noexcept { return not(__x == __y); } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES((extents_type::rank() == _OtherExtents::rank())) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES((extents_type::rank() == _OtherExtents::rank())) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool operator!=(mapping const& __lhs, mapping<_OtherExtents> const& __rhs) noexcept { diff --git a/libcudacxx/include/cuda/std/__mdspan/mdspan.h b/libcudacxx/include/cuda/std/__mdspan/mdspan.h index e4df2f44865..ad359c555a2 100644 --- a/libcudacxx/include/cuda/std/__mdspan/mdspan.h +++ b/libcudacxx/include/cuda/std/__mdspan/mdspan.h @@ -176,13 +176,13 @@ class mdspan _CCCL_HIDE_FROM_ABI constexpr mdspan(const mdspan&) = default; _CCCL_HIDE_FROM_ABI constexpr mdspan(mdspan&&) = default; - _LIBCUDACXX_TEMPLATE(class... _SizeTypes) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _SizeTypes) + _CCCL_REQUIRES( __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _SizeTypes, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) - _LIBCUDACXX_AND((sizeof...(_SizeTypes) == rank()) || (sizeof...(_SizeTypes) == rank_dynamic())) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) + _CCCL_AND((sizeof...(_SizeTypes) == rank()) || (sizeof...(_SizeTypes) == rank_dynamic())) + _CCCL_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) + _CCCL_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) _LIBCUDACXX_HIDE_FROM_ABI explicit constexpr mdspan(data_handle_type __p, _SizeTypes... __dynamic_extents) // TODO @proposal-bug shouldn't I be allowed to do `move(__p)` here? : __members( @@ -191,11 +191,12 @@ class mdspan accessor_type())) {} - _LIBCUDACXX_TEMPLATE(class _SizeType, size_t _Np) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) _LIBCUDACXX_AND _CCCL_TRAIT( - is_nothrow_constructible, index_type, _SizeType) _LIBCUDACXX_AND((_Np == rank()) || (_Np == rank_dynamic())) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_TEMPLATE(class _SizeType, size_t _Np) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType) + _CCCL_AND((_Np == rank()) || (_Np == rank_dynamic())) + _CCCL_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) + _CCCL_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) __MDSPAN_CONDITIONAL_EXPLICIT(_Np != rank_dynamic()) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan(data_handle_type __p, const _CUDA_VSTD::array<_SizeType, _Np>& __dynamic_extents) @@ -203,26 +204,26 @@ class mdspan __map_acc_pair_t(mapping_type(extents_type(__dynamic_extents)), accessor_type())) {} - _LIBCUDACXX_TEMPLATE(class _SizeType, size_t _Np) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) _LIBCUDACXX_AND _CCCL_TRAIT( - is_nothrow_constructible, index_type, _SizeType) _LIBCUDACXX_AND((_Np == rank()) || (_Np == rank_dynamic())) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_TEMPLATE(class _SizeType, size_t _Np) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType) + _CCCL_AND((_Np == rank()) || (_Np == rank_dynamic())) + _CCCL_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) + _CCCL_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) __MDSPAN_CONDITIONAL_EXPLICIT(_Np != rank_dynamic()) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan(data_handle_type __p, _CUDA_VSTD::span<_SizeType, _Np> __dynamic_extents) : __members(_CUDA_VSTD::move(__p), __map_acc_pair_t(mapping_type(extents_type(_CUDA_VSTD::as_const(__dynamic_extents))), accessor_type())) {} - _LIBCUDACXX_TEMPLATE(bool _Is_default_constructible = _CCCL_TRAIT(is_default_constructible, accessor_type)) - _LIBCUDACXX_REQUIRES( - _Is_default_constructible _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type)) + _CCCL_TEMPLATE(bool _Is_default_constructible = _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_REQUIRES(_Is_default_constructible _CCCL_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan(data_handle_type __p, const extents_type& __exts) : __members(_CUDA_VSTD::move(__p), __map_acc_pair_t(mapping_type(__exts), accessor_type())) {} - _LIBCUDACXX_TEMPLATE(bool _Is_default_constructible = _CCCL_TRAIT(is_default_constructible, accessor_type)) - _LIBCUDACXX_REQUIRES(_Is_default_constructible) + _CCCL_TEMPLATE(bool _Is_default_constructible = _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_REQUIRES(_Is_default_constructible) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan(data_handle_type __p, const mapping_type& __m) : __members(_CUDA_VSTD::move(__p), __map_acc_pair_t(__m, accessor_type())) {} @@ -231,10 +232,10 @@ class mdspan : __members(_CUDA_VSTD::move(__p), __map_acc_pair_t(__m, __a)) {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType, class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _OtherElementType, class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor) + _CCCL_REQUIRES( _CCCL_TRAIT(is_constructible, mapping_type, typename _OtherLayoutPolicy::template mapping<_OtherExtents>) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, accessor_type, _OtherAccessor)) + _CCCL_AND _CCCL_TRAIT(is_constructible, accessor_type, _OtherAccessor)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan( const mdspan<_OtherElementType, _OtherExtents, _OtherLayoutPolicy, _OtherAccessor>& __other) : __members(__other.__ptr_ref(), __map_acc_pair_t(__other.__mapping_ref(), __other.__accessor_ref())) @@ -262,11 +263,11 @@ class mdspan // [mdspan.basic.mapping], mdspan mapping domain multidimensional index to access codomain element # if __MDSPAN_USE_BRACKET_OPERATOR - _LIBCUDACXX_TEMPLATE(class... _SizeTypes) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _SizeTypes) + _CCCL_REQUIRES( __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _SizeTypes, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) - _LIBCUDACXX_AND(rank() == sizeof...(_SizeTypes))) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) + _CCCL_AND(rank() == sizeof...(_SizeTypes))) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator[](_SizeTypes... __indices) const { @@ -274,18 +275,18 @@ class mdspan } # endif - _LIBCUDACXX_TEMPLATE(class _SizeType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) + _CCCL_TEMPLATE(class _SizeType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator[](const _CUDA_VSTD::array<_SizeType, rank()>& __indices) const { return __impl::template __callop(*this, __indices); } - _LIBCUDACXX_TEMPLATE(class _SizeType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) + _CCCL_TEMPLATE(class _SizeType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator[](_CUDA_VSTD::span<_SizeType, rank()> __indices) const { @@ -293,9 +294,10 @@ class mdspan } # if !__MDSPAN_USE_BRACKET_OPERATOR - _LIBCUDACXX_TEMPLATE(class _Index) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _Index, index_type) _LIBCUDACXX_AND _CCCL_TRAIT( - is_nothrow_constructible, index_type, _Index) _LIBCUDACXX_AND(extents_type::rank() == 1)) + _CCCL_TEMPLATE(class _Index) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _Index, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _Index) + _CCCL_AND(extents_type::rank() == 1)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator[](_Index __idx) const { @@ -304,29 +306,29 @@ class mdspan # endif # if __MDSPAN_USE_PAREN_OPERATOR - _LIBCUDACXX_TEMPLATE(class... _SizeTypes) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _SizeTypes) + _CCCL_REQUIRES( __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _SizeTypes, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) - _LIBCUDACXX_AND(extents_type::rank() == sizeof...(_SizeTypes))) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) + _CCCL_AND(extents_type::rank() == sizeof...(_SizeTypes))) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator()(_SizeTypes... __indices) const { return __accessor_ref().access(__ptr_ref(), __mapping_ref()(__indices...)); } - _LIBCUDACXX_TEMPLATE(class _SizeType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) + _CCCL_TEMPLATE(class _SizeType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator()(const _CUDA_VSTD::array<_SizeType, rank()>& __indices) const { return __impl::template __callop(*this, __indices); } - _LIBCUDACXX_TEMPLATE(class _SizeType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) + _CCCL_TEMPLATE(class _SizeType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator()(_CUDA_VSTD::span<_SizeType, rank()> __indices) const { @@ -437,18 +439,18 @@ class mdspan }; # if defined(__MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION) -_LIBCUDACXX_TEMPLATE(class _ElementType, class... _SizeTypes) -_LIBCUDACXX_REQUIRES(__MDSPAN_FOLD_AND(_CCCL_TRAIT(is_integral, _SizeTypes) /* && ... */) - _LIBCUDACXX_AND(sizeof...(_SizeTypes) > 0)) +_CCCL_TEMPLATE(class _ElementType, class... _SizeTypes) +_CCCL_REQUIRES(__MDSPAN_FOLD_AND(_CCCL_TRAIT(is_integral, _SizeTypes) /* && ... */) + _CCCL_AND(sizeof...(_SizeTypes) > 0)) _CCCL_HOST_DEVICE explicit mdspan(_ElementType*, _SizeTypes...) -> mdspan<_ElementType, dextents>; -_LIBCUDACXX_TEMPLATE(class _Pointer) -_LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_pointer, _CUDA_VSTD::remove_reference_t<_Pointer>)) +_CCCL_TEMPLATE(class _Pointer) +_CCCL_REQUIRES(_CCCL_TRAIT(is_pointer, _CUDA_VSTD::remove_reference_t<_Pointer>)) _CCCL_HOST_DEVICE mdspan(_Pointer&&) -> mdspan<_CUDA_VSTD::remove_pointer_t<_CUDA_VSTD::remove_reference_t<_Pointer>>, extents>; -_LIBCUDACXX_TEMPLATE(class _CArray) -_LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_array, _CArray) _LIBCUDACXX_AND(rank_v<_CArray> == 1)) +_CCCL_TEMPLATE(class _CArray) +_CCCL_REQUIRES(_CCCL_TRAIT(is_array, _CArray) _CCCL_AND(rank_v<_CArray> == 1)) _CCCL_HOST_DEVICE mdspan(_CArray&) -> mdspan<_CUDA_VSTD::remove_all_extents_t<_CArray>, extents>>; diff --git a/libcudacxx/include/cuda/std/__mdspan/static_array.h b/libcudacxx/include/cuda/std/__mdspan/static_array.h index 70715173bd6..326ca279b74 100644 --- a/libcudacxx/include/cuda/std/__mdspan/static_array.h +++ b/libcudacxx/include/cuda/std/__mdspan/static_array.h @@ -158,8 +158,8 @@ class __partially_static_array_impl< : __partially_static_array_impl(__construct_psa_from_all_exts_values_tag, _CUDA_VSTD::get<_Idxs>(__vals)...) {} - _LIBCUDACXX_TEMPLATE(bool _SizeMatches = (sizeof...(_Idxs) != __size_dynamic)) - _LIBCUDACXX_REQUIRES(_SizeMatches) + _CCCL_TEMPLATE(bool _SizeMatches = (sizeof...(_Idxs) != __size_dynamic)) + _CCCL_REQUIRES(_SizeMatches) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit __partially_static_array_impl( array<_Tp, __size_dynamic> const& __vals) noexcept __partially_static_array_impl(__construct_psa_from_dynamic_exts_values_tag, diff --git a/libcudacxx/include/cuda/std/__mdspan/submdspan.h b/libcudacxx/include/cuda/std/__mdspan/submdspan.h index 92d79209e2a..2053c3a6d88 100644 --- a/libcudacxx/include/cuda/std/__mdspan/submdspan.h +++ b/libcudacxx/include/cuda/std/__mdspan/submdspan.h @@ -521,15 +521,14 @@ struct _is_layout_stride : true_type //============================================================================== -_LIBCUDACXX_TEMPLATE(class _ET, class _EXT, class _LP, class _AP, class... _SliceSpecs) -_LIBCUDACXX_REQUIRES( +_CCCL_TEMPLATE(class _ET, class _EXT, class _LP, class _AP, class... _SliceSpecs) +_CCCL_REQUIRES( (_CCCL_TRAIT(_CUDA_VSTD::is_same, _LP, layout_left) || _CCCL_TRAIT(_CUDA_VSTD::is_same, _LP, layout_right) || __detail::_is_layout_stride<_LP>::value) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND( - (_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, size_t) - || _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, tuple) - || _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, full_extent_t)) /* && ... */) - _LIBCUDACXX_AND(sizeof...(_SliceSpecs) == _EXT::rank())) + _CCCL_AND __MDSPAN_FOLD_AND((_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, size_t) + || _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, tuple) + || _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, full_extent_t)) /* && ... */) + _CCCL_AND(sizeof...(_SliceSpecs) == _EXT::rank())) _LIBCUDACXX_HIDE_FROM_ABI __MDSPAN_DEDUCE_RETURN_TYPE_SINGLE_LINE( (constexpr submdspan(mdspan<_ET, _EXT, _LP, _AP> const& __src, _SliceSpecs... __slices) noexcept), ( diff --git a/libcudacxx/include/cuda/std/__ranges/access.h b/libcudacxx/include/cuda/std/__ranges/access.h index eae85751f4c..14686989fd9 100644 --- a/libcudacxx/include/cuda/std/__ranges/access.h +++ b/libcudacxx/include/cuda/std/__ranges/access.h @@ -84,24 +84,24 @@ struct __fn { // This has been made valid as a defect report for C++17 onwards, however gcc below 11.0 does not implement it # if (!defined(_CCCL_COMPILER_GCC) || __GNUC__ >= 11) - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[]) const noexcept { return __t + 0; } # endif // (!defined(__GNUC__) || __GNUC__ >= 11) - _LIBCUDACXX_TEMPLATE(class _Tp, size_t _Np) - _LIBCUDACXX_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. + _CCCL_TEMPLATE(class _Tp, size_t _Np) + _CCCL_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept { return __t + 0; } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_begin<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_begin<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.begin()))) { @@ -109,16 +109,16 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_begin<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_begin<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(begin(__t)))) { return _LIBCUDACXX_AUTO_CAST(begin(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((!__member_begin<_Tp>) _LIBCUDACXX_AND(!__unqualified_begin<_Tp>)) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((!__member_begin<_Tp>) _CCCL_AND(!__unqualified_begin<_Tp>)) void operator()(_Tp&&) const = delete; }; _LIBCUDACXX_END_NAMESPACE_CPO @@ -181,16 +181,16 @@ _LIBCUDACXX_CONCEPT __unqualified_end = _LIBCUDACXX_FRAGMENT(__unqualified_end_, struct __fn { - _LIBCUDACXX_TEMPLATE(class _Tp, size_t _Np) - _LIBCUDACXX_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. + _CCCL_TEMPLATE(class _Tp, size_t _Np) + _CCCL_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept { return __t + _Np; } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_end<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_end<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.end()))) { @@ -198,16 +198,16 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_end<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_end<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(end(__t)))) { return _LIBCUDACXX_AUTO_CAST(end(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((!__member_end<_Tp>) _LIBCUDACXX_AND(!__unqualified_end<_Tp>)) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((!__member_end<_Tp>) _CCCL_AND(!__unqualified_end<_Tp>)) void operator()(_Tp&&) const = delete; }; _LIBCUDACXX_END_NAMESPACE_CPO @@ -223,8 +223,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__cbegin) struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::begin(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::begin(static_cast&>(__t))) @@ -233,8 +233,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::begin(static_cast(__t)))) -> decltype(_CUDA_VRANGES::begin(static_cast(__t))) @@ -255,8 +255,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__cend) struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::end(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::end(static_cast&>(__t))) @@ -265,8 +265,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept( _CUDA_VRANGES::end(static_cast(__t)))) -> decltype(_CUDA_VRANGES::end(static_cast(__t))) { diff --git a/libcudacxx/include/cuda/std/__ranges/data.h b/libcudacxx/include/cuda/std/__ranges/data.h index d28da2031aa..3c73d6d287b 100644 --- a/libcudacxx/include/cuda/std/__ranges/data.h +++ b/libcudacxx/include/cuda/std/__ranges/data.h @@ -78,16 +78,16 @@ _LIBCUDACXX_CONCEPT __ranges_begin_invocable = _LIBCUDACXX_FRAGMENT(__ranges_beg struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_data<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_data<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(__t.data())) { return __t.data(); } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__ranges_begin_invocable<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__ranges_begin_invocable<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VSTD::to_address(_CUDA_VRANGES::begin(__t)))) { @@ -106,8 +106,8 @@ _CCCL_GLOBAL_CONSTANT auto data = __data::__fn{}; _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__cdata) struct __fn { - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::data(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::data(static_cast&>(__t))) @@ -115,8 +115,8 @@ struct __fn return _CUDA_VRANGES::data(static_cast&>(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept( _CUDA_VRANGES::data(static_cast(__t)))) -> decltype(_CUDA_VRANGES::data(static_cast(__t))) { diff --git a/libcudacxx/include/cuda/std/__ranges/empty.h b/libcudacxx/include/cuda/std/__ranges/empty.h index 8b41ac1deeb..7c9411c19ad 100644 --- a/libcudacxx/include/cuda/std/__ranges/empty.h +++ b/libcudacxx/include/cuda/std/__ranges/empty.h @@ -74,24 +74,24 @@ _LIBCUDACXX_CONCEPT __can_compare_begin_end = _LIBCUDACXX_FRAGMENT(__can_compare struct __fn { - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_empty<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_empty<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const noexcept(noexcept(bool(__t.empty()))) { return bool(__t.empty()); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_invoke_size<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_invoke_size<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::size(__t))) { return _CUDA_VRANGES::size(__t) == 0; } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_compare_begin_end<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_compare_begin_end<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const noexcept(noexcept(bool(_CUDA_VRANGES::begin(__t) == _CUDA_VRANGES::end(__t)))) { diff --git a/libcudacxx/include/cuda/std/__ranges/enable_view.h b/libcudacxx/include/cuda/std/__ranges/enable_view.h index ff6376001e8..1e5a09cd541 100644 --- a/libcudacxx/include/cuda/std/__ranges/enable_view.h +++ b/libcudacxx/include/cuda/std/__ranges/enable_view.h @@ -52,8 +52,8 @@ class view_interface; _LIBCUDACXX_END_NAMESPACE_RANGES_ABI -_LIBCUDACXX_TEMPLATE(class _Op, class _Yp) -_LIBCUDACXX_REQUIRES(is_convertible_v<_Op*, view_interface<_Yp>*>) +_CCCL_TEMPLATE(class _Op, class _Yp) +_CCCL_REQUIRES(is_convertible_v<_Op*, view_interface<_Yp>*>) _LIBCUDACXX_HIDE_FROM_ABI void __is_derived_from_view_interface(const _Op*, const view_interface<_Yp>*); # if _CCCL_STD_VER >= 2020 diff --git a/libcudacxx/include/cuda/std/__ranges/rbegin.h b/libcudacxx/include/cuda/std/__ranges/rbegin.h index 98d92deda2e..4d1bb7a0fb1 100644 --- a/libcudacxx/include/cuda/std/__ranges/rbegin.h +++ b/libcudacxx/include/cuda/std/__ranges/rbegin.h @@ -99,8 +99,8 @@ _LIBCUDACXX_CONCEPT __can_reverse = _LIBCUDACXX_FRAGMENT(__can_reverse_, _Tp); struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_rbegin<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_rbegin<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.rbegin()))) { @@ -108,8 +108,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_rbegin<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_rbegin<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(rbegin(__t)))) { @@ -117,16 +117,16 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_reverse<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_reverse<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::end(__t))) { return _CUDA_VSTD::make_reverse_iterator(_CUDA_VRANGES::end(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((!__member_rbegin<_Tp> && !__unqualified_rbegin<_Tp> && !__can_reverse<_Tp>) ) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((!__member_rbegin<_Tp> && !__unqualified_rbegin<_Tp> && !__can_reverse<_Tp>) ) void operator()(_Tp&&) const = delete; }; _LIBCUDACXX_END_NAMESPACE_CPO @@ -142,8 +142,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__crbegin) struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::rbegin(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::rbegin(static_cast&>(__t))) @@ -152,8 +152,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::rbegin(static_cast(__t)))) -> decltype(_CUDA_VRANGES::rbegin(static_cast(__t))) diff --git a/libcudacxx/include/cuda/std/__ranges/rend.h b/libcudacxx/include/cuda/std/__ranges/rend.h index 429c701f347..dd4a11d3a0b 100644 --- a/libcudacxx/include/cuda/std/__ranges/rend.h +++ b/libcudacxx/include/cuda/std/__ranges/rend.h @@ -106,8 +106,8 @@ class __fn { public: _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_rend<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_rend<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.rend()))) { @@ -115,8 +115,8 @@ class __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_rend<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_rend<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(rend(__t)))) { @@ -124,16 +124,16 @@ class __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_reverse<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_reverse<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::begin(__t))) { return _CUDA_VSTD::make_reverse_iterator(_CUDA_VRANGES::begin(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((!__member_rend<_Tp> && !__unqualified_rend<_Tp> && !__can_reverse<_Tp>) ) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((!__member_rend<_Tp> && !__unqualified_rend<_Tp> && !__can_reverse<_Tp>) ) void operator()(_Tp&&) const = delete; }; _LIBCUDACXX_END_NAMESPACE_CPO @@ -149,8 +149,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__crend) struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::rend(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::rend(static_cast&>(__t))) @@ -159,8 +159,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept( _CUDA_VRANGES::rend(static_cast(__t)))) -> decltype(_CUDA_VRANGES::rend(static_cast(__t))) { diff --git a/libcudacxx/include/cuda/std/__ranges/size.h b/libcudacxx/include/cuda/std/__ranges/size.h index 259900b537e..80227afc412 100644 --- a/libcudacxx/include/cuda/std/__ranges/size.h +++ b/libcudacxx/include/cuda/std/__ranges/size.h @@ -124,8 +124,8 @@ struct __fn // `[range.prim.size]`: `auto(t.size())` is a valid expression. _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_size<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_size<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.size()))) { @@ -134,8 +134,8 @@ struct __fn // `[range.prim.size]`: `auto(size(t))` is a valid expression. _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_size<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_size<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(size(__t)))) { @@ -144,8 +144,8 @@ struct __fn // [range.prim.size]: the `to-unsigned-like` case. _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__difference<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__difference<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VSTD::__to_unsigned_like(_CUDA_VRANGES::end(__t) - _CUDA_VRANGES::begin(__t)))) -> decltype(_CUDA_VSTD::__to_unsigned_like(_CUDA_VRANGES::end(__t) - _CUDA_VRANGES::begin(__t))) @@ -177,8 +177,8 @@ _LIBCUDACXX_CONCEPT __can_ssize = _LIBCUDACXX_FRAGMENT(__can_ssize_, _Tp); struct __fn { - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_ssize<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_ssize<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::size(__t))) { diff --git a/libcudacxx/include/cuda/std/__ranges/subrange.h b/libcudacxx/include/cuda/std/__ranges/subrange.h index 61cf0fa77dc..8be1d88ccd3 100644 --- a/libcudacxx/include/cuda/std/__ranges/subrange.h +++ b/libcudacxx/include/cuda/std/__ranges/subrange.h @@ -256,16 +256,16 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface>(){}; # endif // _CCCL_STD_VER <= 2017 - _LIBCUDACXX_TEMPLATE(class _It) - _LIBCUDACXX_REQUIRES(__subrange_from_iter_sent<_Iter, _It, _StoreSize>) + _CCCL_TEMPLATE(class _It) + _CCCL_REQUIRES(__subrange_from_iter_sent<_Iter, _It, _StoreSize>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_It __iter, _Sent __sent) : view_interface>() , __begin_(_CUDA_VSTD::move(__iter)) , __end_(_CUDA_VSTD::move(__sent)) {} - _LIBCUDACXX_TEMPLATE(class _It) - _LIBCUDACXX_REQUIRES(__subrange_from_iter_sent_size<_Iter, _Kind, _It>) + _CCCL_TEMPLATE(class _It) + _CCCL_REQUIRES(__subrange_from_iter_sent_size<_Iter, _Kind, _It>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_It __iter, _Sent __sent, make_unsigned_t> __n) : view_interface>() , __begin_(_CUDA_VSTD::move(__iter)) @@ -279,42 +279,42 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__subrange_from_range<_Iter, _Sent, _Kind, _Range, !_StoreSize>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_Range&& __range) : subrange(_CUDA_VRANGES::begin(__range), _CUDA_VRANGES::end(__range)) {} - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(__subrange_from_range<_Iter, _Sent, _Kind, _Range, _StoreSize>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__subrange_from_range<_Iter, _Sent, _Kind, _Range, _StoreSize>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_Range&& __range) : subrange(__range, _CUDA_VRANGES::size(__range)) {} - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(__subrange_from_range_size<_Iter, _Sent, _Kind, _Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__subrange_from_range_size<_Iter, _Sent, _Kind, _Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_Range&& __range, make_unsigned_t> __n) : subrange(_CUDA_VRANGES::begin(__range), _CUDA_VRANGES::end(__range), __n) {} # if (!defined(_CCCL_COMPILER_GCC) || _GNUC_VER >= 900) - _LIBCUDACXX_TEMPLATE(class _Pair) - _LIBCUDACXX_REQUIRES(__pair_like<_Pair> _LIBCUDACXX_AND __subrange_to_pair<_Iter, _Sent, _Kind, _Pair>) + _CCCL_TEMPLATE(class _Pair) + _CCCL_REQUIRES(__pair_like<_Pair> _CCCL_AND __subrange_to_pair<_Iter, _Sent, _Kind, _Pair>) _LIBCUDACXX_HIDE_FROM_ABI constexpr operator _Pair() const { return _Pair(__begin_, __end_); } # endif // !(_CCCL_COMPILER_GCC < 9) - _LIBCUDACXX_TEMPLATE(class _It = _Iter) - _LIBCUDACXX_REQUIRES(copyable<_It>) + _CCCL_TEMPLATE(class _It = _Iter) + _CCCL_REQUIRES(copyable<_It>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr _It begin() const { return __begin_; } - _LIBCUDACXX_TEMPLATE(class _It = _Iter) - _LIBCUDACXX_REQUIRES((!copyable<_It>) ) + _CCCL_TEMPLATE(class _It = _Iter) + _CCCL_REQUIRES((!copyable<_It>) ) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr _It begin() { return _CUDA_VSTD::move(__begin_); @@ -330,8 +330,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface> size() const { if constexpr (_StoreSize) @@ -347,8 +347,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface) + _CCCL_TEMPLATE(class _It = _Iter) + _CCCL_REQUIRES(forward_iterator<_It>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) const& { auto __tmp = *this; @@ -362,8 +362,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface) + _CCCL_TEMPLATE(class _It = _Iter) + _CCCL_REQUIRES(bidirectional_iterator<_It>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange prev(iter_difference_t<_Iter> __n = 1) const { auto __tmp = *this; @@ -396,17 +396,17 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface _LIBCUDACXX_AND sentinel_for<_Sent, _Iter>) +_CCCL_TEMPLATE(class _Iter, class _Sent) +_CCCL_REQUIRES(input_or_output_iterator<_Iter> _CCCL_AND sentinel_for<_Sent, _Iter>) _CCCL_HOST_DEVICE subrange(_Iter, _Sent) -> subrange<_Iter, _Sent>; -_LIBCUDACXX_TEMPLATE(class _Iter, class _Sent) -_LIBCUDACXX_REQUIRES(input_or_output_iterator<_Iter> _LIBCUDACXX_AND sentinel_for<_Sent, _Iter>) +_CCCL_TEMPLATE(class _Iter, class _Sent) +_CCCL_REQUIRES(input_or_output_iterator<_Iter> _CCCL_AND sentinel_for<_Sent, _Iter>) _CCCL_HOST_DEVICE subrange(_Iter, _Sent, make_unsigned_t>) -> subrange<_Iter, _Sent, subrange_kind::sized>; -_LIBCUDACXX_TEMPLATE(class _Range) -_LIBCUDACXX_REQUIRES(borrowed_range<_Range>) +_CCCL_TEMPLATE(class _Range) +_CCCL_REQUIRES(borrowed_range<_Range>) _CCCL_HOST_DEVICE subrange(_Range&&) -> subrange, sentinel_t<_Range>, @@ -414,14 +414,14 @@ _CCCL_HOST_DEVICE subrange(_Range&&) ? subrange_kind::sized : subrange_kind::unsized>; -_LIBCUDACXX_TEMPLATE(class _Range) -_LIBCUDACXX_REQUIRES(borrowed_range<_Range>) +_CCCL_TEMPLATE(class _Range) +_CCCL_REQUIRES(borrowed_range<_Range>) _CCCL_HOST_DEVICE subrange(_Range&&, make_unsigned_t>) -> subrange, sentinel_t<_Range>, subrange_kind::sized>; _LIBCUDACXX_END_NAMESPACE_RANGES_ABI -// Not _LIBCUDACXX_TEMPLATE because we need to forward declare them +// Not _CCCL_TEMPLATE because we need to forward declare them # if _CCCL_STD_VER >= 2020 template requires((_Index == 0) && copyable<_Iter>) || (_Index == 1) diff --git a/libcudacxx/include/cuda/std/__ranges/unwrap_end.h b/libcudacxx/include/cuda/std/__ranges/unwrap_end.h index 96d1a96b1fd..f134f141e8f 100644 --- a/libcudacxx/include/cuda/std/__ranges/unwrap_end.h +++ b/libcudacxx/include/cuda/std/__ranges/unwrap_end.h @@ -29,8 +29,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES #if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) -_LIBCUDACXX_TEMPLATE(class _Range) -_LIBCUDACXX_REQUIRES(forward_range<_Range>) +_CCCL_TEMPLATE(class _Range) +_CCCL_REQUIRES(forward_range<_Range>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator_t<_Range> __unwrap_end(_Range& __range) { if constexpr (common_range<_Range>) diff --git a/libcudacxx/include/cuda/std/__ranges/view_interface.h b/libcudacxx/include/cuda/std/__ranges/view_interface.h index 7b44aba63a9..5042770abde 100644 --- a/libcudacxx/include/cuda/std/__ranges/view_interface.h +++ b/libcudacxx/include/cuda/std/__ranges/view_interface.h @@ -73,104 +73,103 @@ class view_interface } public: - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range<_D2>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range<_D2>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty() { return _CUDA_VRANGES::begin(__derived()) == _CUDA_VRANGES::end(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty() const { return _CUDA_VRANGES::begin(__derived()) == _CUDA_VRANGES::end(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(__can_empty<_D2>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(__can_empty<_D2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit operator bool() { return !_CUDA_VRANGES::empty(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(__can_empty) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(__can_empty) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit operator bool() const { return !_CUDA_VRANGES::empty(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(contiguous_iterator>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(contiguous_iterator>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto data() { return _CUDA_VSTD::to_address(_CUDA_VRANGES::begin(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(range _LIBCUDACXX_AND contiguous_iterator>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(range _CCCL_AND contiguous_iterator>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto data() const { return _CUDA_VSTD::to_address(_CUDA_VRANGES::begin(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range<_D2> _LIBCUDACXX_AND sized_sentinel_for, iterator_t<_D2>>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range<_D2> _CCCL_AND sized_sentinel_for, iterator_t<_D2>>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto size() { return _CUDA_VSTD::__to_unsigned_like(_CUDA_VRANGES::end(__derived()) - _CUDA_VRANGES::begin(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES( - forward_range _LIBCUDACXX_AND sized_sentinel_for, iterator_t>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range _CCCL_AND sized_sentinel_for, iterator_t>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto size() const { return _CUDA_VSTD::__to_unsigned_like(_CUDA_VRANGES::end(__derived()) - _CUDA_VRANGES::begin(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range<_D2>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range<_D2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) front() { _CCCL_ASSERT(!empty(), "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); return *_CUDA_VRANGES::begin(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) front() const { _CCCL_ASSERT(!empty(), "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); return *_CUDA_VRANGES::begin(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(bidirectional_range<_D2> _LIBCUDACXX_AND common_range<_D2>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(bidirectional_range<_D2> _CCCL_AND common_range<_D2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) back() { _CCCL_ASSERT(!empty(), "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); return *_CUDA_VRANGES::prev(_CUDA_VRANGES::end(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(bidirectional_range _LIBCUDACXX_AND common_range) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(bidirectional_range _CCCL_AND common_range) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) back() const { _CCCL_ASSERT(!empty(), "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); return *_CUDA_VRANGES::prev(_CUDA_VRANGES::end(__derived())); } - _LIBCUDACXX_TEMPLATE(class _RARange = _Derived) - _LIBCUDACXX_REQUIRES(random_access_range<_RARange>) + _CCCL_TEMPLATE(class _RARange = _Derived) + _CCCL_REQUIRES(random_access_range<_RARange>) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) { return _CUDA_VRANGES::begin(__derived())[__index]; } - _LIBCUDACXX_TEMPLATE(class _RARange = const _Derived) - _LIBCUDACXX_REQUIRES(random_access_range<_RARange>) + _CCCL_TEMPLATE(class _RARange = const _Derived) + _CCCL_REQUIRES(random_access_range<_RARange>) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) const { return _CUDA_VRANGES::begin(__derived())[__index]; diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/optional b/libcudacxx/include/cuda/std/detail/libcxx/include/optional index b43e8dceeb0..6b5d9401556 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/optional +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/optional @@ -691,60 +691,54 @@ public: _CCCL_HIDE_FROM_ABI constexpr optional(optional&&) = default; _LIBCUDACXX_HIDE_FROM_ABI constexpr optional(nullopt_t) noexcept {} - _LIBCUDACXX_TEMPLATE(class _In_place_t, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_same, _In_place_t, in_place_t) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, value_type, _Args...)) + _CCCL_TEMPLATE(class _In_place_t, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_same, _In_place_t, in_place_t) + _CCCL_AND _CCCL_TRAIT(is_constructible, value_type, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(_In_place_t, _Args&&... __args) : __base(in_place, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, value_type, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, value_type, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args) : __base(in_place, __il, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up = value_type) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_U<_Tp, _Up> _LIBCUDACXX_AND __opt_is_implictly_constructible<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up = value_type) + _CCCL_REQUIRES(__opt_is_constructible_from_U<_Tp, _Up> _CCCL_AND __opt_is_implictly_constructible<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional(_Up&& __v) : __base(in_place, _CUDA_VSTD::forward<_Up>(__v)) {} - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_U<_Tp, _Up> _LIBCUDACXX_AND __opt_is_explictly_constructible<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_U<_Tp, _Up> _CCCL_AND __opt_is_explictly_constructible<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(_Up&& __v) : __base(in_place, _CUDA_VSTD::forward<_Up>(__v)) {} - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_implictly_constructible<_Tp, const _Up&>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_opt<_Tp, _Up> _CCCL_AND __opt_is_implictly_constructible<_Tp, const _Up&>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional(const optional<_Up>& __v) { this->__construct_from(__v); } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_explictly_constructible<_Tp, const _Up&>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_opt<_Tp, _Up> _CCCL_AND __opt_is_explictly_constructible<_Tp, const _Up&>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(const optional<_Up>& __v) { this->__construct_from(__v); } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_implictly_constructible<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_opt<_Tp, _Up> _CCCL_AND __opt_is_implictly_constructible<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional(optional<_Up>&& __v) { this->__construct_from(_CUDA_VSTD::move(__v)); } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_explictly_constructible<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_opt<_Tp, _Up> _CCCL_AND __opt_is_explictly_constructible<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(optional<_Up>&& __v) { this->__construct_from(_CUDA_VSTD::move(__v)); @@ -768,8 +762,8 @@ public: constexpr optional& operator=(const optional&) = default; constexpr optional& operator=(optional&&) = default; - _LIBCUDACXX_TEMPLATE(class _Up = value_type) - _LIBCUDACXX_REQUIRES(__opt_is_assignable_from_U<_Tp, _Up> _LIBCUDACXX_AND __opt_is_assignable<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up = value_type) + _CCCL_REQUIRES(__opt_is_assignable_from_U<_Tp, _Up> _CCCL_AND __opt_is_assignable<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional& operator=(_Up&& __v) { if (this->has_value()) @@ -783,16 +777,16 @@ public: return *this; } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES(__opt_is_assignable_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_assignable<_Tp, const _Up&>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_assignable_from_opt<_Tp, _Up> _CCCL_AND __opt_is_assignable<_Tp, const _Up&>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional& operator=(const optional<_Up>& __v) { this->__assign_from(__v); return *this; } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES(__opt_is_assignable_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_assignable<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_assignable_from_opt<_Tp, _Up> _CCCL_AND __opt_is_assignable<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional& operator=(optional<_Up>&& __v) { this->__assign_from(_CUDA_VSTD::move(__v)); @@ -1059,8 +1053,8 @@ public: return optional<_Up>(); } - _LIBCUDACXX_TEMPLATE(class _Func, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(invocable<_Func> _LIBCUDACXX_AND _CCCL_TRAIT(is_copy_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Func, class _Tp2 = _Tp) + _CCCL_REQUIRES(invocable<_Func> _CCCL_AND _CCCL_TRAIT(is_copy_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) const& { static_assert(_CCCL_TRAIT(is_same, remove_cvref_t>, optional), @@ -1072,8 +1066,8 @@ public: return _CUDA_VSTD::forward<_Func>(__f)(); } - _LIBCUDACXX_TEMPLATE(class _Func, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(invocable<_Func> _LIBCUDACXX_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Func, class _Tp2 = _Tp) + _CCCL_REQUIRES(invocable<_Func> _CCCL_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) && { static_assert(_CCCL_TRAIT(is_same, remove_cvref_t>, optional), diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/span b/libcudacxx/include/cuda/std/detail/libcxx/include/span index ab67136accb..7e3cfc1fd8e 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/span +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/span @@ -334,8 +334,8 @@ public: _CCCL_HIDE_FROM_ABI span& operator=(const span&) noexcept = default; # if defined(_CCCL_SPAN_USES_RANGES) - _LIBCUDACXX_TEMPLATE(class _It) - _LIBCUDACXX_REQUIRES(__span_compatible_iterator<_It, element_type>) + _CCCL_TEMPLATE(class _It) + _CCCL_REQUIRES(__span_compatible_iterator<_It, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit span(_It __first, size_type __count) : __data_{_CUDA_VSTD::to_address(__first)} { @@ -343,9 +343,8 @@ public: _CCCL_ASSERT(_Extent == __count, "size mismatch in span's constructor (iterator, len)"); } - _LIBCUDACXX_TEMPLATE(class _It, class _End) - _LIBCUDACXX_REQUIRES( - __span_compatible_iterator<_It, element_type> _LIBCUDACXX_AND __span_compatible_sentinel_for<_End, _It>) + _CCCL_TEMPLATE(class _It, class _End) + _CCCL_REQUIRES(__span_compatible_iterator<_It, element_type> _CCCL_AND __span_compatible_sentinel_for<_End, _It>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit span(_It __first, _End __last) : __data_{_CUDA_VSTD::to_address(__first)} { @@ -380,37 +379,37 @@ public: {} # endif // !_CCCL_COMPILER_NVRTC && !_CCCL_COMPILER_MSVC_2017 - _LIBCUDACXX_TEMPLATE(class _OtherElementType) - _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType) + _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(array<_OtherElementType, _Extent>& __arr) noexcept : __data_{__arr.data()} {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType) - _LIBCUDACXX_REQUIRES(__span_array_convertible) + _CCCL_TEMPLATE(class _OtherElementType) + _CCCL_REQUIRES(__span_array_convertible) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data_{__arr.data()} {} # if defined(_CCCL_SPAN_USES_RANGES) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(__span_compatible_range<_Range, element_type>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__span_compatible_range<_Range, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit span(_Range&& __r) : __data_{_CUDA_VRANGES::data(__r)} { _CCCL_ASSERT(_CUDA_VRANGES::size(__r) == _Extent, "size mismatch in span's constructor (range)"); } # else // ^^^ _CCCL_SPAN_USES_RANGES ^^^ / vvv !_CCCL_SPAN_USES_RANGES vvv - _LIBCUDACXX_TEMPLATE(class _Container) - _LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, _Tp>) + _CCCL_TEMPLATE(class _Container) + _CCCL_REQUIRES(__is_span_compatible_container<_Container, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_Container& __c) noexcept(noexcept(_CUDA_VSTD::data(__c))) : __data_{_CUDA_VSTD::data(__c)} { _CCCL_ASSERT(_Extent == _CUDA_VSTD::size(__c), "size mismatch in span's constructor (other span)"); } - _LIBCUDACXX_TEMPLATE(class _Container) - _LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, const _Tp>) + _CCCL_TEMPLATE(class _Container) + _CCCL_REQUIRES(__is_span_compatible_container<_Container, const _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const _Container& __c) noexcept(noexcept(_CUDA_VSTD::data(__c))) : __data_{_CUDA_VSTD::data(__c)} { @@ -418,15 +417,14 @@ public: } # endif // !_CCCL_SPAN_USES_RANGES - _LIBCUDACXX_TEMPLATE(class _OtherElementType, size_t _Extent2 = _Extent) - _LIBCUDACXX_REQUIRES((_Extent2 != dynamic_extent) - _LIBCUDACXX_AND __span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType, size_t _Extent2 = _Extent) + _CCCL_REQUIRES((_Extent2 != dynamic_extent) _CCCL_AND __span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const span<_OtherElementType, _Extent2>& __other) noexcept : __data_{__other.data()} {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType) - _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType) + _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit span(const span<_OtherElementType, dynamic_extent>& __other) noexcept : __data_{__other.data()} { @@ -583,16 +581,15 @@ public: _CCCL_HIDE_FROM_ABI span& operator=(const span&) noexcept = default; # if defined(_CCCL_SPAN_USES_RANGES) - _LIBCUDACXX_TEMPLATE(class _It) - _LIBCUDACXX_REQUIRES(__span_compatible_iterator<_It, element_type>) + _CCCL_TEMPLATE(class _It) + _CCCL_REQUIRES(__span_compatible_iterator<_It, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_It __first, size_type __count) : __data_{_CUDA_VSTD::to_address(__first)} , __size_{__count} {} - _LIBCUDACXX_TEMPLATE(class _It, class _End) - _LIBCUDACXX_REQUIRES( - __span_compatible_iterator<_It, element_type> _LIBCUDACXX_AND __span_compatible_sentinel_for<_End, _It>) + _CCCL_TEMPLATE(class _It, class _End) + _CCCL_REQUIRES(__span_compatible_iterator<_It, element_type> _CCCL_AND __span_compatible_sentinel_for<_End, _It>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_It __first, _End __last) : __data_(_CUDA_VSTD::to_address(__first)) , __size_(__last - __first) @@ -617,45 +614,45 @@ public: , __size_{_Sz} {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType, size_t _Sz) - _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType, size_t _Sz) + _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(array<_OtherElementType, _Sz>& __arr) noexcept : __data_{__arr.data()} , __size_{_Sz} {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType, size_t _Sz) - _LIBCUDACXX_REQUIRES(__span_array_convertible) + _CCCL_TEMPLATE(class _OtherElementType, size_t _Sz) + _CCCL_REQUIRES(__span_array_convertible) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data_{__arr.data()} , __size_{_Sz} {} # if defined(_CCCL_SPAN_USES_RANGES) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(__span_compatible_range<_Range, element_type>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__span_compatible_range<_Range, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_Range&& __r) : __data_(_CUDA_VRANGES::data(__r)) , __size_{_CUDA_VRANGES::size(__r)} {} # else // ^^^ _CCCL_SPAN_USES_RANGES ^^^ / vvv !_CCCL_SPAN_USES_RANGES vvv - _LIBCUDACXX_TEMPLATE(class _Container) - _LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, _Tp>) + _CCCL_TEMPLATE(class _Container) + _CCCL_REQUIRES(__is_span_compatible_container<_Container, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_Container& __c) : __data_{_CUDA_VSTD::data(__c)} , __size_{(size_type) _CUDA_VSTD::size(__c)} {} - _LIBCUDACXX_TEMPLATE(class _Container) - _LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, const _Tp>) + _CCCL_TEMPLATE(class _Container) + _CCCL_REQUIRES(__is_span_compatible_container<_Container, const _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const _Container& __c) : __data_{_CUDA_VSTD::data(__c)} , __size_{(size_type) _CUDA_VSTD::size(__c)} {} # endif // !_CCCL_SPAN_USES_RANGES - _LIBCUDACXX_TEMPLATE(class _OtherElementType, size_t _OtherExtent) - _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType, size_t _OtherExtent) + _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const span<_OtherElementType, _OtherExtent>& __other) noexcept : __data_{__other.data()} , __size_{__other.size()} @@ -793,8 +790,8 @@ _LIBCUDACXX_HIDE_FROM_ABI auto as_bytes(span<_Tp, _Extent> __s) noexcept return __s.__as_bytes(); } -_LIBCUDACXX_TEMPLATE(class _Tp, size_t _Extent) -_LIBCUDACXX_REQUIRES((!is_const<_Tp>::value)) +_CCCL_TEMPLATE(class _Tp, size_t _Extent) +_CCCL_REQUIRES((!is_const<_Tp>::value)) _LIBCUDACXX_HIDE_FROM_ABI auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept { return __s.__as_writable_bytes(); @@ -816,23 +813,23 @@ _CCCL_HOST_DEVICE span(const array<_Tp, _Sz>&) -> span; # if defined(_CCCL_SPAN_USES_RANGES) -_LIBCUDACXX_TEMPLATE(class _It, class _EndOrSize) -_LIBCUDACXX_REQUIRES(contiguous_iterator<_It>) +_CCCL_TEMPLATE(class _It, class _EndOrSize) +_CCCL_REQUIRES(contiguous_iterator<_It>) _CCCL_HOST_DEVICE span(_It, _EndOrSize) -> span>, __maybe_static_ext<_EndOrSize>>; -_LIBCUDACXX_TEMPLATE(class _Range) -_LIBCUDACXX_REQUIRES(_CUDA_VRANGES::contiguous_range<_Range>) +_CCCL_TEMPLATE(class _Range) +_CCCL_REQUIRES(_CUDA_VRANGES::contiguous_range<_Range>) _CCCL_HOST_DEVICE span(_Range&&) -> span>>; # else // ^^^ _CCCL_SPAN_USES_RANGES ^^^ / vvv !_CCCL_SPAN_USES_RANGES vvv -_LIBCUDACXX_TEMPLATE(class _Container) -_LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, typename _Container::value_type>) +_CCCL_TEMPLATE(class _Container) +_CCCL_REQUIRES(__is_span_compatible_container<_Container, typename _Container::value_type>) _CCCL_HOST_DEVICE span(_Container&) -> span; -_LIBCUDACXX_TEMPLATE(class _Container) -_LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, const typename _Container::value_type>) +_CCCL_TEMPLATE(class _Container) +_CCCL_REQUIRES(__is_span_compatible_container<_Container, const typename _Container::value_type>) _CCCL_HOST_DEVICE span(const _Container&) -> span; # endif // !_CCCL_SPAN_USES_RANGES diff --git a/libcudacxx/include/cuda/std/inplace_vector b/libcudacxx/include/cuda/std/inplace_vector index 16c14bdfcfa..73449b26188 100644 --- a/libcudacxx/include/cuda/std/inplace_vector +++ b/libcudacxx/include/cuda/std/inplace_vector @@ -230,8 +230,8 @@ protected: this->__size_ -= static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_default_constructible, _Tp)) - _LIBCUDACXX_REQUIRES(_IsNothrow) + _CCCL_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_default_constructible, _Tp)) + _CCCL_REQUIRES(_IsNothrow) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_value_construct(iterator __first, iterator __last) noexcept { iterator __idx = __first; @@ -242,8 +242,8 @@ protected: this->__size_ += static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_default_constructible, _Tp)) - _LIBCUDACXX_REQUIRES((!_IsNothrow)) + _CCCL_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_default_constructible, _Tp)) + _CCCL_REQUIRES((!_IsNothrow)) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_value_construct(iterator __first, iterator __last) { iterator __idx = __first; @@ -256,8 +256,8 @@ protected: this->__size_ += static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) - _LIBCUDACXX_REQUIRES(_IsNothrow) + _CCCL_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) + _CCCL_REQUIRES(_IsNothrow) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_fill(iterator __first, iterator __last, const _Tp& __value) noexcept { iterator __idx = __first; @@ -268,8 +268,8 @@ protected: this->__size_ += static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) - _LIBCUDACXX_REQUIRES((!_IsNothrow)) + _CCCL_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) + _CCCL_REQUIRES((!_IsNothrow)) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_fill(iterator __first, iterator __last, const _Tp& __value) { iterator __idx = __first; @@ -282,8 +282,8 @@ protected: this->__size_ += static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) - _LIBCUDACXX_REQUIRES(_IsNothrow) + _CCCL_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) + _CCCL_REQUIRES(_IsNothrow) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_copy(_Iter __first, _Iter __last, iterator __dest) noexcept { iterator __curr = __dest; @@ -294,8 +294,8 @@ protected: this->__size_ += static_cast<__size_type>(__curr - __dest); } - _LIBCUDACXX_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) - _LIBCUDACXX_REQUIRES((!_IsNothrow)) + _CCCL_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) + _CCCL_REQUIRES((!_IsNothrow)) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_copy(_Iter __first, _Iter __last, iterator __dest) { iterator __curr = __dest; @@ -308,8 +308,8 @@ protected: this->__size_ += static_cast<__size_type>(__curr - __dest); } - _LIBCUDACXX_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) - _LIBCUDACXX_REQUIRES(_IsNothrow) + _CCCL_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) + _CCCL_REQUIRES(_IsNothrow) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_move(_Iter __first, _Iter __last, iterator __dest) noexcept { iterator __curr = __dest; @@ -324,8 +324,8 @@ protected: this->__size_ += static_cast<__size_type>(__curr - __dest); } - _LIBCUDACXX_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) - _LIBCUDACXX_REQUIRES((!_IsNothrow)) + _CCCL_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) + _CCCL_REQUIRES((!_IsNothrow)) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_move(_Iter __first, _Iter __last, iterator __dest) { iterator __curr = __dest; @@ -758,9 +758,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES( - __is_cpp17_input_iterator<_Iter>::value _LIBCUDACXX_AND(!__is_cpp17_forward_iterator<_Iter>::value)) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value _CCCL_AND(!__is_cpp17_forward_iterator<_Iter>::value)) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(_Iter __first, _Iter __last) : __base() { @@ -770,8 +769,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(_Iter __first, _Iter __last) : __base() { @@ -802,9 +801,9 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) : __base() { @@ -816,9 +815,9 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND _CUDA_VRANGES::sized_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND _CUDA_VRANGES::sized_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) : __base() { @@ -834,9 +833,9 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND(!_CUDA_VRANGES::sized_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND(!_CUDA_VRANGES::sized_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) : __base() { @@ -898,9 +897,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES( - __is_cpp17_input_iterator<_Iter>::value _LIBCUDACXX_AND(!__is_cpp17_forward_iterator<_Iter>::value)) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value _CCCL_AND(!__is_cpp17_forward_iterator<_Iter>::value)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign(_Iter __first, _Iter __last) { iterator __end = this->end(); @@ -920,8 +918,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign(_Iter __first, _Iter __last) { const auto __count = static_cast(_CUDA_VSTD::distance(__first, __last)); @@ -964,9 +962,9 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) { auto __first = _CUDA_VRANGES::begin(__range); @@ -988,9 +986,9 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND _CUDA_VRANGES::sized_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND _CUDA_VRANGES::sized_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) { const auto __size = _CUDA_VRANGES::size(__range); @@ -1014,9 +1012,9 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND(!_CUDA_VRANGES::sized_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND(!_CUDA_VRANGES::sized_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) { const auto __first = _CUDA_VRANGES::begin(__range); @@ -1203,9 +1201,8 @@ public: return __first; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES( - __is_cpp17_input_iterator<_Iter>::value _LIBCUDACXX_AND(!__is_cpp17_forward_iterator<_Iter>::value)) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value _CCCL_AND(!__is_cpp17_forward_iterator<_Iter>::value)) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert(const_iterator __cpos, _Iter __first, _Iter __last) { // add all new elements to the back then rotate @@ -1220,8 +1217,8 @@ public: return __res; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert(const_iterator __cpos, _Iter __first, _Iter __last) { const auto __pos = static_cast(__cpos - this->cbegin()); @@ -1311,9 +1308,9 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __cpos, _Range&& __range) { // add all new elements to the back then rotate @@ -1330,18 +1327,17 @@ public: return __pos; } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND _CUDA_VRANGES::forward_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND _CUDA_VRANGES::forward_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __cpos, _Range&& __range) { auto __first = _CUDA_VRANGES::begin(__range); return insert(__cpos, __first, _CUDA_VRANGES::__unwrap_end(__range)); } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) { auto __first = _CUDA_VRANGES::begin(__range); @@ -1352,9 +1348,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND _CUDA_VRANGES::forward_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND _CUDA_VRANGES::forward_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) { auto __first = _CUDA_VRANGES::begin(__range); @@ -1457,9 +1452,9 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept(_CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) { @@ -1472,9 +1467,9 @@ public: return __first; } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND _CUDA_VRANGES::sized_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND _CUDA_VRANGES::sized_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept(_CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) { @@ -1488,9 +1483,9 @@ public: return __middle; } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND(!_CUDA_VRANGES::sized_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND(!_CUDA_VRANGES::sized_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept(_CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) { @@ -1627,8 +1622,8 @@ public: } _LIBCUDACXX_HIDE_FROM_ABI static constexpr void shrink_to_fit() noexcept {} - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_swappable, _Tp2) _LIBCUDACXX_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_swappable, _Tp2) _CCCL_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void swap(inplace_vector& __other) noexcept( _CCCL_TRAIT(is_nothrow_swappable, _Tp2) && _CCCL_TRAIT(is_nothrow_move_constructible, _Tp2)) { @@ -1646,8 +1641,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_swappable, _Tp2) _LIBCUDACXX_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_swappable, _Tp2) _CCCL_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr void swap(inplace_vector& __lhs, inplace_vector& __rhs) noexcept( _Capacity == 0 || (_CCCL_TRAIT(is_nothrow_swappable, _Tp2) && _CCCL_TRAIT(is_nothrow_move_constructible, _Tp2))) { @@ -1771,8 +1766,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(_Iter __first, _Iter __last) : __base() { @@ -1792,8 +1787,8 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) : __base() { @@ -1823,8 +1818,8 @@ public: return; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign(_Iter __first, _Iter __last) { if (__first != __last) @@ -1844,8 +1839,8 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) { if (_CUDA_VRANGES::begin(__range) != _CUDA_VRANGES::end(__range)) @@ -1981,8 +1976,8 @@ public: return nullptr; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert(const_iterator, _Iter __first, _Iter __last) { if (__first != __last) @@ -2002,8 +1997,8 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __cpos, _Range&& __range) { if (_CUDA_VRANGES::begin(__range) != _CUDA_VRANGES::end(__range)) @@ -2013,8 +2008,8 @@ public: return nullptr; } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) { if (_CUDA_VRANGES::begin(__range) != _CUDA_VRANGES::end(__range)) @@ -2067,8 +2062,8 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept { return _CUDA_VRANGES::begin(__range); diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/inheritance.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/inheritance.pass.cpp index 1a5fa15483e..b980031d024 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/inheritance.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/inheritance.pass.cpp @@ -41,13 +41,12 @@ struct async_resource_base return false; } - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES((!cuda::property_with_value) - && _CUDA_VSTD::__is_included_in_v) // + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) // friend void get_property(const async_resource_base&, Property) noexcept {} - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) // + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) // friend typename Property::value_type get_property(const async_resource_base& res, Property) noexcept { return 42; diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/properties.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/properties.pass.cpp index 9568c00a8db..ab9d80ef296 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/properties.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/properties.pass.cpp @@ -53,29 +53,29 @@ static_assert( == (2 * sizeof(void*)), ""); -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES((!cuda::property_with_value) ) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES((!cuda::property_with_value) ) // int InvokeIfWithValue(const Ref& ref) { return -1; } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES(cuda::property_with_value) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES(cuda::property_with_value) // typename Property::value_type InvokeIfWithValue(const Ref& ref) { return get_property(ref, Property{}); } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES(cuda::property_with_value) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES(cuda::property_with_value) // int InvokeIfWithoutValue(const Ref& ref) { return -1; } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES((!cuda::property_with_value) ) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES((!cuda::property_with_value) ) // int InvokeIfWithoutValue(const Ref& ref) { get_property(ref, Property{}); diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/types.h b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/types.h index fd738dd8724..3d36c6a96d1 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/types.h +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/types.h @@ -58,12 +58,12 @@ struct async_resource int _val = 0; - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) friend void get_property(const async_resource&, Property) noexcept {} - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) friend typename Property::value_type get_property(const async_resource& res, Property) noexcept { return static_cast(res._val); diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/inheritance.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/inheritance.pass.cpp index 4ad9d0cc34a..4ddc1f1d7b7 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/inheritance.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/inheritance.pass.cpp @@ -37,13 +37,12 @@ struct resource_base return false; } - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES((!cuda::property_with_value) - && _CUDA_VSTD::__is_included_in_v) // + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) // friend void get_property(const resource_base&, Property) noexcept {} - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) // + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) // friend typename Property::value_type get_property(const resource_base& res, Property) noexcept { return 42; diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/properties.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/properties.pass.cpp index 5b7e1d82ce3..2576e480f8d 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/properties.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/properties.pass.cpp @@ -49,29 +49,29 @@ static_assert( == (2 * sizeof(void*)), ""); -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES((!cuda::property_with_value) ) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES((!cuda::property_with_value) ) // int InvokeIfWithValue(const Ref& ref) { return -1; } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES(cuda::property_with_value) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES(cuda::property_with_value) // typename Property::value_type InvokeIfWithValue(const Ref& ref) { return get_property(ref, Property{}); } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES(cuda::property_with_value) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES(cuda::property_with_value) // int InvokeIfWithoutValue(const Ref& ref) { return -1; } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES((!cuda::property_with_value) ) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES((!cuda::property_with_value) ) // int InvokeIfWithoutValue(const Ref& ref) { get_property(ref, Property{}); diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/types.h b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/types.h index 30a49ec931b..aa08be29133 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/types.h +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/types.h @@ -58,12 +58,12 @@ struct resource int _val = 0; - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) friend void get_property(const resource&, Property) noexcept {} - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) friend typename Property::value_type get_property(const resource& res, Property) noexcept { return static_cast(res._val); diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp index 17689aca794..a76fb02b07a 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp @@ -43,8 +43,8 @@ __host__ __device__ constexpr bool models_totally_ordered() noexcept #else -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES(cuda::std::totally_ordered) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES(cuda::std::totally_ordered) __host__ __device__ constexpr bool models_totally_ordered() noexcept { return true; diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp index 84aabb999ff..a9697a050be 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp @@ -68,8 +68,8 @@ __host__ __device__ void CheckIsConvertibleButNotConvertibleTo() #if TEST_STD_VER > 2017 template #else -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES((!(cuda::std::same_as || cuda::std::same_as) )) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES((!(cuda::std::same_as || cuda::std::same_as) )) #endif __host__ __device__ constexpr void CommonlyNotConvertibleTo() { @@ -84,8 +84,8 @@ __host__ __device__ constexpr void CommonlyNotConvertibleTo() CheckNotConvertibleTo(); } -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES(cuda::std::same_as) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES(cuda::std::same_as) __host__ __device__ constexpr void CommonlyNotConvertibleTo() { CheckNotConvertibleTo(); @@ -98,8 +98,8 @@ __host__ __device__ constexpr void CommonlyNotConvertibleTo() CheckConvertibleTo(); } -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES(cuda::std::same_as) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES(cuda::std::same_as) __host__ __device__ constexpr void CommonlyNotConvertibleTo() { CheckNotConvertibleTo(); diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.same/same_as.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.same/same_as.pass.cpp index f5226241307..d39f941b2bb 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.same/same_as.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.same/same_as.pass.cpp @@ -137,13 +137,13 @@ __host__ __device__ void CheckNotSameAs() #if TEST_STD_VER > 2017 // Checks subsumption works as intended -_LIBCUDACXX_TEMPLATE(class T, class U) -_LIBCUDACXX_REQUIRES(same_as) +_CCCL_TEMPLATE(class T, class U) +_CCCL_REQUIRES(same_as) __host__ __device__ void SubsumptionTest(); // clang-format off -_LIBCUDACXX_TEMPLATE(class T, class U) - _LIBCUDACXX_REQUIRES( same_as && true) +_CCCL_TEMPLATE(class T, class U) + _CCCL_REQUIRES( same_as && true) __host__ __device__ int SubsumptionTest(); // clang-format on diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp index e090eb0b5b5..7a9b004c5d2 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp @@ -35,8 +35,8 @@ struct expected // clang-format off // Checks [concept.swappable]/2.1 -_LIBCUDACXX_TEMPLATE(class T, class U) - _LIBCUDACXX_REQUIRES( cuda::std::same_as, cuda::std::remove_cvref_t > && +_CCCL_TEMPLATE(class T, class U) + _CCCL_REQUIRES( cuda::std::same_as, cuda::std::remove_cvref_t > && swappable >) // __host__ __device__ constexpr bool check_swap_21(T&& x, U&& y) { expected > const e{y, x}; @@ -45,8 +45,8 @@ __host__ __device__ constexpr bool check_swap_21(T&& x, U&& y) { } // Checks [concept.swappable]/2.2 -_LIBCUDACXX_TEMPLATE(class T, cuda::std::size_t N) - _LIBCUDACXX_REQUIRES( swappable) +_CCCL_TEMPLATE(class T, cuda::std::size_t N) + _CCCL_REQUIRES( swappable) __host__ __device__ constexpr bool check_swap_22(T (&x)[N], T (&y)[N]) { expected e{}; for (cuda::std::size_t i = 0; i < N; ++i) { @@ -65,8 +65,8 @@ __host__ __device__ constexpr bool check_swap_22(T (&x)[N], T (&y)[N]) { } // Checks [concept.swappable]/2.3 -_LIBCUDACXX_TEMPLATE(class T) - _LIBCUDACXX_REQUIRES( swappable && cuda::std::copy_constructible >) +_CCCL_TEMPLATE(class T) + _CCCL_REQUIRES( swappable && cuda::std::copy_constructible >) __host__ __device__ constexpr bool check_swap_23(T x, T y) { expected > const e{y, x}; cuda::std::ranges::swap(x, y); diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp index e18047bf86a..5e080dd9b61 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp @@ -579,15 +579,15 @@ static_assert(!check_swappable_with(), ""); namespace LWG3175 { // Example taken directly from [concept.swappable] -_LIBCUDACXX_TEMPLATE(class T, class U) -_LIBCUDACXX_REQUIRES(swappable_with) +_CCCL_TEMPLATE(class T, class U) +_CCCL_REQUIRES(swappable_with) __host__ __device__ constexpr void value_swap(T&& t, U&& u) { cuda::std::ranges::swap(cuda::std::forward(t), cuda::std::forward(u)); } -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES(swappable) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES(swappable) __host__ __device__ constexpr void lv_swap(T& t1, T& t2) { cuda::std::ranges::swap(t1, t2); diff --git a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/foo_customizations.hpp b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/foo_customizations.hpp index 809ae51f42c..9603b4bc2e5 100644 --- a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/foo_customizations.hpp +++ b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/foo_customizations.hpp @@ -92,8 +92,8 @@ class layout_foo::mapping : __extents(__exts) {} - _LIBCUDACXX_TEMPLATE(class OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) + _CCCL_TEMPLATE(class OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((!cuda::std::is_convertible::value)) // needs two () due to // comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -106,8 +106,8 @@ class layout_foo::mapping */ } - _LIBCUDACXX_TEMPLATE(class OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) + _CCCL_TEMPLATE(class OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((!cuda::std::is_convertible::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -115,9 +115,8 @@ class layout_foo::mapping : __extents(other.extents()) {} - _LIBCUDACXX_TEMPLATE(class OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents) - && (extents_type::rank() <= 1)) + _CCCL_TEMPLATE(class OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents) && (extents_type::rank() <= 1)) __MDSPAN_CONDITIONAL_EXPLICIT((!cuda::std::is_convertible::value)) // needs two () due to // comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -125,8 +124,8 @@ class layout_foo::mapping : __extents(other.extents()) {} - _LIBCUDACXX_TEMPLATE(class OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) + _CCCL_TEMPLATE(class OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((extents_type::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( cuda::std::layout_stride::mapping const& other) // NOLINT(google-explicit-constructor) diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp index 41edbcedd00..6e5c64f524f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp @@ -73,8 +73,8 @@ static_assert(!canCstrFromExpected, ""); template struct CtorFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ explicit CtorFrom(int); __host__ __device__ explicit CtorFrom(T); @@ -100,8 +100,8 @@ static_assert(!canCstrFromExpected const& template struct ConvertFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ ConvertFrom(int); __host__ __device__ ConvertFrom(T); diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp index f8aa967c410..e29769a45d3 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp @@ -74,8 +74,8 @@ static_assert(!canCstrFromExpected, ""); template struct CtorFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ explicit CtorFrom(int); __host__ __device__ explicit CtorFrom(T); template @@ -100,8 +100,8 @@ static_assert(!canCstrFromExpected const& template struct ConvertFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ ConvertFrom(int); __host__ __device__ ConvertFrom(T); template diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp index 306489d4d14..01f1e49b58f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp @@ -73,8 +73,8 @@ struct Data int vec_[N] = {}; cuda::std::tuple tuple_; - _LIBCUDACXX_TEMPLATE(class... Us) - _LIBCUDACXX_REQUIRES(cuda::std::is_constructible, Us&&...>::value) + _CCCL_TEMPLATE(class... Us) + _CCCL_REQUIRES(cuda::std::is_constructible, Us&&...>::value) __host__ __device__ constexpr Data(cuda::std::initializer_list il, Us&&... us) : tuple_(cuda::std::forward(us)...) { diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp index 47ec39c0b33..beeb1c0d439 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp @@ -74,8 +74,8 @@ struct Data int vec_[N]{}; cuda::std::tuple tuple_; - _LIBCUDACXX_TEMPLATE(class... Us) - _LIBCUDACXX_REQUIRES(cuda::std::is_constructible, Us&&...>::value) + _CCCL_TEMPLATE(class... Us) + _CCCL_REQUIRES(cuda::std::is_constructible, Us&&...>::value) __host__ __device__ constexpr Data(cuda::std::initializer_list il, Us&&... us) : tuple_(cuda::std::forward(us)...) { diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp index 6c1429a3267..e1ac6bee998 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp @@ -60,8 +60,8 @@ static_assert(!canCstrFromExpected, ""); template struct CtorFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ explicit CtorFrom(int); __host__ __device__ explicit CtorFrom(T); template diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp index e4798b3e40f..86508312c98 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp @@ -61,8 +61,8 @@ static_assert(!canCstrFromExpected, ""); template struct CtorFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ explicit CtorFrom(int); __host__ __device__ explicit CtorFrom(T); template diff --git a/libcudacxx/test/support/test_iterators.h b/libcudacxx/test/support/test_iterators.h index 8d5c92b1e6d..3356d9b500e 100644 --- a/libcudacxx/test/support/test_iterators.h +++ b/libcudacxx/test/support/test_iterators.h @@ -1669,25 +1669,25 @@ struct Proxy Proxy(const Proxy&) = default; - _LIBCUDACXX_TEMPLATE(class U) - _LIBCUDACXX_REQUIRES(cuda::std::constructible_from) + _CCCL_TEMPLATE(class U) + _CCCL_REQUIRES(cuda::std::constructible_from) __host__ __device__ constexpr Proxy(U&& u) : data{cuda::std::forward(u)} {} // This constructor covers conversion from cvref of Proxy, including non-const/const versions of copy/move // constructor - _LIBCUDACXX_TEMPLATE(class Other) - _LIBCUDACXX_REQUIRES((IsProxy> - && cuda::std::constructible_from().getData())>) ) + _CCCL_TEMPLATE(class Other) + _CCCL_REQUIRES((IsProxy> + && cuda::std::constructible_from().getData())>) ) __host__ __device__ constexpr Proxy(Other&& other) : data{cuda::std::forward(other).getData()} {} - _LIBCUDACXX_TEMPLATE(class Other) - _LIBCUDACXX_REQUIRES((IsProxy> - && cuda::std::assignable_from, - decltype(cuda::std::declval().getData())>) ) + _CCCL_TEMPLATE(class Other) + _CCCL_REQUIRES((IsProxy> + && cuda::std::assignable_from, + decltype(cuda::std::declval().getData())>) ) __host__ __device__ constexpr Proxy& operator=(Other&& other) { data = cuda::std::forward(other).getData(); @@ -1699,10 +1699,10 @@ struct Proxy # endif // TEST_COMPILER_MSVC // const assignment required to make ProxyIterator model cuda::std::indirectly_writable - _LIBCUDACXX_TEMPLATE(class Other) - _LIBCUDACXX_REQUIRES((IsProxy> - && cuda::std::assignable_from, - decltype(cuda::std::declval().getData())>) ) + _CCCL_TEMPLATE(class Other) + _CCCL_REQUIRES((IsProxy> + && cuda::std::assignable_from, + decltype(cuda::std::declval().getData())>) ) __host__ __device__ constexpr const Proxy& operator=(Other&& other) const { data = cuda::std::forward(other).getData(); @@ -1726,8 +1726,8 @@ struct Proxy requires(cuda::std::equality_comparable && !cuda::std::is_reference_v) = default; # else - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((cuda::std::equality_comparable && !cuda::std::is_reference_v) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((cuda::std::equality_comparable && !cuda::std::is_reference_v) ) __host__ __device__ friend constexpr bool operator==(const Proxy& lhs, const Proxy& rhs) { return lhs.data == rhs.data; @@ -1736,8 +1736,8 @@ struct Proxy // Helps compare e.g. `Proxy` and `Proxy`. Note that the default equality comparison operator is deleted // when `T` is a reference type. - _LIBCUDACXX_TEMPLATE(class U) - _LIBCUDACXX_REQUIRES((cuda::std::equality_comparable_with, cuda::std::decay_t>) ) + _CCCL_TEMPLATE(class U) + _CCCL_REQUIRES((cuda::std::equality_comparable_with, cuda::std::decay_t>) ) __host__ __device__ friend constexpr bool operator==(const Proxy& lhs, const Proxy& rhs) { return lhs.data == rhs.data; @@ -1838,8 +1838,8 @@ struct ProxyIterator : ProxyIteratorBase : base_{cuda::std::move(base)} {} - _LIBCUDACXX_TEMPLATE(class T) - _LIBCUDACXX_REQUIRES(cuda::std::constructible_from) + _CCCL_TEMPLATE(class T) + _CCCL_REQUIRES(cuda::std::constructible_from) __host__ __device__ constexpr ProxyIterator(T&& t) : base_{cuda::std::forward(t)} {} @@ -1884,16 +1884,16 @@ struct ProxyIterator : ProxyIteratorBase ++*this; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::equality_comparable) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::equality_comparable) __host__ __device__ friend constexpr bool operator==(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ == y.base_; } // to satisfy forward_iterator - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::forward_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::forward_iterator) __host__ __device__ constexpr ProxyIterator operator++(int) { auto tmp = *this; @@ -1902,16 +1902,16 @@ struct ProxyIterator : ProxyIteratorBase } // to satisfy bidirectional_iterator - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::bidirectional_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::bidirectional_iterator) __host__ __device__ constexpr ProxyIterator& operator--() { --base_; return *this; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::bidirectional_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::bidirectional_iterator) __host__ __device__ constexpr ProxyIterator operator--(int) { auto tmp = *this; @@ -1920,89 +1920,89 @@ struct ProxyIterator : ProxyIteratorBase } // to satisfy random_access_iterator - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ constexpr ProxyIterator& operator+=(difference_type n) { base_ += n; return *this; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ constexpr ProxyIterator& operator-=(difference_type n) { base_ -= n; return *this; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ constexpr Proxy> operator[](difference_type n) const { return {base_[n]}; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr bool operator<(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ < y.base_; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr bool operator>(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ > y.base_; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr bool operator<=(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ <= y.base_; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr bool operator>=(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ >= y.base_; } # ifndef TEST_HAS_NO_SPACESHIP_OPERATOR - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator&& cuda::std::three_way_comparable) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator&& cuda::std::three_way_comparable) __host__ __device__ friend constexpr auto operator<=>(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ <=> y.base_; } # endif // TEST_HAS_NO_SPACESHIP_OPERATOR - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr ProxyIterator operator+(const ProxyIterator& x, difference_type n) { return ProxyIterator{x.base_ + n}; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr ProxyIterator operator+(difference_type n, const ProxyIterator& x) { return ProxyIterator{n + x.base_}; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr ProxyIterator operator-(const ProxyIterator& x, difference_type n) { return ProxyIterator{x.base_ - n}; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr difference_type operator-(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ - y.base_; @@ -2023,8 +2023,8 @@ struct ProxySentinel : base_{cuda::std::move(base)} {} - _LIBCUDACXX_TEMPLATE(class Base) - _LIBCUDACXX_REQUIRES(cuda::std::equality_comparable_with) + _CCCL_TEMPLATE(class Base) + _CCCL_REQUIRES(cuda::std::equality_comparable_with) __host__ __device__ friend constexpr bool operator==(const ProxyIterator& p, const ProxySentinel& sent) { return p.base_ == sent.base_; From 1a424d64b4ac1826f771c87c0b21e794714e1235 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 19:05:23 +0100 Subject: [PATCH 14/29] Just avoid the whole warning entirely and let the optimizer do the thing --- libcudacxx/include/cuda/std/__utility/cmp.h | 45 ++++++++----------- .../intcmp.cmp_equal/cmp_equal.pass.cpp | 4 +- .../intcmp.cmp_greater/cmp_greater.pass.cpp | 4 +- .../cmp_greater_equal.pass.cpp | 4 +- .../intcmp.cmp_less/cmp_less.pass.cpp | 4 +- .../cmp_less_equal.pass.cpp | 4 +- .../cmp_not_equal.pass.cpp | 4 +- .../utility/utility.intcmp/intcmp.fail.cpp | 2 - .../intcmp.in_range/in_range.pass.cpp | 4 +- 9 files changed, 32 insertions(+), 43 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 331b1265ebe..b5361f4a7ed 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -36,23 +36,6 @@ _CCCL_PUSH_MACROS _LIBCUDACXX_BEGIN_NAMESPACE_STD -#if _CCCL_STD_VER >= 2014 - -_CCCL_DIAG_PUSH - -// Suppress NVHPC's warnings about signed/unsigned comparisons when -Wsign-compare is specified -// TODO: find out the warning number -// _CCCL_DIAG_SUPPRESS_NVHPC() - -// Suppress MSVC's warnings about signed/unsigned comparisons -// C4018: 'token' : signed/unsigned mismatch -// C4127: conditional expression is constant -// C4389: 'equality-operator' : signed/unsigned mismatch -_CCCL_DIAG_SUPPRESS_MSVC(4018 4127 4389) - -// pointless comparison of unsigned integer with zero -_CCCL_NV_DIAG_SUPPRESS(186) - template using __is_same_as_any = __fold_or<_CCCL_TRAIT(is_same, _Tp, _Up)...>; @@ -64,14 +47,14 @@ struct __is_safe_integral_cmp char, char16_t, char32_t -# ifndef _LIBCUDACXX_NO_HAS_CHAR8_T +#ifndef _LIBCUDACXX_NO_HAS_CHAR8_T , char8_t -# endif // _LIBCUDACXX_NO_HAS_CHAR8_T -# ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS +#endif // _LIBCUDACXX_NO_HAS_CHAR8_T +#ifndef _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS , wchar_t -# endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS +#endif // _LIBCUDACXX_HAS_NO_WIDE_CHARACTERS >::value> {}; @@ -79,6 +62,7 @@ _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) _LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { +#if _CCCL_STD_VER >= 2017 _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) { return __t == __u; @@ -91,6 +75,12 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); } +#else // ^^^ C++17 ^^^ / vvv C++14 vvv + return ((_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) + ? (__t == __u) + : (_CCCL_TRAIT(is_signed, _Tp) ? (__t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u) + : (__u < 0 ? false : __t == make_unsigned_t<_Up>(__u)))); +#endif // _CCCL_STD_VER <= 2014 } _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) @@ -104,6 +94,7 @@ _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) _LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { +#if _CCCL_STD_VER >= 2017 _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) { return __t < __u; @@ -116,6 +107,12 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); } +#else // ^^^ C++17 ^^^ / vvv C++14 vvv + return ((_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) + ? (__t < __u) + : (_CCCL_TRAIT(is_signed, _Tp) ? (__t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u) + : (__u < 0 ? false : __t < make_unsigned_t<_Up>(__u)))); +#endif // _CCCL_STD_VER <= 2014 } _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) @@ -147,12 +144,6 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept && _CUDA_VSTD::cmp_greater_equal(__u, numeric_limits<_Tp>::min()); } -_CCCL_NV_DIAG_DEFAULT(186) - -_CCCL_DIAG_POP - -#endif // _CCCL_STD_VER >= 2014 - _LIBCUDACXX_END_NAMESPACE_STD _CCCL_POP_MACROS diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp index dd1ee4f1fc3..082e013bd7d 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp @@ -7,8 +7,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++11 - // // template @@ -112,6 +110,8 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_equal(0, 0)); test(); +#if TEST_STD_VER >= 2014 static_assert(test(), ""); +#endif // TEST_STD_VER >= 2014 return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp index 1eccf50c1e7..593bbe10c4e 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++11 - // // constexpr bool cmp_greater(T t, U u) noexcept; @@ -102,6 +100,8 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_greater(1, 0)); test(); +#if TEST_STD_VER >= 2014 static_assert(test(), ""); +#endif // TEST_STD_VER >= 2014 return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp index 0bcb3451b16..56f2d200473 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++11 - // // constexpr bool cmp_greater_equal(T t, U u) noexcept; @@ -104,6 +102,8 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_greater_equal(1, 0)); test(); +#if TEST_STD_VER >= 2014 static_assert(test(), ""); +#endif // TEST_STD_VER >= 2014 return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp index 981af709bdf..7d974824e7e 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++11 - // // template @@ -103,6 +101,8 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_less(0, 1)); test(); +#if TEST_STD_VER >= 2014 static_assert(test(), ""); +#endif // TEST_STD_VER >= 2014 return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp index 0f9574cddc7..23a226112c4 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++11 - // // constexpr bool cmp_less_equal(T t, U u) noexcept; @@ -103,6 +101,8 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_less_equal(0, 1)); test(); +#if TEST_STD_VER >= 2014 static_assert(test(), ""); +#endif // TEST_STD_VER >= 2014 return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp index 65d37e016f5..eda5cc037b0 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++11 - // // template @@ -110,6 +108,8 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::cmp_not_equal(0, 0)); test(); +#if TEST_STD_VER >= 2014 static_assert(test(), ""); +#endif // TEST_STD_VER >= 2014 return 0; } diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp index 43f74d2fbbc..6cd15e96236 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++11 - // // template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp index 36f9f89ba6f..85c233ad299 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp @@ -6,8 +6,6 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++11 - // // template @@ -78,6 +76,8 @@ int main(int, char**) { ASSERT_NOEXCEPT(cuda::std::in_range(-1)); test(); +#if TEST_STD_VER >= 2014 static_assert(test(), ""); +#endif // TEST_STD_VER >= 2014 return 0; } From 40988e86b86c983c0e149f085ccb77c688b19902 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 19:21:47 +0100 Subject: [PATCH 15/29] Make it work in C++11 --- libcudacxx/include/cuda/std/__utility/cmp.h | 28 +++++++++---------- .../intcmp.cmp_equal/cmp_equal.pass.cpp | 10 +++---- .../intcmp.cmp_greater/cmp_greater.pass.cpp | 14 +++++----- .../cmp_greater_equal.pass.cpp | 14 +++++----- .../intcmp.cmp_less/cmp_less.pass.cpp | 14 +++++----- .../cmp_less_equal.pass.cpp | 14 +++++----- .../cmp_not_equal.pass.cpp | 16 +++++------ .../utility/utility.intcmp/intcmp.fail.cpp | 6 ++-- .../intcmp.in_range/in_range.pass.cpp | 8 +++--- 9 files changed, 62 insertions(+), 62 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index b5361f4a7ed..a207c08571a 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -58,8 +58,8 @@ struct __is_safe_integral_cmp >::value> {}; -_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) -_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) +_CCCL_TEMPLATE(class _Tp, class _Up) +_CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { #if _CCCL_STD_VER >= 2017 @@ -83,15 +83,15 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept #endif // _CCCL_STD_VER <= 2014 } -_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) -_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) +_CCCL_TEMPLATE(class _Tp, class _Up) +_CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_not_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_equal(__t, __u); } -_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) -_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) +_CCCL_TEMPLATE(class _Tp, class _Up) +_CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { #if _CCCL_STD_VER >= 2017 @@ -115,29 +115,29 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept #endif // _CCCL_STD_VER <= 2014 } -_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) -_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) +_CCCL_TEMPLATE(class _Tp, class _Up) +_CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_greater(_Tp __t, _Up __u) noexcept { return _CUDA_VSTD::cmp_less(__u, __t); } -_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) -_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) +_CCCL_TEMPLATE(class _Tp, class _Up) +_CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_greater(__t, __u); } -_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) -_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) +_CCCL_TEMPLATE(class _Tp, class _Up) +_CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_greater_equal(_Tp __t, _Up __u) noexcept { return !_CUDA_VSTD::cmp_less(__t, __u); } -_LIBCUDACXX_TEMPLATE(class _Tp, class _Up) -_LIBCUDACXX_REQUIRES(__is_safe_integral_cmp<_Tp>::value _LIBCUDACXX_AND __is_safe_integral_cmp<_Up>::value) +_CCCL_TEMPLATE(class _Tp, class _Up) +_CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept { return _CUDA_VSTD::cmp_less_equal(__u, numeric_limits<_Tp>::max()) diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp index 082e013bd7d..97fb3d26cc2 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp @@ -24,11 +24,11 @@ struct Tuple { T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); - T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; + T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; }; template -__host__ __device__ constexpr void test1() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test1() { constexpr Tuple tup{}; assert(cuda::std::cmp_equal(T(0), T(0))); @@ -53,7 +53,7 @@ __host__ __device__ constexpr void test1() } template -__host__ __device__ constexpr void test2() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test2() { constexpr Tuple ttup{}; constexpr Tuple utup{}; @@ -68,7 +68,7 @@ __host__ __device__ constexpr void test2() } template -__host__ __device__ constexpr void test() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test() { test1(); #ifndef TEST_HAS_NO_INT128_T @@ -87,7 +87,7 @@ __host__ __device__ constexpr void test() test2(); } -__host__ __device__ constexpr bool test() +__host__ __device__ TEST_CONSTEXPR_CXX14 bool test() { #ifndef TEST_HAS_NO_INT128_T test<__int128_t>(); diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp index 593bbe10c4e..18d33d0960d 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp @@ -22,11 +22,11 @@ struct Tuple { T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); - T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; + T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; }; template -__host__ __device__ constexpr void test1() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test1() { constexpr Tuple tup{}; assert(!cuda::std::cmp_greater(T(0), T(1))); @@ -44,21 +44,21 @@ __host__ __device__ constexpr void test1() assert(cuda::std::cmp_greater(tup.max, 1)); assert(cuda::std::cmp_greater(1, tup.min)); assert(!cuda::std::cmp_greater(T(-1), T(-1))); - assert(cuda::std::cmp_greater(-2, tup.min) == cuda::std::is_signed_v); - assert(!cuda::std::cmp_greater(tup.min, -2) == cuda::std::is_signed_v); + assert(cuda::std::cmp_greater(-2, tup.min) == cuda::std::is_signed::value); + assert(!cuda::std::cmp_greater(tup.min, -2) == cuda::std::is_signed::value); assert(!cuda::std::cmp_greater(-2, tup.max)); assert(cuda::std::cmp_greater(tup.max, -2)); } template -__host__ __device__ constexpr void test2() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test2() { assert(!cuda::std::cmp_greater(T(0), U(1))); assert(cuda::std::cmp_greater(T(1), U(0))); } template -__host__ __device__ constexpr void test() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test() { test1(); #ifndef TEST_HAS_NO_INT128_T @@ -77,7 +77,7 @@ __host__ __device__ constexpr void test() test2(); } -__host__ __device__ constexpr bool test() +__host__ __device__ TEST_CONSTEXPR_CXX14 bool test() { #ifndef TEST_HAS_NO_INT128_T test<__int128_t>(); diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp index 56f2d200473..2411ecbc79c 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp @@ -22,11 +22,11 @@ struct Tuple { T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); - T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; + T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; }; template -__host__ __device__ constexpr void test1() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test1() { constexpr Tuple tup{}; assert(!cuda::std::cmp_greater_equal(T(0), T(1))); @@ -44,14 +44,14 @@ __host__ __device__ constexpr void test1() assert(cuda::std::cmp_greater_equal(tup.max, 1)); assert(cuda::std::cmp_greater_equal(1, tup.min)); assert(cuda::std::cmp_greater_equal(T(-1), T(-1))); - assert(cuda::std::cmp_greater_equal(-2, tup.min) == cuda::std::is_signed_v); - assert(cuda::std::cmp_greater_equal(tup.min, -2) == cuda::std::is_unsigned_v); + assert(cuda::std::cmp_greater_equal(-2, tup.min) == cuda::std::is_signed::value); + assert(cuda::std::cmp_greater_equal(tup.min, -2) == cuda::std::is_unsigned::value); assert(!cuda::std::cmp_greater_equal(-2, tup.max)); assert(cuda::std::cmp_greater_equal(tup.max, -2)); } template -__host__ __device__ constexpr void test2() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test2() { assert(!cuda::std::cmp_greater_equal(T(0), U(1))); assert(cuda::std::cmp_greater_equal(T(1), U(0))); @@ -60,7 +60,7 @@ __host__ __device__ constexpr void test2() } template -__host__ __device__ constexpr void test() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test() { test1(); #ifndef TEST_HAS_NO_INT128_T @@ -79,7 +79,7 @@ __host__ __device__ constexpr void test() test2(); } -__host__ __device__ constexpr bool test() +__host__ __device__ TEST_CONSTEXPR_CXX14 bool test() { #ifndef TEST_HAS_NO_INT128_T test<__int128_t>(); diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp index 7d974824e7e..bce287402a2 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp @@ -23,11 +23,11 @@ struct Tuple { T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); - T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; + T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; }; template -__host__ __device__ constexpr void test1() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test1() { constexpr Tuple tup{}; assert(cuda::std::cmp_less(T(0), T(1))); @@ -45,21 +45,21 @@ __host__ __device__ constexpr void test1() assert(!cuda::std::cmp_less(tup.max, 1)); assert(!cuda::std::cmp_less(1, tup.min)); assert(!cuda::std::cmp_less(T(-1), T(-1))); - assert(!cuda::std::cmp_less(-2, tup.min) == cuda::std::is_signed_v); - assert(cuda::std::cmp_less(tup.min, -2) == cuda::std::is_signed_v); + assert(!cuda::std::cmp_less(-2, tup.min) == cuda::std::is_signed::value); + assert(cuda::std::cmp_less(tup.min, -2) == cuda::std::is_signed::value); assert(cuda::std::cmp_less(-2, tup.max)); assert(!cuda::std::cmp_less(tup.max, -2)); } template -__host__ __device__ constexpr void test2() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test2() { assert(cuda::std::cmp_less(T(0), U(1))); assert(!cuda::std::cmp_less(T(1), U(0))); } template -__host__ __device__ constexpr void test() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test() { test1(); #ifndef TEST_HAS_NO_INT128_T @@ -78,7 +78,7 @@ __host__ __device__ constexpr void test() test2(); } -__host__ __device__ constexpr bool test() +__host__ __device__ TEST_CONSTEXPR_CXX14 bool test() { #ifndef TEST_HAS_NO_INT128_T test<__int128_t>(); diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp index 23a226112c4..81c5270b099 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp @@ -22,11 +22,11 @@ struct Tuple { T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); - T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; + T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; }; template -__host__ __device__ constexpr void test1() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test1() { constexpr Tuple tup{}; assert(cuda::std::cmp_less_equal(T(0), T(0))); @@ -44,14 +44,14 @@ __host__ __device__ constexpr void test1() assert(!cuda::std::cmp_less_equal(tup.max, 1)); assert(!cuda::std::cmp_less_equal(1, tup.min)); assert(cuda::std::cmp_less_equal(T(-1), T(-1))); - assert(!cuda::std::cmp_less_equal(-2, tup.min) == cuda::std::is_signed_v); - assert(cuda::std::cmp_less_equal(tup.min, -2) == cuda::std::is_signed_v); + assert(!cuda::std::cmp_less_equal(-2, tup.min) == cuda::std::is_signed::value); + assert(cuda::std::cmp_less_equal(tup.min, -2) == cuda::std::is_signed::value); assert(cuda::std::cmp_less_equal(-2, tup.max)); assert(!cuda::std::cmp_less_equal(tup.max, -2)); } template -__host__ __device__ constexpr void test2() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test2() { assert(cuda::std::cmp_less_equal(T(0), U(1))); assert(cuda::std::cmp_less_equal(T(0), U(0))); @@ -59,7 +59,7 @@ __host__ __device__ constexpr void test2() } template -__host__ __device__ constexpr void test() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test() { test1(); #ifndef TEST_HAS_NO_INT128_T @@ -78,7 +78,7 @@ __host__ __device__ constexpr void test() test2(); } -__host__ __device__ constexpr bool test() +__host__ __device__ TEST_CONSTEXPR_CXX14 bool test() { #ifndef TEST_HAS_NO_INT128_T test<__int128_t>(); diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp index eda5cc037b0..ceebecdfb51 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp @@ -23,13 +23,13 @@ struct Tuple { T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); - T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; + T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; }; template -__host__ __device__ constexpr void test1() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test1() { - constexpr Tuple tup{}; + TEST_CONSTEXPR_CXX14 Tuple tup{}; assert(!cuda::std::cmp_not_equal(T(0), T(0))); assert(!cuda::std::cmp_not_equal(T(10), T(10))); assert(!cuda::std::cmp_not_equal(tup.min, tup.min)); @@ -51,10 +51,10 @@ __host__ __device__ constexpr void test1() } template -__host__ __device__ constexpr void test2() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test2() { - constexpr Tuple ttup; - constexpr Tuple utup; + TEST_CONSTEXPR_CXX14 Tuple ttup; + TEST_CONSTEXPR_CXX14 Tuple utup; assert(!cuda::std::cmp_not_equal(T(0), U(0))); assert(!cuda::std::cmp_not_equal(T(10), U(10))); assert(cuda::std::cmp_not_equal(T(0), U(1))); @@ -66,7 +66,7 @@ __host__ __device__ constexpr void test2() } template -__host__ __device__ constexpr void test() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test() { test1(); #ifndef TEST_HAS_NO_INT128_T @@ -85,7 +85,7 @@ __host__ __device__ constexpr void test() test2(); } -__host__ __device__ constexpr bool test() +__host__ __device__ TEST_CONSTEXPR_CXX14 bool test() { #ifndef TEST_HAS_NO_INT128_T test<__int128_t>(); diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp index 6cd15e96236..2fab113df47 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.fail.cpp @@ -64,7 +64,7 @@ struct EmptyT {}; template -__host__ __device__ constexpr void test() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test() { cuda::std::cmp_equal(T(), T()); // expected-error 10-11 {{no matching function for call to 'cmp_equal'}} cuda::std::cmp_equal(T(), int()); // expected-error 10-11 {{no matching function for call to 'cmp_equal'}} @@ -92,7 +92,7 @@ __host__ __device__ constexpr void test() } #ifndef TEST_HAS_NO_CHAR8_T template -__host__ __device__ constexpr void test_char8t() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test_char8t() { cuda::std::cmp_equal(T(), T()); // expected-error 1 {{no matching function for call to 'cmp_equal'}} cuda::std::cmp_equal(T(), int()); // expected-error 1 {{no matching function for call to 'cmp_equal'}} @@ -118,7 +118,7 @@ __host__ __device__ constexpr void test_char8t() #endif // TEST_HAS_NO_CHAR8_T template -__host__ __device__ constexpr void test_uchars() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test_uchars() { cuda::std::cmp_equal(T(), T()); // expected-error 2 {{no matching function for call to 'cmp_equal'}} cuda::std::cmp_equal(T(), int()); // expected-error 2 {{no matching function for call to 'cmp_equal'}} diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp index 85c233ad299..8b622eff244 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp @@ -24,11 +24,11 @@ struct Tuple { T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); - T mid = cuda::std::is_signed_v ? T(-1) : max >> 1; + T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; }; template -__host__ __device__ constexpr void test_in_range1() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test_in_range1() { constexpr Tuple tup{}; assert(cuda::std::in_range(tup.min)); @@ -40,7 +40,7 @@ __host__ __device__ constexpr void test_in_range1() assert(cuda::std::in_range(tup.mid + 1)); } -__host__ __device__ constexpr void test_in_range() +__host__ __device__ TEST_CONSTEXPR_CXX14 void test_in_range() { constexpr Tuple utup8{}; constexpr Tuple stup8{}; @@ -52,7 +52,7 @@ __host__ __device__ constexpr void test_in_range() assert(!cuda::std::in_range(-1)); } -__host__ __device__ constexpr bool test() +__host__ __device__ TEST_CONSTEXPR_CXX14 bool test() { test_in_range(); #ifndef TEST_HAS_NO_INT128_T From e97795a3e094d267675c46cd75fa3274ed7b057a Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 20:40:27 +0100 Subject: [PATCH 16/29] Avoid old nvcc issues --- .../utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp | 2 ++ .../utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp | 2 ++ .../intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp | 2 ++ .../utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp | 2 ++ .../intcmp.cmp_less_equal/cmp_less_equal.pass.cpp | 2 ++ .../utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp | 2 ++ .../utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp | 2 ++ 7 files changed, 14 insertions(+) diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp index 97fb3d26cc2..3d0c0e8757b 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_equal/cmp_equal.pass.cpp @@ -25,6 +25,8 @@ struct Tuple T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; + + __host__ __device__ constexpr Tuple() noexcept {} }; template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp index 18d33d0960d..5c816949a69 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater/cmp_greater.pass.cpp @@ -23,6 +23,8 @@ struct Tuple T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; + + __host__ __device__ constexpr Tuple() noexcept {} }; template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp index 2411ecbc79c..1c1d7729d2e 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_greater_equal/cmp_greater_equal.pass.cpp @@ -23,6 +23,8 @@ struct Tuple T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; + + __host__ __device__ constexpr Tuple() noexcept {} }; template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp index bce287402a2..9ec369c28a3 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less/cmp_less.pass.cpp @@ -24,6 +24,8 @@ struct Tuple T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; + + __host__ __device__ constexpr Tuple() noexcept {} }; template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp index 81c5270b099..a33a248a493 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_less_equal/cmp_less_equal.pass.cpp @@ -23,6 +23,8 @@ struct Tuple T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; + + __host__ __device__ constexpr Tuple() noexcept {} }; template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp index ceebecdfb51..383a4229d30 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.cmp_not_equal/cmp_not_equal.pass.cpp @@ -24,6 +24,8 @@ struct Tuple T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; + + __host__ __device__ constexpr Tuple() noexcept {} }; template diff --git a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp index 8b622eff244..73bb106f77f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/utility/utility.intcmp/intcmp.in_range/in_range.pass.cpp @@ -25,6 +25,8 @@ struct Tuple T min = cuda::std::numeric_limits::min(); T max = cuda::std::numeric_limits::max(); T mid = cuda::std::is_signed::value ? T(-1) : max >> 1; + + __host__ __device__ constexpr Tuple() noexcept {} }; template From abfa8266d68f803a02736c17dcc0f9f1dc2f4cb1 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 20:43:05 +0100 Subject: [PATCH 17/29] Pacify MSVC --- libcudacxx/include/cuda/std/__utility/cmp.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index a207c08571a..def001be82e 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -34,6 +34,9 @@ _CCCL_PUSH_MACROS +_CCCL_DIAG_PUSH +_CCCL_DIAG_SUPPRESS_MSVC(4389) // signed/unsigned mismatch + _LIBCUDACXX_BEGIN_NAMESPACE_STD template @@ -146,6 +149,8 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept _LIBCUDACXX_END_NAMESPACE_STD +_CCCL_DIAG_POP + _CCCL_POP_MACROS #endif // _LIBCUDACXX___UTILITY_CMP_H From 3fdfab32121d8181a935c9948ac18810ba960574 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Fri, 15 Nov 2024 16:13:28 +0100 Subject: [PATCH 18/29] Move implementation of `_LIBCUDACXX_TEMPLATE` to CCCL We have emulation for concepts in LIBCUDACXX that was guarded behind C++14 But there is nothing that requires C++14 for just the template headers and we want to use them universally throughout the codebase Consequently move them to CCCL proper and enable them unconditionally. To ensure that we do not add any hidden dependencies this also adds a barebones implementation of `enable_if_t` and a trailing `enable_if_t` --- .clang-format | 4 +- .../cuda/experimental/__algorithm/copy.cuh | 4 +- .../cuda/experimental/__algorithm/fill.cuh | 4 +- .../uninitialized_async_buffer.cuh | 13 +- .../__container/uninitialized_buffer.cuh | 13 +- .../__memory_resource/any_resource.cuh | 46 +-- .../device_memory_resource.cuh | 36 +- .../__memory_resource/shared_resource.cuh | 16 +- .../cuda/experimental/__stream/get_stream.cuh | 14 +- docs/repo.toml | 8 +- .../device_memory_resource.h | 28 +- .../cuda/__memory_resource/get_property.h | 10 +- .../managed_memory_resource.h | 16 +- .../pinned_memory_resource.h | 16 +- .../cuda/__memory_resource/resource_ref.h | 64 ++- libcudacxx/include/cuda/std/__cccl/dialect.h | 40 ++ .../cuda/std/__concepts/__concept_macros.h | 23 -- .../include/cuda/std/__concepts/swappable.h | 12 +- .../include/cuda/std/__expected/expected.h | 368 +++++++++--------- .../cuda/std/__expected/expected_base.h | 40 +- .../include/cuda/std/__expected/unexpected.h | 20 +- .../cuda/std/__functional/bind_front.h | 4 +- .../include/cuda/std/__functional/not_fn.h | 4 +- .../cuda/std/__functional/perfect_forward.h | 36 +- .../cuda/std/__functional/ranges_operations.h | 24 +- .../include/cuda/std/__iterator/advance.h | 12 +- .../include/cuda/std/__iterator/distance.h | 12 +- .../include/cuda/std/__iterator/iter_move.h | 12 +- .../include/cuda/std/__iterator/iter_swap.h | 12 +- .../cuda/std/__iterator/move_iterator.h | 50 +-- .../cuda/std/__iterator/move_sentinel.h | 8 +- libcudacxx/include/cuda/std/__iterator/next.h | 16 +- libcudacxx/include/cuda/std/__iterator/prev.h | 12 +- .../include/cuda/std/__iterator/projected.h | 4 +- .../cuda/std/__iterator/reverse_iterator.h | 4 +- .../std/__iterator/unreachable_sentinel.h | 16 +- .../cuda/std/__mdspan/default_accessor.h | 4 +- .../include/cuda/std/__mdspan/extents.h | 53 ++- .../include/cuda/std/__mdspan/layout_left.h | 22 +- .../include/cuda/std/__mdspan/layout_right.h | 22 +- .../include/cuda/std/__mdspan/layout_stride.h | 51 ++- libcudacxx/include/cuda/std/__mdspan/mdspan.h | 110 +++--- .../include/cuda/std/__mdspan/static_array.h | 4 +- .../include/cuda/std/__mdspan/submdspan.h | 13 +- libcudacxx/include/cuda/std/__ranges/access.h | 52 +-- libcudacxx/include/cuda/std/__ranges/data.h | 16 +- libcudacxx/include/cuda/std/__ranges/empty.h | 12 +- .../include/cuda/std/__ranges/enable_view.h | 4 +- libcudacxx/include/cuda/std/__ranges/rbegin.h | 24 +- libcudacxx/include/cuda/std/__ranges/rend.h | 24 +- libcudacxx/include/cuda/std/__ranges/size.h | 16 +- .../include/cuda/std/__ranges/subrange.h | 62 +-- .../include/cuda/std/__ranges/unwrap_end.h | 4 +- .../cuda/std/__ranges/view_interface.h | 57 ++- .../cuda/std/detail/libcxx/include/optional | 60 ++- .../cuda/std/detail/libcxx/include/span | 91 +++-- libcudacxx/include/cuda/std/inplace_vector | 175 ++++----- .../async_resource_ref/inheritance.pass.cpp | 9 +- .../async_resource_ref/properties.pass.cpp | 16 +- .../async_resource_ref/types.h | 8 +- .../resource_ref/inheritance.pass.cpp | 9 +- .../resource_ref/properties.pass.cpp | 16 +- .../cuda/memory_resource/resource_ref/types.h | 8 +- .../totally_ordered.pass.cpp | 4 +- .../convertible_to.pass.cpp | 12 +- .../concept.same/same_as.pass.cpp | 8 +- .../concept.swappable/swappable.pass.cpp | 12 +- .../swappable_with.compile.pass.cpp | 8 +- .../views/mdspan/foo_customizations.hpp | 17 +- .../ctor/ctor.convert.copy.pass.cpp | 8 +- .../ctor/ctor.convert.move.pass.cpp | 8 +- .../ctor/ctor.inplace_init_list.pass.cpp | 4 +- .../ctor/ctor.unexpect_init_list.pass.cpp | 4 +- .../ctor/ctor.convert.copy.pass.cpp | 4 +- .../ctor/ctor.convert.move.pass.cpp | 4 +- libcudacxx/test/support/test_iterators.h | 106 ++--- 76 files changed, 1071 insertions(+), 1091 deletions(-) diff --git a/.clang-format b/.clang-format index 342eb344057..d081c43b219 100644 --- a/.clang-format +++ b/.clang-format @@ -128,8 +128,8 @@ IndentWidth: 2 KeepEmptyLinesAtTheStartOfBlocks: false MaxEmptyLinesToKeep: 1 Macros: -- _LIBCUDACXX_TEMPLATE(...)=template<...> -- _LIBCUDACXX_REQUIRES(...)=requires (...) +- _CCCL_TEMPLATE(...)=template<...> +- _CCCL_REQUIRES(...)=requires (...) WhitespaceSensitiveMacros: - _CCCL_HAS_INCLUDE NamespaceIndentation: None diff --git a/cudax/include/cuda/experimental/__algorithm/copy.cuh b/cudax/include/cuda/experimental/__algorithm/copy.cuh index b01bac3c1ce..87f03f3f59f 100644 --- a/cudax/include/cuda/experimental/__algorithm/copy.cuh +++ b/cudax/include/cuda/experimental/__algorithm/copy.cuh @@ -62,8 +62,8 @@ void __copy_bytes_impl(stream_ref __stream, _CUDA_VSTD::span<_SrcTy> __src, _CUD //! @param __stream Stream that the copy should be inserted into //! @param __src Source to copy from //! @param __dst Destination to copy into -_LIBCUDACXX_TEMPLATE(typename _SrcTy, typename _DstTy) -_LIBCUDACXX_REQUIRES(__valid_copy_fill_argument<_SrcTy> _LIBCUDACXX_AND __valid_copy_fill_argument<_DstTy>) +_CCCL_TEMPLATE(typename _SrcTy, typename _DstTy) +_CCCL_REQUIRES(__valid_copy_fill_argument<_SrcTy> _CCCL_AND __valid_copy_fill_argument<_DstTy>) void copy_bytes(stream_ref __stream, _SrcTy&& __src, _DstTy&& __dst) { __copy_bytes_impl( diff --git a/cudax/include/cuda/experimental/__algorithm/fill.cuh b/cudax/include/cuda/experimental/__algorithm/fill.cuh index 4fef2777e87..5628c655013 100644 --- a/cudax/include/cuda/experimental/__algorithm/fill.cuh +++ b/cudax/include/cuda/experimental/__algorithm/fill.cuh @@ -49,8 +49,8 @@ void __fill_bytes_impl(stream_ref __stream, _CUDA_VSTD::span<_DstTy, _DstSize> _ //! @param __stream Stream that the copy should be inserted into //! @param __dst Destination memory to fill //! @param __value Value to fill into every byte in the destination -_LIBCUDACXX_TEMPLATE(typename _DstTy) -_LIBCUDACXX_REQUIRES(__valid_copy_fill_argument<_DstTy>) +_CCCL_TEMPLATE(typename _DstTy) +_CCCL_REQUIRES(__valid_copy_fill_argument<_DstTy>) void fill_bytes(stream_ref __stream, _DstTy&& __dst, uint8_t __value) { __fill_bytes_impl(__stream, diff --git a/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh b/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh index 5bad25bd46e..4bcd93d259f 100644 --- a/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh +++ b/cudax/include/cuda/experimental/__container/uninitialized_async_buffer.cuh @@ -117,7 +117,7 @@ private: template _CCCL_NODISCARD_FRIEND _CCCL_HIDE_FROM_ABI auto __cudax_launch_transform(::cuda::stream_ref, uninitialized_async_buffer& __self) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(_CUDA_VSTD::span<_Tp>)( + _CCCL_TRAILING_REQUIRES(_CUDA_VSTD::span<_Tp>)( _CUDA_VSTD::same_as<_Tp, _Tp2>&& _CUDA_VSTD::__is_included_in_v<_CUDA_VMR::device_accessible, _Properties...>) { // TODO add auto synchronization @@ -129,7 +129,7 @@ private: template _CCCL_NODISCARD_FRIEND _CCCL_HIDE_FROM_ABI auto __cudax_launch_transform(::cuda::stream_ref, const uninitialized_async_buffer& __self) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(_CUDA_VSTD::span)( + _CCCL_TRAILING_REQUIRES(_CUDA_VSTD::span)( _CUDA_VSTD::same_as<_Tp, _Tp2>&& _CUDA_VSTD::__is_included_in_v<_CUDA_VMR::device_accessible, _Properties...>) { // TODO add auto synchronization @@ -173,8 +173,8 @@ public: //! @brief Move-constructs a \c uninitialized_async_buffer from \p __other //! @param __other Another \c uninitialized_async_buffer with matching properties //! Takes ownership of the allocation in \p __other and resets it - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES(__properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES(__properties_match<_OtherProperties...>) _CCCL_HIDE_FROM_ABI uninitialized_async_buffer(uninitialized_async_buffer<_Tp, _OtherProperties...>&& __other) noexcept : __mr_(_CUDA_VSTD::move(__other.__mr_)) , __stream_(_CUDA_VSTD::exchange(__other.__stream_, {})) @@ -275,9 +275,8 @@ public: # ifndef DOXYGEN_SHOULD_SKIP_THIS // friend functions are currently broken //! @brief Forwards the passed properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - (!property_with_value<_Property>) _LIBCUDACXX_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) _CCCL_HIDE_FROM_ABI friend constexpr void get_property(const uninitialized_async_buffer&, _Property) noexcept {} # endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh b/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh index 0388074514e..d480ded4588 100644 --- a/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh +++ b/cudax/include/cuda/experimental/__container/uninitialized_buffer.cuh @@ -107,7 +107,7 @@ private: template _CCCL_NODISCARD_FRIEND _CCCL_HIDE_FROM_ABI auto __cudax_launch_transform(::cuda::stream_ref, uninitialized_buffer& __self) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(_CUDA_VSTD::span<_Tp>)( + _CCCL_TRAILING_REQUIRES(_CUDA_VSTD::span<_Tp>)( _CUDA_VSTD::same_as<_Tp, _Tp2>&& _CUDA_VSTD::__is_included_in_v<_CUDA_VMR::device_accessible, _Properties...>) { return {__self.__get_data(), __self.size()}; @@ -118,7 +118,7 @@ private: template _CCCL_NODISCARD_FRIEND _CCCL_HIDE_FROM_ABI auto __cudax_launch_transform(::cuda::stream_ref, const uninitialized_buffer& __self) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(_CUDA_VSTD::span)( + _CCCL_TRAILING_REQUIRES(_CUDA_VSTD::span)( _CUDA_VSTD::same_as<_Tp, _Tp2>&& _CUDA_VSTD::__is_included_in_v<_CUDA_VMR::device_accessible, _Properties...>) { return {__self.__get_data(), __self.size()}; @@ -158,8 +158,8 @@ public: //! @brief Move-constructs a \c uninitialized_buffer from another \c uninitialized_buffer with matching properties //! @param __other Another \c uninitialized_buffer //! Takes ownership of the allocation in \p __other and resets it - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES(__properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES(__properties_match<_OtherProperties...>) _CCCL_HIDE_FROM_ABI uninitialized_buffer(uninitialized_buffer<_Tp, _OtherProperties...>&& __other) noexcept : __mr_(_CUDA_VSTD::move(__other.__mr_)) , __count_(_CUDA_VSTD::exchange(__other.__count_, 0)) @@ -240,9 +240,8 @@ public: # ifndef DOXYGEN_SHOULD_SKIP_THIS // friend functions are currently broken //! @brief Forwards the passed Properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - (!property_with_value<_Property>) _LIBCUDACXX_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) _CCCL_HIDE_FROM_ABI friend constexpr void get_property(const uninitialized_buffer&, _Property) noexcept {} # endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh index 0c0578f68a7..cf3877b91f0 100644 --- a/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh @@ -101,8 +101,8 @@ public: //! @brief Constructs a \c basic_any_resource from a type that satisfies the \c resource or \c async_resource //! concept as well as all properties. //! @param __res The resource to be wrapped within the \c basic_any_resource. - _LIBCUDACXX_TEMPLATE(class _Resource, class __resource_t = _CUDA_VSTD::remove_cvref_t<_Resource>) - _LIBCUDACXX_REQUIRES((!__is_basic_any_resource<_Resource>) _LIBCUDACXX_AND __valid_resource<__resource_t>) + _CCCL_TEMPLATE(class _Resource, class __resource_t = _CUDA_VSTD::remove_cvref_t<_Resource>) + _CCCL_REQUIRES((!__is_basic_any_resource<_Resource>) _CCCL_AND __valid_resource<__resource_t>) basic_any_resource(_Resource&& __res) noexcept : _CUDA_VMR::_Resource_base<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning>( nullptr, &_CUDA_VMR::__alloc_vtable<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning, __resource_t>) @@ -123,9 +123,8 @@ public: //! concept, and it must provide all properties in \c _Properties... . //! @param __args The arguments used to construct the instance of \c _Resource to be wrapped within the //! \c basic_any_resource. - _LIBCUDACXX_TEMPLATE(class _Resource, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, _Resource, _Args...) - _LIBCUDACXX_AND __valid_resource<_Resource>) + _CCCL_TEMPLATE(class _Resource, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, _Resource, _Args...) _CCCL_AND __valid_resource<_Resource>) basic_any_resource(_CUDA_VSTD::in_place_type_t<_Resource>, _Args&&... __args) noexcept : _CUDA_VMR::_Resource_base<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning>( nullptr, &_CUDA_VMR::__alloc_vtable<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning, _Resource>) @@ -144,11 +143,11 @@ public: //! @brief Conversion from a \c basic_any_resource with the same set of properties but in a different order. //! This constructor also handles conversion from \c any_async_resource to \c any_resource //! @param __other The other \c basic_any_resource. - _LIBCUDACXX_TEMPLATE(_CUDA_VMR::_AllocType _OtherAllocType, class... _OtherProperties) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(_CUDA_VMR::_AllocType _OtherAllocType, class... _OtherProperties) + _CCCL_REQUIRES( (_CUDA_VSTD::_IsNotSame>::value) - _LIBCUDACXX_AND(_OtherAllocType == _Alloc_type || _OtherAllocType == _CUDA_VMR::_AllocType::_Async) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_AND(_OtherAllocType == _Alloc_type || _OtherAllocType == _CUDA_VMR::_AllocType::_Async) + _CCCL_AND __properties_match<_OtherProperties...>) basic_any_resource(basic_any_resource<_OtherAllocType, _OtherProperties...> __other) noexcept : _CUDA_VMR::_Resource_base<_Alloc_type, _CUDA_VMR::_WrapperType::_Owning>( nullptr, _CUDA_VSTD::exchange(__other.__static_vtable, nullptr)) @@ -216,10 +215,9 @@ public: //! @brief Converts a \c basic_any_resource to a \c resource_ref with a potential subset of properties. //! @return The \c resource_ref to this resource. - _LIBCUDACXX_TEMPLATE(_CUDA_VMR::_AllocType _OtherAllocType, class... _OtherProperties) - _LIBCUDACXX_REQUIRES( - (_OtherAllocType == _CUDA_VMR::_AllocType::_Default || _OtherAllocType == _Alloc_type) _LIBCUDACXX_AND( - _CUDA_VSTD::__type_set_contains_v<_CUDA_VSTD::__make_type_set<_Properties...>, _OtherProperties...>)) + _CCCL_TEMPLATE(_CUDA_VMR::_AllocType _OtherAllocType, class... _OtherProperties) + _CCCL_REQUIRES((_OtherAllocType == _CUDA_VMR::_AllocType::_Default || _OtherAllocType == _Alloc_type) _CCCL_AND( + _CUDA_VSTD::__type_set_contains_v<_CUDA_VSTD::__make_type_set<_Properties...>, _OtherProperties...>)) operator _CUDA_VMR::basic_resource_ref<_OtherAllocType, _OtherProperties...>() noexcept { return _CUDA_VMR::_Resource_ref_helper::_Construct<_Alloc_type, _OtherProperties...>( @@ -239,9 +237,9 @@ public: //! @param __rhs The other \c basic_any_resource //! @return Checks whether both resources have the same equality function stored in their vtable and if so returns //! the result of that equality comparison. Otherwise returns false. - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) + _CCCL_AND __properties_match<_OtherProperties...>) _CCCL_NODISCARD bool operator==(const basic_any_resource<_Alloc_type, _OtherProperties...>& __rhs) const { return (this->__static_vtable->__equal_fn == __rhs.__static_vtable->__equal_fn) @@ -252,24 +250,22 @@ public: //! @param __rhs The other \c basic_any_resource //! @return Checks whether both resources have the same equality function stored in their vtable and if so returns //! the inverse result of that equality comparison. Otherwise returns true. - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) + _CCCL_AND __properties_match<_OtherProperties...>) _CCCL_NODISCARD bool operator!=(const basic_any_resource<_Alloc_type, _OtherProperties...>& __rhs) const { return !(*this == __rhs); } //! @brief Forwards the stateless properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - (!property_with_value<_Property>) _LIBCUDACXX_AND(_CUDA_VSTD::__is_included_in_v<_Property, _Properties...>)) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND(_CUDA_VSTD::__is_included_in_v<_Property, _Properties...>)) friend void get_property(const basic_any_resource&, _Property) noexcept {} //! @brief Forwards the stateful properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - property_with_value<_Property> _LIBCUDACXX_AND(_CUDA_VSTD::__is_included_in_v<_Property, _Properties...>)) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES(property_with_value<_Property> _CCCL_AND(_CUDA_VSTD::__is_included_in_v<_Property, _Properties...>)) _CCCL_NODISCARD_FRIEND __property_value_t<_Property> get_property(const basic_any_resource& __res, _Property) noexcept { _CUDA_VMR::_Property_vtable<_Property> const& __prop = __res; diff --git a/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh index 4869bc31672..46c8c44528e 100644 --- a/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh @@ -315,8 +315,8 @@ public: //! @param __rhs The resource to compare to. //! @returns If the underlying types are equality comparable, returns the result of equality comparison of both //! resources. Otherwise, returns false. - _LIBCUDACXX_TEMPLATE(class _Resource) - _LIBCUDACXX_REQUIRES((_CUDA_VMR::__different_resource) ) + _CCCL_TEMPLATE(class _Resource) + _CCCL_REQUIRES((_CUDA_VMR::__different_resource) ) _CCCL_NODISCARD bool operator==(_Resource const& __rhs) const noexcept { if constexpr (has_property<_Resource, _CUDA_VMR::device_accessible>) @@ -332,8 +332,8 @@ public: # else // ^^^ C++20 ^^^ / vvv C++17 template _CCCL_NODISCARD_FRIEND auto operator==(device_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& - has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& + has_property<_Resource, _CUDA_VMR::device_accessible>) { return _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast(__lhs)} == _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast<_Resource&>(__rhs)}; @@ -341,16 +341,16 @@ public: template _CCCL_NODISCARD_FRIEND auto operator==(device_memory_resource const&, _Resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource - && !has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource + && !has_property<_Resource, _CUDA_VMR::device_accessible>) { return false; } template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const& __rhs, device_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& - has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& + has_property<_Resource, _CUDA_VMR::device_accessible>) { return _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast(__lhs)} == _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast<_Resource&>(__rhs)}; @@ -358,16 +358,16 @@ public: template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const&, device_memory_resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource - && !has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource + && !has_property<_Resource, _CUDA_VMR::device_accessible>) { return false; } template _CCCL_NODISCARD_FRIEND auto operator!=(device_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& - has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& + has_property<_Resource, _CUDA_VMR::device_accessible>) { return _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast(__lhs)} != _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast<_Resource&>(__rhs)}; @@ -375,16 +375,16 @@ public: template _CCCL_NODISCARD_FRIEND auto operator!=(device_memory_resource const&, _Resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource - && !has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource + && !has_property<_Resource, _CUDA_VMR::device_accessible>) { return true; } template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const& __rhs, device_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& - has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource&& + has_property<_Resource, _CUDA_VMR::device_accessible>) { return _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast(__lhs)} != _CUDA_VMR::resource_ref<_CUDA_VMR::device_accessible>{const_cast<_Resource&>(__rhs)}; @@ -392,8 +392,8 @@ public: template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const&, device_memory_resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource - && !has_property<_Resource, _CUDA_VMR::device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(_CUDA_VMR::__different_resource + && !has_property<_Resource, _CUDA_VMR::device_accessible>) { return true; } diff --git a/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh index bdd774f2169..e2cd76940db 100644 --- a/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/shared_resource.cuh @@ -172,8 +172,8 @@ struct shared_resource //! @return Pointer to the newly allocated memory. //! @note The caller is responsible for ensuring that the memory is not accessed until the //! operation has completed. - _LIBCUDACXX_TEMPLATE(class _ThisResource = _Resource) - _LIBCUDACXX_REQUIRES(_CUDA_VMR::async_resource<_ThisResource>) + _CCCL_TEMPLATE(class _ThisResource = _Resource) + _CCCL_REQUIRES(_CUDA_VMR::async_resource<_ThisResource>) _CCCL_NODISCARD void* async_allocate(size_t __bytes, size_t __alignment, ::cuda::stream_ref __stream) { return this->__control_block->__resource.async_allocate(__bytes, __alignment, __stream); @@ -188,8 +188,8 @@ struct shared_resource //! \p __ptr. //! @note The caller is responsible for ensuring that the memory is not accessed after the //! operation has completed. - _LIBCUDACXX_TEMPLATE(class _ThisResource = _Resource) - _LIBCUDACXX_REQUIRES(_CUDA_VMR::async_resource<_ThisResource>) + _CCCL_TEMPLATE(class _ThisResource = _Resource) + _CCCL_REQUIRES(_CUDA_VMR::async_resource<_ThisResource>) void async_deallocate(void* __ptr, size_t __bytes, size_t __alignment, ::cuda::stream_ref __stream) { this->__control_block->__resource.async_deallocate(__ptr, __bytes, __alignment, __stream); @@ -224,13 +224,13 @@ struct shared_resource } //! @brief Forwards the stateless properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES((!property_with_value<_Property>) _LIBCUDACXX_AND(has_property<_Resource, _Property>)) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND(has_property<_Resource, _Property>)) friend void get_property(const shared_resource&, _Property) noexcept {} //! @brief Forwards the stateful properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES(property_with_value<_Property> _LIBCUDACXX_AND(has_property<_Resource, _Property>)) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES(property_with_value<_Property> _CCCL_AND(has_property<_Resource, _Property>)) _CCCL_NODISCARD_FRIEND __property_value_t<_Property> get_property(const shared_resource& __self, _Property) noexcept { return get_property(__self.__control_block->__resource, _Property{}); diff --git a/cudax/include/cuda/experimental/__stream/get_stream.cuh b/cudax/include/cuda/experimental/__stream/get_stream.cuh index 0f2848b12fa..87d8158be3e 100644 --- a/cudax/include/cuda/experimental/__stream/get_stream.cuh +++ b/cudax/include/cuda/experimental/__stream/get_stream.cuh @@ -49,25 +49,25 @@ _LIBCUDACXX_CONCEPT __has_member_get_stream = _LIBCUDACXX_FRAGMENT(__has_member_ //! @brief `get_stream` is a customization point object that queries a type `T` for an associated stream struct get_stream_t { - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__convertible_to_stream_ref<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__convertible_to_stream_ref<_Tp>) _CCCL_NODISCARD _CCCL_HIDE_FROM_ABI constexpr ::cuda::stream_ref operator()(const _Tp& __t) const noexcept(noexcept(static_cast<::cuda::stream_ref>(__t))) { return static_cast<::cuda::stream_ref>(__t); } // namespace __get_stream - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__has_member_get_stream<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__has_member_get_stream<_Tp>) _CCCL_NODISCARD _CCCL_HIDE_FROM_ABI constexpr ::cuda::stream_ref operator()(const _Tp& __t) const noexcept(noexcept(__t.get_stream())) { return __t.get_stream(); } - _LIBCUDACXX_TEMPLATE( - class _Env, class _Ret = decltype(_CUDA_VSTD::declval().query(_CUDA_VSTD::declval()))) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Ret, ::cuda::stream_ref)) + _CCCL_TEMPLATE(class _Env, + class _Ret = decltype(_CUDA_VSTD::declval().query(_CUDA_VSTD::declval()))) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Ret, ::cuda::stream_ref)) _CCCL_NODISCARD _CCCL_HIDE_FROM_ABI constexpr ::cuda::stream_ref operator()(const _Env& __env) const noexcept { static_assert(noexcept(__env.query(*this)), ""); diff --git a/docs/repo.toml b/docs/repo.toml index ed00fa8c4f2..d9302440ec4 100644 --- a/docs/repo.toml +++ b/docs/repo.toml @@ -435,12 +435,12 @@ doxygen_predefined = [ "_CUDAX_TRIVIAL_HOST_API", "_CUDAX_TRIVIAL_DEVICE_API", "_CUDAX_PUBLIC_API", - "_LIBCUDACXX_AND=&&", + "_CCCL_AND=&&", "_LIBCUDACXX_EAT_REST(x)=", "_LIBCUDACXX_GLOBAL_CONSTANT=inline", - "_LIBCUDACXX_REQUIRES(x)= ::cuda::std::enable_if_t = 0>", - "_LIBCUDACXX_TEMPLATE(x)=template x _LIBCUDACXX_EAT_REST", + "_CCCL_REQUIRES(x)= ::cuda::std::enable_if_t = 0>", + "_CCCL_TEMPLATE(x)=template x _LIBCUDACXX_EAT_REST", "LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE=", ] diff --git a/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h index 5910e272041..9061adfc3d1 100644 --- a/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h @@ -112,8 +112,8 @@ class device_memory_resource //! @param __rhs The resource to compare to //! @return If the underlying types are equality comparable, returns the result of equality comparison of both //! resources. Otherwise, returns false. - _LIBCUDACXX_TEMPLATE(class _Resource) - _LIBCUDACXX_REQUIRES((__different_resource) ) + _CCCL_TEMPLATE(class _Resource) + _CCCL_REQUIRES((__different_resource) ) _CCCL_NODISCARD bool operator==(_Resource const& __rhs) const noexcept { if constexpr (has_property<_Resource, device_accessible>) @@ -129,7 +129,7 @@ class device_memory_resource # else // ^^^ C++20 ^^^ / vvv C++17 template _CCCL_NODISCARD_FRIEND auto operator==(device_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, device_accessible>) { return resource_ref{const_cast(__lhs)} @@ -138,15 +138,15 @@ class device_memory_resource template _CCCL_NODISCARD_FRIEND auto operator==(device_memory_resource const&, _Resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource - && !has_property<_Resource, device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource + && !has_property<_Resource, device_accessible>) { return false; } template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const& __rhs, device_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, device_accessible>) { return resource_ref{const_cast(__lhs)} @@ -155,15 +155,15 @@ class device_memory_resource template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const&, device_memory_resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource - && !has_property<_Resource, device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource + && !has_property<_Resource, device_accessible>) { return false; } template _CCCL_NODISCARD_FRIEND auto operator!=(device_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, device_accessible>) { return resource_ref{const_cast(__lhs)} @@ -172,15 +172,15 @@ class device_memory_resource template _CCCL_NODISCARD_FRIEND auto operator!=(device_memory_resource const&, _Resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource - && !has_property<_Resource, device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource + && !has_property<_Resource, device_accessible>) { return true; } template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const& __rhs, device_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, device_accessible>) { return resource_ref{const_cast(__lhs)} @@ -189,8 +189,8 @@ class device_memory_resource template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const&, device_memory_resource const&) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource - && !has_property<_Resource, device_accessible>) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource + && !has_property<_Resource, device_accessible>) { return true; } diff --git a/libcudacxx/include/cuda/__memory_resource/get_property.h b/libcudacxx/include/cuda/__memory_resource/get_property.h index 3fea72da9da..12be348a01d 100644 --- a/libcudacxx/include/cuda/__memory_resource/get_property.h +++ b/libcudacxx/include/cuda/__memory_resource/get_property.h @@ -139,15 +139,15 @@ template struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES((!property_with_value<_Property>) _LIBCUDACXX_AND has_property<_Upstream, _Property>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND has_property<_Upstream, _Property>) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr void get_property(const _Derived&, _Property) noexcept {} // The indirection is needed, otherwise the compiler might believe that _Derived is an incomplete type _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Property, class _Derived2 = _Derived) - _LIBCUDACXX_REQUIRES(property_with_value<_Property> _LIBCUDACXX_AND has_property<_Upstream, _Property> _LIBCUDACXX_AND - __has_upstream_resource<_Derived2, _Upstream>) + _CCCL_TEMPLATE(class _Property, class _Derived2 = _Derived) + _CCCL_REQUIRES(property_with_value<_Property> _CCCL_AND has_property<_Upstream, _Property> _CCCL_AND + __has_upstream_resource<_Derived2, _Upstream>) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr __property_value_t<_Property> get_property(const _Derived& __res, _Property __prop) { diff --git a/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h index 0ceb686c170..24132149e08 100644 --- a/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h @@ -107,8 +107,8 @@ class managed_memory_resource //! @param __rhs The resource to compare to //! @return If the underlying types are equality comparable, returns the result of equality comparison of both //! resources. Otherwise, returns false. - _LIBCUDACXX_TEMPLATE(class _Resource) - _LIBCUDACXX_REQUIRES(__different_resource) + _CCCL_TEMPLATE(class _Resource) + _CCCL_REQUIRES(__different_resource) _CCCL_NODISCARD bool operator==(_Resource const& __rhs) const noexcept { if constexpr (has_property<_Resource, host_accessible>) @@ -129,7 +129,7 @@ class managed_memory_resource # else // ^^^ C++20 ^^^ / vvv C++17 template _CCCL_NODISCARD_FRIEND auto operator==(managed_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, host_accessible>) { return resource_ref{const_cast(__lhs)} @@ -137,7 +137,7 @@ class managed_memory_resource } template _CCCL_NODISCARD_FRIEND auto operator==(managed_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource && !has_property<_Resource, host_accessible> && has_property<_Resource, device_accessible>) { @@ -146,7 +146,7 @@ class managed_memory_resource } template _CCCL_NODISCARD_FRIEND auto operator==(managed_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource && !has_property<_Resource, host_accessible> && !has_property<_Resource, device_accessible>) { @@ -155,21 +155,21 @@ class managed_memory_resource template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const& __lhs, managed_memory_resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return __rhs == __lhs; } template _CCCL_NODISCARD_FRIEND auto operator!=(managed_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return !(__lhs == __rhs); } template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const& __rhs, managed_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return !(__rhs == __lhs); } diff --git a/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h index c0c0aa101bf..c2ad95bc7cc 100644 --- a/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h @@ -110,8 +110,8 @@ class pinned_memory_resource //! @param __rhs The resource to compare to //! @return If the underlying types are equality comparable, returns the result of equality comparison of both //! resources. Otherwise, returns false. - _LIBCUDACXX_TEMPLATE(class _Resource) - _LIBCUDACXX_REQUIRES(__different_resource) + _CCCL_TEMPLATE(class _Resource) + _CCCL_REQUIRES(__different_resource) _CCCL_NODISCARD bool operator==(_Resource const& __rhs) const noexcept { if constexpr (has_property<_Resource, host_accessible>) @@ -132,7 +132,7 @@ class pinned_memory_resource # else // ^^^ C++20 ^^^ / vvv C++17 template _CCCL_NODISCARD_FRIEND auto operator==(pinned_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource&& has_property<_Resource, host_accessible>) { return resource_ref{const_cast(__lhs)} @@ -140,7 +140,7 @@ class pinned_memory_resource } template _CCCL_NODISCARD_FRIEND auto operator==(pinned_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource && !has_property<_Resource, host_accessible> && has_property<_Resource, device_accessible>) { @@ -149,7 +149,7 @@ class pinned_memory_resource } template _CCCL_NODISCARD_FRIEND auto operator==(pinned_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)( + _CCCL_TRAILING_REQUIRES(bool)( __different_resource && !has_property<_Resource, host_accessible> && !has_property<_Resource, device_accessible>) { @@ -158,21 +158,21 @@ class pinned_memory_resource template _CCCL_NODISCARD_FRIEND auto operator==(_Resource const& __lhs, pinned_memory_resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return __rhs == __lhs; } template _CCCL_NODISCARD_FRIEND auto operator!=(pinned_memory_resource const& __lhs, _Resource const& __rhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return !(__lhs == __rhs); } template _CCCL_NODISCARD_FRIEND auto operator!=(_Resource const& __rhs, pinned_memory_resource const& __lhs) noexcept - _LIBCUDACXX_TRAILING_REQUIRES(bool)(__different_resource) + _CCCL_TRAILING_REQUIRES(bool)(__different_resource) { return !(__rhs == __lhs); } diff --git a/libcudacxx/include/cuda/__memory_resource/resource_ref.h b/libcudacxx/include/cuda/__memory_resource/resource_ref.h index c6187b80ddc..560f58fa0f3 100644 --- a/libcudacxx/include/cuda/__memory_resource/resource_ref.h +++ b/libcudacxx/include/cuda/__memory_resource/resource_ref.h @@ -262,8 +262,8 @@ struct _Resource_vtable_builder _Copy_impl<_Resource>(__object, __other, __wrapper_type<_Wrapper_type>{}); } - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type, _WrapperType _Wrapper_type) - _LIBCUDACXX_REQUIRES((_Alloc_type == _AllocType::_Default)) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type, _WrapperType _Wrapper_type) + _CCCL_REQUIRES((_Alloc_type == _AllocType::_Default)) static constexpr _Alloc_vtable _Create() noexcept { return {_IsSmall<_Resource>(), @@ -275,8 +275,8 @@ struct _Resource_vtable_builder &_Resource_vtable_builder::_Copy<_Resource, _Wrapper_type>}; } - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type, _WrapperType _Wrapper_type) - _LIBCUDACXX_REQUIRES((_Alloc_type == _AllocType::_Async)) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type, _WrapperType _Wrapper_type) + _CCCL_REQUIRES((_Alloc_type == _AllocType::_Async)) static constexpr _Async_alloc_vtable _Create() noexcept { return {_IsSmall<_Resource>(), @@ -521,9 +521,9 @@ class basic_resource_ref //! @brief Constructs a \c basic_resource_ref from a type that satisfies the \c resource or \c async_resource concept //! as well as all properties //! @param __res The resource to be wrapped within the \c basic_resource_ref - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) - _LIBCUDACXX_REQUIRES((!_Is_resource_base<_Resource>) _LIBCUDACXX_AND(_Alloc_type2 == _AllocType::_Default) - _LIBCUDACXX_AND resource_with<_Resource, _Properties...>) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) + _CCCL_REQUIRES((!_Is_resource_base<_Resource>) _CCCL_AND(_Alloc_type2 == _AllocType::_Default) + _CCCL_AND resource_with<_Resource, _Properties...>) basic_resource_ref(_Resource& __res) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>( _CUDA_VSTD::addressof(__res), &__alloc_vtable<_Alloc_type, _WrapperType::_Reference, _Resource>) @@ -533,9 +533,9 @@ class basic_resource_ref //! @brief Constructs a \c resource_ref from a type that satisfies the \c async_resource concept as well as all //! properties. This ignores the async interface of the passed in resource //! @param __res The resource to be wrapped within the \c resource_ref - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) - _LIBCUDACXX_REQUIRES((!_Is_resource_base<_Resource>) _LIBCUDACXX_AND(_Alloc_type2 == _AllocType::_Async) - _LIBCUDACXX_AND async_resource_with<_Resource, _Properties...>) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) + _CCCL_REQUIRES((!_Is_resource_base<_Resource>) _CCCL_AND(_Alloc_type2 == _AllocType::_Async) + _CCCL_AND async_resource_with<_Resource, _Properties...>) basic_resource_ref(_Resource& __res) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>( _CUDA_VSTD::addressof(__res), &__alloc_vtable<_Alloc_type, _WrapperType::_Reference, _Resource>) @@ -545,9 +545,9 @@ class basic_resource_ref //! @brief Constructs a \c basic_resource_ref from a type that satisfies the \c resource or \c async_resource concept //! as well as all properties //! @param __res Pointer to a resource to be wrapped within the \c basic_resource_ref - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) - _LIBCUDACXX_REQUIRES((!_Is_resource_base<_Resource>) _LIBCUDACXX_AND(_Alloc_type2 == _AllocType::_Default) - _LIBCUDACXX_AND resource_with<_Resource, _Properties...>) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) + _CCCL_REQUIRES((!_Is_resource_base<_Resource>) _CCCL_AND(_Alloc_type2 == _AllocType::_Default) + _CCCL_AND resource_with<_Resource, _Properties...>) basic_resource_ref(_Resource* __res) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>( __res, &__alloc_vtable<_Alloc_type, _WrapperType::_Reference, _Resource>) @@ -557,9 +557,9 @@ class basic_resource_ref //! @brief Constructs a \c resource_ref from a type that satisfies the \c async_resource concept as well as all //! properties. This ignores the async interface of the passed in resource //! @param __res Pointer to a resource to be wrapped within the \c resource_ref - _LIBCUDACXX_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) - _LIBCUDACXX_REQUIRES((!_Is_resource_base<_Resource>) _LIBCUDACXX_AND(_Alloc_type2 == _AllocType::_Async) - _LIBCUDACXX_AND async_resource_with<_Resource, _Properties...>) + _CCCL_TEMPLATE(class _Resource, _AllocType _Alloc_type2 = _Alloc_type) + _CCCL_REQUIRES((!_Is_resource_base<_Resource>) _CCCL_AND(_Alloc_type2 == _AllocType::_Async) + _CCCL_AND async_resource_with<_Resource, _Properties...>) basic_resource_ref(_Resource* __res) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>( __res, &__alloc_vtable<_Alloc_type, _WrapperType::_Reference, _Resource>) @@ -568,8 +568,8 @@ class basic_resource_ref //! @brief Conversion from a \c basic_resource_ref with the same set of properties but in a different order //! @param __ref The other \c basic_resource_ref - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES(__properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES(__properties_match<_OtherProperties...>) basic_resource_ref(basic_resource_ref<_Alloc_type, _OtherProperties...> __ref) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>(__ref.__object, __ref.__static_vtable) , __vtable(static_cast&>(__ref)) @@ -578,9 +578,9 @@ class basic_resource_ref //! @brief Conversion from a \c async_resource_ref with the same set of properties but in a different order to a //! \c resource_ref //! @param __ref The other \c async_resource_ref - _LIBCUDACXX_TEMPLATE(_AllocType _OtherAllocType, class... _OtherProperties) - _LIBCUDACXX_REQUIRES((_OtherAllocType == _AllocType::_Async) _LIBCUDACXX_AND(_OtherAllocType != _Alloc_type) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(_AllocType _OtherAllocType, class... _OtherProperties) + _CCCL_REQUIRES((_OtherAllocType == _AllocType::_Async) _CCCL_AND(_OtherAllocType != _Alloc_type) + _CCCL_AND __properties_match<_OtherProperties...>) basic_resource_ref(basic_resource_ref<_OtherAllocType, _OtherProperties...> __ref) noexcept : _Resource_base<_Alloc_type, _WrapperType::_Reference>(__ref.__object, __ref.__static_vtable) , __vtable(static_cast&>(__ref)) @@ -590,9 +590,9 @@ class basic_resource_ref //! @param __rhs The other \c basic_resource_ref //! @return Checks whether both resources have the same equality function stored in their vtable and if so returns //! the result of that equality comparison. Otherwise returns false. - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) + _CCCL_AND __properties_match<_OtherProperties...>) _CCCL_NODISCARD bool operator==(const basic_resource_ref<_Alloc_type, _OtherProperties...>& __rhs) const { // BUGBUG: comparing function pointers like this can lead to false negatives: @@ -604,24 +604,22 @@ class basic_resource_ref //! @param __rhs The other \c basic_resource_ref //! @return Checks whether both resources have the same equality function stored in their vtable and if so returns //! the inverse result of that equality comparison. Otherwise returns true. - _LIBCUDACXX_TEMPLATE(class... _OtherProperties) - _LIBCUDACXX_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) - _LIBCUDACXX_AND __properties_match<_OtherProperties...>) + _CCCL_TEMPLATE(class... _OtherProperties) + _CCCL_REQUIRES((sizeof...(_Properties) == sizeof...(_OtherProperties)) + _CCCL_AND __properties_match<_OtherProperties...>) _CCCL_NODISCARD bool operator!=(const basic_resource_ref<_Alloc_type, _OtherProperties...>& __rhs) const { return !(*this == __rhs); } //! @brief Forwards the stateless properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - (!property_with_value<_Property>) _LIBCUDACXX_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES((!property_with_value<_Property>) _CCCL_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) friend void get_property(const basic_resource_ref&, _Property) noexcept {} //! @brief Forwards the stateful properties - _LIBCUDACXX_TEMPLATE(class _Property) - _LIBCUDACXX_REQUIRES( - property_with_value<_Property> _LIBCUDACXX_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) + _CCCL_TEMPLATE(class _Property) + _CCCL_REQUIRES(property_with_value<_Property> _CCCL_AND _CUDA_VSTD::__is_included_in_v<_Property, _Properties...>) _CCCL_NODISCARD_FRIEND __property_value_t<_Property> get_property(const basic_resource_ref& __res, _Property) noexcept { return __res._Property_vtable<_Property>::__property_fn(__res.__object); diff --git a/libcudacxx/include/cuda/std/__cccl/dialect.h b/libcudacxx/include/cuda/std/__cccl/dialect.h index 4b96695de73..80a0612c82a 100644 --- a/libcudacxx/include/cuda/std/__cccl/dialect.h +++ b/libcudacxx/include/cuda/std/__cccl/dialect.h @@ -126,4 +126,44 @@ # define _CCCL_GLOBAL_CONSTANT _CCCL_INLINE_VAR constexpr #endif // __CUDA_ARCH__ +//////////////////////////////////////////////////////////////////////////////// +// _CCCL_TEMPLATE +// Usage: +// _CCCL_TEMPLATE(typename A, typename _Bp) +// _CCCL_REQUIRES( Concept1 _CCCL_AND Concept2<_Bp>) +// void foo(A a, _Bp b) +// {} + +// Barebones enable if implementation to use outside of cuda::std +template +struct __cccl_select +{}; + +template <> +struct __cccl_select +{ + template + using type = _Tp; +}; + +template +using __cccl_enable_if_t = typename __cccl_select<_Bp>::template type<_Tp>; + +template +using __cccl_requires_t = typename __cccl_select<_Bp>::template type<_Tp>; + +#if (defined(__cpp_concepts) && _CCCL_STD_VER >= 2020) +# define _CCCL_TEMPLATE(...) template <__VA_ARGS__> +# define _CCCL_REQUIRES(...) requires __VA_ARGS__ +# define _CCCL_AND && +# define _CCCL_TRAILING_REQUIRES_AUX_(...) requires __VA_ARGS__ +# define _CCCL_TRAILING_REQUIRES(...) ->__VA_ARGS__ _CCCL_TRAILING_REQUIRES_AUX_ +#else // ^^^ __cpp_concepts ^^^ / vvv !__cpp_concepts vvv +# define _CCCL_TEMPLATE(...) template <__VA_ARGS__ +# define _CCCL_REQUIRES(...) , bool _CCCL_true_ = true, __cccl_enable_if_t < __VA_ARGS__ && _CCCL_true_, int > = 0 > +# define _CCCL_AND &&_CCCL_true_, int > = 0, __cccl_enable_if_t < +# define _CCCL_TRAILING_REQUIRES_AUX_(...) , __VA_ARGS__ > +# define _CCCL_TRAILING_REQUIRES(...) ->__cccl_requires_t < __VA_ARGS__ _CCCL_TRAILING_REQUIRES_AUX_ +#endif // !__cpp_concepts + #endif // __CCCL_DIALECT_H diff --git a/libcudacxx/include/cuda/std/__concepts/__concept_macros.h b/libcudacxx/include/cuda/std/__concepts/__concept_macros.h index 6c845260ed3..5472bcc8bba 100644 --- a/libcudacxx/include/cuda/std/__concepts/__concept_macros.h +++ b/libcudacxx/include/cuda/std/__concepts/__concept_macros.h @@ -316,29 +316,6 @@ # endif -//////////////////////////////////////////////////////////////////////////////// -// _LIBCUDACXX_TEMPLATE -// Usage: -// _LIBCUDACXX_TEMPLATE(typename A, typename _Bp) -// _LIBCUDACXX_REQUIRES( Concept1 _LIBCUDACXX_AND Concept2<_Bp>) -// void foo(A a, _Bp b) -// {} -# if (defined(__cpp_concepts) && _CCCL_STD_VER >= 2020) -# define _LIBCUDACXX_TEMPLATE(...) template <__VA_ARGS__> -# define _LIBCUDACXX_REQUIRES(...) requires __VA_ARGS__ -# define _LIBCUDACXX_AND && -# define _LIBCUDACXX_TRAILING_REQUIRES(...) \ - ->__VA_ARGS__ \ - requires _LIBCUDACXX_PP_EXPAND -# else -# define _LIBCUDACXX_TEMPLATE(...) template <__VA_ARGS__ -# define _LIBCUDACXX_REQUIRES(...) \ - , bool _LIBCUDACXX_true_ = true, _Concept::_Enable_if_t < __VA_ARGS__ && _LIBCUDACXX_true_, int > = 0 > /**/ -# define _LIBCUDACXX_AND &&_LIBCUDACXX_true_, int > = 0, _Concept::_Enable_if_t < -# define _LIBCUDACXX_TRAILING_REQUIRES_AUX_(...) , __VA_ARGS__ > -# define _LIBCUDACXX_TRAILING_REQUIRES(...) ->_Concept::_Requires_t < __VA_ARGS__ _LIBCUDACXX_TRAILING_REQUIRES_AUX_ -# endif - //////////////////////////////////////////////////////////////////////////////// // _LIBCUDACXX_REQUIRES_EXPR // Usage: diff --git a/libcudacxx/include/cuda/std/__concepts/swappable.h b/libcudacxx/include/cuda/std/__concepts/swappable.h index 4d41338c428..aaddf1a9ee3 100644 --- a/libcudacxx/include/cuda/std/__concepts/swappable.h +++ b/libcudacxx/include/cuda/std/__concepts/swappable.h @@ -105,8 +105,8 @@ struct __fn { // 2.1 `S` is `(void)swap(E1, E2)`* if `E1` or `E2` has class or enumeration type and... // *The name `swap` is used here unqualified. - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(__unqualified_swappable_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(__unqualified_swappable_with<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(swap(_CUDA_VSTD::forward<_Tp>(__t), _CUDA_VSTD::forward<_Up>(__u)))) { @@ -114,8 +114,8 @@ struct __fn } // 2.2 Otherwise, if `E1` and `E2` are lvalues of array types with equal extent and... - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up, size_t _Size) - _LIBCUDACXX_REQUIRES(__swappable_arrays<_Tp, _Up, _Size>) + _CCCL_TEMPLATE(class _Tp, class _Up, size_t _Size) + _CCCL_REQUIRES(__swappable_arrays<_Tp, _Up, _Size>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Tp (&__t)[_Size], _Up (&__u)[_Size]) const noexcept(__noexcept_swappable_arrays<_Tp, _Up>) { @@ -127,8 +127,8 @@ struct __fn } // 2.3 Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models... - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__exchangeable<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__exchangeable<_Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Tp& __x, _Tp& __y) const noexcept(_CCCL_TRAIT(is_nothrow_move_constructible, _Tp) && _CCCL_TRAIT(is_nothrow_move_assignable, _Tp)) { diff --git a/libcudacxx/include/cuda/std/__expected/expected.h b/libcudacxx/include/cuda/std/__expected/expected.h index 523d9c73eda..cc5ddfc03f0 100644 --- a/libcudacxx/include/cuda/std/__expected/expected.h +++ b/libcudacxx/include/cuda/std/__expected/expected.h @@ -124,8 +124,8 @@ class expected : private __expected_move_assign<_Tp, _Err> using rebind = expected<_Up, error_type>; // [expected.object.ctor], constructors - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected() noexcept(_CCCL_TRAIT(is_nothrow_default_constructible, _Tp2)) : __base(true) {} @@ -154,9 +154,9 @@ class expected : private __expected_move_assign<_Tp, _Err> _Not, const expected<_Up, _OtherErr>>>>; public: - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, const _Up&, const _OtherErr&>::value _LIBCUDACXX_AND _CCCL_TRAIT( - is_convertible, const _Up&, _Tp) _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, const _Up&, const _OtherErr&>::value _CCCL_AND _CCCL_TRAIT( + is_convertible, const _Up&, _Tp) _CCCL_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected(const expected<_Up, _OtherErr>& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, const _Up&) && _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened @@ -172,8 +172,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, const _Up&, const _OtherErr&>::value _LIBCUDACXX_AND( + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, const _Up&, const _OtherErr&>::value _CCCL_AND( !_CCCL_TRAIT(is_convertible, const _Up&, _Tp) || !_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 explicit expected(const expected<_Up, _OtherErr>& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, const _Up&) @@ -190,9 +190,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, _Up, _OtherErr>::value _LIBCUDACXX_AND _CCCL_TRAIT( - is_convertible, _Up, _Tp) _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, _Up, _OtherErr>::value _CCCL_AND _CCCL_TRAIT(is_convertible, _Up, _Tp) + _CCCL_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected(expected<_Up, _OtherErr>&& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up) && _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened @@ -208,8 +208,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, _Up, _OtherErr>::value _LIBCUDACXX_AND( + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, _Up, _OtherErr>::value _CCCL_AND( !_CCCL_TRAIT(is_convertible, _Up, _Tp) || !_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 explicit expected(expected<_Up, _OtherErr>&& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up) @@ -226,67 +226,64 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Up = _Tp) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Up>, in_place_t)) _LIBCUDACXX_AND(!_CCCL_TRAIT( - is_same, expected, remove_cvref_t<_Up>)) _LIBCUDACXX_AND(!__unexpected::__is_unexpected>) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _Up, _Tp)) + _CCCL_TEMPLATE(class _Up = _Tp) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Up>, in_place_t)) _CCCL_AND( + !_CCCL_TRAIT(is_same, expected, remove_cvref_t<_Up>)) _CCCL_AND(!__unexpected::__is_unexpected>) + _CCCL_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) _CCCL_AND _CCCL_TRAIT(is_convertible, _Up, _Tp)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(_Up&& __u) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up)) // strengthened : __base(in_place, _CUDA_VSTD::forward<_Up>(__u)) {} - _LIBCUDACXX_TEMPLATE(class _Up = _Tp) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Up>, in_place_t)) _LIBCUDACXX_AND(!_CCCL_TRAIT( - is_same, expected, remove_cvref_t<_Up>)) _LIBCUDACXX_AND(!__unexpected::__is_unexpected>) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, _Up, _Tp))) + _CCCL_TEMPLATE(class _Up = _Tp) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Up>, in_place_t)) _CCCL_AND( + !_CCCL_TRAIT(is_same, expected, remove_cvref_t<_Up>)) _CCCL_AND(!__unexpected::__is_unexpected>) + _CCCL_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) _CCCL_AND(!_CCCL_TRAIT(is_convertible, _Up, _Tp))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(_Up&& __u) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up)) // strengthened : __base(in_place, _CUDA_VSTD::forward<_Up>(__u)) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(const unexpected<_OtherErr>& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened : __base(unexpect, __unex.error()) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND(!_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(const unexpected<_OtherErr>& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened : __base(unexpect, __unex.error()) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) _CCCL_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(unexpected<_OtherErr>&& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(unexpect, _CUDA_VSTD::move(__unex.error())) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) + _CCCL_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(unexpected<_OtherErr>&& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(unexpect, _CUDA_VSTD::move(__unex.error())) {} - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(in_place_t, _Args&&... __args) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Tp, _Args...)) // strengthened : __base(in_place, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected( in_place_t, initializer_list<_Up> __il, @@ -297,15 +294,15 @@ class expected : private __expected_move_assign<_Tp, _Err> : __base(in_place, __il, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(unexpect_t, _Args&&... __args) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _Args...)) // strengthened : __base(unexpect, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected( unexpect_t, initializer_list<_Up> __il, @@ -343,14 +340,12 @@ class expected : private __expected_move_assign<_Tp, _Err> public: // [expected.object.assign], assignment - _LIBCUDACXX_TEMPLATE(class _Up = _Tp) - _LIBCUDACXX_REQUIRES( - (!_CCCL_TRAIT(is_same, expected, remove_cvref_t<_Up>)) - _LIBCUDACXX_AND(!__unexpected::__is_unexpected>) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) _LIBCUDACXX_AND _CCCL_TRAIT(is_assignable, _Tp&, _Up) - _LIBCUDACXX_AND(_CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up) - || _CCCL_TRAIT(is_nothrow_move_constructible, _Tp) - || _CCCL_TRAIT(is_nothrow_move_constructible, _Err))) + _CCCL_TEMPLATE(class _Up = _Tp) + _CCCL_REQUIRES( + (!_CCCL_TRAIT(is_same, expected, remove_cvref_t<_Up>)) _CCCL_AND(!__unexpected::__is_unexpected>) + _CCCL_AND _CCCL_TRAIT(is_constructible, _Tp, _Up) _CCCL_AND _CCCL_TRAIT(is_assignable, _Tp&, _Up) + _CCCL_AND(_CCCL_TRAIT(is_nothrow_constructible, _Tp, _Up) || _CCCL_TRAIT(is_nothrow_move_constructible, _Tp) + || _CCCL_TRAIT(is_nothrow_move_constructible, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(_Up&& __v) { if (this->__has_val_) @@ -376,8 +371,8 @@ class expected : private __expected_move_assign<_Tp, _Err> is_nothrow_move_constructible<_Err>>>::value; public: - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_assign_from_unexpected) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(__can_assign_from_unexpected) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(const unexpected<_OtherErr>& __un) { if (this->__has_val_) @@ -392,8 +387,8 @@ class expected : private __expected_move_assign<_Tp, _Err> return *this; } - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_assign_from_unexpected<_OtherErr>) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(__can_assign_from_unexpected<_OtherErr>) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(unexpected<_OtherErr>&& __un) { if (this->__has_val_) @@ -408,8 +403,8 @@ class expected : private __expected_move_assign<_Tp, _Err> return *this; } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _Tp, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _Tp, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 _Tp& emplace(_Args&&... __args) noexcept { if (this->__has_val_) @@ -424,8 +419,8 @@ class expected : private __expected_move_assign<_Tp, _Err> return *_LIBCUDACXX_CONSTRUCT_AT(this->__union_.__val_, _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _Tp, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _Tp, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) noexcept { if (this->__has_val_) @@ -442,8 +437,8 @@ class expected : private __expected_move_assign<_Tp, _Err> public: // [expected.object.swap], swap - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(__expected::__can_swap<_Tp2, _Err2>) + _CCCL_TEMPLATE(class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(__expected::__can_swap<_Tp2, _Err2>) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void swap(expected<_Tp2, _Err>& __rhs) noexcept( _CCCL_TRAIT(is_nothrow_move_constructible, _Tp2) && _CCCL_TRAIT(is_nothrow_swappable, _Tp2) && _CCCL_TRAIT(is_nothrow_move_constructible, _Err) && _CCCL_TRAIT(is_nothrow_swappable, _Err)) @@ -478,7 +473,7 @@ class expected : private __expected_move_assign<_Tp, _Err> friend _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 auto swap(expected& __x, expected& __y) noexcept( _CCCL_TRAIT(is_nothrow_move_constructible, _Tp2) && _CCCL_TRAIT(is_nothrow_swappable, _Tp2) && _CCCL_TRAIT(is_nothrow_move_constructible, _Err2) && _CCCL_TRAIT(is_nothrow_swappable, _Err2)) - _LIBCUDACXX_TRAILING_REQUIRES(void)(__expected::__can_swap<_Tp2, _Err2>) + _CCCL_TRAILING_REQUIRES(void)(__expected::__can_swap<_Tp2, _Err2>) { return __x.swap(__y); // some compiler warn about non void function without return } @@ -617,8 +612,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } // [expected.object.monadic] - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) & { using _Res = remove_cvref_t>; @@ -637,8 +632,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) const& { using _Res = remove_cvref_t>; @@ -657,8 +652,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) && { using _Res = remove_cvref_t>; @@ -677,8 +672,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) const&& { using _Res = remove_cvref_t>; @@ -697,8 +692,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, _Tp2&)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, _Tp2&)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto or_else(_Fun&& __fun) & { using _Res = remove_cvref_t>; @@ -718,8 +713,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto or_else(_Fun&& __fun) const& { using _Res = remove_cvref_t>; @@ -739,8 +734,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto or_else(_Fun&& __fun) && { using _Res = remove_cvref_t>; @@ -760,8 +755,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, const _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, const _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto or_else(_Fun&& __fun) const&& { using _Res = remove_cvref_t>; @@ -781,9 +776,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) & { static_assert(invocable<_Fun, _Tp&>, "std::expected::transform requires that F must be invocable with T."); @@ -800,9 +795,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) & { static_assert(invocable<_Fun, _Tp&>, "std::expected::transform requires that F must be invocable with T."); @@ -826,9 +821,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const& { static_assert(invocable<_Fun, const _Tp&>, "std::expected::transform requires that F must be invocable with T."); @@ -845,9 +840,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const& { static_assert(invocable<_Fun, const _Tp&>, "std::expected::transform requires that F must be invocable with T"); @@ -871,9 +866,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) && { static_assert(invocable<_Fun, _Tp>, "std::expected::transform requires that F must be invocable with T."); @@ -889,9 +884,9 @@ class expected : private __expected_move_assign<_Tp, _Err> return expected<_Res, _Err>{unexpect, _CUDA_VSTD::move(this->__union_.__unex_)}; } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) && { static_assert(invocable<_Fun, _Tp>, "std::expected::transform requires that F must be invocable with T"); @@ -918,9 +913,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const&& { static_assert(invocable<_Fun, const _Tp>, "std::expected::transform requires that F must be invocable with T."); @@ -937,9 +932,9 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const&& { static_assert(invocable<_Fun, const _Tp>, "std::expected::transform requires that F must be invocable with T"); @@ -966,8 +961,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, _Tp2&)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, _Tp2&)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform_error(_Fun&& __fun) & { static_assert(invocable<_Fun, _Err&>, "std::expected::transform_error requires that F must be invocable with E"); @@ -991,8 +986,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform_error(_Fun&& __fun) const& { static_assert(invocable<_Fun, const _Err&>, @@ -1017,8 +1012,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform_error(_Fun&& __fun) && { static_assert(invocable<_Fun, _Err>, "std::expected::transform_error requires that F must be invocable with E"); @@ -1045,8 +1040,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, const _Tp2)) + _CCCL_TEMPLATE(class _Fun, class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Tp2, const _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform_error(_Fun&& __fun) const&& { static_assert(invocable<_Fun, const _Err>, @@ -1101,8 +1096,8 @@ class expected : private __expected_move_assign<_Tp, _Err> } # endif // _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _T2, class _E2) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_void, _T2))) + _CCCL_TEMPLATE(class _T2, class _E2) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_void, _T2))) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const expected& __x, const expected<_T2, _E2>& __y) { if (__x.__has_val_ != __y.has_value()) @@ -1123,35 +1118,35 @@ class expected : private __expected_move_assign<_Tp, _Err> } # if _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _T2, class _E2) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_void, _T2))) + _CCCL_TEMPLATE(class _T2, class _E2) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_void, _T2))) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const expected& __x, const expected<_T2, _E2>& __y) { return !(__x == __y); } # endif // _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _T2) - _LIBCUDACXX_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) + _CCCL_TEMPLATE(class _T2) + _CCCL_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const expected& __x, const _T2& __v) { return __x.__has_val_ && static_cast(__x.__union_.__val_ == __v); } # if _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _T2) - _LIBCUDACXX_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) + _CCCL_TEMPLATE(class _T2) + _CCCL_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const _T2& __v, const expected& __x) { return __x.__has_val_ && static_cast(__x.__union_.__val_ == __v); } - _LIBCUDACXX_TEMPLATE(class _T2) - _LIBCUDACXX_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) + _CCCL_TEMPLATE(class _T2) + _CCCL_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const expected& __x, const _T2& __v) { return !__x.__has_val_ || static_cast(__x.__union_.__val_ != __v); } - _LIBCUDACXX_TEMPLATE(class _T2) - _LIBCUDACXX_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) + _CCCL_TEMPLATE(class _T2) + _CCCL_REQUIRES((!__expected::__is_expected_nonvoid<_T2>) ) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const _T2& __v, const expected& __x) { return !__x.__has_val_ || static_cast(__x.__union_.__val_ != __v); @@ -1217,8 +1212,8 @@ class expected : private __expected_move_assign _CCCL_HIDE_FROM_ABI constexpr expected& operator=(const expected&) = default; _CCCL_HIDE_FROM_ABI constexpr expected& operator=(expected&&) = default; - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, const _OtherErr&>::value _LIBCUDACXX_AND _CCCL_TRAIT( + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, const _OtherErr&>::value _CCCL_AND _CCCL_TRAIT( is_convertible, const _OtherErr&, _Err)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected(const expected<_Up, _OtherErr>& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened @@ -1230,8 +1225,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES(__can_convert<_Up, _OtherErr, const _OtherErr&>::value _LIBCUDACXX_AND( + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, const _OtherErr&>::value _CCCL_AND( !_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 explicit expected(const expected<_Up, _OtherErr>& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened @@ -1243,9 +1238,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES( - __can_convert<_Up, _OtherErr, _OtherErr>::value _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES(__can_convert<_Up, _OtherErr, _OtherErr>::value _CCCL_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected(expected<_Up, _OtherErr>&& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(__other.__has_val_) @@ -1256,9 +1250,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Up, class _OtherErr) - _LIBCUDACXX_REQUIRES( - __can_convert<_Up, _OtherErr, _OtherErr>::value _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) + _CCCL_TEMPLATE(class _Up, class _OtherErr) + _CCCL_REQUIRES( + __can_convert<_Up, _OtherErr, _OtherErr>::value _CCCL_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 explicit expected(expected<_Up, _OtherErr>&& __other) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(__other.__has_val_) @@ -1269,33 +1263,32 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND _CCCL_TRAIT(is_convertible, const _OtherErr&, _Err)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(const unexpected<_OtherErr>& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened : __base(unexpect, __unex.error()) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND(!_CCCL_TRAIT(is_convertible, const _OtherErr&, _Err))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(const unexpected<_OtherErr>& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened : __base(unexpect, __unex.error()) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) _CCCL_AND _CCCL_TRAIT(is_convertible, _OtherErr, _Err)) _LIBCUDACXX_HIDE_FROM_ABI constexpr expected(unexpected<_OtherErr>&& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(unexpect, _CUDA_VSTD::move(__unex.error())) {} - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) + _CCCL_AND(!_CCCL_TRAIT(is_convertible, _OtherErr, _Err))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(unexpected<_OtherErr>&& __unex) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) // strengthened : __base(unexpect, _CUDA_VSTD::move(__unex.error())) @@ -1305,15 +1298,15 @@ class expected : private __expected_move_assign : __base(true) {} - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected(unexpect_t, _Args&&... __args) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _Args...)) // strengthened : __base(unexpect, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit expected( unexpect_t, initializer_list<_Up> __il, @@ -1340,9 +1333,9 @@ class expected : private __expected_move_assign public: // [expected.void.dtor], destructor // [expected.void.assign], assignment - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_assignable, _Err&, const _OtherErr&)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, const _OtherErr&) + _CCCL_AND _CCCL_TRAIT(is_assignable, _Err&, const _OtherErr&)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(const unexpected<_OtherErr>& __un) noexcept( _CCCL_TRAIT(is_nothrow_assignable, _Err&, const _OtherErr&) && _CCCL_TRAIT(is_nothrow_constructible, _Err, const _OtherErr&)) // strengthened @@ -1359,9 +1352,8 @@ class expected : private __expected_move_assign return *this; } - _LIBCUDACXX_TEMPLATE(class _OtherErr) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) - _LIBCUDACXX_AND _CCCL_TRAIT(is_assignable, _Err&, _OtherErr)) + _CCCL_TEMPLATE(class _OtherErr) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _OtherErr) _CCCL_AND _CCCL_TRAIT(is_assignable, _Err&, _OtherErr)) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 expected& operator=(unexpected<_OtherErr>&& __un) noexcept( _CCCL_TRAIT(is_nothrow_assignable, _Err&, _OtherErr) && _CCCL_TRAIT(is_nothrow_constructible, _Err, _OtherErr)) { @@ -1387,8 +1379,8 @@ class expected : private __expected_move_assign } // [expected.void.swap], swap - _LIBCUDACXX_TEMPLATE(class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(__expected::__can_swap) + _CCCL_TEMPLATE(class _Err2 = _Err) + _CCCL_REQUIRES(__expected::__can_swap) _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void swap(expected& __rhs) noexcept( _CCCL_TRAIT(is_nothrow_move_constructible, _Err2) && _CCCL_TRAIT(is_nothrow_swappable, _Err2)) { @@ -1416,7 +1408,7 @@ class expected : private __expected_move_assign template friend _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 auto swap(expected& __x, expected& __y) noexcept( _CCCL_TRAIT(is_nothrow_move_constructible, _Err2) && _CCCL_TRAIT(is_nothrow_swappable, _Err2)) - _LIBCUDACXX_TRAILING_REQUIRES(void)(__expected::__can_swap) + _CCCL_TRAILING_REQUIRES(void)(__expected::__can_swap) { return __x.swap(__y); // some compiler warn about non void function without return } @@ -1482,8 +1474,8 @@ class expected : private __expected_move_assign } // [expected.void.monadic] - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) & { using _Res = remove_cvref_t>; @@ -1502,8 +1494,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) const& { using _Res = remove_cvref_t>; @@ -1522,8 +1514,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) && { using _Res = remove_cvref_t>; @@ -1542,8 +1534,8 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto and_then(_Fun&& __fun) const&& { using _Res = remove_cvref_t>; @@ -1642,9 +1634,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) & { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1659,9 +1651,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, _Err2&) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) & { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1684,9 +1676,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const& { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1701,9 +1693,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_copy_constructible, _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const& { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T"); @@ -1726,9 +1718,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) && { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1742,9 +1734,9 @@ class expected : private __expected_move_assign return expected{unexpect, _CUDA_VSTD::move(this->__union_.__unex_)}; } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_move_constructible, _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) && { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T"); @@ -1767,9 +1759,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) - _LIBCUDACXX_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) + _CCCL_AND _CCCL_TRAIT(is_same, remove_cv_t>, void)) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const&& { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T."); @@ -1784,9 +1776,9 @@ class expected : private __expected_move_assign } } - _LIBCUDACXX_TEMPLATE(class _Fun, class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) - _LIBCUDACXX_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) + _CCCL_TEMPLATE(class _Fun, class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err2, const _Err2) + _CCCL_AND(!_CCCL_TRAIT(is_same, remove_cv_t>, void))) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto transform(_Fun&& __fun) const&& { static_assert(invocable<_Fun>, "std::expected::transform requires that F must be invocable with T"); diff --git a/libcudacxx/include/cuda/std/__expected/expected_base.h b/libcudacxx/include/cuda/std/__expected/expected_base.h index 9c675a90456..f2eaa804196 100644 --- a/libcudacxx/include/cuda/std/__expected/expected_base.h +++ b/libcudacxx/include/cuda/std/__expected/expected_base.h @@ -71,14 +71,14 @@ union __expected_union_t struct __empty_t {}; - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr __expected_union_t() noexcept(_CCCL_TRAIT(is_nothrow_default_constructible, _Tp2)) : __val_() {} - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_default_constructible, _Tp2))) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_default_constructible, _Tp2))) _LIBCUDACXX_HIDE_FROM_ABI constexpr __expected_union_t() noexcept : __empty_() {} @@ -128,14 +128,14 @@ union __expected_union_t<_Tp, _Err, true> struct __empty_t {}; - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_default_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr __expected_union_t() noexcept(_CCCL_TRAIT(is_nothrow_default_constructible, _Tp2)) : __val_() {} - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_default_constructible, _Tp2))) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_default_constructible, _Tp2))) _LIBCUDACXX_HIDE_FROM_ABI constexpr __expected_union_t() noexcept : __empty_() {} @@ -436,8 +436,8 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> { _LIBCUDACXX_DELEGATE_CONSTRUCTORS(__expected_storage, __expected_destruct, _Tp, _Err); - _LIBCUDACXX_TEMPLATE(class _T1, class _T2, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) + _CCCL_TEMPLATE(class _T1, class _T2, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __reinit_expected(_T1& __newval, _T2& __oldval, _Args&&... __args) noexcept { @@ -445,9 +445,9 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> _LIBCUDACXX_CONSTRUCT_AT(__newval, _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class _T1, class _T2, class... _Args) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) _LIBCUDACXX_AND _CCCL_TRAIT( - is_nothrow_move_constructible, _T1)) + _CCCL_TEMPLATE(class _T1, class _T2, class... _Args) + _CCCL_REQUIRES( + (!_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) _CCCL_AND _CCCL_TRAIT(is_nothrow_move_constructible, _T1)) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __reinit_expected(_T1& __newval, _T2& __oldval, _Args&&... __args) { @@ -456,9 +456,9 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> _LIBCUDACXX_CONSTRUCT_AT(__newval, _CUDA_VSTD::move(__tmp)); } - _LIBCUDACXX_TEMPLATE(class _T1, class _T2, class... _Args) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) _LIBCUDACXX_AND( - !_CCCL_TRAIT(is_nothrow_move_constructible, _T1))) + _CCCL_TEMPLATE(class _T1, class _T2, class... _Args) + _CCCL_REQUIRES( + (!_CCCL_TRAIT(is_nothrow_constructible, _T1, _Args...)) _CCCL_AND(!_CCCL_TRAIT(is_nothrow_move_constructible, _T1))) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __reinit_expected(_T1& __newval, _T2& __oldval, _Args&&... __args) { @@ -475,8 +475,8 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> __trans.__complete(); } - _LIBCUDACXX_TEMPLATE(class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_nothrow_move_constructible, _Err2)) + _CCCL_TEMPLATE(class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_nothrow_move_constructible, _Err2)) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __swap_val_unex_impl(__expected_storage<_Tp, _Err2>& __with_val, __expected_storage& __with_err) { @@ -493,8 +493,8 @@ struct __expected_storage : __expected_destruct<_Tp, _Err> __with_err.__has_val_ = true; } - _LIBCUDACXX_TEMPLATE(class _Err2 = _Err) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_nothrow_move_constructible, _Err2))) + _CCCL_TEMPLATE(class _Err2 = _Err) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_nothrow_move_constructible, _Err2))) static _LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX20 void __swap_val_unex_impl(__expected_storage<_Tp, _Err2>& __with_val, __expected_storage& __with_err) { diff --git a/libcudacxx/include/cuda/std/__expected/unexpected.h b/libcudacxx/include/cuda/std/__expected/unexpected.h index 2bcf32cfa87..215a38d346c 100644 --- a/libcudacxx/include/cuda/std/__expected/unexpected.h +++ b/libcudacxx/include/cuda/std/__expected/unexpected.h @@ -73,24 +73,24 @@ class unexpected _CCCL_HIDE_FROM_ABI unexpected(const unexpected&) = default; _CCCL_HIDE_FROM_ABI unexpected(unexpected&&) = default; - _LIBCUDACXX_TEMPLATE(class _Error = _Err) - _LIBCUDACXX_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Error>, unexpected) - && !_CCCL_TRAIT(is_same, remove_cvref_t<_Error>, in_place_t) - && _CCCL_TRAIT(is_constructible, _Err, _Error))) + _CCCL_TEMPLATE(class _Error = _Err) + _CCCL_REQUIRES((!_CCCL_TRAIT(is_same, remove_cvref_t<_Error>, unexpected) + && !_CCCL_TRAIT(is_same, remove_cvref_t<_Error>, in_place_t) + && _CCCL_TRAIT(is_constructible, _Err, _Error))) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit unexpected(_Error&& __error) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _Error)) : __unex_(_CUDA_VSTD::forward<_Error>(__error)) {} - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit unexpected(in_place_t, _Args&&... __args) noexcept( _CCCL_TRAIT(is_nothrow_constructible, _Err, _Args...)) : __unex_(_CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, _Err, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit unexpected( in_place_t, initializer_list<_Up> __il, @@ -130,8 +130,8 @@ class unexpected swap(__unex_, __other.__unex_); } - _LIBCUDACXX_TEMPLATE(class _Err2 = _Err) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_swappable, _Err2)) + _CCCL_TEMPLATE(class _Err2 = _Err) + _CCCL_REQUIRES(_CCCL_TRAIT(is_swappable, _Err2)) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr void swap(unexpected& __lhs, unexpected& __rhs) noexcept(_CCCL_TRAIT(is_nothrow_swappable, _Err2)) { diff --git a/libcudacxx/include/cuda/std/__functional/bind_front.h b/libcudacxx/include/cuda/std/__functional/bind_front.h index 5ddbff62d33..68423e73772 100644 --- a/libcudacxx/include/cuda/std/__functional/bind_front.h +++ b/libcudacxx/include/cuda/std/__functional/bind_front.h @@ -68,8 +68,8 @@ _LIBCUDACXX_CONCEPT __can_bind_front = is_constructible_v, _Fn> && is_move_constructible_v> && (is_constructible_v, _Args> && ...) && (is_move_constructible_v> && ...); -_LIBCUDACXX_TEMPLATE(class _Fn, class... _Args) -_LIBCUDACXX_REQUIRES(__can_bind_front<_Fn, _Args...>) +_CCCL_TEMPLATE(class _Fn, class... _Args) +_CCCL_REQUIRES(__can_bind_front<_Fn, _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto bind_front(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_constructible_v...>, _Args&&...>) { diff --git a/libcudacxx/include/cuda/std/__functional/not_fn.h b/libcudacxx/include/cuda/std/__functional/not_fn.h index b2ee6abc17e..b146b13416f 100644 --- a/libcudacxx/include/cuda/std/__functional/not_fn.h +++ b/libcudacxx/include/cuda/std/__functional/not_fn.h @@ -51,8 +51,8 @@ struct __not_fn_t : __perfect_forward<__not_fn_op, _Fn> # if defined(_CCCL_COMPILER_NVRTC) // nvbug 3961621 _CCCL_HIDE_FROM_ABI constexpr __not_fn_t() noexcept = default; - _LIBCUDACXX_TEMPLATE(class _OrigFn) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_same, _Fn, decay_t<_OrigFn>)) + _CCCL_TEMPLATE(class _OrigFn) + _CCCL_REQUIRES(_CCCL_TRAIT(is_same, _Fn, decay_t<_OrigFn>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr __not_fn_t(_OrigFn&& __fn) noexcept( noexcept(__base(_CUDA_VSTD::declval<_OrigFn>()))) : __base(_CUDA_VSTD::forward<_OrigFn>(__fn)) diff --git a/libcudacxx/include/cuda/std/__functional/perfect_forward.h b/libcudacxx/include/cuda/std/__functional/perfect_forward.h index dc281d78e3a..4f7630ae7b6 100644 --- a/libcudacxx/include/cuda/std/__functional/perfect_forward.h +++ b/libcudacxx/include/cuda/std/__functional/perfect_forward.h @@ -46,8 +46,8 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> tuple<_BoundArgs...> __bound_args_; public: - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_constructible_v, _Args&&...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_constructible_v, _Args&&...>) _LIBCUDACXX_HIDE_FROM_ABI explicit constexpr __perfect_forward_impl(_Args&&... __bound_args) noexcept( is_nothrow_constructible_v, _Args&&...>) : __bound_args_(_CUDA_VSTD::forward<_Args>(__bound_args)...) @@ -59,8 +59,8 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> _CCCL_HIDE_FROM_ABI __perfect_forward_impl& operator=(__perfect_forward_impl const&) = default; _CCCL_HIDE_FROM_ABI __perfect_forward_impl& operator=(__perfect_forward_impl&&) = default; - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_invocable_v<_Op, _BoundArgs&..., _Args...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_invocable_v<_Op, _BoundArgs&..., _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) & noexcept( noexcept(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...))) -> decltype(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...)) @@ -68,12 +68,12 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> return _Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES((!is_invocable_v<_Op, _BoundArgs&..., _Args...>) ) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES((!is_invocable_v<_Op, _BoundArgs&..., _Args...>) ) _LIBCUDACXX_HIDE_FROM_ABI auto operator()(_Args&&...) & = delete; - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_invocable_v<_Op, _BoundArgs const&..., _Args...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_invocable_v<_Op, _BoundArgs const&..., _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const& noexcept( noexcept(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...))) -> decltype(_Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...)) @@ -81,12 +81,12 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> return _Op()(_CUDA_VSTD::get<_Idx>(__bound_args_)..., _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES((!is_invocable_v<_Op, _BoundArgs const&..., _Args...>) ) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES((!is_invocable_v<_Op, _BoundArgs const&..., _Args...>) ) _LIBCUDACXX_HIDE_FROM_ABI auto operator()(_Args&&...) const& = delete; - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_invocable_v<_Op, _BoundArgs..., _Args...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_invocable_v<_Op, _BoundArgs..., _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) && noexcept( noexcept(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...))) -> decltype(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...)) @@ -94,12 +94,12 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> return _Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES((!is_invocable_v<_Op, _BoundArgs..., _Args...>) ) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES((!is_invocable_v<_Op, _BoundArgs..., _Args...>) ) _LIBCUDACXX_HIDE_FROM_ABI auto operator()(_Args&&...) && = delete; - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES(is_invocable_v<_Op, _BoundArgs const..., _Args...>) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES(is_invocable_v<_Op, _BoundArgs const..., _Args...>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const&& noexcept( noexcept(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...))) -> decltype(_Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...)) @@ -107,8 +107,8 @@ struct __perfect_forward_impl<_Op, index_sequence<_Idx...>, _BoundArgs...> return _Op()(_CUDA_VSTD::get<_Idx>(_CUDA_VSTD::move(__bound_args_))..., _CUDA_VSTD::forward<_Args>(__args)...); } - _LIBCUDACXX_TEMPLATE(class... _Args) - _LIBCUDACXX_REQUIRES((!is_invocable_v<_Op, _BoundArgs const..., _Args...>) ) + _CCCL_TEMPLATE(class... _Args) + _CCCL_REQUIRES((!is_invocable_v<_Op, _BoundArgs const..., _Args...>) ) _LIBCUDACXX_HIDE_FROM_ABI auto operator()(_Args&&...) const&& = delete; }; diff --git a/libcudacxx/include/cuda/std/__functional/ranges_operations.h b/libcudacxx/include/cuda/std/__functional/ranges_operations.h index 6db42a3eee7..059eda975f4 100644 --- a/libcudacxx/include/cuda/std/__functional/ranges_operations.h +++ b/libcudacxx/include/cuda/std/__functional/ranges_operations.h @@ -31,8 +31,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES_ABI struct equal_to { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(equality_comparable_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(equality_comparable_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u)))) { @@ -44,8 +44,8 @@ struct equal_to struct not_equal_to { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(equality_comparable_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(equality_comparable_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Tp>(__t) == _CUDA_VSTD::forward<_Up>(__u))))) { @@ -57,8 +57,8 @@ struct not_equal_to struct less { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(totally_ordered_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(totally_ordered_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(_CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u)))) { @@ -70,8 +70,8 @@ struct less struct less_equal { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(totally_ordered_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(totally_ordered_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t))))) { @@ -83,8 +83,8 @@ struct less_equal struct greater { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(totally_ordered_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(totally_ordered_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(_CUDA_VSTD::forward<_Up>(__u) < _CUDA_VSTD::forward<_Tp>(__t)))) { @@ -96,8 +96,8 @@ struct greater struct greater_equal { - _LIBCUDACXX_TEMPLATE(class _Tp, class _Up) - _LIBCUDACXX_REQUIRES(totally_ordered_with<_Tp, _Up>) + _CCCL_TEMPLATE(class _Tp, class _Up) + _CCCL_REQUIRES(totally_ordered_with<_Tp, _Up>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t, _Up&& __u) const noexcept(noexcept(bool(!(_CUDA_VSTD::forward<_Tp>(__t) < _CUDA_VSTD::forward<_Up>(__u))))) { diff --git a/libcudacxx/include/cuda/std/__iterator/advance.h b/libcudacxx/include/cuda/std/__iterator/advance.h index aeb3c6993c1..17ba093634a 100644 --- a/libcudacxx/include/cuda/std/__iterator/advance.h +++ b/libcudacxx/include/cuda/std/__iterator/advance.h @@ -123,8 +123,8 @@ struct __fn public: // Preconditions: If `I` does not model `bidirectional_iterator`, `n` is not negative. - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, iter_difference_t<_Ip> __n) const { _CCCL_ASSERT(__n >= 0 || bidirectional_iterator<_Ip>, "If `n < 0`, then `bidirectional_iterator` must be true."); @@ -151,8 +151,8 @@ struct __fn } } - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip> _LIBCUDACXX_AND sentinel_for<_Sp, _Ip>) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES(input_or_output_iterator<_Ip> _CCCL_AND sentinel_for<_Sp, _Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_Ip& __i, _Sp __bound_sentinel) const { // If `I` and `S` model `assignable_from`, equivalent to `i = std::move(bound_sentinel)`. @@ -182,8 +182,8 @@ struct __fn // * If `n < 0`, [bound_sentinel, i) denotes a range, `I` models `bidirectional_iterator`, // and `I` and `S` model `same_as`. // Returns: `n - M`, where `M` is the difference between the ending and starting position. - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip> _LIBCUDACXX_AND sentinel_for<_Sp, _Ip>) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES(input_or_output_iterator<_Ip> _CCCL_AND sentinel_for<_Sp, _Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip& __i, iter_difference_t<_Ip> __n, _Sp __bound_sentinel) const { diff --git a/libcudacxx/include/cuda/std/__iterator/distance.h b/libcudacxx/include/cuda/std/__iterator/distance.h index 3623a6dcf0d..1e6fae1c988 100644 --- a/libcudacxx/include/cuda/std/__iterator/distance.h +++ b/libcudacxx/include/cuda/std/__iterator/distance.h @@ -67,8 +67,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__distance) struct __fn { - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES((sentinel_for<_Sp, _Ip> && !sized_sentinel_for<_Sp, _Ip>) ) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES((sentinel_for<_Sp, _Ip> && !sized_sentinel_for<_Sp, _Ip>) ) _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip __first, _Sp __last) const { iter_difference_t<_Ip> __n = 0; @@ -80,8 +80,8 @@ struct __fn return __n; } - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES((sized_sentinel_for<_Sp, decay_t<_Ip>>) ) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES((sized_sentinel_for<_Sp, decay_t<_Ip>>) ) _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip&& __first, _Sp __last) const { if constexpr (sized_sentinel_for<_Sp, remove_cvref_t<_Ip>>) @@ -95,8 +95,8 @@ struct __fn _CCCL_UNREACHABLE(); } - _LIBCUDACXX_TEMPLATE(class _Rp) - _LIBCUDACXX_REQUIRES((range<_Rp>) ) + _CCCL_TEMPLATE(class _Rp) + _CCCL_REQUIRES((range<_Rp>) ) _LIBCUDACXX_HIDE_FROM_ABI constexpr range_difference_t<_Rp> operator()(_Rp&& __r) const { if constexpr (sized_range<_Rp>) diff --git a/libcudacxx/include/cuda/std/__iterator/iter_move.h b/libcudacxx/include/cuda/std/__iterator/iter_move.h index 45192440a53..e956ea5ee86 100644 --- a/libcudacxx/include/cuda/std/__iterator/iter_move.h +++ b/libcudacxx/include/cuda/std/__iterator/iter_move.h @@ -92,24 +92,24 @@ _LIBCUDACXX_CONCEPT __just_deref = _LIBCUDACXX_FRAGMENT(__just_deref_, _Tp); struct __fn { - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(__unqualified_iter_move<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(__unqualified_iter_move<_Ip>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) operator()(_Ip&& __i) const noexcept(noexcept(iter_move(_CUDA_VSTD::forward<_Ip>(__i)))) { return iter_move(_CUDA_VSTD::forward<_Ip>(__i)); } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(__move_deref<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(__move_deref<_Ip>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Ip&& __i) const noexcept(noexcept( _CUDA_VSTD::move(*_CUDA_VSTD::forward<_Ip>(__i)))) -> decltype(_CUDA_VSTD::move(*_CUDA_VSTD::forward<_Ip>(__i))) { return _CUDA_VSTD::move(*_CUDA_VSTD::forward<_Ip>(__i)); } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(__just_deref<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(__just_deref<_Ip>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Ip&& __i) const noexcept(noexcept(*_CUDA_VSTD::forward<_Ip>(__i))) -> decltype(*_CUDA_VSTD::forward<_Ip>(__i)) { diff --git a/libcudacxx/include/cuda/std/__iterator/iter_swap.h b/libcudacxx/include/cuda/std/__iterator/iter_swap.h index a5d42ff0316..05e13f3240f 100644 --- a/libcudacxx/include/cuda/std/__iterator/iter_swap.h +++ b/libcudacxx/include/cuda/std/__iterator/iter_swap.h @@ -87,24 +87,24 @@ _LIBCUDACXX_CONCEPT __moveable_storable = _LIBCUDACXX_FRAGMENT(__moveable_storab struct __fn { - _LIBCUDACXX_TEMPLATE(class _T1, class _T2) - _LIBCUDACXX_REQUIRES(__unqualified_iter_swap<_T1, _T2>) + _CCCL_TEMPLATE(class _T1, class _T2) + _CCCL_REQUIRES(__unqualified_iter_swap<_T1, _T2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_T1&& __x, _T2&& __y) const noexcept(noexcept(iter_swap(_CUDA_VSTD::forward<_T1>(__x), _CUDA_VSTD::forward<_T2>(__y)))) { (void) iter_swap(_CUDA_VSTD::forward<_T1>(__x), _CUDA_VSTD::forward<_T2>(__y)); } - _LIBCUDACXX_TEMPLATE(class _T1, class _T2) - _LIBCUDACXX_REQUIRES(__readable_swappable<_T1, _T2>) + _CCCL_TEMPLATE(class _T1, class _T2) + _CCCL_REQUIRES(__readable_swappable<_T1, _T2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_T1&& __x, _T2&& __y) const noexcept(noexcept(_CUDA_VRANGES::swap(*_CUDA_VSTD::forward<_T1>(__x), *_CUDA_VSTD::forward<_T2>(__y)))) { _CUDA_VRANGES::swap(*_CUDA_VSTD::forward<_T1>(__x), *_CUDA_VSTD::forward<_T2>(__y)); } - _LIBCUDACXX_TEMPLATE(class _T1, class _T2) - _LIBCUDACXX_REQUIRES(__moveable_storable<_T2, _T1>) + _CCCL_TEMPLATE(class _T1, class _T2) + _CCCL_REQUIRES(__moveable_storable<_T2, _T1>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator()(_T1&& __x, _T2&& __y) const noexcept(noexcept(iter_value_t<_T2>(_CUDA_VRANGES::iter_move(__y))) && noexcept(*__y = _CUDA_VRANGES::iter_move(__x)) diff --git a/libcudacxx/include/cuda/std/__iterator/move_iterator.h b/libcudacxx/include/cuda/std/__iterator/move_iterator.h index db072903f2f..05efe454467 100644 --- a/libcudacxx/include/cuda/std/__iterator/move_iterator.h +++ b/libcudacxx/include/cuda/std/__iterator/move_iterator.h @@ -185,22 +185,22 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator : __current_() {} # else // ^^^ _CCCL_STD_VER > 2017 ^^^ / vvv _CCCL_STD_VER < 2020 vvv - _LIBCUDACXX_TEMPLATE(class _It2 = _Iter) - _LIBCUDACXX_REQUIRES(is_constructible_v<_It2>) + _CCCL_TEMPLATE(class _It2 = _Iter) + _CCCL_REQUIRES(is_constructible_v<_It2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_iterator() : __current_() {} # endif // _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES((!_IsSame<_Up, _Iter>::value) && convertible_to) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES((!_IsSame<_Up, _Iter>::value) && convertible_to) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_iterator(const move_iterator<_Up>& __u) : __current_(__u.base()) {} - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES((!_IsSame<_Up, _Iter>::value) - && convertible_to && assignable_from<_Iter&, const _Up&>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES((!_IsSame<_Up, _Iter>::value) + && convertible_to && assignable_from<_Iter&, const _Up&>) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_iterator& operator=(const move_iterator<_Up>& __u) { __current_ = __u.base(); @@ -225,8 +225,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator return _CUDA_VRANGES::iter_move(__current_ + __n); } - _LIBCUDACXX_TEMPLATE(class _It2 = _Iter) - _LIBCUDACXX_REQUIRES(forward_iterator<_It2>) + _CCCL_TEMPLATE(class _It2 = _Iter) + _CCCL_REQUIRES(forward_iterator<_It2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator++(int) { move_iterator __tmp(*this); @@ -234,8 +234,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator return __tmp; } - _LIBCUDACXX_TEMPLATE(class _It2 = _Iter) - _LIBCUDACXX_REQUIRES((!forward_iterator<_It2>) ) + _CCCL_TEMPLATE(class _It2 = _Iter) + _CCCL_REQUIRES((!forward_iterator<_It2>) ) _LIBCUDACXX_HIDE_FROM_ABI constexpr void operator++(int) { ++__current_; @@ -318,46 +318,46 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator } #if _CCCL_STD_VER > 2014 - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sentinel_for<_Sent, _Iter> _LIBCUDACXX_AND __move_iter_comparable<_Iter, _Sent>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sentinel_for<_Sent, _Iter> _CCCL_AND __move_iter_comparable<_Iter, _Sent>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const move_iterator& __x, const move_sentinel<_Sent>& __y) { return __x.base() == __y.base(); } # if _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sentinel_for<_Sent, _Iter> _LIBCUDACXX_AND __move_iter_comparable<_Iter, _Sent>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sentinel_for<_Sent, _Iter> _CCCL_AND __move_iter_comparable<_Iter, _Sent>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const move_sentinel<_Sent>& __y, const move_iterator& __x) { return __y.base() == __x.base(); } - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sentinel_for<_Sent, _Iter> _LIBCUDACXX_AND __move_iter_comparable<_Iter, _Sent>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sentinel_for<_Sent, _Iter> _CCCL_AND __move_iter_comparable<_Iter, _Sent>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const move_iterator& __x, const move_sentinel<_Sent>& __y) { return __x.base() != __y.base(); } - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sentinel_for<_Sent, _Iter> _LIBCUDACXX_AND __move_iter_comparable<_Iter, _Sent>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sentinel_for<_Sent, _Iter> _CCCL_AND __move_iter_comparable<_Iter, _Sent>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const move_sentinel<_Sent>& __y, const move_iterator& __x) { return __y.base() != __x.base(); } # endif // _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sized_sentinel_for<_Sent, _Iter>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sized_sentinel_for<_Sent, _Iter>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> operator-(const move_sentinel<_Sent>& __x, const move_iterator& __y) { return __x.base() - __y.base(); } - _LIBCUDACXX_TEMPLATE(class _Sent) - _LIBCUDACXX_REQUIRES(sized_sentinel_for<_Sent, _Iter>) + _CCCL_TEMPLATE(class _Sent) + _CCCL_REQUIRES(sized_sentinel_for<_Sent, _Iter>) friend _LIBCUDACXX_HIDE_FROM_ABI constexpr iter_difference_t<_Iter> operator-(const move_iterator& __x, const move_sentinel<_Sent>& __y) { @@ -374,7 +374,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator template _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap( const move_iterator<_Iter1>& __x, const move_iterator<_Iter2>& __y) noexcept(__noexcept_swappable<_Iter1, _Iter2>) - _LIBCUDACXX_TRAILING_REQUIRES(void)(same_as<_Iter1, _Iter>&& indirectly_swappable<_Iter2, _Iter1>) + _CCCL_TRAILING_REQUIRES(void)(same_as<_Iter1, _Iter>&& indirectly_swappable<_Iter2, _Iter1>) { return _CUDA_VRANGES::iter_swap(__x.__current_, __y.__current_); } @@ -382,7 +382,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_iterator template _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const move_iterator& __x, const move_iterator<_Iter2>& __y) noexcept(__noexcept_swappable<_Iter, _Iter2>) - _LIBCUDACXX_TRAILING_REQUIRES(void)(indirectly_swappable<_Iter2, _Iter>) + _CCCL_TRAILING_REQUIRES(void)(indirectly_swappable<_Iter2, _Iter>) { return _CUDA_VRANGES::iter_swap(__x.__current_, __y.__current_); } diff --git a/libcudacxx/include/cuda/std/__iterator/move_sentinel.h b/libcudacxx/include/cuda/std/__iterator/move_sentinel.h index 29bcaae141f..2bdef0bf59e 100644 --- a/libcudacxx/include/cuda/std/__iterator/move_sentinel.h +++ b/libcudacxx/include/cuda/std/__iterator/move_sentinel.h @@ -43,14 +43,14 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT move_sentinel : __last_(_CUDA_VSTD::move(__s)) {} - _LIBCUDACXX_TEMPLATE(class _S2) - _LIBCUDACXX_REQUIRES(convertible_to) + _CCCL_TEMPLATE(class _S2) + _CCCL_REQUIRES(convertible_to) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_sentinel(const move_sentinel<_S2>& __s) : __last_(__s.base()) {} - _LIBCUDACXX_TEMPLATE(class _S2) - _LIBCUDACXX_REQUIRES(assignable_from) + _CCCL_TEMPLATE(class _S2) + _CCCL_REQUIRES(assignable_from) _LIBCUDACXX_HIDE_FROM_ABI constexpr move_sentinel& operator=(const move_sentinel<_S2>& __s) { __last_ = __s.base(); diff --git a/libcudacxx/include/cuda/std/__iterator/next.h b/libcudacxx/include/cuda/std/__iterator/next.h index dee2d94b232..4651214e4bd 100644 --- a/libcudacxx/include/cuda/std/__iterator/next.h +++ b/libcudacxx/include/cuda/std/__iterator/next.h @@ -50,32 +50,32 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__next) struct __fn { - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x) const { ++__x; return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const { _CUDA_VRANGES::advance(__x, __n); return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>&& sentinel_for<_Sp, _Ip>) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>&& sentinel_for<_Sp, _Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, _Sp __bound_sentinel) const { _CUDA_VRANGES::advance(__x, __bound_sentinel); return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip, class _Sp) - _LIBCUDACXX_REQUIRES(input_or_output_iterator<_Ip>&& sentinel_for<_Sp, _Ip>) + _CCCL_TEMPLATE(class _Ip, class _Sp) + _CCCL_REQUIRES(input_or_output_iterator<_Ip>&& sentinel_for<_Sp, _Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Sp __bound_sentinel) const { _CUDA_VRANGES::advance(__x, __n, __bound_sentinel); diff --git a/libcudacxx/include/cuda/std/__iterator/prev.h b/libcudacxx/include/cuda/std/__iterator/prev.h index d87d8a91706..f28098d9e45 100644 --- a/libcudacxx/include/cuda/std/__iterator/prev.h +++ b/libcudacxx/include/cuda/std/__iterator/prev.h @@ -49,24 +49,24 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__prev) struct __fn { - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(bidirectional_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(bidirectional_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x) const { --__x; return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(bidirectional_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(bidirectional_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n) const { _CUDA_VRANGES::advance(__x, -__n); return __x; } - _LIBCUDACXX_TEMPLATE(class _Ip) - _LIBCUDACXX_REQUIRES(bidirectional_iterator<_Ip>) + _CCCL_TEMPLATE(class _Ip) + _CCCL_REQUIRES(bidirectional_iterator<_Ip>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _Ip operator()(_Ip __x, iter_difference_t<_Ip> __n, _Ip __bound_iter) const { _CUDA_VRANGES::advance(__x, -__n, __bound_iter); diff --git a/libcudacxx/include/cuda/std/__iterator/projected.h b/libcudacxx/include/cuda/std/__iterator/projected.h index 0882b15c3d5..d5cb94ced04 100644 --- a/libcudacxx/include/cuda/std/__iterator/projected.h +++ b/libcudacxx/include/cuda/std/__iterator/projected.h @@ -29,8 +29,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD #if _CCCL_STD_VER > 2014 -_LIBCUDACXX_TEMPLATE(class _It, class _Proj) -_LIBCUDACXX_REQUIRES(indirectly_readable<_It> _LIBCUDACXX_AND indirectly_regular_unary_invocable<_Proj, _It>) +_CCCL_TEMPLATE(class _It, class _Proj) +_CCCL_REQUIRES(indirectly_readable<_It> _CCCL_AND indirectly_regular_unary_invocable<_Proj, _It>) struct projected { using value_type = remove_cvref_t>; diff --git a/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h b/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h index b89c096ba30..6f2b0cce65e 100644 --- a/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h +++ b/libcudacxx/include/cuda/std/__iterator/reverse_iterator.h @@ -253,7 +253,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT reverse_iterator _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y) noexcept(__noexcept_rev_iter_iter_swap<_Iter1, _Iter2>) - _LIBCUDACXX_TRAILING_REQUIRES(void)(same_as<_Iter1, _Iter>&& indirectly_swappable<_Iter2, _Iter1>) + _CCCL_TRAILING_REQUIRES(void)(same_as<_Iter1, _Iter>&& indirectly_swappable<_Iter2, _Iter1>) { auto __xtmp = __x.base(); auto __ytmp = __y.base(); @@ -264,7 +264,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT reverse_iterator _LIBCUDACXX_HIDE_FROM_ABI friend constexpr auto iter_swap(const reverse_iterator& __x, const reverse_iterator<_Iter2>& __y) noexcept(__noexcept_rev_iter_iter_swap<_Iter, _Iter2>) - _LIBCUDACXX_TRAILING_REQUIRES(void)(indirectly_swappable<_Iter2, _Iter>) + _CCCL_TRAILING_REQUIRES(void)(indirectly_swappable<_Iter2, _Iter>) { auto __xtmp = __x.base(); auto __ytmp = __y.base(); diff --git a/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h b/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h index d4e5504b69c..785c6d149c9 100644 --- a/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h +++ b/libcudacxx/include/cuda/std/__iterator/unreachable_sentinel.h @@ -42,30 +42,30 @@ namespace __unreachable_sentinel_detail struct __unreachable_base # endif // _CCCL_COMPILER_MSVC { - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(weakly_incrementable<_Iter>) _CCCL_NODISCARD_FRIEND _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const unreachable_sentinel_t&, const _Iter&) noexcept { return false; } # if _CCCL_STD_VER < 2020 - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(weakly_incrementable<_Iter>) _CCCL_NODISCARD_FRIEND _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator==(const _Iter&, const unreachable_sentinel_t&) noexcept { return false; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(weakly_incrementable<_Iter>) _CCCL_NODISCARD_FRIEND _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const unreachable_sentinel_t&, const _Iter&) noexcept { return true; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(weakly_incrementable<_Iter>) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(weakly_incrementable<_Iter>) _CCCL_NODISCARD_FRIEND _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator!=(const _Iter&, const unreachable_sentinel_t&) noexcept { diff --git a/libcudacxx/include/cuda/std/__mdspan/default_accessor.h b/libcudacxx/include/cuda/std/__mdspan/default_accessor.h index 777eb8c97a4..ccba021aa99 100644 --- a/libcudacxx/include/cuda/std/__mdspan/default_accessor.h +++ b/libcudacxx/include/cuda/std/__mdspan/default_accessor.h @@ -72,8 +72,8 @@ struct default_accessor _CCCL_HIDE_FROM_ABI constexpr default_accessor() noexcept = default; - _LIBCUDACXX_TEMPLATE(class _OtherElementType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _OtherElementType (*)[], element_type (*)[])) + _CCCL_TEMPLATE(class _OtherElementType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _OtherElementType (*)[], element_type (*)[])) _LIBCUDACXX_HIDE_FROM_ABI constexpr default_accessor(default_accessor<_OtherElementType>) noexcept {} _LIBCUDACXX_HIDE_FROM_ABI constexpr data_handle_type offset(data_handle_type __p, size_t __i) const noexcept diff --git a/libcudacxx/include/cuda/std/__mdspan/extents.h b/libcudacxx/include/cuda/std/__mdspan/extents.h index 846759e395d..302cc26894a 100644 --- a/libcudacxx/include/cuda/std/__mdspan/extents.h +++ b/libcudacxx/include/cuda/std/__mdspan/extents.h @@ -246,8 +246,8 @@ class extents _CCCL_HIDE_FROM_ABI constexpr extents() noexcept = default; // Converting constructor - _LIBCUDACXX_TEMPLATE(class _OtherIndexType, size_t... _OtherExtents) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _OtherIndexType, size_t... _OtherExtents) + _CCCL_REQUIRES( /* multi-stage check to protect from invalid pack expansion when sizes don't match? */ (decltype(__detail::__check_compatible_extents( integral_constant{}, @@ -281,23 +281,22 @@ class extents } # ifdef __NVCC__ - _LIBCUDACXX_TEMPLATE(class... _Integral) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _Integral) + _CCCL_REQUIRES( // TODO: check whether the other version works with newest NVCC, doesn't with 11.4 // NVCC seems to pick up rank_dynamic from the wrong extents type??? __MDSPAN_FOLD_AND(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Integral, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND( - _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Integral) /* && ... */) _LIBCUDACXX_AND + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Integral) /* && ... */) + _CCCL_AND // NVCC chokes on the fold thingy here so wrote the workaround ((sizeof...(_Integral) == __detail::__count_dynamic_extents<_Extents...>::val) || (sizeof...(_Integral) == sizeof...(_Extents)))) # else - _LIBCUDACXX_TEMPLATE(class... _Integral) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _Integral) + _CCCL_REQUIRES( __MDSPAN_FOLD_AND(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Integral, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND( - _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Integral) /* && ... */) - _LIBCUDACXX_AND((sizeof...(_Integral) == rank_dynamic()) || (sizeof...(_Integral) == rank()))) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Integral) /* && ... */) + _CCCL_AND((sizeof...(_Integral) == rank_dynamic()) || (sizeof...(_Integral) == rank()))) # endif _LIBCUDACXX_HIDE_FROM_ABI explicit constexpr extents(_Integral... __exts) noexcept # ifndef _CCCL_HAS_NO_ATTRIBUTE_NO_UNIQUE_ADDRESS @@ -330,16 +329,16 @@ class extents # ifdef __NVCC__ // NVCC seems to pick up rank_dynamic from the wrong extents type??? // NVCC chokes on the fold thingy here so wrote the workaround - _LIBCUDACXX_TEMPLATE(class _IndexType, size_t _Np) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _IndexType, size_t _Np) + _CCCL_REQUIRES( _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) - _LIBCUDACXX_AND((_Np == __detail::__count_dynamic_extents<_Extents...>::val) || (_Np == sizeof...(_Extents)))) + _CCCL_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) + _CCCL_AND((_Np == __detail::__count_dynamic_extents<_Extents...>::val) || (_Np == sizeof...(_Extents)))) # else - _LIBCUDACXX_TEMPLATE(class _IndexType, size_t _Np) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) - _LIBCUDACXX_AND(_Np == rank() || _Np == rank_dynamic())) + _CCCL_TEMPLATE(class _IndexType, size_t _Np) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) + _CCCL_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) + _CCCL_AND(_Np == rank() || _Np == rank_dynamic())) # endif __MDSPAN_CONDITIONAL_EXPLICIT(_Np != rank_dynamic()) _LIBCUDACXX_HIDE_FROM_ABI constexpr extents(_CUDA_VSTD::array<_IndexType, _Np> const& __exts) noexcept @@ -373,16 +372,16 @@ class extents # ifdef __NVCC__ // NVCC seems to pick up rank_dynamic from the wrong extents type??? // NVCC chokes on the fold thingy here so wrote the workaround - _LIBCUDACXX_TEMPLATE(class _IndexType, size_t _Np) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _IndexType, size_t _Np) + _CCCL_REQUIRES( _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) - _LIBCUDACXX_AND((_Np == __detail::__count_dynamic_extents<_Extents...>::val) || (_Np == sizeof...(_Extents)))) + _CCCL_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) + _CCCL_AND((_Np == __detail::__count_dynamic_extents<_Extents...>::val) || (_Np == sizeof...(_Extents)))) # else - _LIBCUDACXX_TEMPLATE(class _IndexType, size_t _Np) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) - _LIBCUDACXX_AND(_Np == rank() || _Np == rank_dynamic())) + _CCCL_TEMPLATE(class _IndexType, size_t _Np) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _IndexType, index_type) + _CCCL_AND _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _IndexType) + _CCCL_AND(_Np == rank() || _Np == rank_dynamic())) # endif __MDSPAN_CONDITIONAL_EXPLICIT(_Np != rank_dynamic()) _LIBCUDACXX_HIDE_FROM_ABI constexpr extents(_CUDA_VSTD::span<_IndexType, _Np> __exts) noexcept diff --git a/libcudacxx/include/cuda/std/__mdspan/layout_left.h b/libcudacxx/include/cuda/std/__mdspan/layout_left.h index f20ffc89bef..8a11107f390 100644 --- a/libcudacxx/include/cuda/std/__mdspan/layout_left.h +++ b/libcudacxx/include/cuda/std/__mdspan/layout_left.h @@ -120,8 +120,8 @@ class layout_left::mapping : __extents(__exts) {} - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((!_CUDA_VSTD::is_convertible<_OtherExtents, extents_type>::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -134,9 +134,9 @@ class layout_left::mapping */ } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents) - _LIBCUDACXX_AND(extents_type::rank() <= 1)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents) + _CCCL_AND(extents_type::rank() <= 1)) __MDSPAN_CONDITIONAL_EXPLICIT((!_CUDA_VSTD::is_convertible<_OtherExtents, extents_type>::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -149,8 +149,8 @@ class layout_left::mapping */ } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((extents_type::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( layout_stride::mapping<_OtherExtents> const& __other) // NOLINT(google-explicit-constructor) @@ -186,8 +186,8 @@ class layout_left::mapping //-------------------------------------------------------------------------------- - _LIBCUDACXX_TEMPLATE(class... _Indices) - _LIBCUDACXX_REQUIRES((sizeof...(_Indices) == extents_type::rank()) _LIBCUDACXX_AND __MDSPAN_FOLD_AND( + _CCCL_TEMPLATE(class... _Indices) + _CCCL_REQUIRES((sizeof...(_Indices) == extents_type::rank()) _CCCL_AND __MDSPAN_FOLD_AND( (_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Indices, index_type) && _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Indices)))) _CCCL_HOST_DEVICE constexpr index_type operator()(_Indices... __idxs) const noexcept @@ -222,8 +222,8 @@ class layout_left::mapping return true; } - _LIBCUDACXX_TEMPLATE(class _Ext = _Extents) - _LIBCUDACXX_REQUIRES((_Ext::rank() > 0)) + _CCCL_TEMPLATE(class _Ext = _Extents) + _CCCL_REQUIRES((_Ext::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr index_type stride(rank_type __i) const noexcept { index_type __value = 1; diff --git a/libcudacxx/include/cuda/std/__mdspan/layout_right.h b/libcudacxx/include/cuda/std/__mdspan/layout_right.h index 463c7fc41d6..bd61461ab82 100644 --- a/libcudacxx/include/cuda/std/__mdspan/layout_right.h +++ b/libcudacxx/include/cuda/std/__mdspan/layout_right.h @@ -125,8 +125,8 @@ class layout_right::mapping : __extents(__exts) {} - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((!_CUDA_VSTD::is_convertible<_OtherExtents, extents_type>::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -139,9 +139,9 @@ class layout_right::mapping */ } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents) - _LIBCUDACXX_AND(extents_type::rank() <= 1)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents) + _CCCL_AND(extents_type::rank() <= 1)) __MDSPAN_CONDITIONAL_EXPLICIT((!_CUDA_VSTD::is_convertible<_OtherExtents, extents_type>::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -154,8 +154,8 @@ class layout_right::mapping */ } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, _OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((extents_type::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( layout_stride::mapping<_OtherExtents> const& __other) // NOLINT(google-explicit-constructor) @@ -191,8 +191,8 @@ class layout_right::mapping //-------------------------------------------------------------------------------- - _LIBCUDACXX_TEMPLATE(class... _Indices) - _LIBCUDACXX_REQUIRES((sizeof...(_Indices) == extents_type::rank()) _LIBCUDACXX_AND __MDSPAN_FOLD_AND( + _CCCL_TEMPLATE(class... _Indices) + _CCCL_REQUIRES((sizeof...(_Indices) == extents_type::rank()) _CCCL_AND __MDSPAN_FOLD_AND( (_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _Indices, index_type) && _CCCL_TRAIT(_CUDA_VSTD::is_nothrow_constructible, index_type, _Indices)))) _CCCL_HOST_DEVICE constexpr index_type operator()(_Indices... __idxs) const noexcept @@ -225,8 +225,8 @@ class layout_right::mapping return true; } - _LIBCUDACXX_TEMPLATE(class _Ext = _Extents) - _LIBCUDACXX_REQUIRES((_Ext::rank() > 0)) + _CCCL_TEMPLATE(class _Ext = _Extents) + _CCCL_REQUIRES((_Ext::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr index_type stride(rank_type __i) const noexcept { index_type __value = 1; diff --git a/libcudacxx/include/cuda/std/__mdspan/layout_stride.h b/libcudacxx/include/cuda/std/__mdspan/layout_stride.h index 723d2e816cd..3f31820cf49 100644 --- a/libcudacxx/include/cuda/std/__mdspan/layout_stride.h +++ b/libcudacxx/include/cuda/std/__mdspan/layout_stride.h @@ -294,7 +294,7 @@ struct layout_stride _CCCL_HIDE_FROM_ABI constexpr mapping() noexcept = default; _CCCL_HIDE_FROM_ABI constexpr mapping(mapping const&) noexcept = default; - // nvcc cannot deduce this constructor when using _LIBCUDACXX_REQUIRES + // nvcc cannot deduce this constructor when using _CCCL_REQUIRES template < class _IntegralTypes, enable_if_t<_CCCL_TRAIT(is_convertible, const remove_const_t<_IntegralTypes>&, index_type), int> = 0, @@ -323,7 +323,7 @@ struct layout_stride */ } - // nvcc cannot deduce this constructor when using _LIBCUDACXX_REQUIRES + // nvcc cannot deduce this constructor when using _CCCL_REQUIRES template < class _IntegralTypes, enable_if_t<_CCCL_TRAIT(is_convertible, const remove_const_t<_IntegralTypes>&, index_type), int> = 0, @@ -353,12 +353,11 @@ struct layout_stride } # if !(__MDSPAN_USE_CONCEPTS && __MDSPAN_HAS_CXX_20) - _LIBCUDACXX_TEMPLATE(class _StridedLayoutMapping) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _StridedLayoutMapping) + _CCCL_REQUIRES( _CCCL_TRAIT(_CUDA_VSTD::is_constructible, extents_type, typename _StridedLayoutMapping::extents_type) - _LIBCUDACXX_AND __detail::__is_mapping_of - _LIBCUDACXX_AND(_StridedLayoutMapping::is_always_unique()) - _LIBCUDACXX_AND(_StridedLayoutMapping::is_always_strided())) + _CCCL_AND __detail::__is_mapping_of + _CCCL_AND(_StridedLayoutMapping::is_always_unique()) _CCCL_AND(_StridedLayoutMapping::is_always_strided())) # else template requires(__detail::__layout_mapping_alike<_StridedLayoutMapping> @@ -425,11 +424,11 @@ struct layout_stride return __span_size; } - _LIBCUDACXX_TEMPLATE(class... _Indices) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _Indices) + _CCCL_REQUIRES( (sizeof...(_Indices) == _Extents::rank()) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _Indices, index_type) /*&& ...*/) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _Indices) /*&& ...*/)) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _Indices, index_type) /*&& ...*/) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _Indices) /*&& ...*/)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr index_type operator()(_Indices... __idxs) const noexcept { @@ -464,19 +463,18 @@ struct layout_stride return true; } - _LIBCUDACXX_TEMPLATE(class _Ext = _Extents) - _LIBCUDACXX_REQUIRES((_Ext::rank() > 0)) + _CCCL_TEMPLATE(class _Ext = _Extents) + _CCCL_REQUIRES((_Ext::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr index_type stride(rank_type __r) const noexcept { return __strides_storage()[__r]; } # if !(__MDSPAN_USE_CONCEPTS && __MDSPAN_HAS_CXX_20) - _LIBCUDACXX_TEMPLATE(class _StridedLayoutMapping) - _LIBCUDACXX_REQUIRES( - __detail::__is_mapping_of _LIBCUDACXX_AND( - extents_type::rank() == _StridedLayoutMapping::extents_type::rank()) - _LIBCUDACXX_AND(_StridedLayoutMapping::is_always_strided())) + _CCCL_TEMPLATE(class _StridedLayoutMapping) + _CCCL_REQUIRES(__detail::__is_mapping_of + _CCCL_AND(extents_type::rank() == _StridedLayoutMapping::extents_type::rank()) + _CCCL_AND(_StridedLayoutMapping::is_always_strided())) # else template requires(__detail::__layout_mapping_alike<_StridedLayoutMapping> @@ -496,8 +494,8 @@ struct layout_stride } // This one is not technically part of the proposal. Just here to make implementation a bit more optimal hopefully - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES((extents_type::rank() == _OtherExtents::rank())) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES((extents_type::rank() == _OtherExtents::rank())) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool operator==(mapping const& __lhs, mapping<_OtherExtents> const& __rhs) noexcept { @@ -505,19 +503,18 @@ struct layout_stride } # if !__MDSPAN_HAS_CXX_20 - _LIBCUDACXX_TEMPLATE(class _StridedLayoutMapping) - _LIBCUDACXX_REQUIRES( - __detail::__is_mapping_of _LIBCUDACXX_AND( - extents_type::rank() == _StridedLayoutMapping::extents_type::rank()) - _LIBCUDACXX_AND(_StridedLayoutMapping::is_always_strided())) + _CCCL_TEMPLATE(class _StridedLayoutMapping) + _CCCL_REQUIRES(__detail::__is_mapping_of + _CCCL_AND(extents_type::rank() == _StridedLayoutMapping::extents_type::rank()) + _CCCL_AND(_StridedLayoutMapping::is_always_strided())) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool operator!=(const mapping& __x, const _StridedLayoutMapping& __y) noexcept { return not(__x == __y); } - _LIBCUDACXX_TEMPLATE(class _OtherExtents) - _LIBCUDACXX_REQUIRES((extents_type::rank() == _OtherExtents::rank())) + _CCCL_TEMPLATE(class _OtherExtents) + _CCCL_REQUIRES((extents_type::rank() == _OtherExtents::rank())) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr bool operator!=(mapping const& __lhs, mapping<_OtherExtents> const& __rhs) noexcept { diff --git a/libcudacxx/include/cuda/std/__mdspan/mdspan.h b/libcudacxx/include/cuda/std/__mdspan/mdspan.h index e4df2f44865..ad359c555a2 100644 --- a/libcudacxx/include/cuda/std/__mdspan/mdspan.h +++ b/libcudacxx/include/cuda/std/__mdspan/mdspan.h @@ -176,13 +176,13 @@ class mdspan _CCCL_HIDE_FROM_ABI constexpr mdspan(const mdspan&) = default; _CCCL_HIDE_FROM_ABI constexpr mdspan(mdspan&&) = default; - _LIBCUDACXX_TEMPLATE(class... _SizeTypes) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _SizeTypes) + _CCCL_REQUIRES( __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _SizeTypes, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) - _LIBCUDACXX_AND((sizeof...(_SizeTypes) == rank()) || (sizeof...(_SizeTypes) == rank_dynamic())) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) + _CCCL_AND((sizeof...(_SizeTypes) == rank()) || (sizeof...(_SizeTypes) == rank_dynamic())) + _CCCL_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) + _CCCL_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) _LIBCUDACXX_HIDE_FROM_ABI explicit constexpr mdspan(data_handle_type __p, _SizeTypes... __dynamic_extents) // TODO @proposal-bug shouldn't I be allowed to do `move(__p)` here? : __members( @@ -191,11 +191,12 @@ class mdspan accessor_type())) {} - _LIBCUDACXX_TEMPLATE(class _SizeType, size_t _Np) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) _LIBCUDACXX_AND _CCCL_TRAIT( - is_nothrow_constructible, index_type, _SizeType) _LIBCUDACXX_AND((_Np == rank()) || (_Np == rank_dynamic())) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_TEMPLATE(class _SizeType, size_t _Np) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType) + _CCCL_AND((_Np == rank()) || (_Np == rank_dynamic())) + _CCCL_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) + _CCCL_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) __MDSPAN_CONDITIONAL_EXPLICIT(_Np != rank_dynamic()) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan(data_handle_type __p, const _CUDA_VSTD::array<_SizeType, _Np>& __dynamic_extents) @@ -203,26 +204,26 @@ class mdspan __map_acc_pair_t(mapping_type(extents_type(__dynamic_extents)), accessor_type())) {} - _LIBCUDACXX_TEMPLATE(class _SizeType, size_t _Np) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) _LIBCUDACXX_AND _CCCL_TRAIT( - is_nothrow_constructible, index_type, _SizeType) _LIBCUDACXX_AND((_Np == rank()) || (_Np == rank_dynamic())) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_TEMPLATE(class _SizeType, size_t _Np) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType) + _CCCL_AND((_Np == rank()) || (_Np == rank_dynamic())) + _CCCL_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type) + _CCCL_AND _CCCL_TRAIT(is_default_constructible, accessor_type)) __MDSPAN_CONDITIONAL_EXPLICIT(_Np != rank_dynamic()) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan(data_handle_type __p, _CUDA_VSTD::span<_SizeType, _Np> __dynamic_extents) : __members(_CUDA_VSTD::move(__p), __map_acc_pair_t(mapping_type(extents_type(_CUDA_VSTD::as_const(__dynamic_extents))), accessor_type())) {} - _LIBCUDACXX_TEMPLATE(bool _Is_default_constructible = _CCCL_TRAIT(is_default_constructible, accessor_type)) - _LIBCUDACXX_REQUIRES( - _Is_default_constructible _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type)) + _CCCL_TEMPLATE(bool _Is_default_constructible = _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_REQUIRES(_Is_default_constructible _CCCL_AND _CCCL_TRAIT(is_constructible, mapping_type, extents_type)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan(data_handle_type __p, const extents_type& __exts) : __members(_CUDA_VSTD::move(__p), __map_acc_pair_t(mapping_type(__exts), accessor_type())) {} - _LIBCUDACXX_TEMPLATE(bool _Is_default_constructible = _CCCL_TRAIT(is_default_constructible, accessor_type)) - _LIBCUDACXX_REQUIRES(_Is_default_constructible) + _CCCL_TEMPLATE(bool _Is_default_constructible = _CCCL_TRAIT(is_default_constructible, accessor_type)) + _CCCL_REQUIRES(_Is_default_constructible) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan(data_handle_type __p, const mapping_type& __m) : __members(_CUDA_VSTD::move(__p), __map_acc_pair_t(__m, accessor_type())) {} @@ -231,10 +232,10 @@ class mdspan : __members(_CUDA_VSTD::move(__p), __map_acc_pair_t(__m, __a)) {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType, class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class _OtherElementType, class _OtherExtents, class _OtherLayoutPolicy, class _OtherAccessor) + _CCCL_REQUIRES( _CCCL_TRAIT(is_constructible, mapping_type, typename _OtherLayoutPolicy::template mapping<_OtherExtents>) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, accessor_type, _OtherAccessor)) + _CCCL_AND _CCCL_TRAIT(is_constructible, accessor_type, _OtherAccessor)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mdspan( const mdspan<_OtherElementType, _OtherExtents, _OtherLayoutPolicy, _OtherAccessor>& __other) : __members(__other.__ptr_ref(), __map_acc_pair_t(__other.__mapping_ref(), __other.__accessor_ref())) @@ -262,11 +263,11 @@ class mdspan // [mdspan.basic.mapping], mdspan mapping domain multidimensional index to access codomain element # if __MDSPAN_USE_BRACKET_OPERATOR - _LIBCUDACXX_TEMPLATE(class... _SizeTypes) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _SizeTypes) + _CCCL_REQUIRES( __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _SizeTypes, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) - _LIBCUDACXX_AND(rank() == sizeof...(_SizeTypes))) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) + _CCCL_AND(rank() == sizeof...(_SizeTypes))) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator[](_SizeTypes... __indices) const { @@ -274,18 +275,18 @@ class mdspan } # endif - _LIBCUDACXX_TEMPLATE(class _SizeType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) + _CCCL_TEMPLATE(class _SizeType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator[](const _CUDA_VSTD::array<_SizeType, rank()>& __indices) const { return __impl::template __callop(*this, __indices); } - _LIBCUDACXX_TEMPLATE(class _SizeType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) + _CCCL_TEMPLATE(class _SizeType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator[](_CUDA_VSTD::span<_SizeType, rank()> __indices) const { @@ -293,9 +294,10 @@ class mdspan } # if !__MDSPAN_USE_BRACKET_OPERATOR - _LIBCUDACXX_TEMPLATE(class _Index) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _Index, index_type) _LIBCUDACXX_AND _CCCL_TRAIT( - is_nothrow_constructible, index_type, _Index) _LIBCUDACXX_AND(extents_type::rank() == 1)) + _CCCL_TEMPLATE(class _Index) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _Index, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _Index) + _CCCL_AND(extents_type::rank() == 1)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator[](_Index __idx) const { @@ -304,29 +306,29 @@ class mdspan # endif # if __MDSPAN_USE_PAREN_OPERATOR - _LIBCUDACXX_TEMPLATE(class... _SizeTypes) - _LIBCUDACXX_REQUIRES( + _CCCL_TEMPLATE(class... _SizeTypes) + _CCCL_REQUIRES( __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_convertible, _SizeTypes, index_type) /* && ... */) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) - _LIBCUDACXX_AND(extents_type::rank() == sizeof...(_SizeTypes))) + _CCCL_AND __MDSPAN_FOLD_AND(_CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeTypes) /* && ... */) + _CCCL_AND(extents_type::rank() == sizeof...(_SizeTypes))) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator()(_SizeTypes... __indices) const { return __accessor_ref().access(__ptr_ref(), __mapping_ref()(__indices...)); } - _LIBCUDACXX_TEMPLATE(class _SizeType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) + _CCCL_TEMPLATE(class _SizeType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator()(const _CUDA_VSTD::array<_SizeType, rank()>& __indices) const { return __impl::template __callop(*this, __indices); } - _LIBCUDACXX_TEMPLATE(class _SizeType) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) - _LIBCUDACXX_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) + _CCCL_TEMPLATE(class _SizeType) + _CCCL_REQUIRES(_CCCL_TRAIT(is_convertible, _SizeType, index_type) + _CCCL_AND _CCCL_TRAIT(is_nothrow_constructible, index_type, _SizeType)) __MDSPAN_FORCE_INLINE_FUNCTION constexpr reference operator()(_CUDA_VSTD::span<_SizeType, rank()> __indices) const { @@ -437,18 +439,18 @@ class mdspan }; # if defined(__MDSPAN_USE_CLASS_TEMPLATE_ARGUMENT_DEDUCTION) -_LIBCUDACXX_TEMPLATE(class _ElementType, class... _SizeTypes) -_LIBCUDACXX_REQUIRES(__MDSPAN_FOLD_AND(_CCCL_TRAIT(is_integral, _SizeTypes) /* && ... */) - _LIBCUDACXX_AND(sizeof...(_SizeTypes) > 0)) +_CCCL_TEMPLATE(class _ElementType, class... _SizeTypes) +_CCCL_REQUIRES(__MDSPAN_FOLD_AND(_CCCL_TRAIT(is_integral, _SizeTypes) /* && ... */) + _CCCL_AND(sizeof...(_SizeTypes) > 0)) _CCCL_HOST_DEVICE explicit mdspan(_ElementType*, _SizeTypes...) -> mdspan<_ElementType, dextents>; -_LIBCUDACXX_TEMPLATE(class _Pointer) -_LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_pointer, _CUDA_VSTD::remove_reference_t<_Pointer>)) +_CCCL_TEMPLATE(class _Pointer) +_CCCL_REQUIRES(_CCCL_TRAIT(is_pointer, _CUDA_VSTD::remove_reference_t<_Pointer>)) _CCCL_HOST_DEVICE mdspan(_Pointer&&) -> mdspan<_CUDA_VSTD::remove_pointer_t<_CUDA_VSTD::remove_reference_t<_Pointer>>, extents>; -_LIBCUDACXX_TEMPLATE(class _CArray) -_LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_array, _CArray) _LIBCUDACXX_AND(rank_v<_CArray> == 1)) +_CCCL_TEMPLATE(class _CArray) +_CCCL_REQUIRES(_CCCL_TRAIT(is_array, _CArray) _CCCL_AND(rank_v<_CArray> == 1)) _CCCL_HOST_DEVICE mdspan(_CArray&) -> mdspan<_CUDA_VSTD::remove_all_extents_t<_CArray>, extents>>; diff --git a/libcudacxx/include/cuda/std/__mdspan/static_array.h b/libcudacxx/include/cuda/std/__mdspan/static_array.h index 70715173bd6..326ca279b74 100644 --- a/libcudacxx/include/cuda/std/__mdspan/static_array.h +++ b/libcudacxx/include/cuda/std/__mdspan/static_array.h @@ -158,8 +158,8 @@ class __partially_static_array_impl< : __partially_static_array_impl(__construct_psa_from_all_exts_values_tag, _CUDA_VSTD::get<_Idxs>(__vals)...) {} - _LIBCUDACXX_TEMPLATE(bool _SizeMatches = (sizeof...(_Idxs) != __size_dynamic)) - _LIBCUDACXX_REQUIRES(_SizeMatches) + _CCCL_TEMPLATE(bool _SizeMatches = (sizeof...(_Idxs) != __size_dynamic)) + _CCCL_REQUIRES(_SizeMatches) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit __partially_static_array_impl( array<_Tp, __size_dynamic> const& __vals) noexcept __partially_static_array_impl(__construct_psa_from_dynamic_exts_values_tag, diff --git a/libcudacxx/include/cuda/std/__mdspan/submdspan.h b/libcudacxx/include/cuda/std/__mdspan/submdspan.h index 92d79209e2a..2053c3a6d88 100644 --- a/libcudacxx/include/cuda/std/__mdspan/submdspan.h +++ b/libcudacxx/include/cuda/std/__mdspan/submdspan.h @@ -521,15 +521,14 @@ struct _is_layout_stride : true_type //============================================================================== -_LIBCUDACXX_TEMPLATE(class _ET, class _EXT, class _LP, class _AP, class... _SliceSpecs) -_LIBCUDACXX_REQUIRES( +_CCCL_TEMPLATE(class _ET, class _EXT, class _LP, class _AP, class... _SliceSpecs) +_CCCL_REQUIRES( (_CCCL_TRAIT(_CUDA_VSTD::is_same, _LP, layout_left) || _CCCL_TRAIT(_CUDA_VSTD::is_same, _LP, layout_right) || __detail::_is_layout_stride<_LP>::value) - _LIBCUDACXX_AND __MDSPAN_FOLD_AND( - (_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, size_t) - || _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, tuple) - || _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, full_extent_t)) /* && ... */) - _LIBCUDACXX_AND(sizeof...(_SliceSpecs) == _EXT::rank())) + _CCCL_AND __MDSPAN_FOLD_AND((_CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, size_t) + || _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, tuple) + || _CCCL_TRAIT(_CUDA_VSTD::is_convertible, _SliceSpecs, full_extent_t)) /* && ... */) + _CCCL_AND(sizeof...(_SliceSpecs) == _EXT::rank())) _LIBCUDACXX_HIDE_FROM_ABI __MDSPAN_DEDUCE_RETURN_TYPE_SINGLE_LINE( (constexpr submdspan(mdspan<_ET, _EXT, _LP, _AP> const& __src, _SliceSpecs... __slices) noexcept), ( diff --git a/libcudacxx/include/cuda/std/__ranges/access.h b/libcudacxx/include/cuda/std/__ranges/access.h index eae85751f4c..14686989fd9 100644 --- a/libcudacxx/include/cuda/std/__ranges/access.h +++ b/libcudacxx/include/cuda/std/__ranges/access.h @@ -84,24 +84,24 @@ struct __fn { // This has been made valid as a defect report for C++17 onwards, however gcc below 11.0 does not implement it # if (!defined(_CCCL_COMPILER_GCC) || __GNUC__ >= 11) - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[]) const noexcept { return __t + 0; } # endif // (!defined(__GNUC__) || __GNUC__ >= 11) - _LIBCUDACXX_TEMPLATE(class _Tp, size_t _Np) - _LIBCUDACXX_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. + _CCCL_TEMPLATE(class _Tp, size_t _Np) + _CCCL_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept { return __t + 0; } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_begin<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_begin<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.begin()))) { @@ -109,16 +109,16 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_begin<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_begin<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(begin(__t)))) { return _LIBCUDACXX_AUTO_CAST(begin(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((!__member_begin<_Tp>) _LIBCUDACXX_AND(!__unqualified_begin<_Tp>)) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((!__member_begin<_Tp>) _CCCL_AND(!__unqualified_begin<_Tp>)) void operator()(_Tp&&) const = delete; }; _LIBCUDACXX_END_NAMESPACE_CPO @@ -181,16 +181,16 @@ _LIBCUDACXX_CONCEPT __unqualified_end = _LIBCUDACXX_FRAGMENT(__unqualified_end_, struct __fn { - _LIBCUDACXX_TEMPLATE(class _Tp, size_t _Np) - _LIBCUDACXX_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. + _CCCL_TEMPLATE(class _Tp, size_t _Np) + _CCCL_REQUIRES((sizeof(_Tp) >= 0)) // Disallow incomplete element types. _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp (&__t)[_Np]) const noexcept { return __t + _Np; } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_end<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_end<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.end()))) { @@ -198,16 +198,16 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_end<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_end<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(end(__t)))) { return _LIBCUDACXX_AUTO_CAST(end(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((!__member_end<_Tp>) _LIBCUDACXX_AND(!__unqualified_end<_Tp>)) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((!__member_end<_Tp>) _CCCL_AND(!__unqualified_end<_Tp>)) void operator()(_Tp&&) const = delete; }; _LIBCUDACXX_END_NAMESPACE_CPO @@ -223,8 +223,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__cbegin) struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::begin(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::begin(static_cast&>(__t))) @@ -233,8 +233,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::begin(static_cast(__t)))) -> decltype(_CUDA_VRANGES::begin(static_cast(__t))) @@ -255,8 +255,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__cend) struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::end(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::end(static_cast&>(__t))) @@ -265,8 +265,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept( _CUDA_VRANGES::end(static_cast(__t)))) -> decltype(_CUDA_VRANGES::end(static_cast(__t))) { diff --git a/libcudacxx/include/cuda/std/__ranges/data.h b/libcudacxx/include/cuda/std/__ranges/data.h index d28da2031aa..3c73d6d287b 100644 --- a/libcudacxx/include/cuda/std/__ranges/data.h +++ b/libcudacxx/include/cuda/std/__ranges/data.h @@ -78,16 +78,16 @@ _LIBCUDACXX_CONCEPT __ranges_begin_invocable = _LIBCUDACXX_FRAGMENT(__ranges_beg struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_data<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_data<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(__t.data())) { return __t.data(); } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__ranges_begin_invocable<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__ranges_begin_invocable<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VSTD::to_address(_CUDA_VRANGES::begin(__t)))) { @@ -106,8 +106,8 @@ _CCCL_GLOBAL_CONSTANT auto data = __data::__fn{}; _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__cdata) struct __fn { - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::data(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::data(static_cast&>(__t))) @@ -115,8 +115,8 @@ struct __fn return _CUDA_VRANGES::data(static_cast&>(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept( _CUDA_VRANGES::data(static_cast(__t)))) -> decltype(_CUDA_VRANGES::data(static_cast(__t))) { diff --git a/libcudacxx/include/cuda/std/__ranges/empty.h b/libcudacxx/include/cuda/std/__ranges/empty.h index 8b41ac1deeb..7c9411c19ad 100644 --- a/libcudacxx/include/cuda/std/__ranges/empty.h +++ b/libcudacxx/include/cuda/std/__ranges/empty.h @@ -74,24 +74,24 @@ _LIBCUDACXX_CONCEPT __can_compare_begin_end = _LIBCUDACXX_FRAGMENT(__can_compare struct __fn { - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_empty<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_empty<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const noexcept(noexcept(bool(__t.empty()))) { return bool(__t.empty()); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_invoke_size<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_invoke_size<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::size(__t))) { return _CUDA_VRANGES::size(__t) == 0; } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_compare_begin_end<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_compare_begin_end<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool operator()(_Tp&& __t) const noexcept(noexcept(bool(_CUDA_VRANGES::begin(__t) == _CUDA_VRANGES::end(__t)))) { diff --git a/libcudacxx/include/cuda/std/__ranges/enable_view.h b/libcudacxx/include/cuda/std/__ranges/enable_view.h index ff6376001e8..1e5a09cd541 100644 --- a/libcudacxx/include/cuda/std/__ranges/enable_view.h +++ b/libcudacxx/include/cuda/std/__ranges/enable_view.h @@ -52,8 +52,8 @@ class view_interface; _LIBCUDACXX_END_NAMESPACE_RANGES_ABI -_LIBCUDACXX_TEMPLATE(class _Op, class _Yp) -_LIBCUDACXX_REQUIRES(is_convertible_v<_Op*, view_interface<_Yp>*>) +_CCCL_TEMPLATE(class _Op, class _Yp) +_CCCL_REQUIRES(is_convertible_v<_Op*, view_interface<_Yp>*>) _LIBCUDACXX_HIDE_FROM_ABI void __is_derived_from_view_interface(const _Op*, const view_interface<_Yp>*); # if _CCCL_STD_VER >= 2020 diff --git a/libcudacxx/include/cuda/std/__ranges/rbegin.h b/libcudacxx/include/cuda/std/__ranges/rbegin.h index 98d92deda2e..4d1bb7a0fb1 100644 --- a/libcudacxx/include/cuda/std/__ranges/rbegin.h +++ b/libcudacxx/include/cuda/std/__ranges/rbegin.h @@ -99,8 +99,8 @@ _LIBCUDACXX_CONCEPT __can_reverse = _LIBCUDACXX_FRAGMENT(__can_reverse_, _Tp); struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_rbegin<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_rbegin<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.rbegin()))) { @@ -108,8 +108,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_rbegin<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_rbegin<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(rbegin(__t)))) { @@ -117,16 +117,16 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_reverse<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_reverse<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::end(__t))) { return _CUDA_VSTD::make_reverse_iterator(_CUDA_VRANGES::end(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((!__member_rbegin<_Tp> && !__unqualified_rbegin<_Tp> && !__can_reverse<_Tp>) ) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((!__member_rbegin<_Tp> && !__unqualified_rbegin<_Tp> && !__can_reverse<_Tp>) ) void operator()(_Tp&&) const = delete; }; _LIBCUDACXX_END_NAMESPACE_CPO @@ -142,8 +142,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__crbegin) struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::rbegin(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::rbegin(static_cast&>(__t))) @@ -152,8 +152,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::rbegin(static_cast(__t)))) -> decltype(_CUDA_VRANGES::rbegin(static_cast(__t))) diff --git a/libcudacxx/include/cuda/std/__ranges/rend.h b/libcudacxx/include/cuda/std/__ranges/rend.h index 429c701f347..dd4a11d3a0b 100644 --- a/libcudacxx/include/cuda/std/__ranges/rend.h +++ b/libcudacxx/include/cuda/std/__ranges/rend.h @@ -106,8 +106,8 @@ class __fn { public: _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_rend<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_rend<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.rend()))) { @@ -115,8 +115,8 @@ class __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_rend<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_rend<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(rend(__t)))) { @@ -124,16 +124,16 @@ class __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_reverse<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_reverse<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::begin(__t))) { return _CUDA_VSTD::make_reverse_iterator(_CUDA_VRANGES::begin(__t)); } - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES((!__member_rend<_Tp> && !__unqualified_rend<_Tp> && !__can_reverse<_Tp>) ) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES((!__member_rend<_Tp> && !__unqualified_rend<_Tp> && !__can_reverse<_Tp>) ) void operator()(_Tp&&) const = delete; }; _LIBCUDACXX_END_NAMESPACE_CPO @@ -149,8 +149,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__crend) struct __fn { _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_lvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_lvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::rend(static_cast&>(__t)))) -> decltype(_CUDA_VRANGES::rend(static_cast&>(__t))) @@ -159,8 +159,8 @@ struct __fn } _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(is_rvalue_reference_v<_Tp&&>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(is_rvalue_reference_v<_Tp&&>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept( _CUDA_VRANGES::rend(static_cast(__t)))) -> decltype(_CUDA_VRANGES::rend(static_cast(__t))) { diff --git a/libcudacxx/include/cuda/std/__ranges/size.h b/libcudacxx/include/cuda/std/__ranges/size.h index 259900b537e..80227afc412 100644 --- a/libcudacxx/include/cuda/std/__ranges/size.h +++ b/libcudacxx/include/cuda/std/__ranges/size.h @@ -124,8 +124,8 @@ struct __fn // `[range.prim.size]`: `auto(t.size())` is a valid expression. _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__member_size<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__member_size<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(__t.size()))) { @@ -134,8 +134,8 @@ struct __fn // `[range.prim.size]`: `auto(size(t))` is a valid expression. _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__unqualified_size<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__unqualified_size<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_LIBCUDACXX_AUTO_CAST(size(__t)))) { @@ -144,8 +144,8 @@ struct __fn // [range.prim.size]: the `to-unsigned-like` case. _CCCL_EXEC_CHECK_DISABLE - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__difference<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__difference<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VSTD::__to_unsigned_like(_CUDA_VRANGES::end(__t) - _CUDA_VRANGES::begin(__t)))) -> decltype(_CUDA_VSTD::__to_unsigned_like(_CUDA_VRANGES::end(__t) - _CUDA_VRANGES::begin(__t))) @@ -177,8 +177,8 @@ _LIBCUDACXX_CONCEPT __can_ssize = _LIBCUDACXX_FRAGMENT(__can_ssize_, _Tp); struct __fn { - _LIBCUDACXX_TEMPLATE(class _Tp) - _LIBCUDACXX_REQUIRES(__can_ssize<_Tp>) + _CCCL_TEMPLATE(class _Tp) + _CCCL_REQUIRES(__can_ssize<_Tp>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t) const noexcept(noexcept(_CUDA_VRANGES::size(__t))) { diff --git a/libcudacxx/include/cuda/std/__ranges/subrange.h b/libcudacxx/include/cuda/std/__ranges/subrange.h index 61cf0fa77dc..8be1d88ccd3 100644 --- a/libcudacxx/include/cuda/std/__ranges/subrange.h +++ b/libcudacxx/include/cuda/std/__ranges/subrange.h @@ -256,16 +256,16 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface>(){}; # endif // _CCCL_STD_VER <= 2017 - _LIBCUDACXX_TEMPLATE(class _It) - _LIBCUDACXX_REQUIRES(__subrange_from_iter_sent<_Iter, _It, _StoreSize>) + _CCCL_TEMPLATE(class _It) + _CCCL_REQUIRES(__subrange_from_iter_sent<_Iter, _It, _StoreSize>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_It __iter, _Sent __sent) : view_interface>() , __begin_(_CUDA_VSTD::move(__iter)) , __end_(_CUDA_VSTD::move(__sent)) {} - _LIBCUDACXX_TEMPLATE(class _It) - _LIBCUDACXX_REQUIRES(__subrange_from_iter_sent_size<_Iter, _Kind, _It>) + _CCCL_TEMPLATE(class _It) + _CCCL_REQUIRES(__subrange_from_iter_sent_size<_Iter, _Kind, _It>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_It __iter, _Sent __sent, make_unsigned_t> __n) : view_interface>() , __begin_(_CUDA_VSTD::move(__iter)) @@ -279,42 +279,42 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__subrange_from_range<_Iter, _Sent, _Kind, _Range, !_StoreSize>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_Range&& __range) : subrange(_CUDA_VRANGES::begin(__range), _CUDA_VRANGES::end(__range)) {} - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(__subrange_from_range<_Iter, _Sent, _Kind, _Range, _StoreSize>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__subrange_from_range<_Iter, _Sent, _Kind, _Range, _StoreSize>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_Range&& __range) : subrange(__range, _CUDA_VRANGES::size(__range)) {} - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(__subrange_from_range_size<_Iter, _Sent, _Kind, _Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__subrange_from_range_size<_Iter, _Sent, _Kind, _Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange(_Range&& __range, make_unsigned_t> __n) : subrange(_CUDA_VRANGES::begin(__range), _CUDA_VRANGES::end(__range), __n) {} # if (!defined(_CCCL_COMPILER_GCC) || _GNUC_VER >= 900) - _LIBCUDACXX_TEMPLATE(class _Pair) - _LIBCUDACXX_REQUIRES(__pair_like<_Pair> _LIBCUDACXX_AND __subrange_to_pair<_Iter, _Sent, _Kind, _Pair>) + _CCCL_TEMPLATE(class _Pair) + _CCCL_REQUIRES(__pair_like<_Pair> _CCCL_AND __subrange_to_pair<_Iter, _Sent, _Kind, _Pair>) _LIBCUDACXX_HIDE_FROM_ABI constexpr operator _Pair() const { return _Pair(__begin_, __end_); } # endif // !(_CCCL_COMPILER_GCC < 9) - _LIBCUDACXX_TEMPLATE(class _It = _Iter) - _LIBCUDACXX_REQUIRES(copyable<_It>) + _CCCL_TEMPLATE(class _It = _Iter) + _CCCL_REQUIRES(copyable<_It>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr _It begin() const { return __begin_; } - _LIBCUDACXX_TEMPLATE(class _It = _Iter) - _LIBCUDACXX_REQUIRES((!copyable<_It>) ) + _CCCL_TEMPLATE(class _It = _Iter) + _CCCL_REQUIRES((!copyable<_It>) ) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr _It begin() { return _CUDA_VSTD::move(__begin_); @@ -330,8 +330,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface> size() const { if constexpr (_StoreSize) @@ -347,8 +347,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface) + _CCCL_TEMPLATE(class _It = _Iter) + _CCCL_REQUIRES(forward_iterator<_It>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange next(iter_difference_t<_Iter> __n = 1) const& { auto __tmp = *this; @@ -362,8 +362,8 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface) + _CCCL_TEMPLATE(class _It = _Iter) + _CCCL_REQUIRES(bidirectional_iterator<_It>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr subrange prev(iter_difference_t<_Iter> __n = 1) const { auto __tmp = *this; @@ -396,17 +396,17 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT subrange : public view_interface _LIBCUDACXX_AND sentinel_for<_Sent, _Iter>) +_CCCL_TEMPLATE(class _Iter, class _Sent) +_CCCL_REQUIRES(input_or_output_iterator<_Iter> _CCCL_AND sentinel_for<_Sent, _Iter>) _CCCL_HOST_DEVICE subrange(_Iter, _Sent) -> subrange<_Iter, _Sent>; -_LIBCUDACXX_TEMPLATE(class _Iter, class _Sent) -_LIBCUDACXX_REQUIRES(input_or_output_iterator<_Iter> _LIBCUDACXX_AND sentinel_for<_Sent, _Iter>) +_CCCL_TEMPLATE(class _Iter, class _Sent) +_CCCL_REQUIRES(input_or_output_iterator<_Iter> _CCCL_AND sentinel_for<_Sent, _Iter>) _CCCL_HOST_DEVICE subrange(_Iter, _Sent, make_unsigned_t>) -> subrange<_Iter, _Sent, subrange_kind::sized>; -_LIBCUDACXX_TEMPLATE(class _Range) -_LIBCUDACXX_REQUIRES(borrowed_range<_Range>) +_CCCL_TEMPLATE(class _Range) +_CCCL_REQUIRES(borrowed_range<_Range>) _CCCL_HOST_DEVICE subrange(_Range&&) -> subrange, sentinel_t<_Range>, @@ -414,14 +414,14 @@ _CCCL_HOST_DEVICE subrange(_Range&&) ? subrange_kind::sized : subrange_kind::unsized>; -_LIBCUDACXX_TEMPLATE(class _Range) -_LIBCUDACXX_REQUIRES(borrowed_range<_Range>) +_CCCL_TEMPLATE(class _Range) +_CCCL_REQUIRES(borrowed_range<_Range>) _CCCL_HOST_DEVICE subrange(_Range&&, make_unsigned_t>) -> subrange, sentinel_t<_Range>, subrange_kind::sized>; _LIBCUDACXX_END_NAMESPACE_RANGES_ABI -// Not _LIBCUDACXX_TEMPLATE because we need to forward declare them +// Not _CCCL_TEMPLATE because we need to forward declare them # if _CCCL_STD_VER >= 2020 template requires((_Index == 0) && copyable<_Iter>) || (_Index == 1) diff --git a/libcudacxx/include/cuda/std/__ranges/unwrap_end.h b/libcudacxx/include/cuda/std/__ranges/unwrap_end.h index 96d1a96b1fd..f134f141e8f 100644 --- a/libcudacxx/include/cuda/std/__ranges/unwrap_end.h +++ b/libcudacxx/include/cuda/std/__ranges/unwrap_end.h @@ -29,8 +29,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_RANGES #if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) -_LIBCUDACXX_TEMPLATE(class _Range) -_LIBCUDACXX_REQUIRES(forward_range<_Range>) +_CCCL_TEMPLATE(class _Range) +_CCCL_REQUIRES(forward_range<_Range>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator_t<_Range> __unwrap_end(_Range& __range) { if constexpr (common_range<_Range>) diff --git a/libcudacxx/include/cuda/std/__ranges/view_interface.h b/libcudacxx/include/cuda/std/__ranges/view_interface.h index 7b44aba63a9..5042770abde 100644 --- a/libcudacxx/include/cuda/std/__ranges/view_interface.h +++ b/libcudacxx/include/cuda/std/__ranges/view_interface.h @@ -73,104 +73,103 @@ class view_interface } public: - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range<_D2>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range<_D2>) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty() { return _CUDA_VRANGES::begin(__derived()) == _CUDA_VRANGES::end(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range) _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr bool empty() const { return _CUDA_VRANGES::begin(__derived()) == _CUDA_VRANGES::end(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(__can_empty<_D2>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(__can_empty<_D2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit operator bool() { return !_CUDA_VRANGES::empty(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(__can_empty) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(__can_empty) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit operator bool() const { return !_CUDA_VRANGES::empty(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(contiguous_iterator>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(contiguous_iterator>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto data() { return _CUDA_VSTD::to_address(_CUDA_VRANGES::begin(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(range _LIBCUDACXX_AND contiguous_iterator>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(range _CCCL_AND contiguous_iterator>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto data() const { return _CUDA_VSTD::to_address(_CUDA_VRANGES::begin(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range<_D2> _LIBCUDACXX_AND sized_sentinel_for, iterator_t<_D2>>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range<_D2> _CCCL_AND sized_sentinel_for, iterator_t<_D2>>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto size() { return _CUDA_VSTD::__to_unsigned_like(_CUDA_VRANGES::end(__derived()) - _CUDA_VRANGES::begin(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES( - forward_range _LIBCUDACXX_AND sized_sentinel_for, iterator_t>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range _CCCL_AND sized_sentinel_for, iterator_t>) _LIBCUDACXX_HIDE_FROM_ABI constexpr auto size() const { return _CUDA_VSTD::__to_unsigned_like(_CUDA_VRANGES::end(__derived()) - _CUDA_VRANGES::begin(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range<_D2>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range<_D2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) front() { _CCCL_ASSERT(!empty(), "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); return *_CUDA_VRANGES::begin(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(forward_range) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(forward_range) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) front() const { _CCCL_ASSERT(!empty(), "Precondition `!empty()` not satisfied. `.front()` called on an empty view."); return *_CUDA_VRANGES::begin(__derived()); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(bidirectional_range<_D2> _LIBCUDACXX_AND common_range<_D2>) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(bidirectional_range<_D2> _CCCL_AND common_range<_D2>) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) back() { _CCCL_ASSERT(!empty(), "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); return *_CUDA_VRANGES::prev(_CUDA_VRANGES::end(__derived())); } - _LIBCUDACXX_TEMPLATE(class _D2 = _Derived) - _LIBCUDACXX_REQUIRES(bidirectional_range _LIBCUDACXX_AND common_range) + _CCCL_TEMPLATE(class _D2 = _Derived) + _CCCL_REQUIRES(bidirectional_range _CCCL_AND common_range) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) back() const { _CCCL_ASSERT(!empty(), "Precondition `!empty()` not satisfied. `.back()` called on an empty view."); return *_CUDA_VRANGES::prev(_CUDA_VRANGES::end(__derived())); } - _LIBCUDACXX_TEMPLATE(class _RARange = _Derived) - _LIBCUDACXX_REQUIRES(random_access_range<_RARange>) + _CCCL_TEMPLATE(class _RARange = _Derived) + _CCCL_REQUIRES(random_access_range<_RARange>) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) { return _CUDA_VRANGES::begin(__derived())[__index]; } - _LIBCUDACXX_TEMPLATE(class _RARange = const _Derived) - _LIBCUDACXX_REQUIRES(random_access_range<_RARange>) + _CCCL_TEMPLATE(class _RARange = const _Derived) + _CCCL_REQUIRES(random_access_range<_RARange>) _LIBCUDACXX_HIDE_FROM_ABI constexpr decltype(auto) operator[](range_difference_t<_RARange> __index) const { return _CUDA_VRANGES::begin(__derived())[__index]; diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/optional b/libcudacxx/include/cuda/std/detail/libcxx/include/optional index b43e8dceeb0..6b5d9401556 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/optional +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/optional @@ -691,60 +691,54 @@ public: _CCCL_HIDE_FROM_ABI constexpr optional(optional&&) = default; _LIBCUDACXX_HIDE_FROM_ABI constexpr optional(nullopt_t) noexcept {} - _LIBCUDACXX_TEMPLATE(class _In_place_t, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_same, _In_place_t, in_place_t) - _LIBCUDACXX_AND _CCCL_TRAIT(is_constructible, value_type, _Args...)) + _CCCL_TEMPLATE(class _In_place_t, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_same, _In_place_t, in_place_t) + _CCCL_AND _CCCL_TRAIT(is_constructible, value_type, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(_In_place_t, _Args&&... __args) : __base(in_place, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up, class... _Args) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_constructible, value_type, initializer_list<_Up>&, _Args...)) + _CCCL_TEMPLATE(class _Up, class... _Args) + _CCCL_REQUIRES(_CCCL_TRAIT(is_constructible, value_type, initializer_list<_Up>&, _Args...)) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args) : __base(in_place, __il, _CUDA_VSTD::forward<_Args>(__args)...) {} - _LIBCUDACXX_TEMPLATE(class _Up = value_type) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_U<_Tp, _Up> _LIBCUDACXX_AND __opt_is_implictly_constructible<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up = value_type) + _CCCL_REQUIRES(__opt_is_constructible_from_U<_Tp, _Up> _CCCL_AND __opt_is_implictly_constructible<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional(_Up&& __v) : __base(in_place, _CUDA_VSTD::forward<_Up>(__v)) {} - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_U<_Tp, _Up> _LIBCUDACXX_AND __opt_is_explictly_constructible<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_U<_Tp, _Up> _CCCL_AND __opt_is_explictly_constructible<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(_Up&& __v) : __base(in_place, _CUDA_VSTD::forward<_Up>(__v)) {} - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_implictly_constructible<_Tp, const _Up&>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_opt<_Tp, _Up> _CCCL_AND __opt_is_implictly_constructible<_Tp, const _Up&>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional(const optional<_Up>& __v) { this->__construct_from(__v); } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_explictly_constructible<_Tp, const _Up&>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_opt<_Tp, _Up> _CCCL_AND __opt_is_explictly_constructible<_Tp, const _Up&>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(const optional<_Up>& __v) { this->__construct_from(__v); } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_implictly_constructible<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_opt<_Tp, _Up> _CCCL_AND __opt_is_implictly_constructible<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional(optional<_Up>&& __v) { this->__construct_from(_CUDA_VSTD::move(__v)); } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES( - __opt_is_constructible_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_explictly_constructible<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_constructible_from_opt<_Tp, _Up> _CCCL_AND __opt_is_explictly_constructible<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit optional(optional<_Up>&& __v) { this->__construct_from(_CUDA_VSTD::move(__v)); @@ -768,8 +762,8 @@ public: constexpr optional& operator=(const optional&) = default; constexpr optional& operator=(optional&&) = default; - _LIBCUDACXX_TEMPLATE(class _Up = value_type) - _LIBCUDACXX_REQUIRES(__opt_is_assignable_from_U<_Tp, _Up> _LIBCUDACXX_AND __opt_is_assignable<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up = value_type) + _CCCL_REQUIRES(__opt_is_assignable_from_U<_Tp, _Up> _CCCL_AND __opt_is_assignable<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional& operator=(_Up&& __v) { if (this->has_value()) @@ -783,16 +777,16 @@ public: return *this; } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES(__opt_is_assignable_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_assignable<_Tp, const _Up&>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_assignable_from_opt<_Tp, _Up> _CCCL_AND __opt_is_assignable<_Tp, const _Up&>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional& operator=(const optional<_Up>& __v) { this->__assign_from(__v); return *this; } - _LIBCUDACXX_TEMPLATE(class _Up) - _LIBCUDACXX_REQUIRES(__opt_is_assignable_from_opt<_Tp, _Up> _LIBCUDACXX_AND __opt_is_assignable<_Tp, _Up>) + _CCCL_TEMPLATE(class _Up) + _CCCL_REQUIRES(__opt_is_assignable_from_opt<_Tp, _Up> _CCCL_AND __opt_is_assignable<_Tp, _Up>) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional& operator=(optional<_Up>&& __v) { this->__assign_from(_CUDA_VSTD::move(__v)); @@ -1059,8 +1053,8 @@ public: return optional<_Up>(); } - _LIBCUDACXX_TEMPLATE(class _Func, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(invocable<_Func> _LIBCUDACXX_AND _CCCL_TRAIT(is_copy_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Func, class _Tp2 = _Tp) + _CCCL_REQUIRES(invocable<_Func> _CCCL_AND _CCCL_TRAIT(is_copy_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) const& { static_assert(_CCCL_TRAIT(is_same, remove_cvref_t>, optional), @@ -1072,8 +1066,8 @@ public: return _CUDA_VSTD::forward<_Func>(__f)(); } - _LIBCUDACXX_TEMPLATE(class _Func, class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(invocable<_Func> _LIBCUDACXX_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Func, class _Tp2 = _Tp) + _CCCL_REQUIRES(invocable<_Func> _CCCL_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr optional or_else(_Func&& __f) && { static_assert(_CCCL_TRAIT(is_same, remove_cvref_t>, optional), diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/span b/libcudacxx/include/cuda/std/detail/libcxx/include/span index ab67136accb..7e3cfc1fd8e 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/span +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/span @@ -334,8 +334,8 @@ public: _CCCL_HIDE_FROM_ABI span& operator=(const span&) noexcept = default; # if defined(_CCCL_SPAN_USES_RANGES) - _LIBCUDACXX_TEMPLATE(class _It) - _LIBCUDACXX_REQUIRES(__span_compatible_iterator<_It, element_type>) + _CCCL_TEMPLATE(class _It) + _CCCL_REQUIRES(__span_compatible_iterator<_It, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit span(_It __first, size_type __count) : __data_{_CUDA_VSTD::to_address(__first)} { @@ -343,9 +343,8 @@ public: _CCCL_ASSERT(_Extent == __count, "size mismatch in span's constructor (iterator, len)"); } - _LIBCUDACXX_TEMPLATE(class _It, class _End) - _LIBCUDACXX_REQUIRES( - __span_compatible_iterator<_It, element_type> _LIBCUDACXX_AND __span_compatible_sentinel_for<_End, _It>) + _CCCL_TEMPLATE(class _It, class _End) + _CCCL_REQUIRES(__span_compatible_iterator<_It, element_type> _CCCL_AND __span_compatible_sentinel_for<_End, _It>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit span(_It __first, _End __last) : __data_{_CUDA_VSTD::to_address(__first)} { @@ -380,37 +379,37 @@ public: {} # endif // !_CCCL_COMPILER_NVRTC && !_CCCL_COMPILER_MSVC_2017 - _LIBCUDACXX_TEMPLATE(class _OtherElementType) - _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType) + _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(array<_OtherElementType, _Extent>& __arr) noexcept : __data_{__arr.data()} {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType) - _LIBCUDACXX_REQUIRES(__span_array_convertible) + _CCCL_TEMPLATE(class _OtherElementType) + _CCCL_REQUIRES(__span_array_convertible) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data_{__arr.data()} {} # if defined(_CCCL_SPAN_USES_RANGES) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(__span_compatible_range<_Range, element_type>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__span_compatible_range<_Range, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit span(_Range&& __r) : __data_{_CUDA_VRANGES::data(__r)} { _CCCL_ASSERT(_CUDA_VRANGES::size(__r) == _Extent, "size mismatch in span's constructor (range)"); } # else // ^^^ _CCCL_SPAN_USES_RANGES ^^^ / vvv !_CCCL_SPAN_USES_RANGES vvv - _LIBCUDACXX_TEMPLATE(class _Container) - _LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, _Tp>) + _CCCL_TEMPLATE(class _Container) + _CCCL_REQUIRES(__is_span_compatible_container<_Container, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_Container& __c) noexcept(noexcept(_CUDA_VSTD::data(__c))) : __data_{_CUDA_VSTD::data(__c)} { _CCCL_ASSERT(_Extent == _CUDA_VSTD::size(__c), "size mismatch in span's constructor (other span)"); } - _LIBCUDACXX_TEMPLATE(class _Container) - _LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, const _Tp>) + _CCCL_TEMPLATE(class _Container) + _CCCL_REQUIRES(__is_span_compatible_container<_Container, const _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const _Container& __c) noexcept(noexcept(_CUDA_VSTD::data(__c))) : __data_{_CUDA_VSTD::data(__c)} { @@ -418,15 +417,14 @@ public: } # endif // !_CCCL_SPAN_USES_RANGES - _LIBCUDACXX_TEMPLATE(class _OtherElementType, size_t _Extent2 = _Extent) - _LIBCUDACXX_REQUIRES((_Extent2 != dynamic_extent) - _LIBCUDACXX_AND __span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType, size_t _Extent2 = _Extent) + _CCCL_REQUIRES((_Extent2 != dynamic_extent) _CCCL_AND __span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const span<_OtherElementType, _Extent2>& __other) noexcept : __data_{__other.data()} {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType) - _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType) + _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr explicit span(const span<_OtherElementType, dynamic_extent>& __other) noexcept : __data_{__other.data()} { @@ -583,16 +581,15 @@ public: _CCCL_HIDE_FROM_ABI span& operator=(const span&) noexcept = default; # if defined(_CCCL_SPAN_USES_RANGES) - _LIBCUDACXX_TEMPLATE(class _It) - _LIBCUDACXX_REQUIRES(__span_compatible_iterator<_It, element_type>) + _CCCL_TEMPLATE(class _It) + _CCCL_REQUIRES(__span_compatible_iterator<_It, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_It __first, size_type __count) : __data_{_CUDA_VSTD::to_address(__first)} , __size_{__count} {} - _LIBCUDACXX_TEMPLATE(class _It, class _End) - _LIBCUDACXX_REQUIRES( - __span_compatible_iterator<_It, element_type> _LIBCUDACXX_AND __span_compatible_sentinel_for<_End, _It>) + _CCCL_TEMPLATE(class _It, class _End) + _CCCL_REQUIRES(__span_compatible_iterator<_It, element_type> _CCCL_AND __span_compatible_sentinel_for<_End, _It>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_It __first, _End __last) : __data_(_CUDA_VSTD::to_address(__first)) , __size_(__last - __first) @@ -617,45 +614,45 @@ public: , __size_{_Sz} {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType, size_t _Sz) - _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType, size_t _Sz) + _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(array<_OtherElementType, _Sz>& __arr) noexcept : __data_{__arr.data()} , __size_{_Sz} {} - _LIBCUDACXX_TEMPLATE(class _OtherElementType, size_t _Sz) - _LIBCUDACXX_REQUIRES(__span_array_convertible) + _CCCL_TEMPLATE(class _OtherElementType, size_t _Sz) + _CCCL_REQUIRES(__span_array_convertible) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data_{__arr.data()} , __size_{_Sz} {} # if defined(_CCCL_SPAN_USES_RANGES) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(__span_compatible_range<_Range, element_type>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(__span_compatible_range<_Range, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_Range&& __r) : __data_(_CUDA_VRANGES::data(__r)) , __size_{_CUDA_VRANGES::size(__r)} {} # else // ^^^ _CCCL_SPAN_USES_RANGES ^^^ / vvv !_CCCL_SPAN_USES_RANGES vvv - _LIBCUDACXX_TEMPLATE(class _Container) - _LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, _Tp>) + _CCCL_TEMPLATE(class _Container) + _CCCL_REQUIRES(__is_span_compatible_container<_Container, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(_Container& __c) : __data_{_CUDA_VSTD::data(__c)} , __size_{(size_type) _CUDA_VSTD::size(__c)} {} - _LIBCUDACXX_TEMPLATE(class _Container) - _LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, const _Tp>) + _CCCL_TEMPLATE(class _Container) + _CCCL_REQUIRES(__is_span_compatible_container<_Container, const _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const _Container& __c) : __data_{_CUDA_VSTD::data(__c)} , __size_{(size_type) _CUDA_VSTD::size(__c)} {} # endif // !_CCCL_SPAN_USES_RANGES - _LIBCUDACXX_TEMPLATE(class _OtherElementType, size_t _OtherExtent) - _LIBCUDACXX_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) + _CCCL_TEMPLATE(class _OtherElementType, size_t _OtherExtent) + _CCCL_REQUIRES(__span_array_convertible<_OtherElementType, element_type>) _LIBCUDACXX_HIDE_FROM_ABI constexpr span(const span<_OtherElementType, _OtherExtent>& __other) noexcept : __data_{__other.data()} , __size_{__other.size()} @@ -793,8 +790,8 @@ _LIBCUDACXX_HIDE_FROM_ABI auto as_bytes(span<_Tp, _Extent> __s) noexcept return __s.__as_bytes(); } -_LIBCUDACXX_TEMPLATE(class _Tp, size_t _Extent) -_LIBCUDACXX_REQUIRES((!is_const<_Tp>::value)) +_CCCL_TEMPLATE(class _Tp, size_t _Extent) +_CCCL_REQUIRES((!is_const<_Tp>::value)) _LIBCUDACXX_HIDE_FROM_ABI auto as_writable_bytes(span<_Tp, _Extent> __s) noexcept { return __s.__as_writable_bytes(); @@ -816,23 +813,23 @@ _CCCL_HOST_DEVICE span(const array<_Tp, _Sz>&) -> span; # if defined(_CCCL_SPAN_USES_RANGES) -_LIBCUDACXX_TEMPLATE(class _It, class _EndOrSize) -_LIBCUDACXX_REQUIRES(contiguous_iterator<_It>) +_CCCL_TEMPLATE(class _It, class _EndOrSize) +_CCCL_REQUIRES(contiguous_iterator<_It>) _CCCL_HOST_DEVICE span(_It, _EndOrSize) -> span>, __maybe_static_ext<_EndOrSize>>; -_LIBCUDACXX_TEMPLATE(class _Range) -_LIBCUDACXX_REQUIRES(_CUDA_VRANGES::contiguous_range<_Range>) +_CCCL_TEMPLATE(class _Range) +_CCCL_REQUIRES(_CUDA_VRANGES::contiguous_range<_Range>) _CCCL_HOST_DEVICE span(_Range&&) -> span>>; # else // ^^^ _CCCL_SPAN_USES_RANGES ^^^ / vvv !_CCCL_SPAN_USES_RANGES vvv -_LIBCUDACXX_TEMPLATE(class _Container) -_LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, typename _Container::value_type>) +_CCCL_TEMPLATE(class _Container) +_CCCL_REQUIRES(__is_span_compatible_container<_Container, typename _Container::value_type>) _CCCL_HOST_DEVICE span(_Container&) -> span; -_LIBCUDACXX_TEMPLATE(class _Container) -_LIBCUDACXX_REQUIRES(__is_span_compatible_container<_Container, const typename _Container::value_type>) +_CCCL_TEMPLATE(class _Container) +_CCCL_REQUIRES(__is_span_compatible_container<_Container, const typename _Container::value_type>) _CCCL_HOST_DEVICE span(const _Container&) -> span; # endif // !_CCCL_SPAN_USES_RANGES diff --git a/libcudacxx/include/cuda/std/inplace_vector b/libcudacxx/include/cuda/std/inplace_vector index 16c14bdfcfa..73449b26188 100644 --- a/libcudacxx/include/cuda/std/inplace_vector +++ b/libcudacxx/include/cuda/std/inplace_vector @@ -230,8 +230,8 @@ protected: this->__size_ -= static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_default_constructible, _Tp)) - _LIBCUDACXX_REQUIRES(_IsNothrow) + _CCCL_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_default_constructible, _Tp)) + _CCCL_REQUIRES(_IsNothrow) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_value_construct(iterator __first, iterator __last) noexcept { iterator __idx = __first; @@ -242,8 +242,8 @@ protected: this->__size_ += static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_default_constructible, _Tp)) - _LIBCUDACXX_REQUIRES((!_IsNothrow)) + _CCCL_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_default_constructible, _Tp)) + _CCCL_REQUIRES((!_IsNothrow)) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_value_construct(iterator __first, iterator __last) { iterator __idx = __first; @@ -256,8 +256,8 @@ protected: this->__size_ += static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) - _LIBCUDACXX_REQUIRES(_IsNothrow) + _CCCL_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) + _CCCL_REQUIRES(_IsNothrow) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_fill(iterator __first, iterator __last, const _Tp& __value) noexcept { iterator __idx = __first; @@ -268,8 +268,8 @@ protected: this->__size_ += static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) - _LIBCUDACXX_REQUIRES((!_IsNothrow)) + _CCCL_TEMPLATE(bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) + _CCCL_REQUIRES((!_IsNothrow)) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_fill(iterator __first, iterator __last, const _Tp& __value) { iterator __idx = __first; @@ -282,8 +282,8 @@ protected: this->__size_ += static_cast<__size_type>(__last - __first); } - _LIBCUDACXX_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) - _LIBCUDACXX_REQUIRES(_IsNothrow) + _CCCL_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) + _CCCL_REQUIRES(_IsNothrow) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_copy(_Iter __first, _Iter __last, iterator __dest) noexcept { iterator __curr = __dest; @@ -294,8 +294,8 @@ protected: this->__size_ += static_cast<__size_type>(__curr - __dest); } - _LIBCUDACXX_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) - _LIBCUDACXX_REQUIRES((!_IsNothrow)) + _CCCL_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_copy_constructible, _Tp)) + _CCCL_REQUIRES((!_IsNothrow)) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_copy(_Iter __first, _Iter __last, iterator __dest) { iterator __curr = __dest; @@ -308,8 +308,8 @@ protected: this->__size_ += static_cast<__size_type>(__curr - __dest); } - _LIBCUDACXX_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) - _LIBCUDACXX_REQUIRES(_IsNothrow) + _CCCL_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) + _CCCL_REQUIRES(_IsNothrow) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_move(_Iter __first, _Iter __last, iterator __dest) noexcept { iterator __curr = __dest; @@ -324,8 +324,8 @@ protected: this->__size_ += static_cast<__size_type>(__curr - __dest); } - _LIBCUDACXX_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) - _LIBCUDACXX_REQUIRES((!_IsNothrow)) + _CCCL_TEMPLATE(class _Iter, bool _IsNothrow = _CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) + _CCCL_REQUIRES((!_IsNothrow)) _LIBCUDACXX_HIDE_FROM_ABI void __uninitialized_move(_Iter __first, _Iter __last, iterator __dest) { iterator __curr = __dest; @@ -758,9 +758,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES( - __is_cpp17_input_iterator<_Iter>::value _LIBCUDACXX_AND(!__is_cpp17_forward_iterator<_Iter>::value)) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value _CCCL_AND(!__is_cpp17_forward_iterator<_Iter>::value)) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(_Iter __first, _Iter __last) : __base() { @@ -770,8 +769,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(_Iter __first, _Iter __last) : __base() { @@ -802,9 +801,9 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) : __base() { @@ -816,9 +815,9 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND _CUDA_VRANGES::sized_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND _CUDA_VRANGES::sized_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) : __base() { @@ -834,9 +833,9 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND(!_CUDA_VRANGES::sized_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND(!_CUDA_VRANGES::sized_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) : __base() { @@ -898,9 +897,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES( - __is_cpp17_input_iterator<_Iter>::value _LIBCUDACXX_AND(!__is_cpp17_forward_iterator<_Iter>::value)) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value _CCCL_AND(!__is_cpp17_forward_iterator<_Iter>::value)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign(_Iter __first, _Iter __last) { iterator __end = this->end(); @@ -920,8 +918,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign(_Iter __first, _Iter __last) { const auto __count = static_cast(_CUDA_VSTD::distance(__first, __last)); @@ -964,9 +962,9 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) { auto __first = _CUDA_VRANGES::begin(__range); @@ -988,9 +986,9 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND _CUDA_VRANGES::sized_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND _CUDA_VRANGES::sized_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) { const auto __size = _CUDA_VRANGES::size(__range); @@ -1014,9 +1012,9 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND(!_CUDA_VRANGES::sized_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND(!_CUDA_VRANGES::sized_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) { const auto __first = _CUDA_VRANGES::begin(__range); @@ -1203,9 +1201,8 @@ public: return __first; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES( - __is_cpp17_input_iterator<_Iter>::value _LIBCUDACXX_AND(!__is_cpp17_forward_iterator<_Iter>::value)) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value _CCCL_AND(!__is_cpp17_forward_iterator<_Iter>::value)) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert(const_iterator __cpos, _Iter __first, _Iter __last) { // add all new elements to the back then rotate @@ -1220,8 +1217,8 @@ public: return __res; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_forward_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert(const_iterator __cpos, _Iter __first, _Iter __last) { const auto __pos = static_cast(__cpos - this->cbegin()); @@ -1311,9 +1308,9 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __cpos, _Range&& __range) { // add all new elements to the back then rotate @@ -1330,18 +1327,17 @@ public: return __pos; } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND _CUDA_VRANGES::forward_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND _CUDA_VRANGES::forward_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __cpos, _Range&& __range) { auto __first = _CUDA_VRANGES::begin(__range); return insert(__cpos, __first, _CUDA_VRANGES::__unwrap_end(__range)); } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) { auto __first = _CUDA_VRANGES::begin(__range); @@ -1352,9 +1348,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND _CUDA_VRANGES::forward_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND _CUDA_VRANGES::forward_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) { auto __first = _CUDA_VRANGES::begin(__range); @@ -1457,9 +1452,9 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES( - _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND(!_CUDA_VRANGES::forward_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES( + _CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND(!_CUDA_VRANGES::forward_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept(_CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) { @@ -1472,9 +1467,9 @@ public: return __first; } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND _CUDA_VRANGES::sized_range<_Range>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND _CUDA_VRANGES::sized_range<_Range>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept(_CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) { @@ -1488,9 +1483,9 @@ public: return __middle; } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _LIBCUDACXX_AND - _CUDA_VRANGES::forward_range<_Range> _LIBCUDACXX_AND(!_CUDA_VRANGES::sized_range<_Range>)) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp> _CCCL_AND + _CUDA_VRANGES::forward_range<_Range> _CCCL_AND(!_CUDA_VRANGES::sized_range<_Range>)) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept(_CCCL_TRAIT(is_nothrow_move_constructible, _Tp)) { @@ -1627,8 +1622,8 @@ public: } _LIBCUDACXX_HIDE_FROM_ABI static constexpr void shrink_to_fit() noexcept {} - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_swappable, _Tp2) _LIBCUDACXX_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_swappable, _Tp2) _CCCL_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI constexpr void swap(inplace_vector& __other) noexcept( _CCCL_TRAIT(is_nothrow_swappable, _Tp2) && _CCCL_TRAIT(is_nothrow_move_constructible, _Tp2)) { @@ -1646,8 +1641,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Tp2 = _Tp) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(is_swappable, _Tp2) _LIBCUDACXX_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) + _CCCL_TEMPLATE(class _Tp2 = _Tp) + _CCCL_REQUIRES(_CCCL_TRAIT(is_swappable, _Tp2) _CCCL_AND _CCCL_TRAIT(is_move_constructible, _Tp2)) _LIBCUDACXX_HIDE_FROM_ABI friend constexpr void swap(inplace_vector& __lhs, inplace_vector& __rhs) noexcept( _Capacity == 0 || (_CCCL_TRAIT(is_nothrow_swappable, _Tp2) && _CCCL_TRAIT(is_nothrow_move_constructible, _Tp2))) { @@ -1771,8 +1766,8 @@ public: } } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(_Iter __first, _Iter __last) : __base() { @@ -1792,8 +1787,8 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr inplace_vector(from_range_t, _Range&& __range) : __base() { @@ -1823,8 +1818,8 @@ public: return; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign(_Iter __first, _Iter __last) { if (__first != __last) @@ -1844,8 +1839,8 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void assign_range(_Range&& __range) { if (_CUDA_VRANGES::begin(__range) != _CUDA_VRANGES::end(__range)) @@ -1981,8 +1976,8 @@ public: return nullptr; } - _LIBCUDACXX_TEMPLATE(class _Iter) - _LIBCUDACXX_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) + _CCCL_TEMPLATE(class _Iter) + _CCCL_REQUIRES(__is_cpp17_input_iterator<_Iter>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert(const_iterator, _Iter __first, _Iter __last) { if (__first != __last) @@ -2002,8 +1997,8 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr iterator insert_range(const_iterator __cpos, _Range&& __range) { if (_CUDA_VRANGES::begin(__range) != _CUDA_VRANGES::end(__range)) @@ -2013,8 +2008,8 @@ public: return nullptr; } - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) { if (_CUDA_VRANGES::begin(__range) != _CUDA_VRANGES::end(__range)) @@ -2067,8 +2062,8 @@ public: } # if _CCCL_STD_VER >= 2017 && !defined(_CCCL_COMPILER_MSVC_2017) - _LIBCUDACXX_TEMPLATE(class _Range) - _LIBCUDACXX_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) + _CCCL_TEMPLATE(class _Range) + _CCCL_REQUIRES(_CUDA_VRANGES::__container_compatible_range<_Range, _Tp>) _LIBCUDACXX_HIDE_FROM_ABI constexpr _CUDA_VRANGES::iterator_t<_Range> try_append_range(_Range&& __range) noexcept { return _CUDA_VRANGES::begin(__range); diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/inheritance.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/inheritance.pass.cpp index 1a5fa15483e..b980031d024 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/inheritance.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/inheritance.pass.cpp @@ -41,13 +41,12 @@ struct async_resource_base return false; } - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES((!cuda::property_with_value) - && _CUDA_VSTD::__is_included_in_v) // + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) // friend void get_property(const async_resource_base&, Property) noexcept {} - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) // + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) // friend typename Property::value_type get_property(const async_resource_base& res, Property) noexcept { return 42; diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/properties.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/properties.pass.cpp index 9568c00a8db..ab9d80ef296 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/properties.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/properties.pass.cpp @@ -53,29 +53,29 @@ static_assert( == (2 * sizeof(void*)), ""); -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES((!cuda::property_with_value) ) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES((!cuda::property_with_value) ) // int InvokeIfWithValue(const Ref& ref) { return -1; } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES(cuda::property_with_value) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES(cuda::property_with_value) // typename Property::value_type InvokeIfWithValue(const Ref& ref) { return get_property(ref, Property{}); } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES(cuda::property_with_value) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES(cuda::property_with_value) // int InvokeIfWithoutValue(const Ref& ref) { return -1; } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES((!cuda::property_with_value) ) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES((!cuda::property_with_value) ) // int InvokeIfWithoutValue(const Ref& ref) { get_property(ref, Property{}); diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/types.h b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/types.h index fd738dd8724..3d36c6a96d1 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/types.h +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/async_resource_ref/types.h @@ -58,12 +58,12 @@ struct async_resource int _val = 0; - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) friend void get_property(const async_resource&, Property) noexcept {} - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) friend typename Property::value_type get_property(const async_resource& res, Property) noexcept { return static_cast(res._val); diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/inheritance.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/inheritance.pass.cpp index 4ad9d0cc34a..4ddc1f1d7b7 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/inheritance.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/inheritance.pass.cpp @@ -37,13 +37,12 @@ struct resource_base return false; } - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES((!cuda::property_with_value) - && _CUDA_VSTD::__is_included_in_v) // + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) // friend void get_property(const resource_base&, Property) noexcept {} - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) // + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) // friend typename Property::value_type get_property(const resource_base& res, Property) noexcept { return 42; diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/properties.pass.cpp b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/properties.pass.cpp index 5b7e1d82ce3..2576e480f8d 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/properties.pass.cpp +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/properties.pass.cpp @@ -49,29 +49,29 @@ static_assert( == (2 * sizeof(void*)), ""); -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES((!cuda::property_with_value) ) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES((!cuda::property_with_value) ) // int InvokeIfWithValue(const Ref& ref) { return -1; } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES(cuda::property_with_value) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES(cuda::property_with_value) // typename Property::value_type InvokeIfWithValue(const Ref& ref) { return get_property(ref, Property{}); } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES(cuda::property_with_value) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES(cuda::property_with_value) // int InvokeIfWithoutValue(const Ref& ref) { return -1; } -_LIBCUDACXX_TEMPLATE(class Property, class Ref) -_LIBCUDACXX_REQUIRES((!cuda::property_with_value) ) // +_CCCL_TEMPLATE(class Property, class Ref) +_CCCL_REQUIRES((!cuda::property_with_value) ) // int InvokeIfWithoutValue(const Ref& ref) { get_property(ref, Property{}); diff --git a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/types.h b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/types.h index 30a49ec931b..aa08be29133 100644 --- a/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/types.h +++ b/libcudacxx/test/libcudacxx/cuda/memory_resource/resource_ref/types.h @@ -58,12 +58,12 @@ struct resource int _val = 0; - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES((!cuda::property_with_value) && _CUDA_VSTD::__is_included_in_v) friend void get_property(const resource&, Property) noexcept {} - _LIBCUDACXX_TEMPLATE(class Property) - _LIBCUDACXX_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) + _CCCL_TEMPLATE(class Property) + _CCCL_REQUIRES(cuda::property_with_value&& _CUDA_VSTD::__is_included_in_v) friend typename Property::value_type get_property(const resource& res, Property) noexcept { return static_cast(res._val); diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp index 17689aca794..a76fb02b07a 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.pass.cpp @@ -43,8 +43,8 @@ __host__ __device__ constexpr bool models_totally_ordered() noexcept #else -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES(cuda::std::totally_ordered) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES(cuda::std::totally_ordered) __host__ __device__ constexpr bool models_totally_ordered() noexcept { return true; diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp index 84aabb999ff..a9697a050be 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp @@ -68,8 +68,8 @@ __host__ __device__ void CheckIsConvertibleButNotConvertibleTo() #if TEST_STD_VER > 2017 template #else -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES((!(cuda::std::same_as || cuda::std::same_as) )) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES((!(cuda::std::same_as || cuda::std::same_as) )) #endif __host__ __device__ constexpr void CommonlyNotConvertibleTo() { @@ -84,8 +84,8 @@ __host__ __device__ constexpr void CommonlyNotConvertibleTo() CheckNotConvertibleTo(); } -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES(cuda::std::same_as) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES(cuda::std::same_as) __host__ __device__ constexpr void CommonlyNotConvertibleTo() { CheckNotConvertibleTo(); @@ -98,8 +98,8 @@ __host__ __device__ constexpr void CommonlyNotConvertibleTo() CheckConvertibleTo(); } -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES(cuda::std::same_as) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES(cuda::std::same_as) __host__ __device__ constexpr void CommonlyNotConvertibleTo() { CheckNotConvertibleTo(); diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.same/same_as.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.same/same_as.pass.cpp index f5226241307..d39f941b2bb 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.same/same_as.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.same/same_as.pass.cpp @@ -137,13 +137,13 @@ __host__ __device__ void CheckNotSameAs() #if TEST_STD_VER > 2017 // Checks subsumption works as intended -_LIBCUDACXX_TEMPLATE(class T, class U) -_LIBCUDACXX_REQUIRES(same_as) +_CCCL_TEMPLATE(class T, class U) +_CCCL_REQUIRES(same_as) __host__ __device__ void SubsumptionTest(); // clang-format off -_LIBCUDACXX_TEMPLATE(class T, class U) - _LIBCUDACXX_REQUIRES( same_as && true) +_CCCL_TEMPLATE(class T, class U) + _CCCL_REQUIRES( same_as && true) __host__ __device__ int SubsumptionTest(); // clang-format on diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp index e090eb0b5b5..7a9b004c5d2 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp @@ -35,8 +35,8 @@ struct expected // clang-format off // Checks [concept.swappable]/2.1 -_LIBCUDACXX_TEMPLATE(class T, class U) - _LIBCUDACXX_REQUIRES( cuda::std::same_as, cuda::std::remove_cvref_t > && +_CCCL_TEMPLATE(class T, class U) + _CCCL_REQUIRES( cuda::std::same_as, cuda::std::remove_cvref_t > && swappable >) // __host__ __device__ constexpr bool check_swap_21(T&& x, U&& y) { expected > const e{y, x}; @@ -45,8 +45,8 @@ __host__ __device__ constexpr bool check_swap_21(T&& x, U&& y) { } // Checks [concept.swappable]/2.2 -_LIBCUDACXX_TEMPLATE(class T, cuda::std::size_t N) - _LIBCUDACXX_REQUIRES( swappable) +_CCCL_TEMPLATE(class T, cuda::std::size_t N) + _CCCL_REQUIRES( swappable) __host__ __device__ constexpr bool check_swap_22(T (&x)[N], T (&y)[N]) { expected e{}; for (cuda::std::size_t i = 0; i < N; ++i) { @@ -65,8 +65,8 @@ __host__ __device__ constexpr bool check_swap_22(T (&x)[N], T (&y)[N]) { } // Checks [concept.swappable]/2.3 -_LIBCUDACXX_TEMPLATE(class T) - _LIBCUDACXX_REQUIRES( swappable && cuda::std::copy_constructible >) +_CCCL_TEMPLATE(class T) + _CCCL_REQUIRES( swappable && cuda::std::copy_constructible >) __host__ __device__ constexpr bool check_swap_23(T x, T y) { expected > const e{y, x}; cuda::std::ranges::swap(x, y); diff --git a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp index e18047bf86a..5e080dd9b61 100644 --- a/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp @@ -579,15 +579,15 @@ static_assert(!check_swappable_with(), ""); namespace LWG3175 { // Example taken directly from [concept.swappable] -_LIBCUDACXX_TEMPLATE(class T, class U) -_LIBCUDACXX_REQUIRES(swappable_with) +_CCCL_TEMPLATE(class T, class U) +_CCCL_REQUIRES(swappable_with) __host__ __device__ constexpr void value_swap(T&& t, U&& u) { cuda::std::ranges::swap(cuda::std::forward(t), cuda::std::forward(u)); } -_LIBCUDACXX_TEMPLATE(class T) -_LIBCUDACXX_REQUIRES(swappable) +_CCCL_TEMPLATE(class T) +_CCCL_REQUIRES(swappable) __host__ __device__ constexpr void lv_swap(T& t1, T& t2) { cuda::std::ranges::swap(t1, t2); diff --git a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/foo_customizations.hpp b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/foo_customizations.hpp index 809ae51f42c..9603b4bc2e5 100644 --- a/libcudacxx/test/libcudacxx/std/containers/views/mdspan/foo_customizations.hpp +++ b/libcudacxx/test/libcudacxx/std/containers/views/mdspan/foo_customizations.hpp @@ -92,8 +92,8 @@ class layout_foo::mapping : __extents(__exts) {} - _LIBCUDACXX_TEMPLATE(class OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) + _CCCL_TEMPLATE(class OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((!cuda::std::is_convertible::value)) // needs two () due to // comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -106,8 +106,8 @@ class layout_foo::mapping */ } - _LIBCUDACXX_TEMPLATE(class OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) + _CCCL_TEMPLATE(class OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((!cuda::std::is_convertible::value)) // needs two () due // to comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -115,9 +115,8 @@ class layout_foo::mapping : __extents(other.extents()) {} - _LIBCUDACXX_TEMPLATE(class OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents) - && (extents_type::rank() <= 1)) + _CCCL_TEMPLATE(class OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents) && (extents_type::rank() <= 1)) __MDSPAN_CONDITIONAL_EXPLICIT((!cuda::std::is_convertible::value)) // needs two () due to // comma _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( @@ -125,8 +124,8 @@ class layout_foo::mapping : __extents(other.extents()) {} - _LIBCUDACXX_TEMPLATE(class OtherExtents) - _LIBCUDACXX_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) + _CCCL_TEMPLATE(class OtherExtents) + _CCCL_REQUIRES(_CCCL_TRAIT(cuda::std::is_constructible, extents_type, OtherExtents)) __MDSPAN_CONDITIONAL_EXPLICIT((extents_type::rank() > 0)) _LIBCUDACXX_HIDE_FROM_ABI constexpr mapping( cuda::std::layout_stride::mapping const& other) // NOLINT(google-explicit-constructor) diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp index 41edbcedd00..6e5c64f524f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.copy.pass.cpp @@ -73,8 +73,8 @@ static_assert(!canCstrFromExpected, ""); template struct CtorFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ explicit CtorFrom(int); __host__ __device__ explicit CtorFrom(T); @@ -100,8 +100,8 @@ static_assert(!canCstrFromExpected const& template struct ConvertFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ ConvertFrom(int); __host__ __device__ ConvertFrom(T); diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp index f8aa967c410..e29769a45d3 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.convert.move.pass.cpp @@ -74,8 +74,8 @@ static_assert(!canCstrFromExpected, ""); template struct CtorFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ explicit CtorFrom(int); __host__ __device__ explicit CtorFrom(T); template @@ -100,8 +100,8 @@ static_assert(!canCstrFromExpected const& template struct ConvertFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ ConvertFrom(int); __host__ __device__ ConvertFrom(T); template diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp index 306489d4d14..01f1e49b58f 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.inplace_init_list.pass.cpp @@ -73,8 +73,8 @@ struct Data int vec_[N] = {}; cuda::std::tuple tuple_; - _LIBCUDACXX_TEMPLATE(class... Us) - _LIBCUDACXX_REQUIRES(cuda::std::is_constructible, Us&&...>::value) + _CCCL_TEMPLATE(class... Us) + _CCCL_REQUIRES(cuda::std::is_constructible, Us&&...>::value) __host__ __device__ constexpr Data(cuda::std::initializer_list il, Us&&... us) : tuple_(cuda::std::forward(us)...) { diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp index 47ec39c0b33..beeb1c0d439 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.expected/ctor/ctor.unexpect_init_list.pass.cpp @@ -74,8 +74,8 @@ struct Data int vec_[N]{}; cuda::std::tuple tuple_; - _LIBCUDACXX_TEMPLATE(class... Us) - _LIBCUDACXX_REQUIRES(cuda::std::is_constructible, Us&&...>::value) + _CCCL_TEMPLATE(class... Us) + _CCCL_REQUIRES(cuda::std::is_constructible, Us&&...>::value) __host__ __device__ constexpr Data(cuda::std::initializer_list il, Us&&... us) : tuple_(cuda::std::forward(us)...) { diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp index 6c1429a3267..e1ac6bee998 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.copy.pass.cpp @@ -60,8 +60,8 @@ static_assert(!canCstrFromExpected, ""); template struct CtorFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ explicit CtorFrom(int); __host__ __device__ explicit CtorFrom(T); template diff --git a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp index e4798b3e40f..86508312c98 100644 --- a/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp +++ b/libcudacxx/test/libcudacxx/std/utilities/expected/expected.void/ctor/ctor.convert.move.pass.cpp @@ -61,8 +61,8 @@ static_assert(!canCstrFromExpected, ""); template struct CtorFrom { - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((!cuda::std::same_as) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((!cuda::std::same_as) ) __host__ __device__ explicit CtorFrom(int); __host__ __device__ explicit CtorFrom(T); template diff --git a/libcudacxx/test/support/test_iterators.h b/libcudacxx/test/support/test_iterators.h index 8d5c92b1e6d..3356d9b500e 100644 --- a/libcudacxx/test/support/test_iterators.h +++ b/libcudacxx/test/support/test_iterators.h @@ -1669,25 +1669,25 @@ struct Proxy Proxy(const Proxy&) = default; - _LIBCUDACXX_TEMPLATE(class U) - _LIBCUDACXX_REQUIRES(cuda::std::constructible_from) + _CCCL_TEMPLATE(class U) + _CCCL_REQUIRES(cuda::std::constructible_from) __host__ __device__ constexpr Proxy(U&& u) : data{cuda::std::forward(u)} {} // This constructor covers conversion from cvref of Proxy, including non-const/const versions of copy/move // constructor - _LIBCUDACXX_TEMPLATE(class Other) - _LIBCUDACXX_REQUIRES((IsProxy> - && cuda::std::constructible_from().getData())>) ) + _CCCL_TEMPLATE(class Other) + _CCCL_REQUIRES((IsProxy> + && cuda::std::constructible_from().getData())>) ) __host__ __device__ constexpr Proxy(Other&& other) : data{cuda::std::forward(other).getData()} {} - _LIBCUDACXX_TEMPLATE(class Other) - _LIBCUDACXX_REQUIRES((IsProxy> - && cuda::std::assignable_from, - decltype(cuda::std::declval().getData())>) ) + _CCCL_TEMPLATE(class Other) + _CCCL_REQUIRES((IsProxy> + && cuda::std::assignable_from, + decltype(cuda::std::declval().getData())>) ) __host__ __device__ constexpr Proxy& operator=(Other&& other) { data = cuda::std::forward(other).getData(); @@ -1699,10 +1699,10 @@ struct Proxy # endif // TEST_COMPILER_MSVC // const assignment required to make ProxyIterator model cuda::std::indirectly_writable - _LIBCUDACXX_TEMPLATE(class Other) - _LIBCUDACXX_REQUIRES((IsProxy> - && cuda::std::assignable_from, - decltype(cuda::std::declval().getData())>) ) + _CCCL_TEMPLATE(class Other) + _CCCL_REQUIRES((IsProxy> + && cuda::std::assignable_from, + decltype(cuda::std::declval().getData())>) ) __host__ __device__ constexpr const Proxy& operator=(Other&& other) const { data = cuda::std::forward(other).getData(); @@ -1726,8 +1726,8 @@ struct Proxy requires(cuda::std::equality_comparable && !cuda::std::is_reference_v) = default; # else - _LIBCUDACXX_TEMPLATE(class T2 = T) - _LIBCUDACXX_REQUIRES((cuda::std::equality_comparable && !cuda::std::is_reference_v) ) + _CCCL_TEMPLATE(class T2 = T) + _CCCL_REQUIRES((cuda::std::equality_comparable && !cuda::std::is_reference_v) ) __host__ __device__ friend constexpr bool operator==(const Proxy& lhs, const Proxy& rhs) { return lhs.data == rhs.data; @@ -1736,8 +1736,8 @@ struct Proxy // Helps compare e.g. `Proxy` and `Proxy`. Note that the default equality comparison operator is deleted // when `T` is a reference type. - _LIBCUDACXX_TEMPLATE(class U) - _LIBCUDACXX_REQUIRES((cuda::std::equality_comparable_with, cuda::std::decay_t>) ) + _CCCL_TEMPLATE(class U) + _CCCL_REQUIRES((cuda::std::equality_comparable_with, cuda::std::decay_t>) ) __host__ __device__ friend constexpr bool operator==(const Proxy& lhs, const Proxy& rhs) { return lhs.data == rhs.data; @@ -1838,8 +1838,8 @@ struct ProxyIterator : ProxyIteratorBase : base_{cuda::std::move(base)} {} - _LIBCUDACXX_TEMPLATE(class T) - _LIBCUDACXX_REQUIRES(cuda::std::constructible_from) + _CCCL_TEMPLATE(class T) + _CCCL_REQUIRES(cuda::std::constructible_from) __host__ __device__ constexpr ProxyIterator(T&& t) : base_{cuda::std::forward(t)} {} @@ -1884,16 +1884,16 @@ struct ProxyIterator : ProxyIteratorBase ++*this; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::equality_comparable) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::equality_comparable) __host__ __device__ friend constexpr bool operator==(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ == y.base_; } // to satisfy forward_iterator - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::forward_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::forward_iterator) __host__ __device__ constexpr ProxyIterator operator++(int) { auto tmp = *this; @@ -1902,16 +1902,16 @@ struct ProxyIterator : ProxyIteratorBase } // to satisfy bidirectional_iterator - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::bidirectional_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::bidirectional_iterator) __host__ __device__ constexpr ProxyIterator& operator--() { --base_; return *this; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::bidirectional_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::bidirectional_iterator) __host__ __device__ constexpr ProxyIterator operator--(int) { auto tmp = *this; @@ -1920,89 +1920,89 @@ struct ProxyIterator : ProxyIteratorBase } // to satisfy random_access_iterator - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ constexpr ProxyIterator& operator+=(difference_type n) { base_ += n; return *this; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ constexpr ProxyIterator& operator-=(difference_type n) { base_ -= n; return *this; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ constexpr Proxy> operator[](difference_type n) const { return {base_[n]}; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr bool operator<(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ < y.base_; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr bool operator>(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ > y.base_; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr bool operator<=(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ <= y.base_; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr bool operator>=(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ >= y.base_; } # ifndef TEST_HAS_NO_SPACESHIP_OPERATOR - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator&& cuda::std::three_way_comparable) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator&& cuda::std::three_way_comparable) __host__ __device__ friend constexpr auto operator<=>(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ <=> y.base_; } # endif // TEST_HAS_NO_SPACESHIP_OPERATOR - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr ProxyIterator operator+(const ProxyIterator& x, difference_type n) { return ProxyIterator{x.base_ + n}; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr ProxyIterator operator+(difference_type n, const ProxyIterator& x) { return ProxyIterator{n + x.base_}; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr ProxyIterator operator-(const ProxyIterator& x, difference_type n) { return ProxyIterator{x.base_ - n}; } - _LIBCUDACXX_TEMPLATE(class B2 = Base) - _LIBCUDACXX_REQUIRES(cuda::std::random_access_iterator) + _CCCL_TEMPLATE(class B2 = Base) + _CCCL_REQUIRES(cuda::std::random_access_iterator) __host__ __device__ friend constexpr difference_type operator-(const ProxyIterator& x, const ProxyIterator& y) { return x.base_ - y.base_; @@ -2023,8 +2023,8 @@ struct ProxySentinel : base_{cuda::std::move(base)} {} - _LIBCUDACXX_TEMPLATE(class Base) - _LIBCUDACXX_REQUIRES(cuda::std::equality_comparable_with) + _CCCL_TEMPLATE(class Base) + _CCCL_REQUIRES(cuda::std::equality_comparable_with) __host__ __device__ friend constexpr bool operator==(const ProxyIterator& p, const ProxySentinel& sent) { return p.base_ == sent.base_; From 11cd4e7ac1738f0ba3808a6e58be29317d1e58f4 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Mon, 18 Nov 2024 08:19:15 +0100 Subject: [PATCH 19/29] Move back to the `concept_macros` file --- .../cuda/experimental/__algorithm/copy.cuh | 2 +- .../cuda/experimental/__algorithm/fill.cuh | 2 +- .../__memory_resource/any_resource.cuh | 2 +- .../device_memory_resource.cuh | 2 +- .../cuda/experimental/__stream/get_stream.cuh | 2 +- .../device_memory_resource.h | 2 +- .../managed_memory_resource.h | 2 +- .../pinned_memory_resource.h | 2 +- .../include/cuda/__memory_resource/resource.h | 2 +- .../cuda/__memory_resource/resource_ref.h | 2 +- libcudacxx/include/cuda/std/__cccl/dialect.h | 40 ----------------- .../include/cuda/std/__concepts/arithmetic.h | 2 +- .../include/cuda/std/__concepts/assignable.h | 2 +- .../cuda/std/__concepts/boolean_testable.h | 2 +- .../cuda/std/__concepts/class_or_enum.h | 2 +- .../std/__concepts/common_reference_with.h | 2 +- .../include/cuda/std/__concepts/common_with.h | 2 +- .../{__concept_macros.h => concept_macros.h} | 44 ++++++++++++++++++- .../cuda/std/__concepts/constructible.h | 2 +- .../cuda/std/__concepts/convertible_to.h | 2 +- .../include/cuda/std/__concepts/copyable.h | 2 +- .../cuda/std/__concepts/derived_from.h | 2 +- .../cuda/std/__concepts/destructible.h | 2 +- .../cuda/std/__concepts/different_from.h | 2 +- .../cuda/std/__concepts/equality_comparable.h | 2 +- .../include/cuda/std/__concepts/invocable.h | 2 +- .../include/cuda/std/__concepts/movable.h | 2 +- .../include/cuda/std/__concepts/predicate.h | 2 +- .../include/cuda/std/__concepts/regular.h | 2 +- .../include/cuda/std/__concepts/relation.h | 2 +- .../include/cuda/std/__concepts/same_as.h | 2 +- .../include/cuda/std/__concepts/semiregular.h | 2 +- .../include/cuda/std/__concepts/swappable.h | 2 +- .../cuda/std/__concepts/totally_ordered.h | 2 +- .../cuda/std/__expected/expected_base.h | 2 +- .../include/cuda/std/__expected/unexpected.h | 2 +- .../cuda/std/__functional/bind_front.h | 2 +- .../cuda/std/__functional/perfect_forward.h | 2 +- libcudacxx/include/cuda/std/__mdspan/macros.h | 2 +- .../include/cuda/std/__memory/construct_at.h | 2 +- libcudacxx/include/cuda/std/concepts | 2 +- .../cuda/std/detail/libcxx/include/optional | 2 +- 42 files changed, 82 insertions(+), 82 deletions(-) rename libcudacxx/include/cuda/std/__concepts/{__concept_macros.h => concept_macros.h} (93%) diff --git a/cudax/include/cuda/experimental/__algorithm/copy.cuh b/cudax/include/cuda/experimental/__algorithm/copy.cuh index 87f03f3f59f..9cb5cf99a0a 100644 --- a/cudax/include/cuda/experimental/__algorithm/copy.cuh +++ b/cudax/include/cuda/experimental/__algorithm/copy.cuh @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include diff --git a/cudax/include/cuda/experimental/__algorithm/fill.cuh b/cudax/include/cuda/experimental/__algorithm/fill.cuh index 5628c655013..aeb54235c78 100644 --- a/cudax/include/cuda/experimental/__algorithm/fill.cuh +++ b/cudax/include/cuda/experimental/__algorithm/fill.cuh @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include diff --git a/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh index cf3877b91f0..f386853bb08 100644 --- a/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/any_resource.cuh @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh b/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh index 46c8c44528e..bae301feb0b 100644 --- a/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh +++ b/cudax/include/cuda/experimental/__memory_resource/device_memory_resource.cuh @@ -32,7 +32,7 @@ # include # include # include -# include +# include # include # include # include diff --git a/cudax/include/cuda/experimental/__stream/get_stream.cuh b/cudax/include/cuda/experimental/__stream/get_stream.cuh index 87d8158be3e..230297f307b 100644 --- a/cudax/include/cuda/experimental/__stream/get_stream.cuh +++ b/cudax/include/cuda/experimental/__stream/get_stream.cuh @@ -23,7 +23,7 @@ #include -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h index 9061adfc3d1..d82ba355ff4 100644 --- a/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/device_memory_resource.h @@ -31,7 +31,7 @@ # include # include # include -# include +# include # include # include # include diff --git a/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h index 24132149e08..c1af2074beb 100644 --- a/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/managed_memory_resource.h @@ -31,7 +31,7 @@ # include # include # include -# include +# include # include # include diff --git a/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h b/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h index c2ad95bc7cc..2fe29653d75 100644 --- a/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h +++ b/libcudacxx/include/cuda/__memory_resource/pinned_memory_resource.h @@ -32,7 +32,7 @@ # include # include # include -# include +# include # include # include diff --git a/libcudacxx/include/cuda/__memory_resource/resource.h b/libcudacxx/include/cuda/__memory_resource/resource.h index 1d1bdba8a41..f22762e7ab8 100644 --- a/libcudacxx/include/cuda/__memory_resource/resource.h +++ b/libcudacxx/include/cuda/__memory_resource/resource.h @@ -24,7 +24,7 @@ #if !defined(_CCCL_COMPILER_MSVC_2017) && defined(LIBCUDACXX_ENABLE_EXPERIMENTAL_MEMORY_RESOURCE) # include -# include +# include # include # include # include diff --git a/libcudacxx/include/cuda/__memory_resource/resource_ref.h b/libcudacxx/include/cuda/__memory_resource/resource_ref.h index 560f58fa0f3..4a7aa9a7f6f 100644 --- a/libcudacxx/include/cuda/__memory_resource/resource_ref.h +++ b/libcudacxx/include/cuda/__memory_resource/resource_ref.h @@ -26,7 +26,7 @@ # include # include # include -# include +# include # include # include # include diff --git a/libcudacxx/include/cuda/std/__cccl/dialect.h b/libcudacxx/include/cuda/std/__cccl/dialect.h index 80a0612c82a..4b96695de73 100644 --- a/libcudacxx/include/cuda/std/__cccl/dialect.h +++ b/libcudacxx/include/cuda/std/__cccl/dialect.h @@ -126,44 +126,4 @@ # define _CCCL_GLOBAL_CONSTANT _CCCL_INLINE_VAR constexpr #endif // __CUDA_ARCH__ -//////////////////////////////////////////////////////////////////////////////// -// _CCCL_TEMPLATE -// Usage: -// _CCCL_TEMPLATE(typename A, typename _Bp) -// _CCCL_REQUIRES( Concept1 _CCCL_AND Concept2<_Bp>) -// void foo(A a, _Bp b) -// {} - -// Barebones enable if implementation to use outside of cuda::std -template -struct __cccl_select -{}; - -template <> -struct __cccl_select -{ - template - using type = _Tp; -}; - -template -using __cccl_enable_if_t = typename __cccl_select<_Bp>::template type<_Tp>; - -template -using __cccl_requires_t = typename __cccl_select<_Bp>::template type<_Tp>; - -#if (defined(__cpp_concepts) && _CCCL_STD_VER >= 2020) -# define _CCCL_TEMPLATE(...) template <__VA_ARGS__> -# define _CCCL_REQUIRES(...) requires __VA_ARGS__ -# define _CCCL_AND && -# define _CCCL_TRAILING_REQUIRES_AUX_(...) requires __VA_ARGS__ -# define _CCCL_TRAILING_REQUIRES(...) ->__VA_ARGS__ _CCCL_TRAILING_REQUIRES_AUX_ -#else // ^^^ __cpp_concepts ^^^ / vvv !__cpp_concepts vvv -# define _CCCL_TEMPLATE(...) template <__VA_ARGS__ -# define _CCCL_REQUIRES(...) , bool _CCCL_true_ = true, __cccl_enable_if_t < __VA_ARGS__ && _CCCL_true_, int > = 0 > -# define _CCCL_AND &&_CCCL_true_, int > = 0, __cccl_enable_if_t < -# define _CCCL_TRAILING_REQUIRES_AUX_(...) , __VA_ARGS__ > -# define _CCCL_TRAILING_REQUIRES(...) ->__cccl_requires_t < __VA_ARGS__ _CCCL_TRAILING_REQUIRES_AUX_ -#endif // !__cpp_concepts - #endif // __CCCL_DIALECT_H diff --git a/libcudacxx/include/cuda/std/__concepts/arithmetic.h b/libcudacxx/include/cuda/std/__concepts/arithmetic.h index 69feaa21a6e..0230dc029cf 100644 --- a/libcudacxx/include/cuda/std/__concepts/arithmetic.h +++ b/libcudacxx/include/cuda/std/__concepts/arithmetic.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/assignable.h b/libcudacxx/include/cuda/std/__concepts/assignable.h index bf570ff59e0..3402888e80c 100644 --- a/libcudacxx/include/cuda/std/__concepts/assignable.h +++ b/libcudacxx/include/cuda/std/__concepts/assignable.h @@ -20,8 +20,8 @@ # pragma system_header #endif // no system header -#include #include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/boolean_testable.h b/libcudacxx/include/cuda/std/__concepts/boolean_testable.h index 003144d0689..5c5d90e8851 100644 --- a/libcudacxx/include/cuda/std/__concepts/boolean_testable.h +++ b/libcudacxx/include/cuda/std/__concepts/boolean_testable.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/class_or_enum.h b/libcudacxx/include/cuda/std/__concepts/class_or_enum.h index f5c38513301..49afd287d0a 100644 --- a/libcudacxx/include/cuda/std/__concepts/class_or_enum.h +++ b/libcudacxx/include/cuda/std/__concepts/class_or_enum.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/common_reference_with.h b/libcudacxx/include/cuda/std/__concepts/common_reference_with.h index da988117275..982bc4a09e7 100644 --- a/libcudacxx/include/cuda/std/__concepts/common_reference_with.h +++ b/libcudacxx/include/cuda/std/__concepts/common_reference_with.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/common_with.h b/libcudacxx/include/cuda/std/__concepts/common_with.h index 739bdc0aba4..f296ca3d560 100644 --- a/libcudacxx/include/cuda/std/__concepts/common_with.h +++ b/libcudacxx/include/cuda/std/__concepts/common_with.h @@ -20,8 +20,8 @@ # pragma system_header #endif // no system header -#include #include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/__concept_macros.h b/libcudacxx/include/cuda/std/__concepts/concept_macros.h similarity index 93% rename from libcudacxx/include/cuda/std/__concepts/__concept_macros.h rename to libcudacxx/include/cuda/std/__concepts/concept_macros.h index 5472bcc8bba..f9a864dc93c 100644 --- a/libcudacxx/include/cuda/std/__concepts/__concept_macros.h +++ b/libcudacxx/include/cuda/std/__concepts/concept_macros.h @@ -24,7 +24,47 @@ # pragma system_header #endif // no system header -#if _CCCL_STD_VER > 2011 +//////////////////////////////////////////////////////////////////////////////// +// _CCCL_TEMPLATE +// Usage: +// _CCCL_TEMPLATE(typename A, typename _Bp) +// _CCCL_REQUIRES( Concept1 _CCCL_AND Concept2<_Bp>) +// void foo(A a, _Bp b) +// {} + +// Barebones enable if implementation to use outside of cuda::std +template +struct __cccl_select +{}; + +template <> +struct __cccl_select +{ + template + using type = _Tp; +}; + +template +using __cccl_enable_if_t = typename __cccl_select<_Bp>::template type<_Tp>; + +template +using __cccl_requires_t = typename __cccl_select<_Bp>::template type<_Tp>; + +#if (defined(__cpp_concepts) && _CCCL_STD_VER >= 2020) +# define _CCCL_TEMPLATE(...) template <__VA_ARGS__> +# define _CCCL_REQUIRES(...) requires __VA_ARGS__ +# define _CCCL_AND && +# define _CCCL_TRAILING_REQUIRES_AUX_(...) requires __VA_ARGS__ +# define _CCCL_TRAILING_REQUIRES(...) ->__VA_ARGS__ _CCCL_TRAILING_REQUIRES_AUX_ +#else // ^^^ __cpp_concepts ^^^ / vvv !__cpp_concepts vvv +# define _CCCL_TEMPLATE(...) template <__VA_ARGS__ +# define _CCCL_REQUIRES(...) , bool _CCCL_true_ = true, __cccl_enable_if_t < __VA_ARGS__ && _CCCL_true_, int > = 0 > +# define _CCCL_AND &&_CCCL_true_, int > = 0, __cccl_enable_if_t < +# define _CCCL_TRAILING_REQUIRES_AUX_(...) , __VA_ARGS__ > +# define _CCCL_TRAILING_REQUIRES(...) ->__cccl_requires_t < __VA_ARGS__ _CCCL_TRAILING_REQUIRES_AUX_ +#endif // !__cpp_concepts + +#if _CCCL_STD_VER >= 2014 # define _LIBCUDACXX_PP_CAT_(_Xp, ...) _Xp##__VA_ARGS__ # define _LIBCUDACXX_PP_CAT(_Xp, ...) _LIBCUDACXX_PP_CAT_(_Xp, __VA_ARGS__) @@ -444,6 +484,6 @@ namespace _Vstd = _CUDA_VSTD; // NOLINT(misc-unused-alias-decls) # endif } // namespace _Concept -#endif // _CCCL_STD_VER > 2011 +#endif // _CCCL_STD_VER >= 2014 #endif //_CUDA___CONCEPTS diff --git a/libcudacxx/include/cuda/std/__concepts/constructible.h b/libcudacxx/include/cuda/std/__concepts/constructible.h index 1f5515e730b..9547163b18f 100644 --- a/libcudacxx/include/cuda/std/__concepts/constructible.h +++ b/libcudacxx/include/cuda/std/__concepts/constructible.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/convertible_to.h b/libcudacxx/include/cuda/std/__concepts/convertible_to.h index 3d7a4263ae9..792f5d69e61 100644 --- a/libcudacxx/include/cuda/std/__concepts/convertible_to.h +++ b/libcudacxx/include/cuda/std/__concepts/convertible_to.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/copyable.h b/libcudacxx/include/cuda/std/__concepts/copyable.h index fa88c825ae8..2e02bc21606 100644 --- a/libcudacxx/include/cuda/std/__concepts/copyable.h +++ b/libcudacxx/include/cuda/std/__concepts/copyable.h @@ -20,8 +20,8 @@ # pragma system_header #endif // no system header -#include #include +#include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/derived_from.h b/libcudacxx/include/cuda/std/__concepts/derived_from.h index a273489ec96..8b8b0c21269 100644 --- a/libcudacxx/include/cuda/std/__concepts/derived_from.h +++ b/libcudacxx/include/cuda/std/__concepts/derived_from.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/destructible.h b/libcudacxx/include/cuda/std/__concepts/destructible.h index 91b02ab0d24..8bdce609b1e 100644 --- a/libcudacxx/include/cuda/std/__concepts/destructible.h +++ b/libcudacxx/include/cuda/std/__concepts/destructible.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/different_from.h b/libcudacxx/include/cuda/std/__concepts/different_from.h index f205b6709b6..00268f30680 100644 --- a/libcudacxx/include/cuda/std/__concepts/different_from.h +++ b/libcudacxx/include/cuda/std/__concepts/different_from.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/equality_comparable.h b/libcudacxx/include/cuda/std/__concepts/equality_comparable.h index 51043f57079..80fc334f7a0 100644 --- a/libcudacxx/include/cuda/std/__concepts/equality_comparable.h +++ b/libcudacxx/include/cuda/std/__concepts/equality_comparable.h @@ -20,9 +20,9 @@ # pragma system_header #endif // no system header -#include #include #include +#include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/invocable.h b/libcudacxx/include/cuda/std/__concepts/invocable.h index 3be866aec4f..5444209382a 100644 --- a/libcudacxx/include/cuda/std/__concepts/invocable.h +++ b/libcudacxx/include/cuda/std/__concepts/invocable.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/movable.h b/libcudacxx/include/cuda/std/__concepts/movable.h index 264a2c317a2..8b42fd974dd 100644 --- a/libcudacxx/include/cuda/std/__concepts/movable.h +++ b/libcudacxx/include/cuda/std/__concepts/movable.h @@ -20,8 +20,8 @@ # pragma system_header #endif // no system header -#include #include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/predicate.h b/libcudacxx/include/cuda/std/__concepts/predicate.h index 26efbb78588..963833bff9f 100644 --- a/libcudacxx/include/cuda/std/__concepts/predicate.h +++ b/libcudacxx/include/cuda/std/__concepts/predicate.h @@ -20,8 +20,8 @@ # pragma system_header #endif // no system header -#include #include +#include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/regular.h b/libcudacxx/include/cuda/std/__concepts/regular.h index d70f1b0b1c4..a1229414cc2 100644 --- a/libcudacxx/include/cuda/std/__concepts/regular.h +++ b/libcudacxx/include/cuda/std/__concepts/regular.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/relation.h b/libcudacxx/include/cuda/std/__concepts/relation.h index 793b8d5fde7..e840166167a 100644 --- a/libcudacxx/include/cuda/std/__concepts/relation.h +++ b/libcudacxx/include/cuda/std/__concepts/relation.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include _LIBCUDACXX_BEGIN_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/__concepts/same_as.h b/libcudacxx/include/cuda/std/__concepts/same_as.h index bdae0c40b33..4c1546ded0b 100644 --- a/libcudacxx/include/cuda/std/__concepts/same_as.h +++ b/libcudacxx/include/cuda/std/__concepts/same_as.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include _LIBCUDACXX_BEGIN_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/__concepts/semiregular.h b/libcudacxx/include/cuda/std/__concepts/semiregular.h index ee259bfb653..cf997a2b7aa 100644 --- a/libcudacxx/include/cuda/std/__concepts/semiregular.h +++ b/libcudacxx/include/cuda/std/__concepts/semiregular.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/swappable.h b/libcudacxx/include/cuda/std/__concepts/swappable.h index aaddf1a9ee3..627c4fff8f5 100644 --- a/libcudacxx/include/cuda/std/__concepts/swappable.h +++ b/libcudacxx/include/cuda/std/__concepts/swappable.h @@ -20,10 +20,10 @@ # pragma system_header #endif // no system header -#include #include #include #include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__concepts/totally_ordered.h b/libcudacxx/include/cuda/std/__concepts/totally_ordered.h index fb4339b4d53..6b37bdb4c6c 100644 --- a/libcudacxx/include/cuda/std/__concepts/totally_ordered.h +++ b/libcudacxx/include/cuda/std/__concepts/totally_ordered.h @@ -20,8 +20,8 @@ # pragma system_header #endif // no system header -#include #include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__expected/expected_base.h b/libcudacxx/include/cuda/std/__expected/expected_base.h index f2eaa804196..31de97e3f50 100644 --- a/libcudacxx/include/cuda/std/__expected/expected_base.h +++ b/libcudacxx/include/cuda/std/__expected/expected_base.h @@ -19,7 +19,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__expected/unexpected.h b/libcudacxx/include/cuda/std/__expected/unexpected.h index 215a38d346c..83582756d1e 100644 --- a/libcudacxx/include/cuda/std/__expected/unexpected.h +++ b/libcudacxx/include/cuda/std/__expected/unexpected.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__functional/bind_front.h b/libcudacxx/include/cuda/std/__functional/bind_front.h index 68423e73772..31b2ce06ef7 100644 --- a/libcudacxx/include/cuda/std/__functional/bind_front.h +++ b/libcudacxx/include/cuda/std/__functional/bind_front.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__functional/perfect_forward.h b/libcudacxx/include/cuda/std/__functional/perfect_forward.h index 4f7630ae7b6..6891581627c 100644 --- a/libcudacxx/include/cuda/std/__functional/perfect_forward.h +++ b/libcudacxx/include/cuda/std/__functional/perfect_forward.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__mdspan/macros.h b/libcudacxx/include/cuda/std/__mdspan/macros.h index f98c837565d..d3dc04b1111 100644 --- a/libcudacxx/include/cuda/std/__mdspan/macros.h +++ b/libcudacxx/include/cuda/std/__mdspan/macros.h @@ -54,7 +54,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/__memory/construct_at.h b/libcudacxx/include/cuda/std/__memory/construct_at.h index 8e640e04060..4be12dfce17 100644 --- a/libcudacxx/include/cuda/std/__memory/construct_at.h +++ b/libcudacxx/include/cuda/std/__memory/construct_at.h @@ -21,7 +21,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/concepts b/libcudacxx/include/cuda/std/concepts index 4630872ebca..8accc9ccbba 100644 --- a/libcudacxx/include/cuda/std/concepts +++ b/libcudacxx/include/cuda/std/concepts @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/optional b/libcudacxx/include/cuda/std/detail/libcxx/include/optional index 6b5d9401556..d709d2d9a61 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/optional +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/optional @@ -169,7 +169,7 @@ template # pragma system_header #endif // no system header -#include +#include #include #include #include From 4266526379e6e075514964de372e598f9c712812 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Mon, 18 Nov 2024 08:25:28 +0100 Subject: [PATCH 20/29] Fix formatting --- libcudacxx/include/cuda/std/concepts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcudacxx/include/cuda/std/concepts b/libcudacxx/include/cuda/std/concepts index 8accc9ccbba..b0af6fbb863 100644 --- a/libcudacxx/include/cuda/std/concepts +++ b/libcudacxx/include/cuda/std/concepts @@ -20,13 +20,13 @@ # pragma system_header #endif // no system header -#include #include #include #include #include #include #include +#include #include #include #include From 01e610c3c9df00d42541e3fe1d0194a4c2cbf388 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Mon, 18 Nov 2024 08:53:18 +0100 Subject: [PATCH 21/29] fix concept macros include --- libcudacxx/include/cuda/std/__utility/cmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index def001be82e..464ab34a637 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include From a7a39e11457e79884af8ffd79568d53501e2032d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 20:35:49 +0000 Subject: [PATCH 22/29] [pre-commit.ci] auto code formatting --- libcudacxx/include/cuda/std/__concepts/concept_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcudacxx/include/cuda/std/__concepts/concept_macros.h b/libcudacxx/include/cuda/std/__concepts/concept_macros.h index c8bf81bbd96..ad25a5363ec 100644 --- a/libcudacxx/include/cuda/std/__concepts/concept_macros.h +++ b/libcudacxx/include/cuda/std/__concepts/concept_macros.h @@ -205,7 +205,7 @@ namespace __cccl_unqualified_cuda_std = _CUDA_VSTD; // NOLINT(misc-unused-alias- # define _CCCL_CONCEPT_FRAGMENT_REQS_SAME_AS__Same_as(...) __VA_ARGS__, decltype _CCCL_PP_LPAREN # define _CCCL_FRAGMENT(_NAME, ...) \ - (1u == sizeof(_NAME##_CCCL_CONCEPT_FRAGMENT_(static_cast<::__cccl_tag<__VA_ARGS__>*>(nullptr), nullptr))) + (1u == sizeof(_NAME##_CCCL_CONCEPT_FRAGMENT_(static_cast<::__cccl_tag<__VA_ARGS__>*>(nullptr), nullptr))) # endif //////////////////////////////////////////////////////////////////////////////// From 4f25558caaefc2e3a3ddf21ae30701462b68436d Mon Sep 17 00:00:00 2001 From: David Bayer Date: Tue, 26 Nov 2024 09:17:08 +0100 Subject: [PATCH 23/29] fix compilation for old nvcc --- libcudacxx/include/cuda/std/__utility/cmp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 464ab34a637..01870191159 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -78,6 +78,8 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); } + + _CCCL_UNREACHABLE(); #else // ^^^ C++17 ^^^ / vvv C++14 vvv return ((_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) ? (__t == __u) @@ -110,6 +112,8 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); } + + _CCCL_UNREACHABLE(); #else // ^^^ C++17 ^^^ / vvv C++14 vvv return ((_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) ? (__t < __u) From a4231e1f0cd3a1719f68c7aa81b910fa55e4cfbf Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Tue, 26 Nov 2024 10:10:32 +0100 Subject: [PATCH 24/29] Drop newline --- libcudacxx/include/cuda/std/__utility/cmp.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 01870191159..516c292f7c0 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -78,7 +78,6 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); } - _CCCL_UNREACHABLE(); #else // ^^^ C++17 ^^^ / vvv C++14 vvv return ((_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) @@ -112,7 +111,6 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); } - _CCCL_UNREACHABLE(); #else // ^^^ C++17 ^^^ / vvv C++14 vvv return ((_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) From 838185975b5721fdf5d605ffe686f70025ae03ca Mon Sep 17 00:00:00 2001 From: David Bayer Date: Tue, 26 Nov 2024 13:32:58 +0100 Subject: [PATCH 25/29] fix msvc warnings once again --- libcudacxx/include/cuda/std/__utility/cmp.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index 516c292f7c0..f3019ca5dbc 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -35,7 +35,9 @@ _CCCL_PUSH_MACROS _CCCL_DIAG_PUSH -_CCCL_DIAG_SUPPRESS_MSVC(4389) // signed/unsigned mismatch +_CCCL_DIAG_SUPPRESS_MSVC(4018) // required cast from signed to unsigned +_CCCL_DIAG_SUPPRESS_MSVC(4388) // required cast from signed to larger unsigned +_CCCL_DIAG_SUPPRESS_MSVC(4389) // signed/unsigned mismatch for == and != _LIBCUDACXX_BEGIN_NAMESPACE_STD From 890cb8a96571949709e30f6466c8fd43006628e4 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Tue, 26 Nov 2024 13:45:16 +0100 Subject: [PATCH 26/29] change implementation of `if constexpr` --- libcudacxx/include/cuda/std/__utility/cmp.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index f3019ca5dbc..c6d3ad962e9 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -67,12 +67,12 @@ _CCCL_TEMPLATE(class _Tp, class _Up) _CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept { -#if _CCCL_STD_VER >= 2017 - _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) +#if !defined(_CCCL_NO_IF_CONSTEXPR) + if constexpr (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) { return __t == __u; } - _CCCL_ELSE_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp)) + else if constexpr (_CCCL_TRAIT(is_signed, _Tp)) { return __t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u; } @@ -81,12 +81,12 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_equal(_Tp __t, _Up __u) noexcept return __u < 0 ? false : __t == make_unsigned_t<_Up>(__u); } _CCCL_UNREACHABLE(); -#else // ^^^ C++17 ^^^ / vvv C++14 vvv +#else // ^^^ !_CCCL_NO_IF_CONSTEXPR ^^^ / vvv _CCCL_NO_IF_CONSTEXPR vvv return ((_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) ? (__t == __u) : (_CCCL_TRAIT(is_signed, _Tp) ? (__t < 0 ? false : make_unsigned_t<_Tp>(__t) == __u) : (__u < 0 ? false : __t == make_unsigned_t<_Up>(__u)))); -#endif // _CCCL_STD_VER <= 2014 +#endif // _CCCL_NO_IF_CONSTEXPR } _CCCL_TEMPLATE(class _Tp, class _Up) @@ -100,12 +100,12 @@ _CCCL_TEMPLATE(class _Tp, class _Up) _CCCL_REQUIRES(__is_safe_integral_cmp<_Tp>::value _CCCL_AND __is_safe_integral_cmp<_Up>::value) _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept { -#if _CCCL_STD_VER >= 2017 - _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) +#if !defined(_CCCL_NO_IF_CONSTEXPR) + if constexpr (_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) { return __t < __u; } - _CCCL_ELSE_IF_CONSTEXPR (_CCCL_TRAIT(is_signed, _Tp)) + else if constexpr (_CCCL_TRAIT(is_signed, _Tp)) { return __t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u; } @@ -114,12 +114,12 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool cmp_less(_Tp __t, _Up __u) noexcept return __u < 0 ? false : __t < make_unsigned_t<_Up>(__u); } _CCCL_UNREACHABLE(); -#else // ^^^ C++17 ^^^ / vvv C++14 vvv +#else // ^^^ !_CCCL_NO_IF_CONSTEXPR ^^^ / vvv _CCCL_NO_IF_CONSTEXPR vvv return ((_CCCL_TRAIT(is_signed, _Tp) == _CCCL_TRAIT(is_signed, _Up)) ? (__t < __u) : (_CCCL_TRAIT(is_signed, _Tp) ? (__t < 0 ? true : make_unsigned_t<_Tp>(__t) < __u) : (__u < 0 ? false : __t < make_unsigned_t<_Up>(__u)))); -#endif // _CCCL_STD_VER <= 2014 +#endif // _CCCL_NO_IF_CONSTEXPR } _CCCL_TEMPLATE(class _Tp, class _Up) From 8bac67a486e46abbef4ddf1913fb9a6b25cc0fa9 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Mon, 2 Dec 2024 13:38:14 +0100 Subject: [PATCH 27/29] suppress diagnostics only if `if constexpr` is unavailable --- libcudacxx/include/cuda/std/__utility/cmp.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libcudacxx/include/cuda/std/__utility/cmp.h b/libcudacxx/include/cuda/std/__utility/cmp.h index c6d3ad962e9..9d820eb1854 100644 --- a/libcudacxx/include/cuda/std/__utility/cmp.h +++ b/libcudacxx/include/cuda/std/__utility/cmp.h @@ -34,10 +34,12 @@ _CCCL_PUSH_MACROS +#if defined(_CCCL_NO_IF_CONSTEXPR) _CCCL_DIAG_PUSH _CCCL_DIAG_SUPPRESS_MSVC(4018) // required cast from signed to unsigned _CCCL_DIAG_SUPPRESS_MSVC(4388) // required cast from signed to larger unsigned _CCCL_DIAG_SUPPRESS_MSVC(4389) // signed/unsigned mismatch for == and != +#endif // _CCCL_NO_IF_CONSTEXPR _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -153,7 +155,9 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr bool in_range(_Up __u) noexcept _LIBCUDACXX_END_NAMESPACE_STD +#if defined(_CCCL_NO_IF_CONSTEXPR) _CCCL_DIAG_POP +#endif // _CCCL_NO_IF_CONSTEXPR _CCCL_POP_MACROS From bf3a38007cb975fa07fc7125b292eb4beb06e026 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Mon, 2 Dec 2024 13:42:28 +0100 Subject: [PATCH 28/29] update docs --- docs/libcudacxx/standard_api.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/libcudacxx/standard_api.rst b/docs/libcudacxx/standard_api.rst index 0729df55406..51bddbcd362 100644 --- a/docs/libcudacxx/standard_api.rst +++ b/docs/libcudacxx/standard_api.rst @@ -95,6 +95,8 @@ Feature availability: - ``bind_front`` is available in C++17. +- C++20 integer comparison functions in ```` are available in C++11. + - C++23 ```` is available in C++14. - all features are available in C++14 From b118ed586d4cf46de43aa0c9e5b4f245df2409c5 Mon Sep 17 00:00:00 2001 From: David Bayer Date: Mon, 2 Dec 2024 18:41:11 +0100 Subject: [PATCH 29/29] move library feature test macro to c++11 section --- libcudacxx/include/cuda/std/version | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libcudacxx/include/cuda/std/version b/libcudacxx/include/cuda/std/version index 3b973a8bfab..472f9c809f4 100644 --- a/libcudacxx/include/cuda/std/version +++ b/libcudacxx/include/cuda/std/version @@ -29,7 +29,8 @@ # include // otherwise go for the smallest possible header #endif // !_CCCL_COMPILER(NVRTC) -#define __cccl_lib_to_underlying 202102L +#define __cccl_lib_integer_comparison_functions 202002L +#define __cccl_lib_to_underlying 202102L // #define __cpp_lib_tuple_like 202311L // P2819R2 is implemented, but P2165R4 is not yet #if _CCCL_STD_VER >= 2014 @@ -43,12 +44,11 @@ # define __cccl_lib_exchange_function 201304L # define __cccl_lib_expected 202211L // # define __cccl_lib_generic_associative_lookup 201304L -# define __cccl_lib_integer_sequence 201304L -# define __cccl_lib_integer_comparison_functions 202002L -# define __cccl_lib_integral_constant_callable 201304L -# define __cccl_lib_is_final 201402L -# define __cccl_lib_is_null_pointer 201309L -# define __cccl_lib_make_reverse_iterator 201402L +# define __cccl_lib_integer_sequence 201304L +# define __cccl_lib_integral_constant_callable 201304L +# define __cccl_lib_is_final 201402L +# define __cccl_lib_is_null_pointer 201309L +# define __cccl_lib_make_reverse_iterator 201402L // # define __cccl_lib_make_unique 201304L # if !_CCCL_COMPILER(MSVC) || _CCCL_STD_VER >= 2020 # define __cccl_lib_mdspan 202207L