Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that cuda::std::pair is potentially trivially copyable #1249

Merged
merged 9 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions libcudacxx/include/cuda/std/detail/libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,6 @@ extern "C++" {
// conflict with the dllexport-emitted copy, so we disable it.
# define _LIBCUDACXX_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
# endif
// Feature macros for disabling pre ABI v1 features. All of these options
// are deprecated.
# if defined(__FreeBSD__)
# define _LIBCUDACXX_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
# endif
#endif

#ifdef _LIBCUDACXX_TRIVIAL_PAIR_COPY_CTOR
#error "_LIBCUDACXX_TRIVIAL_PAIR_COPY_CTOR" is no longer supported. \
use _LIBCUDACXX_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR instead
#endif

#ifndef __has_attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@
#endif // no system header
_LIBCUDACXX_BEGIN_NAMESPACE_RANGES

#if _LIBCUDACXX_STD_VER > 14
#if _CCCL_STD_VER >= 2017

struct view_base { };

_LIBCUDACXX_BEGIN_NAMESPACE_RANGES_ABI

#if _LIBCUDACXX_STD_VER > 17
#if _CCCL_STD_VER >= 2020

template<class _Derived>
requires is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>
class view_interface;

#else
#else // ^^^ _CCCL_STD_VER >= 2020 ^^^ / vvv _CCCL_STD_VER <= 2017 vvv

template<class _Derived, enable_if_t<is_class_v<_Derived> && same_as<_Derived, remove_cv_t<_Derived>>, int> = 0>
class view_interface;

#endif // _LIBCUDACXX_STD_VER < 17
#endif // _CCCL_STD_VER <= 2017

_LIBCUDACXX_END_NAMESPACE_RANGES_ABI

Expand All @@ -57,23 +57,23 @@ _LIBCUDACXX_TEMPLATE(class _Op, class _Yp)
_LIBCUDACXX_INLINE_VISIBILITY
void __is_derived_from_view_interface(const _Op*, const view_interface<_Yp>*);

#if _LIBCUDACXX_STD_VER > 17
#if _CCCL_STD_VER >= 2020

template <class _Tp>
_LIBCUDACXX_INLINE_VAR constexpr bool enable_view = derived_from<_Tp, view_base> ||
requires { _CUDA_VRANGES::__is_derived_from_view_interface((_Tp*)nullptr, (_Tp*)nullptr); };

#else
#else // ^^^ _CCCL_STD_VER >= 2020 ^^^ / vvv _CCCL_STD_VER <= 2017 vvv

template <class _Tp, class = void>
_LIBCUDACXX_INLINE_VAR constexpr bool enable_view = derived_from<_Tp, view_base>;

template <class _Tp>
_LIBCUDACXX_INLINE_VAR constexpr bool enable_view<_Tp,
void_t<decltype(_CUDA_VRANGES::__is_derived_from_view_interface((_Tp*)nullptr, (_Tp*)nullptr))>> = true;
#endif // _LIBCUDACXX_STD_VER < 17
#endif // _CCCL_STD_VER <= 2017

#endif // _LIBCUDACXX_STD_VER > 14
#endif // _CCCL_STD_VER >= 2017

_LIBCUDACXX_END_NAMESPACE_RANGES

Expand Down
Loading
Loading