From 8bd263c5e365c4d3c10b89e2426fc7bf7fc45675 Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Tue, 11 Aug 2026 19:12:53 -0400 Subject: [PATCH 1/7] convert some ::value to _v --- libcudacxx/include/cuda/__complex/traits.h | 2 +- libcudacxx/include/cuda/__functional/address_stability.h | 2 +- libcudacxx/include/cuda/std/__algorithm/equal_range.h | 2 +- libcudacxx/include/cuda/std/__algorithm/includes.h | 3 +-- libcudacxx/include/cuda/std/__algorithm/lower_bound.h | 2 +- libcudacxx/include/cuda/std/__algorithm/min_element.h | 3 +-- libcudacxx/include/cuda/std/__algorithm/minmax.h | 2 +- libcudacxx/include/cuda/std/__algorithm/minmax_element.h | 3 +-- libcudacxx/include/cuda/std/__algorithm/stable_sort.h | 9 +++------ libcudacxx/include/cuda/std/__simd/utility.h | 2 +- libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h | 2 +- libcudacxx/include/cuda/std/__type_traits/add_pointer.h | 2 +- .../include/cuda/std/__type_traits/is_copy_assignable.h | 2 +- .../cuda/std/__type_traits/is_copy_constructible.h | 2 +- .../include/cuda/std/__type_traits/is_destructible.h | 4 ++-- .../cuda/std/__type_traits/is_move_constructible.h | 2 +- .../cuda/std/__type_traits/is_nothrow_destructible.h | 2 +- 17 files changed, 20 insertions(+), 26 deletions(-) diff --git a/libcudacxx/include/cuda/__complex/traits.h b/libcudacxx/include/cuda/__complex/traits.h index 550e155f482..4cf1137cf1e 100644 --- a/libcudacxx/include/cuda/__complex/traits.h +++ b/libcudacxx/include/cuda/__complex/traits.h @@ -38,7 +38,7 @@ _CCCL_BEGIN_NAMESPACE_CUDA template _CCCL_CONCEPT __is_complex_compatible_tuple_like = _CCCL_REQUIRES_EXPR( - (_Tp))(requires(::cuda::std::tuple_size<_Tp>::value == 2), + (_Tp))(requires(::cuda::std::tuple_size_v<_Tp> == 2), requires(::cuda::std::is_same_v<::cuda::std::remove_cvref_t<::cuda::std::tuple_element_t<0, _Tp>>, ::cuda::std::remove_cvref_t<::cuda::std::tuple_element_t<1, _Tp>>>)); diff --git a/libcudacxx/include/cuda/__functional/address_stability.h b/libcudacxx/include/cuda/__functional/address_stability.h index 113c9a378c3..a64d3ae0f09 100644 --- a/libcudacxx/include/cuda/__functional/address_stability.h +++ b/libcudacxx/include/cuda/__functional/address_stability.h @@ -65,7 +65,7 @@ struct proclaims_copyable_arguments<__callable_permitting_copied_arguments> : template [[nodiscard]] _CCCL_API constexpr auto proclaim_copyable_arguments(F&& f) { - if constexpr (proclaims_copyable_arguments::value) + if constexpr (proclaims_copyable_arguments_v) { // If F is already marked then we do not need to wrap it return f; } diff --git a/libcudacxx/include/cuda/std/__algorithm/equal_range.h b/libcudacxx/include/cuda/std/__algorithm/equal_range.h index c5ad952c507..93025c79e4d 100644 --- a/libcudacxx/include/cuda/std/__algorithm/equal_range.h +++ b/libcudacxx/include/cuda/std/__algorithm/equal_range.h @@ -77,7 +77,7 @@ template [[nodiscard]] _CCCL_API constexpr pair<_ForwardIterator, _ForwardIterator> equal_range(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) { - static_assert(__is_callable<_Compare, decltype(*__first), const _Tp&>::value, "The comparator has to be callable"); + static_assert(__is_callable_v<_Compare, decltype(*__first), const _Tp&>, "The comparator has to be callable"); static_assert(is_copy_constructible_v<_ForwardIterator>, "Iterator has to be copy constructible"); return ::cuda::std::__equal_range<_ClassicAlgPolicy>( ::cuda::std::move(__first), diff --git a/libcudacxx/include/cuda/std/__algorithm/includes.h b/libcudacxx/include/cuda/std/__algorithm/includes.h index a789c2456f7..23ac329fca7 100644 --- a/libcudacxx/include/cuda/std/__algorithm/includes.h +++ b/libcudacxx/include/cuda/std/__algorithm/includes.h @@ -57,8 +57,7 @@ template [[nodiscard]] _CCCL_API constexpr bool includes( _InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { - static_assert(__is_callable<_Compare, decltype(*__first1), decltype(*__first2)>::value, - "Comparator has to be callable"); + static_assert(__is_callable_v<_Compare, decltype(*__first1), decltype(*__first2)>, "Comparator has to be callable"); return ::cuda::std::__includes( ::cuda::std::move(__first1), diff --git a/libcudacxx/include/cuda/std/__algorithm/lower_bound.h b/libcudacxx/include/cuda/std/__algorithm/lower_bound.h index f03e2ca917a..d96b05e6f67 100644 --- a/libcudacxx/include/cuda/std/__algorithm/lower_bound.h +++ b/libcudacxx/include/cuda/std/__algorithm/lower_bound.h @@ -63,7 +63,7 @@ template [[nodiscard]] _CCCL_API constexpr _ForwardIterator lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp) { - static_assert(__is_callable<_Compare, decltype(*__first), const _Tp&>::value, "The comparator has to be callable"); + static_assert(__is_callable_v<_Compare, decltype(*__first), const _Tp&>, "The comparator has to be callable"); auto __proj = ::cuda::std::identity(); return ::cuda::std::__lower_bound<_ClassicAlgPolicy>(__first, __last, __value, __comp, __proj); } diff --git a/libcudacxx/include/cuda/std/__algorithm/min_element.h b/libcudacxx/include/cuda/std/__algorithm/min_element.h index 99185fed1e9..d184815ca46 100644 --- a/libcudacxx/include/cuda/std/__algorithm/min_element.h +++ b/libcudacxx/include/cuda/std/__algorithm/min_element.h @@ -67,8 +67,7 @@ template min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { static_assert(__has_forward_traversal<_ForwardIterator>, "std::min_element requires a ForwardIterator"); - static_assert(__is_callable<_Compare, decltype(*__first), decltype(*__first)>::value, - "The comparator has to be callable"); + static_assert(__is_callable_v<_Compare, decltype(*__first), decltype(*__first)>, "The comparator has to be callable"); return ::cuda::std::__min_element<__comp_ref_type<_Compare>>( ::cuda::std::move(__first), ::cuda::std::move(__last), __comp); diff --git a/libcudacxx/include/cuda/std/__algorithm/minmax.h b/libcudacxx/include/cuda/std/__algorithm/minmax.h index 200e077b564..b983ae63425 100644 --- a/libcudacxx/include/cuda/std/__algorithm/minmax.h +++ b/libcudacxx/include/cuda/std/__algorithm/minmax.h @@ -47,7 +47,7 @@ template template [[nodiscard]] _CCCL_API constexpr pair<_Tp, _Tp> minmax(initializer_list<_Tp> __t, _Compare __comp) { - static_assert(__is_callable<_Compare, _Tp, _Tp>::value, "The comparator has to be callable"); + static_assert(__is_callable_v<_Compare, _Tp, _Tp>, "The comparator has to be callable"); identity __proj{}; auto __ret = ::cuda::std::__minmax_element_impl(__t.begin(), __t.end(), __comp, __proj); return pair<_Tp, _Tp>(*__ret.first, *__ret.second); diff --git a/libcudacxx/include/cuda/std/__algorithm/minmax_element.h b/libcudacxx/include/cuda/std/__algorithm/minmax_element.h index 7ba369c5add..8d58ee5acf0 100644 --- a/libcudacxx/include/cuda/std/__algorithm/minmax_element.h +++ b/libcudacxx/include/cuda/std/__algorithm/minmax_element.h @@ -125,8 +125,7 @@ template minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { static_assert(__has_forward_traversal<_ForwardIterator>, "::cuda::std::minmax_element requires a ForwardIterator"); - static_assert(__is_callable<_Compare, decltype(*__first), decltype(*__first)>::value, - "The comparator has to be callable"); + static_assert(__is_callable_v<_Compare, decltype(*__first), decltype(*__first)>, "The comparator has to be callable"); auto __proj = identity(); return ::cuda::std::__minmax_element_impl(__first, __last, __comp, __proj); } diff --git a/libcudacxx/include/cuda/std/__algorithm/stable_sort.h b/libcudacxx/include/cuda/std/__algorithm/stable_sort.h index 9ab387cd3b9..ec7ce5aa643 100644 --- a/libcudacxx/include/cuda/std/__algorithm/stable_sort.h +++ b/libcudacxx/include/cuda/std/__algorithm/stable_sort.h @@ -230,10 +230,7 @@ _CCCL_API void __stable_sort_move( } template -struct __stable_sort_switch -{ - static const unsigned value = 128 * is_trivially_copy_assignable_v<_Tp>; -}; +inline constexpr unsigned __stable_sort_switch_v = 128 * is_trivially_copy_assignable_v<_Tp>; template _CCCL_API void __stable_sort( @@ -258,7 +255,7 @@ _CCCL_API void __stable_sort( } return; } - if (__len <= static_cast(__stable_sort_switch::value)) + if (__len <= static_cast(__stable_sort_switch_v)) { ::cuda::std::__insertion_sort<_AlgPolicy, _Compare>(__first, __last, __comp); return; @@ -292,7 +289,7 @@ _CCCL_API void __stable_sort_impl(_RandomAccessIterator __first, _RandomAccessIt difference_type __len = __last - __first; pair __buf(0, 0); unique_ptr __h; - if (__len > static_cast(__stable_sort_switch::value)) + if (__len > static_cast(__stable_sort_switch_v)) { __buf = ::cuda::std::get_temporary_buffer(__len); __h.reset(__buf.first); diff --git a/libcudacxx/include/cuda/std/__simd/utility.h b/libcudacxx/include/cuda/std/__simd/utility.h index bcbdfb655bb..8f4dc9e4a39 100644 --- a/libcudacxx/include/cuda/std/__simd/utility.h +++ b/libcudacxx/include/cuda/std/__simd/utility.h @@ -80,7 +80,7 @@ template inline constexpr bool __has_tuple_size_v = false; template -inline constexpr bool __has_tuple_size_v<_Range, void_t>::value)>> = true; +inline constexpr bool __has_tuple_size_v<_Range, void_t>)>> = true; template inline constexpr bool __has_static_extent_v = false; diff --git a/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h b/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h index 11b0989cf33..dbcfb4db8f3 100644 --- a/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h +++ b/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h @@ -94,7 +94,7 @@ _CCCL_CONCEPT __tuple_like = __tuple_like_ext>; // Not on line 74 because of __COUNTER__ missing in NVRTC template _CCCL_CONCEPT __pair_like = _CCCL_REQUIRES_EXPR((_Tp)) // - (requires(__tuple_like<_Tp>), requires(tuple_size>::value == 2)); + (requires(__tuple_like<_Tp>), requires(tuple_size_v> == 2)); _CCCL_END_NAMESPACE_CUDA_STD diff --git a/libcudacxx/include/cuda/std/__type_traits/add_pointer.h b/libcudacxx/include/cuda/std/__type_traits/add_pointer.h index 6409382cd07..6e5cd81179d 100644 --- a/libcudacxx/include/cuda/std/__type_traits/add_pointer.h +++ b/libcudacxx/include/cuda/std/__type_traits/add_pointer.h @@ -36,7 +36,7 @@ template using add_pointer_t _CCCL_NODEBUG_ALIAS = _CCCL_BUILTIN_ADD_POINTER(_Tp); #else // ^^^ _CCCL_BUILTIN_ADD_POINTER ^^^ / vvv !_CCCL_BUILTIN_ADD_POINTER vvv -template ::value || is_void<_Tp>::value> +template ::value || is_void_v<_Tp>> struct __add_pointer_impl { using type _CCCL_NODEBUG_ALIAS = remove_reference_t<_Tp>*; diff --git a/libcudacxx/include/cuda/std/__type_traits/is_copy_assignable.h b/libcudacxx/include/cuda/std/__type_traits/is_copy_assignable.h index 498b470c5af..259584b4330 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_copy_assignable.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_copy_assignable.h @@ -49,7 +49,7 @@ is_copy_assignable : public is_assignable, add_lvalu template inline constexpr bool is_copy_assignable_v = - is_assignable, add_lvalue_reference_t>>::value; + is_assignable_v, add_lvalue_reference_t>>; #endif // No builtin diff --git a/libcudacxx/include/cuda/std/__type_traits/is_copy_constructible.h b/libcudacxx/include/cuda/std/__type_traits/is_copy_constructible.h index c382c9d644d..737d2185dbf 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_copy_constructible.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_copy_constructible.h @@ -47,7 +47,7 @@ is_copy_constructible : public is_constructible<_Tp, add_lvalue_reference_t -inline constexpr bool is_copy_constructible_v = is_constructible<_Tp, add_lvalue_reference_t>>::value; +inline constexpr bool is_copy_constructible_v = is_constructible_v<_Tp, add_lvalue_reference_t>>; #endif // No builtin diff --git a/libcudacxx/include/cuda/std/__type_traits/is_destructible.h b/libcudacxx/include/cuda/std/__type_traits/is_destructible.h index 5d453185591..9b0d953695e 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_destructible.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_destructible.h @@ -84,7 +84,7 @@ template struct __destructible_false; template -struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, is_reference<_Tp>::value> +struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, is_reference_v<_Tp>> {}; template @@ -92,7 +92,7 @@ struct __destructible_false<_Tp, true> : public false_type {}; template -struct is_destructible : public __destructible_false<_Tp, is_function<_Tp>::value> +struct is_destructible : public __destructible_false<_Tp, is_function_v<_Tp>> {}; template diff --git a/libcudacxx/include/cuda/std/__type_traits/is_move_constructible.h b/libcudacxx/include/cuda/std/__type_traits/is_move_constructible.h index 8dd9310c7fd..3f81c28ac13 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_move_constructible.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_move_constructible.h @@ -45,7 +45,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT is_move_constructible : public is_construct {}; template -inline constexpr bool is_move_constructible_v = is_constructible<_Tp, add_rvalue_reference_t<_Tp>>::value; +inline constexpr bool is_move_constructible_v = is_constructible_v<_Tp, add_rvalue_reference_t<_Tp>>; #endif // No builtin diff --git a/libcudacxx/include/cuda/std/__type_traits/is_nothrow_destructible.h b/libcudacxx/include/cuda/std/__type_traits/is_nothrow_destructible.h index b1c08d558ce..6cc81e63aa0 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_nothrow_destructible.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_nothrow_destructible.h @@ -45,7 +45,7 @@ inline constexpr bool is_nothrow_destructible_v = _CCCL_BUILTIN_IS_NOTHROW_DESTR #else // ^^^ _CCCL_BUILTIN_IS_NOTHROW_DESTRUCTIBLE ^^^ / vvv !_CCCL_BUILTIN_IS_NOTHROW_DESTRUCTIBLE vvv -template ::value> +template > struct __cccl_is_nothrow_destructible : false_type {}; From aa0fc5fc4c9727fc1efd521f5fd3a091eee32b56 Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Wed, 12 Aug 2026 07:53:06 -0400 Subject: [PATCH 2/7] fixup! convert some ::value to _v --- libcudacxx/include/cuda/__complex/traits.h | 2 +- libcudacxx/include/cuda/std/__simd/utility.h | 2 +- libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libcudacxx/include/cuda/__complex/traits.h b/libcudacxx/include/cuda/__complex/traits.h index 4cf1137cf1e..550e155f482 100644 --- a/libcudacxx/include/cuda/__complex/traits.h +++ b/libcudacxx/include/cuda/__complex/traits.h @@ -38,7 +38,7 @@ _CCCL_BEGIN_NAMESPACE_CUDA template _CCCL_CONCEPT __is_complex_compatible_tuple_like = _CCCL_REQUIRES_EXPR( - (_Tp))(requires(::cuda::std::tuple_size_v<_Tp> == 2), + (_Tp))(requires(::cuda::std::tuple_size<_Tp>::value == 2), requires(::cuda::std::is_same_v<::cuda::std::remove_cvref_t<::cuda::std::tuple_element_t<0, _Tp>>, ::cuda::std::remove_cvref_t<::cuda::std::tuple_element_t<1, _Tp>>>)); diff --git a/libcudacxx/include/cuda/std/__simd/utility.h b/libcudacxx/include/cuda/std/__simd/utility.h index 8f4dc9e4a39..bcbdfb655bb 100644 --- a/libcudacxx/include/cuda/std/__simd/utility.h +++ b/libcudacxx/include/cuda/std/__simd/utility.h @@ -80,7 +80,7 @@ template inline constexpr bool __has_tuple_size_v = false; template -inline constexpr bool __has_tuple_size_v<_Range, void_t>)>> = true; +inline constexpr bool __has_tuple_size_v<_Range, void_t>::value)>> = true; template inline constexpr bool __has_static_extent_v = false; diff --git a/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h b/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h index dbcfb4db8f3..11b0989cf33 100644 --- a/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h +++ b/libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h @@ -94,7 +94,7 @@ _CCCL_CONCEPT __tuple_like = __tuple_like_ext>; // Not on line 74 because of __COUNTER__ missing in NVRTC template _CCCL_CONCEPT __pair_like = _CCCL_REQUIRES_EXPR((_Tp)) // - (requires(__tuple_like<_Tp>), requires(tuple_size_v> == 2)); + (requires(__tuple_like<_Tp>), requires(tuple_size>::value == 2)); _CCCL_END_NAMESPACE_CUDA_STD From 13ad027a35b2a3d38e6fb286968952266dd7dc64 Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Wed, 12 Aug 2026 08:36:06 -0400 Subject: [PATCH 3/7] fixup! convert some ::value to _v --- .../cuda/std/__iterator/iterator_traits.h | 7 +-- .../std/__type_traits/add_lvalue_reference.h | 16 ++---- .../cuda/std/__type_traits/add_pointer.h | 4 +- .../std/__type_traits/add_rvalue_reference.h | 16 ++---- .../include/cuda/std/__type_traits/decay.h | 4 +- .../cuda/std/__type_traits/is_referenceable.h | 55 ------------------- .../include/cuda/std/__type_traits/is_same.h | 26 --------- .../cuda/std/__type_traits/is_swappable.h | 6 +- 8 files changed, 16 insertions(+), 118 deletions(-) delete mode 100644 libcudacxx/include/cuda/std/__type_traits/is_referenceable.h diff --git a/libcudacxx/include/cuda/std/__iterator/iterator_traits.h b/libcudacxx/include/cuda/std/__iterator/iterator_traits.h index 8dd0e3665b4..23b90c0ba2b 100644 --- a/libcudacxx/include/cuda/std/__iterator/iterator_traits.h +++ b/libcudacxx/include/cuda/std/__iterator/iterator_traits.h @@ -22,6 +22,7 @@ #endif // no system header #include +#include #include #include #include @@ -79,12 +80,6 @@ struct __cccl_std_contiguous_iterator_tag_exists : __cccl_type_is_defined -using __with_reference = _Tp&; - -template -_CCCL_CONCEPT __can_reference = _CCCL_REQUIRES_EXPR((_Tp))(typename(__with_reference<_Tp>)); - // [iterator.traits] #if _CCCL_HAS_CONCEPTS() template diff --git a/libcudacxx/include/cuda/std/__type_traits/add_lvalue_reference.h b/libcudacxx/include/cuda/std/__type_traits/add_lvalue_reference.h index 07be75ffe6d..a914628af1e 100644 --- a/libcudacxx/include/cuda/std/__type_traits/add_lvalue_reference.h +++ b/libcudacxx/include/cuda/std/__type_traits/add_lvalue_reference.h @@ -20,8 +20,6 @@ # pragma system_header #endif // no system header -#include - #include _CCCL_BEGIN_NAMESPACE_CUDA_STD @@ -33,19 +31,13 @@ using add_lvalue_reference_t _CCCL_NODEBUG_ALIAS = _CCCL_BUILTIN_ADD_LVALUE_REFE #else // ^^^ _CCCL_BUILTIN_ADD_LVALUE_REFERENCE ^^^ / vvv !_CCCL_BUILTIN_ADD_LVALUE_REFERENCE vvv -template ::value> -struct __add_lvalue_reference_impl -{ - using type _CCCL_NODEBUG_ALIAS = _Tp; -}; template -struct __add_lvalue_reference_impl<_Tp, true> -{ - using type _CCCL_NODEBUG_ALIAS = _Tp&; -}; +_Tp& __add_lref_fn(int); +template +_Tp __add_lref_fn(...); template -using add_lvalue_reference_t _CCCL_NODEBUG_ALIAS = typename __add_lvalue_reference_impl<_Tp>::type; +using add_lvalue_reference_t _CCCL_NODEBUG_ALIAS = decltype(::cuda::std::__add_lref_fn<_Tp>(0)); #endif // !_CCCL_BUILTIN_ADD_LVALUE_REFERENCE diff --git a/libcudacxx/include/cuda/std/__type_traits/add_pointer.h b/libcudacxx/include/cuda/std/__type_traits/add_pointer.h index 6e5cd81179d..1cac8960e04 100644 --- a/libcudacxx/include/cuda/std/__type_traits/add_pointer.h +++ b/libcudacxx/include/cuda/std/__type_traits/add_pointer.h @@ -20,7 +20,7 @@ # pragma system_header #endif // no system header -#include +#include #include #include #include @@ -36,7 +36,7 @@ template using add_pointer_t _CCCL_NODEBUG_ALIAS = _CCCL_BUILTIN_ADD_POINTER(_Tp); #else // ^^^ _CCCL_BUILTIN_ADD_POINTER ^^^ / vvv !_CCCL_BUILTIN_ADD_POINTER vvv -template ::value || is_void_v<_Tp>> +template || is_void_v<_Tp>> struct __add_pointer_impl { using type _CCCL_NODEBUG_ALIAS = remove_reference_t<_Tp>*; diff --git a/libcudacxx/include/cuda/std/__type_traits/add_rvalue_reference.h b/libcudacxx/include/cuda/std/__type_traits/add_rvalue_reference.h index 67580e8c34f..c7f62c33558 100644 --- a/libcudacxx/include/cuda/std/__type_traits/add_rvalue_reference.h +++ b/libcudacxx/include/cuda/std/__type_traits/add_rvalue_reference.h @@ -20,8 +20,6 @@ # pragma system_header #endif // no system header -#include - #include _CCCL_BEGIN_NAMESPACE_CUDA_STD @@ -33,19 +31,13 @@ using add_rvalue_reference_t _CCCL_NODEBUG_ALIAS = _CCCL_BUILTIN_ADD_RVALUE_REFE #else // ^^^ _CCCL_BUILTIN_ADD_RVALUE_REFERENCE ^^^ / vvv !_CCCL_BUILTIN_ADD_RVALUE_REFERENCE vvv -template ::value> -struct __add_rvalue_reference_impl -{ - using type _CCCL_NODEBUG_ALIAS = _Tp; -}; template -struct __add_rvalue_reference_impl<_Tp, true> -{ - using type _CCCL_NODEBUG_ALIAS = _Tp&&; -}; +_Tp&& __add_rref_fn(int); +template +_Tp __add_rref_fn(...); template -using add_rvalue_reference_t _CCCL_NODEBUG_ALIAS = typename __add_rvalue_reference_impl<_Tp>::type; +using add_rvalue_reference_t _CCCL_NODEBUG_ALIAS = decltype(::cuda::std::__add_rref_fn<_Tp>(0)); #endif // _CCCL_BUILTIN_ADD_RVALUE_REFERENCE diff --git a/libcudacxx/include/cuda/std/__type_traits/decay.h b/libcudacxx/include/cuda/std/__type_traits/decay.h index e53949e5f33..066b740d418 100644 --- a/libcudacxx/include/cuda/std/__type_traits/decay.h +++ b/libcudacxx/include/cuda/std/__type_traits/decay.h @@ -20,11 +20,11 @@ # pragma system_header #endif // no system header +#include #include #include #include #include -#include #include #include #include @@ -68,7 +68,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT decay using _Up _CCCL_NODEBUG_ALIAS = remove_reference_t<_Tp>; public: - using type _CCCL_NODEBUG_ALIAS = typename __decay_impl<_Up, __cccl_is_referenceable<_Up>::value>::type; + using type _CCCL_NODEBUG_ALIAS = typename __decay_impl<_Up, __can_reference<_Up>>::type; }; template diff --git a/libcudacxx/include/cuda/std/__type_traits/is_referenceable.h b/libcudacxx/include/cuda/std/__type_traits/is_referenceable.h deleted file mode 100644 index d8949b8fb53..00000000000 --- a/libcudacxx/include/cuda/std/__type_traits/is_referenceable.h +++ /dev/null @@ -1,55 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. -// -//===----------------------------------------------------------------------===// - -#ifndef _CUDA_STD___TYPE_TRAITS_IS_REFERENCEABLE_H -#define _CUDA_STD___TYPE_TRAITS_IS_REFERENCEABLE_H - -#include - -#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) -# pragma GCC system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) -# pragma clang system_header -#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) -# pragma system_header -#endif // no system header - -#include -#include - -#include - -_CCCL_BEGIN_NAMESPACE_CUDA_STD - -#if defined(_CCCL_BUILTIN_IS_REFERENCEABLE) && !defined(_LIBCUDACXX_USE_IS_REFERENCEABLE_FALLBACK) - -template -struct __cccl_is_referenceable : public integral_constant -{}; - -#else -struct __cccl_is_referenceable_impl -{ - template - _CCCL_HOST_DEVICE static _Tp& __test(int); - template - _CCCL_HOST_DEVICE static false_type __test(...); -}; - -template -struct __cccl_is_referenceable - : integral_constant(0)), false_type>::value> -{}; -#endif // defined(_CCCL_BUILTIN_IS_REFERENCEABLE) && !defined(_LIBCUDACXX_USE_IS_REFERENCEABLE_FALLBACK) - -_CCCL_END_NAMESPACE_CUDA_STD - -#include - -#endif // _CUDA_STD___TYPE_TRAITS_IS_REFERENCEABLE_H diff --git a/libcudacxx/include/cuda/std/__type_traits/is_same.h b/libcudacxx/include/cuda/std/__type_traits/is_same.h index 37d2beeef59..ba446c1eef0 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_same.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_same.h @@ -39,19 +39,6 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT is_same : bool_constant<_CCCL_BUILTIN_IS_SA template inline constexpr bool is_same_v = _CCCL_BUILTIN_IS_SAME_AS(_Tp, _Up); -// _IsSame has the same effect as is_same but instantiates fewer types: -// is_same and is_same are guaranteed to be different types, but -// _IsSame and _IsSame are the same type (namely, false_type). -// Neither GCC nor Clang can mangle the __is_same builtin, so _IsSame -// mustn't be directly used anywhere that contributes to name-mangling -// (such as in a dependent return type). - -template -using _IsSame = bool_constant<_CCCL_BUILTIN_IS_SAME_AS(_Tp, _Up)>; - -template -using _IsNotSame = bool_constant; - #else // ^^^ _CCCL_BUILTIN_IS_SAME_AS ^^^ / vvv !_CCCL_BUILTIN_IS_SAME_AS vvv template @@ -66,19 +53,6 @@ inline constexpr bool is_same_v = false; template inline constexpr bool is_same_v<_Tp, _Tp> = true; -// _IsSame has the same effect as is_same but instantiates fewer types: -// is_same and is_same are guaranteed to be different types, but -// _IsSame and _IsSame are the same type (namely, false_type). -// Neither GCC nor Clang can mangle the __is_same builtin, so _IsSame -// mustn't be directly used anywhere that contributes to name-mangling -// (such as in a dependent return type). - -template -using _IsSame = bool_constant>; - -template -using _IsNotSame = bool_constant>; - #endif // ^^^ !_CCCL_BUILTIN_IS_SAME_AS ^^^ _CCCL_END_NAMESPACE_CUDA_STD diff --git a/libcudacxx/include/cuda/std/__type_traits/is_swappable.h b/libcudacxx/include/cuda/std/__type_traits/is_swappable.h index 8e9a87c7a6e..71748ae55b3 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_swappable.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_swappable.h @@ -20,6 +20,7 @@ # pragma system_header #endif // no system header +#include #include #include #include @@ -30,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -161,7 +161,7 @@ struct __is_nothrow_swappable : public integral_constant inline constexpr bool is_swappable_with_v = __detail::__swappable_with<_Tp, _Up>::value; -template ::value> +template > inline constexpr bool is_swappable_v = false; template @@ -171,7 +171,7 @@ inline constexpr bool is_swappable_v<_Tp, true> = template inline constexpr bool is_nothrow_swappable_with_v = __detail::__nothrow_swappable_with<_Tp, _Up>::value; -template ::value> +template > inline constexpr bool is_nothrow_swappable_v = false; template From 0aaacd5b341a8cc23548b4711b3277efc0c1dc1c Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Wed, 12 Aug 2026 08:41:02 -0400 Subject: [PATCH 4/7] fixup! convert some ::value to _v --- .../cuda/std/__concepts/can_reference.h | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 libcudacxx/include/cuda/std/__concepts/can_reference.h diff --git a/libcudacxx/include/cuda/std/__concepts/can_reference.h b/libcudacxx/include/cuda/std/__concepts/can_reference.h new file mode 100644 index 00000000000..56a7958e248 --- /dev/null +++ b/libcudacxx/include/cuda/std/__concepts/can_reference.h @@ -0,0 +1,40 @@ +// -*- C++ -*- +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. +// +//===----------------------------------------------------------------------===// + +#ifndef _CUDA_STD___CONCEPTS_CAN_REFERENCE_H +#define _CUDA_STD___CONCEPTS_CAN_REFERENCE_H + +#include + +#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC) +# pragma GCC system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG) +# pragma clang system_header +#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC) +# pragma system_header +#endif // no system header + +#include + +#include + +_CCCL_BEGIN_NAMESPACE_CUDA_STD + +template +using __with_reference = _Tp&; + +template +_CCCL_CONCEPT __can_reference = _CCCL_REQUIRES_EXPR((_Tp), )(typename(__with_reference<_Tp>)); + +_CCCL_END_NAMESPACE_CUDA_STD + +#include + +#endif // _CUDA_STD___CONCEPTS_CAN_REFERENCE_H From d0f7ec66ae5a5ad238645bca53f8f87f37ceea5e Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Wed, 12 Aug 2026 08:57:35 -0400 Subject: [PATCH 5/7] fixup! convert some ::value to _v --- .../std/__type_traits/add_lvalue_reference.h | 16 ++++++++++++---- .../std/__type_traits/add_rvalue_reference.h | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/libcudacxx/include/cuda/std/__type_traits/add_lvalue_reference.h b/libcudacxx/include/cuda/std/__type_traits/add_lvalue_reference.h index a914628af1e..ed4f6b64da1 100644 --- a/libcudacxx/include/cuda/std/__type_traits/add_lvalue_reference.h +++ b/libcudacxx/include/cuda/std/__type_traits/add_lvalue_reference.h @@ -20,6 +20,8 @@ # pragma system_header #endif // no system header +#include + #include _CCCL_BEGIN_NAMESPACE_CUDA_STD @@ -31,13 +33,19 @@ using add_lvalue_reference_t _CCCL_NODEBUG_ALIAS = _CCCL_BUILTIN_ADD_LVALUE_REFE #else // ^^^ _CCCL_BUILTIN_ADD_LVALUE_REFERENCE ^^^ / vvv !_CCCL_BUILTIN_ADD_LVALUE_REFERENCE vvv +template > +struct __add_lvalue_reference_impl +{ + using type _CCCL_NODEBUG_ALIAS = _Tp; +}; template -_Tp& __add_lref_fn(int); -template -_Tp __add_lref_fn(...); +struct __add_lvalue_reference_impl<_Tp, true> +{ + using type _CCCL_NODEBUG_ALIAS = _Tp&; +}; template -using add_lvalue_reference_t _CCCL_NODEBUG_ALIAS = decltype(::cuda::std::__add_lref_fn<_Tp>(0)); +using add_lvalue_reference_t _CCCL_NODEBUG_ALIAS = typename __add_lvalue_reference_impl<_Tp>::type; #endif // !_CCCL_BUILTIN_ADD_LVALUE_REFERENCE diff --git a/libcudacxx/include/cuda/std/__type_traits/add_rvalue_reference.h b/libcudacxx/include/cuda/std/__type_traits/add_rvalue_reference.h index c7f62c33558..26354b0bc97 100644 --- a/libcudacxx/include/cuda/std/__type_traits/add_rvalue_reference.h +++ b/libcudacxx/include/cuda/std/__type_traits/add_rvalue_reference.h @@ -20,6 +20,8 @@ # pragma system_header #endif // no system header +#include + #include _CCCL_BEGIN_NAMESPACE_CUDA_STD @@ -31,13 +33,19 @@ using add_rvalue_reference_t _CCCL_NODEBUG_ALIAS = _CCCL_BUILTIN_ADD_RVALUE_REFE #else // ^^^ _CCCL_BUILTIN_ADD_RVALUE_REFERENCE ^^^ / vvv !_CCCL_BUILTIN_ADD_RVALUE_REFERENCE vvv +template > +struct __add_rvalue_reference_impl +{ + using type _CCCL_NODEBUG_ALIAS = _Tp; +}; template -_Tp&& __add_rref_fn(int); -template -_Tp __add_rref_fn(...); +struct __add_rvalue_reference_impl<_Tp, true> +{ + using type _CCCL_NODEBUG_ALIAS = _Tp&&; +}; template -using add_rvalue_reference_t _CCCL_NODEBUG_ALIAS = decltype(::cuda::std::__add_rref_fn<_Tp>(0)); +using add_rvalue_reference_t _CCCL_NODEBUG_ALIAS = typename __add_rvalue_reference_impl<_Tp>::type; #endif // _CCCL_BUILTIN_ADD_RVALUE_REFERENCE From e158aeef3fe7963f741979d6cbff1f15c62560ad Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Wed, 12 Aug 2026 10:01:15 -0400 Subject: [PATCH 6/7] fixup! convert some ::value to _v --- .../experimental/__detail/type_traits.cuh | 4 +- .../__graph/graph_builder_ref.cuh | 2 +- .../cuda/std/__functional/reference_wrapper.h | 2 +- .../cuda/std/__iterator/iterator_traits.h | 24 ++++---- .../cuda/std/__type_traits/is_constructible.h | 5 +- .../std/__type_traits/is_primary_template.h | 4 +- .../cuda/std/__type_traits/is_swappable.h | 2 +- .../cuda/std/__type_traits/remove_cvref.h | 3 +- .../stress_tests/stress_test_is_same.sh.cpp | 60 ------------------- 9 files changed, 23 insertions(+), 83 deletions(-) delete mode 100644 libcudacxx/test/libcudacxx/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp diff --git a/cudax/include/cuda/experimental/__detail/type_traits.cuh b/cudax/include/cuda/experimental/__detail/type_traits.cuh index f75bebe2aec..6242564f643 100644 --- a/cudax/include/cuda/experimental/__detail/type_traits.cuh +++ b/cudax/include/cuda/experimental/__detail/type_traits.cuh @@ -52,10 +52,10 @@ template } template -_CCCL_CONCEPT __same_as = ::cuda::std::_IsSame<_Ty, _Uy>::value; +_CCCL_CONCEPT __same_as = ::cuda::std::is_same_v<_Ty, _Uy>; template -_CCCL_CONCEPT __not_same_as = !::cuda::std::_IsSame<_Ty, _Uy>::value; +_CCCL_CONCEPT __not_same_as = !::cuda::std::is_same_v<_Ty, _Uy>; template _CCCL_CONCEPT __one_of = (__same_as<_Ty, _Us> || ...); diff --git a/cudax/include/cuda/experimental/__graph/graph_builder_ref.cuh b/cudax/include/cuda/experimental/__graph/graph_builder_ref.cuh index 5e26dda2980..d10fb8c385c 100644 --- a/cudax/include/cuda/experimental/__graph/graph_builder_ref.cuh +++ b/cudax/include/cuda/experimental/__graph/graph_builder_ref.cuh @@ -235,7 +235,7 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT graph_builder_ref _CCCL_HOST_API constexpr auto add(_Node __node, ::cuda::std::span __deps) -> graph_node_ref { // assert that the node descriptor returns a graph_node_ref object: - static_assert(::cuda::std::_IsSame::value, + static_assert(::cuda::std::is_same_v, "node descriptors must return a graph_node_ref"); return __node.__add_to_graph(__graph_, __deps); } diff --git a/libcudacxx/include/cuda/std/__functional/reference_wrapper.h b/libcudacxx/include/cuda/std/__functional/reference_wrapper.h index ed56284dbb2..3a408d2e6fc 100644 --- a/libcudacxx/include/cuda/std/__functional/reference_wrapper.h +++ b/libcudacxx/include/cuda/std/__functional/reference_wrapper.h @@ -50,7 +50,7 @@ class _CCCL_TYPE_VISIBILITY_DEFAULT reference_wrapper : public __weak_result_typ // NOLINTBEGIN(bugprone-forwarding-reference-overload) template < class _Up, - class = enable_if_t::value, decltype(__fun(::cuda::std::declval<_Up>()))>> + class = enable_if_t, decltype(__fun(::cuda::std::declval<_Up>()))>> _CCCL_API constexpr reference_wrapper(_Up&& __u) noexcept(noexcept(__fun(::cuda::std::declval<_Up>()))) { type& __f = static_cast<_Up&&>(__u); diff --git a/libcudacxx/include/cuda/std/__iterator/iterator_traits.h b/libcudacxx/include/cuda/std/__iterator/iterator_traits.h index 23b90c0ba2b..250067c8b0e 100644 --- a/libcudacxx/include/cuda/std/__iterator/iterator_traits.h +++ b/libcudacxx/include/cuda/std/__iterator/iterator_traits.h @@ -152,50 +152,50 @@ using _ITER_TRAITS = typename __iter_traits_cache<_Iter>::type; #if _CCCL_HOSTED() # if defined(_GLIBCXX_DEBUG) _CCCL_TEMPLATE(class _Iter, class _Ty, class _Range) -_CCCL_REQUIRES(_IsSame<_Iter, ::__gnu_debug::_Safe_iterator<_Ty*, _Range>>::value) +_CCCL_REQUIRES(is_same_v<_Iter, ::__gnu_debug::_Safe_iterator<_Ty*, _Range>>) _CCCL_API inline auto __iter_concept_fn(::__gnu_debug::_Safe_iterator<_Ty*, _Range>, __priority_tag<3>) -> contiguous_iterator_tag; # endif // _GLIBCXX_DEBUG # if _CCCL_HOST_STD_LIB(LIBSTDCXX) _CCCL_TEMPLATE(class _Iter, class _Ty, class _Range) -_CCCL_REQUIRES(_IsSame<_Iter, ::__gnu_cxx::__normal_iterator<_Ty*, _Range>>::value) +_CCCL_REQUIRES(is_same_v<_Iter, ::__gnu_cxx::__normal_iterator<_Ty*, _Range>>) _CCCL_API inline auto __iter_concept_fn(::__gnu_cxx::__normal_iterator<_Ty*, _Range>, __priority_tag<3>) -> contiguous_iterator_tag; # endif // _CCCL_HOST_STD_LIB(LIBSTDCXX) # if _CCCL_HOST_STD_LIB(LIBCXX) _CCCL_TEMPLATE(class _Iter, class _Ty) -_CCCL_REQUIRES(_IsSame<_Iter, ::std::__wrap_iter<_Ty*>>::value) +_CCCL_REQUIRES(is_same_v<_Iter, ::std::__wrap_iter<_Ty*>>) _CCCL_API inline auto __iter_concept_fn(::std::__wrap_iter<_Ty*>, __priority_tag<3>) -> contiguous_iterator_tag; # elif _CCCL_HOST_STD_LIB(STL) _CCCL_TEMPLATE(class _Iter) -_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Array_iterator>::value) +_CCCL_REQUIRES(is_same_v<_Iter, class _Iter::_Array_iterator>) _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag; _CCCL_TEMPLATE(class _Iter) -_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Array_const_iterator>::value) +_CCCL_REQUIRES(is_same_v<_Iter, class _Iter::_Array_const_iterator>) _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag; _CCCL_TEMPLATE(class _Iter) -_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Vector_iterator>::value) +_CCCL_REQUIRES(is_same_v<_Iter, class _Iter::_Vector_iterator>) _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag; _CCCL_TEMPLATE(class _Iter) -_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Vector_const_iterator>::value) +_CCCL_REQUIRES(is_same_v<_Iter, class _Iter::_Vector_const_iterator>) _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag; _CCCL_TEMPLATE(class _Iter) -_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_String_iterator>::value) +_CCCL_REQUIRES(is_same_v<_Iter, class _Iter::_String_iterator>) _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag; _CCCL_TEMPLATE(class _Iter) -_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_String_const_iterator>::value) +_CCCL_REQUIRES(is_same_v<_Iter, class _Iter::_String_const_iterator>) _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag; _CCCL_TEMPLATE(class _Iter) -_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_String_view_iterator>::value) +_CCCL_REQUIRES(is_same_v<_Iter, class _Iter::_String_view_iterator>) _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag; _CCCL_TEMPLATE(class _Iter) -_CCCL_REQUIRES(_IsSame<_Iter, class _Iter::_Span_iterator>::value) +_CCCL_REQUIRES(is_same_v<_Iter, class _Iter::_Span_iterator>) _CCCL_API inline auto __iter_concept_fn(_Iter, __priority_tag<3>) -> contiguous_iterator_tag; # endif // _CCCL_HOST_STD_LIB(STL) #endif // _CCCL_HOSTED() _CCCL_TEMPLATE(class _Iter, class _Ty) -_CCCL_REQUIRES(_IsSame<_Iter, _Ty*>::value) +_CCCL_REQUIRES(is_same_v<_Iter, _Ty*>) _CCCL_API inline auto __iter_concept_fn(_Ty*, __priority_tag<3>) -> contiguous_iterator_tag; template diff --git a/libcudacxx/include/cuda/std/__type_traits/is_constructible.h b/libcudacxx/include/cuda/std/__type_traits/is_constructible.h index f8df56b4ee7..4633b9109a3 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_constructible.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_constructible.h @@ -56,7 +56,8 @@ struct __is_invalid_base_to_derived_cast using _RawFrom = remove_cvref_t<_From>; using _RawTo = remove_cvref_t<_To>; static const bool value = - _And<_IsNotSame<_RawFrom, _RawTo>, is_base_of<_RawFrom, _RawTo>, _Not<__cccl_is_constructible<_RawTo, _From>>>::value; + _And<_Not>, is_base_of<_RawFrom, _RawTo>, _Not<__cccl_is_constructible<_RawTo, _From>>>:: + value; }; template @@ -71,7 +72,7 @@ struct __is_invalid_lvalue_to_rvalue_cast<_ToRef&&, _FromRef&> using _RawFrom = remove_cvref_t<_FromRef>; using _RawTo = remove_cvref_t<_ToRef>; static const bool value = - _And<_Not>, _Or<_IsSame<_RawFrom, _RawTo>, is_base_of<_RawTo, _RawFrom>>>::value; + _And<_Not>, _Or, is_base_of<_RawTo, _RawFrom>>>::value; }; struct __is_constructible_helper diff --git a/libcudacxx/include/cuda/std/__type_traits/is_primary_template.h b/libcudacxx/include/cuda/std/__type_traits/is_primary_template.h index 35945fac824..d4bc6062153 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_primary_template.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_primary_template.h @@ -51,7 +51,7 @@ struct __is_primary_cccl_template<_Iter, void_t: #else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv template -using __test_for_primary_template = enable_if_t<_IsSame<_Traits, typename _Traits::__cccl_primary_template>::value>; +using __test_for_primary_template = enable_if_t>; template using __is_primary_cccl_template = _IsValidExpansion<__test_for_primary_template, iterator_traits<_Iter>>; @@ -87,7 +87,7 @@ struct __is_primary_std_template : bool_constant<__is_primary_std_template_impl< // libc++ uses the same mechanism than we do with __primary_template template -using __test_for_primary_std_template = enable_if_t<_IsSame<_Traits, typename _Traits::__primary_template>::value>; +using __test_for_primary_std_template = enable_if_t>; template using __is_primary_std_template = _IsValidExpansion<__test_for_primary_std_template, ::std::iterator_traits<_Iter>>; diff --git a/libcudacxx/include/cuda/std/__type_traits/is_swappable.h b/libcudacxx/include/cuda/std/__type_traits/is_swappable.h index 71748ae55b3..e25a6b23e1a 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_swappable.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_swappable.h @@ -131,7 +131,7 @@ struct __swappable_with using __swap1 = decltype((__test_swap<_Tp, _Up>(0))); using __swap2 = decltype((__test_swap<_Up, _Tp>(0))); - static const bool value = _IsNotSame<__swap1, __nat>::value && _IsNotSame<__swap2, __nat>::value; + static const bool value = !is_same_v<__swap1, __nat> && !is_same_v<__swap2, __nat>; }; template diff --git a/libcudacxx/include/cuda/std/__type_traits/remove_cvref.h b/libcudacxx/include/cuda/std/__type_traits/remove_cvref.h index 4e5a92538b4..8557b864c79 100644 --- a/libcudacxx/include/cuda/std/__type_traits/remove_cvref.h +++ b/libcudacxx/include/cuda/std/__type_traits/remove_cvref.h @@ -41,8 +41,7 @@ using remove_cvref_t _CCCL_NODEBUG_ALIAS = remove_cv_t>; #endif // defined(_CCCL_BUILTIN_REMOVE_CVREF) && !defined(_LIBCUDACXX_USE_REMOVE_CVREF_FALLBACK) template -struct __is_same_uncvref : _IsSame, remove_cvref_t<_Up>> -{}; +inline constexpr bool __is_same_uncvref_v = is_same_v, remove_cvref_t<_Up>>; template struct remove_cvref diff --git a/libcudacxx/test/libcudacxx/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp b/libcudacxx/test/libcudacxx/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp deleted file mode 100644 index 75c91b5e01c..00000000000 --- a/libcudacxx/test/libcudacxx/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// This is a dummy feature that prevents this test from running by default. -// REQUIRES: template-cost-testing - -// The table below compares the compile time and object size for each of the -// variants listed in the RUN script. -// -// Impl Compile Time Object Size -// ------------------------------------------- -// cuda::std::_IsSame: 689.634 ms 356 K -// cuda::std::is_same: 8,129.180 ms 560 K -// -// RUN: %cxx %flags %compile_flags -c %s -o %S/orig.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -// -std=c++17 RUN: %cxx %flags %compile_flags -c %s -o %S/new.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -// -std=c++17 -DTEST_NEW - -#include -#include - -#include "template_cost_testing.h" -#include "test_macros.h" - -template -struct Arg -{ - enum - { - value = 1 - }; -}; - -#ifdef TEST_NEW -# define IS_SAME cuda::std::_IsSame -#else -# define IS_SAME cuda::std::is_same -#endif - -#define TEST_CASE_NOP() IS_SAME, Arg<__COUNTER__>>::value, -#define TEST_CASE_TYPE() IS_SAME, Arg<__COUNTER__>>, - -int sink(...); - -int x = sink(REPEAT_10000(TEST_CASE_NOP) REPEAT_10000(TEST_CASE_NOP) 42); - -void Foo(REPEAT_1000(TEST_CASE_TYPE) int) {} - -static_assert(__COUNTER__ > 10000); - -void escape() -{ - sink(&x); - sink(&Foo); -} From e1806e59d232986876e704175253adb52410a989 Mon Sep 17 00:00:00 2001 From: Jacob Faibussowitsch Date: Wed, 12 Aug 2026 10:14:00 -0400 Subject: [PATCH 7/7] fixup! convert some ::value to _v --- libcudacxx/include/cuda/std/type_traits | 1 - .../utilities/meta/is_referenceable.pass.cpp | 256 +++++++++--------- 2 files changed, 128 insertions(+), 129 deletions(-) diff --git a/libcudacxx/include/cuda/std/type_traits b/libcudacxx/include/cuda/std/type_traits index 292191d923c..00c9eb51e95 100644 --- a/libcudacxx/include/cuda/std/type_traits +++ b/libcudacxx/include/cuda/std/type_traits @@ -112,7 +112,6 @@ #include #include #include -#include #include #include #include diff --git a/libcudacxx/test/libcudacxx/libcxx/utilities/meta/is_referenceable.pass.cpp b/libcudacxx/test/libcudacxx/libcxx/utilities/meta/is_referenceable.pass.cpp index a7fbe61a798..40a1558d38e 100644 --- a/libcudacxx/test/libcudacxx/libcxx/utilities/meta/is_referenceable.pass.cpp +++ b/libcudacxx/test/libcudacxx/libcxx/utilities/meta/is_referenceable.pass.cpp @@ -22,141 +22,141 @@ struct Foo {}; -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); +static_assert(!cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); #if !TEST_COMPILER(MSVC) -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); #endif // !TEST_COMPILER(MSVC) // Functions without cv-qualifiers are referenceable -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); -static_assert((!cuda::std::__cccl_is_referenceable::value)); +static_assert(cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); +static_assert(!cuda::std::__can_reference); // member functions with or without cv-qualifiers are referenceable -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); - -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); -static_assert((cuda::std::__cccl_is_referenceable::value)); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); + +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); +static_assert(cuda::std::__can_reference); int main(int, char**) {