diff --git a/include/__algorithm/simd_utils.h b/include/__algorithm/simd_utils.h index 989a195..c2fc02e 100644 --- a/include/__algorithm/simd_utils.h +++ b/include/__algorithm/simd_utils.h @@ -27,7 +27,7 @@ _LIBCPP_PUSH_MACROS #include <__undef_macros> // TODO: Find out how altivec changes things and allow vectorizations there too. -#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1700 && !defined(__ALTIVEC__) +#if _LIBCPP_STD_VER >= 14 && defined(_LIBCPP_CLANG_VER) && _LIBCPP_CLANG_VER >= 1700 && !defined(__ALTIVEC__) && !defined(__CUDACC__) # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 1 #else # define _LIBCPP_HAS_ALGORITHM_VECTOR_UTILS 0 diff --git a/include/__iterator/reverse_iterator.h b/include/__iterator/reverse_iterator.h index 2ae1461..3fb2a42 100644 --- a/include/__iterator/reverse_iterator.h +++ b/include/__iterator/reverse_iterator.h @@ -132,7 +132,7 @@ public: return *--__tmp; } -#if _LIBCPP_STD_VER >= 20 +#if _LIBCPP_STD_VER >= 20 && !defined(__CUDACC__) _LIBCPP_HIDE_FROM_ABI constexpr pointer operator->() const requires is_pointer_v<_Iter> || requires(const _Iter __i) { __i.operator->(); } { diff --git a/include/__iterator/segmented_iterator.h b/include/__iterator/segmented_iterator.h index f3cd1e5..c0a77ef 100644 --- a/include/__iterator/segmented_iterator.h +++ b/include/__iterator/segmented_iterator.h @@ -68,8 +68,10 @@ struct __segmented_iterator_traits; template struct __has_specialization : false_type {}; +#ifndef __CUDACC__ template struct __has_specialization<_Tp, sizeof(_Tp) * 0> : true_type {}; +#endif template using __is_segmented_iterator = __has_specialization<__segmented_iterator_traits<_Iterator> >; diff --git a/include/__math/traits.h b/include/__math/traits.h index da585af..b271b8f 100644 --- a/include/__math/traits.h +++ b/include/__math/traits.h @@ -67,7 +67,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool i return false; } -#ifdef _LIBCPP_PREFERRED_OVERLOAD +#ifdef _LIBCPP_PREFERRED_OVERLOAD && !defined(__CUDACC__) _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(float __x) _NOEXCEPT { return __builtin_isinf(__x); } @@ -94,7 +94,7 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool i return false; } -#ifdef _LIBCPP_PREFERRED_OVERLOAD +#ifdef _LIBCPP_PREFERRED_OVERLOAD && !defined(__CUDACC__) _LIBCPP_NODISCARD_EXT inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isnan(float __x) _NOEXCEPT { return __builtin_isnan(__x); } diff --git a/include/complex b/include/complex index a81f968..1e4d99d 100644 --- a/include/complex +++ b/include/complex @@ -1513,6 +1513,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr complex operator""i(unsigned long return {0.0, static_cast(__im)}; } +# if !defined(__CUDACC__) _LIBCPP_HIDE_FROM_ABI inline constexpr complex operator""if(long double __im) { return {0.0f, static_cast(__im)}; } @@ -1520,6 +1521,7 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr complex operator""if(long double _ _LIBCPP_HIDE_FROM_ABI inline constexpr complex operator""if(unsigned long long __im) { return {0.0f, static_cast(__im)}; } +# endif } // namespace complex_literals } // namespace literals #endif diff --git a/include/tuple b/include/tuple index c7fc550..ed7d912 100644 --- a/include/tuple +++ b/include/tuple @@ -297,7 +297,7 @@ class __tuple_leaf { template static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() { -# if __has_keyword(__reference_binds_to_temporary) +# if __has_keyword(__reference_binds_to_temporary) && !defined(__CUDACC__) return !__reference_binds_to_temporary(_Hp, _Tp); # else return true; @@ -599,8 +599,16 @@ public: is_constructible<_Tp, _Up>... > {}; template , _EnableUTypesCtor<_Up...> >::value, - int> = 0> + __enable_if_t< _And< _BoolConstant, + _EnableUTypesCtor<_Up...> +// nvcc 12.2 cannot choose between tuple(const T& ... t) and tuple(U&&... u) +// so we have to added an explicit requires in enable_if +# ifdef __CUDACC__ + , + _Not<_And..., _Lazy<_And, is_convertible<_Up, const _Tp&>...>> > +# endif + >::value, + int> = 0> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(_Not<_Lazy<_And, is_convertible<_Up, _Tp>...> >::value) tuple(_Up&&... __u) _NOEXCEPT_(_And...>::value) : __base_(typename __make_tuple_indices::type(),