From 4ee35a578915ba2c1f7eb6a73cad12d3d6eedb01 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Tue, 7 Mar 2023 19:22:31 +0100 Subject: [PATCH] Fix definition of `_LIBCUDACXX_CPO_ACCESSIBILITY` --- include/cuda/memory_resource | 2 +- include/cuda/std/detail/__config | 6 ------ .../detail/libcxx/include/__concepts/swappable.h | 16 ++++++++-------- include/cuda/std/detail/libcxx/include/__config | 4 ++-- .../detail/libcxx/include/__utility/in_place.h | 6 +++--- 5 files changed, 14 insertions(+), 20 deletions(-) diff --git a/include/cuda/memory_resource b/include/cuda/memory_resource index c4c730c361..1e0ab87210 100644 --- a/include/cuda/memory_resource +++ b/include/cuda/memory_resource @@ -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 diff --git a/include/cuda/std/detail/__config b/include/cuda/std/detail/__config index ec4fc189c7..ef6f2fb9d4 100644 --- a/include/cuda/std/detail/__config +++ b/include/cuda/std/detail/__config @@ -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__ diff --git a/include/cuda/std/detail/libcxx/include/__concepts/swappable.h b/include/cuda/std/detail/libcxx/include/__concepts/swappable.h index 8d75f0aaa4..45c00f6d28 100644 --- a/include/cuda/std/detail/libcxx/include/__concepts/swappable.h +++ b/include/cuda/std/detail/libcxx/include/__concepts/swappable.h @@ -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 _LIBCUDACXX_CONCEPT_FRAGMENT( @@ -95,10 +95,10 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__swap) template _LIBCUDACXX_CONCEPT __unqualified_swappable_with = _LIBCUDACXX_FRAGMENT(__unqualified_swappable_with_, _Tp, _Up); - + template _LIBCUDACXX_INLINE_VAR constexpr bool __swappable_arrays = false; - + template _LIBCUDACXX_CONCEPT_FRAGMENT( __exchangeable_, @@ -107,7 +107,7 @@ _LIBCUDACXX_BEGIN_NAMESPACE_CPO(__swap) requires(move_constructible<_Tp>), requires(assignable_from<_Tp&, _Tp>) )); - + template _LIBCUDACXX_CONCEPT __exchangeable = _LIBCUDACXX_FRAGMENT(__exchangeable_, _Tp); #endif // _LIBCUDACXX_STD_VER < 20 @@ -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>) { @@ -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>) { @@ -157,7 +157,7 @@ template requires(extent_v<_Tp> == extent_v<_Up>), typename(decltype(__swap(__t[0], __u[0]))) )); - + template _LIBCUDACXX_INLINE_VAR constexpr bool __swappable_arrays<_Tp, _Up, _Size, void_t>> = _LIBCUDACXX_FRAGMENT(__swappable_arrays_, _Tp, _Up, _CUDA_VSTD::integral_constant); @@ -170,7 +170,7 @@ template _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 diff --git a/include/cuda/std/detail/libcxx/include/__config b/include/cuda/std/detail/libcxx/include/__config index adaa5737ed..7088b25af1 100644 --- a/include/cuda/std/detail/libcxx/include/__config +++ b/include/cuda/std/detail/libcxx/include/__config @@ -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 diff --git a/include/cuda/std/detail/libcxx/include/__utility/in_place.h b/include/cuda/std/detail/libcxx/include/__utility/in_place.h index 8b25db6e8b..477abdb53d 100644 --- a/include/cuda/std/detail/libcxx/include/__utility/in_place.h +++ b/include/cuda/std/detail/libcxx/include/__utility/in_place.h @@ -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 struct _LIBCUDACXX_TEMPLATE_VIS in_place_type_t { explicit in_place_type_t() = default; }; template -_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 struct _LIBCUDACXX_TEMPLATE_VIS in_place_index_t { explicit in_place_index_t() = default; }; template -_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 struct __is_inplace_type_imp : false_type {}; template struct __is_inplace_type_imp> : true_type {};