Skip to content

Commit

Permalink
Disable execution checks for tuple (#2780) (#2867)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Schellenberger Costa <[email protected]>
  • Loading branch information
wmaxey and miscco authored Dec 5, 2024
1 parent 0785a7f commit 205b005
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions libcudacxx/include/cuda/std/detail/libcxx/include/tuple
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ _LIBCUDACXX_HIDE_FROM_ABI constexpr __tuple_leaf_specialization __tuple_leaf_cho
template <size_t _Ip, class _Hp, __tuple_leaf_specialization = __tuple_leaf_choose<_Hp>()>
class __tuple_leaf;

_CCCL_EXEC_CHECK_DISABLE
template <size_t _Ip, class _Hp, __tuple_leaf_specialization _Ep>
_LIBCUDACXX_HIDE_FROM_ABI void
swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y) noexcept(__is_nothrow_swappable<_Hp>::value)
Expand All @@ -240,25 +241,30 @@ class __tuple_leaf<_Ip, _Hp, __tuple_leaf_specialization::__default>
}

public:
_CCCL_EXEC_CHECK_DISABLE
_LIBCUDACXX_HIDE_FROM_ABI constexpr __tuple_leaf() noexcept(_CCCL_TRAIT(is_nothrow_default_constructible, _Hp))
: __value_()
{}

_CCCL_EXEC_CHECK_DISABLE
_LIBCUDACXX_HIDE_FROM_ABI constexpr __tuple_leaf(__tuple_leaf_default_constructor_tag) noexcept(
_CCCL_TRAIT(is_nothrow_default_constructible, _Hp))
: __value_()
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI __tuple_leaf(integral_constant<int, 0>, const _Alloc&)
: __value_()
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a)
: __value_(allocator_arg_t(), __a)
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a)
: __value_(__a)
Expand All @@ -273,21 +279,25 @@ public:
: __value_(_CUDA_VSTD::forward<_Tp>(__t))
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp, class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
: __value_(_CUDA_VSTD::forward<_Tp>(__t))
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp, class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
: __value_(allocator_arg_t(), __a, _CUDA_VSTD::forward<_Tp>(__t))
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp, class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
: __value_(_CUDA_VSTD::forward<_Tp>(__t), __a)
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp>
_LIBCUDACXX_HIDE_FROM_ABI __tuple_leaf& operator=(_Tp&& __t) noexcept(_CCCL_TRAIT(is_nothrow_assignable, _Hp&, _Tp))
{
Expand Down Expand Up @@ -327,6 +337,7 @@ class __tuple_leaf<_Ip, _Hp, __tuple_leaf_specialization::__synthesize_assignmen
}

public:
_CCCL_EXEC_CHECK_DISABLE
_LIBCUDACXX_HIDE_FROM_ABI constexpr __tuple_leaf() noexcept(_CCCL_TRAIT(is_nothrow_default_constructible, _Hp))
: __value_()
{
Expand All @@ -346,6 +357,7 @@ public:
"temporary whose lifetime has ended");
}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp, class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
: __value_(_CUDA_VSTD::forward<_Tp>(__t))
Expand All @@ -355,20 +367,25 @@ public:
"temporary whose lifetime has ended");
}

_CCCL_HIDE_FROM_ABI __tuple_leaf(const __tuple_leaf& __t) = default;
_CCCL_HIDE_FROM_ABI __tuple_leaf(__tuple_leaf&& __t) = default;
_CCCL_EXEC_CHECK_DISABLE
__tuple_leaf(const __tuple_leaf& __t) = default;
_CCCL_EXEC_CHECK_DISABLE
__tuple_leaf(__tuple_leaf&& __t) = default;

_CCCL_EXEC_CHECK_DISABLE
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 __tuple_leaf& operator=(const __tuple_leaf& __t) noexcept
{
__value_ = __t.__value_;
return *this;
}
_CCCL_EXEC_CHECK_DISABLE
_LIBCUDACXX_HIDE_FROM_ABI _CCCL_CONSTEXPR_CXX14 __tuple_leaf& operator=(__tuple_leaf&& __t) noexcept
{
__value_ = _CUDA_VSTD::move(__t.__value_);
return *this;
}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp>
_LIBCUDACXX_HIDE_FROM_ABI __tuple_leaf& operator=(_Tp&& __t) noexcept(_CCCL_TRAIT(is_nothrow_assignable, _Hp&, _Tp))
{
Expand Down Expand Up @@ -396,22 +413,27 @@ template <size_t _Ip, class _Hp>
class __tuple_leaf<_Ip, _Hp, __tuple_leaf_specialization::__empty_non_final> : private _Hp
{
public:
_CCCL_EXEC_CHECK_DISABLE
_LIBCUDACXX_HIDE_FROM_ABI constexpr __tuple_leaf() noexcept(is_nothrow_default_constructible<_Hp>::value) {}

_CCCL_EXEC_CHECK_DISABLE
_LIBCUDACXX_HIDE_FROM_ABI constexpr __tuple_leaf(__tuple_leaf_default_constructor_tag) noexcept(
_CCCL_TRAIT(is_nothrow_default_constructible, _Hp))
: _Hp()
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI __tuple_leaf(integral_constant<int, 0>, const _Alloc&)
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a)
: _Hp(allocator_arg_t(), __a)
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a)
: _Hp(__a)
Expand All @@ -426,16 +448,19 @@ public:
: _Hp(_CUDA_VSTD::forward<_Tp>(__t))
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp, class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
: _Hp(_CUDA_VSTD::forward<_Tp>(__t))
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp, class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
: _Hp(allocator_arg_t(), __a, _CUDA_VSTD::forward<_Tp>(__t))
{}

_CCCL_EXEC_CHECK_DISABLE
template <class _Tp, class _Alloc>
_LIBCUDACXX_HIDE_FROM_ABI explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
: _Hp(_CUDA_VSTD::forward<_Tp>(__t), __a)
Expand All @@ -456,6 +481,7 @@ public:
return *this;
}

_CCCL_EXEC_CHECK_DISABLE
_LIBCUDACXX_HIDE_FROM_ABI int swap(__tuple_leaf& __t) noexcept(__is_nothrow_swappable<__tuple_leaf>::value)
{
_CUDA_VSTD::swap(*this, __t);
Expand Down

0 comments on commit 205b005

Please sign in to comment.