Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Fix definition of _LIBCUDACXX_CPO_ACCESSIBILITY
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Mar 7, 2023
1 parent 63bd664 commit 4ee35a5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion include/cuda/memory_resource
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ struct __fn {
_LIBCUDACXX_END_NAMESPACE_CPO

inline namespace __cpo {
_LIBCUDACXX_CPO_ACCESSIBILITY _LIBCUDACXX_INLINE_VAR constexpr auto get_property = __get_property::__fn{};
_LIBCUDACXX_CPO_ACCESSIBILITY constexpr auto get_property = __get_property::__fn{};
} // namespace __cpo

namespace mr
Expand Down
6 changes: 0 additions & 6 deletions include/cuda/std/detail/__config
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,4 @@
#undef _LIBCUDACXX_END_NAMESPACE_CPO
#define _LIBCUDACXX_END_NAMESPACE_CPO } }

#if defined(__CUDA_ARCH__)
# define _LIBCUDACXX_CPO_ACCESSIBILITY static
#else
# define _LIBCUDACXX_CPO_ACCESSIBILITY
#endif

#endif //__cuda_std__
16 changes: 8 additions & 8 deletions include/cuda/std/detail/libcxx/include/__concepts/swappable.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__swap)
move_constructible<_Tp> &&
assignable_from<_Tp&, _Tp>;

#else // ^^^ CXX20 ^^^ / vvv CXX17 vvv
#else // ^^^ CXX20 ^^^ / vvv CXX17 vvv

template<class _Tp, class _Up>
_LIBCUDACXX_CONCEPT_FRAGMENT(
Expand All @@ -95,10 +95,10 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__swap)

template<class _Tp, class _Up>
_LIBCUDACXX_CONCEPT __unqualified_swappable_with = _LIBCUDACXX_FRAGMENT(__unqualified_swappable_with_, _Tp, _Up);

template<class _Tp, class _Up, size_t _Size, class = void>
_LIBCUDACXX_INLINE_VAR constexpr bool __swappable_arrays = false;

template<class _Tp>
_LIBCUDACXX_CONCEPT_FRAGMENT(
__exchangeable_,
Expand All @@ -107,7 +107,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__swap)
requires(move_constructible<_Tp>),
requires(assignable_from<_Tp&, _Tp>)
));

template<class _Tp>
_LIBCUDACXX_CONCEPT __exchangeable = _LIBCUDACXX_FRAGMENT(__exchangeable_, _Tp);
#endif // _LIBCUDACXX_STD_VER < 20
Expand All @@ -128,7 +128,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__swap)

// 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)
(requires __swappable_arrays<_Tp, _Up, _Size>)
(requires __swappable_arrays<_Tp, _Up, _Size>)
_LIBCUDACXX_INLINE_VISIBILITY constexpr void operator()(_Tp(& __t)[_Size], _Up(& __u)[_Size]) const
noexcept(__noexcept_swappable_arrays<_Tp, _Up>)
{
Expand All @@ -140,7 +140,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__swap)

// 2.3 Otherwise, if `E1` and `E2` are lvalues of the same type `T` that models...
_LIBCUDACXX_TEMPLATE(class _Tp)
(requires __exchangeable<_Tp>)
(requires __exchangeable<_Tp>)
_LIBCUDACXX_INLINE_VISIBILITY constexpr void operator()(_Tp& __x, _Tp& __y) const
noexcept(is_nothrow_move_constructible_v<_Tp> && is_nothrow_move_assignable_v<_Tp>)
{
Expand All @@ -157,7 +157,7 @@ template<class _Tp, class _Up, class _Size>
requires(extent_v<_Tp> == extent_v<_Up>),
typename(decltype(__swap(__t[0], __u[0])))
));

template<class _Tp, class _Up, size_t _Size>
_LIBCUDACXX_INLINE_VAR constexpr bool __swappable_arrays<_Tp, _Up, _Size, void_t<type_identity_t<_Tp>>> =
_LIBCUDACXX_FRAGMENT(__swappable_arrays_, _Tp, _Up, _CUDA_VSTD::integral_constant<size_t, _Size>);
Expand All @@ -170,7 +170,7 @@ template<class _Tp, class _Up, class _Size>
_LIBCUDACXX_END_NAMESPACE_CPO

inline namespace __cpo {
_LIBCUDACXX_CPO_ACCESSIBILITY _LIBCUDACXX_INLINE_VAR constexpr auto swap = __swap::__fn{};
_LIBCUDACXX_CPO_ACCESSIBILITY constexpr auto swap = __swap::__fn{};
} // namespace __cpo
_LIBCUDACXX_END_NAMESPACE_RANGES

Expand Down
4 changes: 2 additions & 2 deletions include/cuda/std/detail/libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -2023,9 +2023,9 @@ extern "C" _LIBCUDACXX_FUNC_VIS void __sanitizer_annotate_contiguous_container(
#endif

#if defined(__CUDA_ARCH__)
# define _LIBCUDACXX_CPO_ACCESSIBILITY static
# define _LIBCUDACXX_CPO_ACCESSIBILITY __device__
#else
# define _LIBCUDACXX_CPO_ACCESSIBILITY
# define _LIBCUDACXX_CPO_ACCESSIBILITY inline
#endif

#endif // __cplusplus
Expand Down
6 changes: 3 additions & 3 deletions include/cuda/std/detail/libcxx/include/__utility/in_place.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD
struct _LIBCUDACXX_TYPE_VIS in_place_t {
explicit in_place_t() = default;
};
_LIBCUDACXX_CPO_ACCESSIBILITY inline constexpr in_place_t in_place{};
_LIBCUDACXX_CPO_ACCESSIBILITY constexpr in_place_t in_place{};

template <class _Tp>
struct _LIBCUDACXX_TEMPLATE_VIS in_place_type_t {
explicit in_place_type_t() = default;
};
template <class _Tp>
_LIBCUDACXX_CPO_ACCESSIBILITY inline constexpr in_place_type_t<_Tp> in_place_type{};
_LIBCUDACXX_CPO_ACCESSIBILITY constexpr in_place_type_t<_Tp> in_place_type{};

template <size_t _Idx>
struct _LIBCUDACXX_TEMPLATE_VIS in_place_index_t {
explicit in_place_index_t() = default;
};
template <size_t _Idx>
_LIBCUDACXX_CPO_ACCESSIBILITY inline constexpr in_place_index_t<_Idx> in_place_index{};
_LIBCUDACXX_CPO_ACCESSIBILITY constexpr in_place_index_t<_Idx> in_place_index{};

template <class _Tp> struct __is_inplace_type_imp : false_type {};
template <class _Tp> struct __is_inplace_type_imp<in_place_type_t<_Tp>> : true_type {};
Expand Down

0 comments on commit 4ee35a5

Please sign in to comment.