Skip to content

Commit 0fed909

Browse files
authored
Merge branch 'main' into isclose
2 parents 1aa4485 + f236692 commit 0fed909

26 files changed

Lines changed: 1056 additions & 279 deletions

libcudacxx/include/cuda/std/__tuple_dir/tuple_like.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ inline constexpr bool __tuple_like_ext<complex<_Tp>> = true;
7777
template <class _Tp>
7878
inline constexpr bool __tuple_like_ext<::cuda::complex<_Tp>> = true;
7979

80+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
81+
template <class _Tp>
82+
inline constexpr bool __tuple_like_ext<::std::complex<_Tp>> = true;
83+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
84+
8085
template <class _Ip, class _Sp, ::cuda::std::ranges::subrange_kind _Kp>
8186
inline constexpr bool __tuple_like_ext<::cuda::std::ranges::subrange<_Ip, _Sp, _Kp>> = true;
8287

libcudacxx/include/cuda/std/__utility/pair.h

Lines changed: 123 additions & 133 deletions
Large diffs are not rendered by default.

libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.assign/const_copy_tuple_like.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ TEST_FUNC constexpr bool test()
102102
!cuda::std::is_assignable_v<const cuda::std::tuple<float, double>&, const cuda::std::complex<double>&>);
103103
}
104104

105-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
105+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
106106
NV_IF_TARGET(
107107
NV_IS_HOST, ({
108108
static_assert(!cuda::std::is_assignable_v<const cuda::std::tuple<float, float>&, const std::complex<float>&>);
109109
static_assert(!cuda::std::is_assignable_v<const cuda::std::tuple<float, double>&, const std::complex<double>&>);
110110
}))
111-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
111+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
112112

113113
#if _CCCL_HAS_HOST_STD_LIB()
114114
NV_IF_TARGET(

libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.assign/const_move_tuple_like.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ TEST_FUNC constexpr bool test()
101101
static_assert(!cuda::std::is_assignable_v<const cuda::std::tuple<float, double>&, cuda::std::complex<double>&&>);
102102
}
103103

104-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
104+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
105105
NV_IF_TARGET(
106106
NV_IS_HOST, ({
107107
static_assert(!cuda::std::is_assignable_v<const cuda::std::tuple<float, float>&, std::complex<float>&&>);
108108
static_assert(!cuda::std::is_assignable_v<const cuda::std::tuple<float, double>&, std::complex<double>&&>);
109109
}))
110-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
110+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
111111

112112
#if _CCCL_HAS_HOST_STD_LIB()
113113
NV_IF_TARGET(

libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.assign/copy_tuple_like.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ TEST_FUNC constexpr bool test()
138138
assert(cuda::std::get<1>(t1) == 42.0f);
139139
}
140140

141-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
141+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
142142
NV_IF_TARGET(
143143
NV_IS_HOST,
144144
(
@@ -157,7 +157,7 @@ TEST_FUNC constexpr bool test()
157157
assert(cuda::std::get<0>(t1) == 3.0f);
158158
assert(cuda::std::get<1>(t1) == 42.0f);
159159
}))
160-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
160+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
161161

162162
#if _CCCL_HAS_HOST_STD_LIB() && !TEST_COMPILER(GCC, <, 9)
163163
NV_IF_TARGET(

libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.assign/move_tuple_like.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ TEST_FUNC constexpr bool test()
108108
assert(cuda::std::get<1>(t1) == 42.0f);
109109
}
110110

111-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
111+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
112112
NV_IF_TARGET(
113113
NV_IS_HOST,
114114
(
@@ -127,7 +127,7 @@ TEST_FUNC constexpr bool test()
127127
assert(cuda::std::get<0>(t1) == 3.0f);
128128
assert(cuda::std::get<1>(t1) == 42.0f);
129129
}))
130-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
130+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
131131

132132
#if _CCCL_HAS_HOST_STD_LIB() && !TEST_COMPILER(GCC, <, 9)
133133
NV_IF_TARGET(

libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_move_tuple_like.pass.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ TEST_FUNC constexpr bool test()
102102
assert(cuda::std::get<1>(t).v == 42.0f);
103103
}
104104

105-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
105+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
106106
NV_IF_TARGET(NV_IS_HOST, ({
107107
const std::complex<float> p{1.0f, 42.0f};
108108
cuda::std::tuple<ConvertibleFrom<float>, ConvertibleFrom<float>> t = cuda::std::move(p);
109109
assert(cuda::std::get<0>(t).v == 1.0f);
110110
assert(cuda::std::get<1>(t).v == 42.0f);
111111
}))
112-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
112+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
113113

114114
// test explicit conversions.
115115
{
@@ -185,14 +185,14 @@ TEST_FUNC constexpr bool test()
185185
assert(cuda::std::get<1>(t).v == 42.0f);
186186
}
187187

188-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
188+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
189189
NV_IF_TARGET(NV_IS_HOST, ({
190190
const std::complex<float> p{1.0f, 42.0f};
191191
cuda::std::tuple<ExplicitConstructibleFrom<float>, ConvertibleFrom<float>> t{cuda::std::move(p)};
192192
assert(cuda::std::get<0>(t).v == 1.0f);
193193
assert(cuda::std::get<1>(t).v == 42.0f);
194194
}))
195-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
195+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
196196

197197
// const overload should be called
198198
{

libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_tuple_like.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ int main(int, char**)
9999
assert(cuda::std::get<1>(t) == 1.0);
100100
}
101101

102-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
102+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
103103
NV_IF_TARGET(NV_IS_HOST, ({
104104
using T = cuda::std::tuple<float, double>;
105105
const std::complex<double> t0{0.0, 1.0};
106106
T t = t0;
107107
assert(cuda::std::get<0>(t) == 0.0f);
108108
assert(cuda::std::get<1>(t) == 1.0);
109109
}))
110-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
110+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
111111

112112
{
113113
using T = cuda::std::tuple<int, long, double>;

libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.cnstr/move_tuple_like.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ int main(int, char**)
143143
assert(cuda::std::get<1>(t) == 1.0f);
144144
}
145145

146-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
146+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
147147
NV_IF_TARGET(NV_IS_HOST, ({
148148
using T = cuda::std::tuple<float, float>;
149149
std::complex<float> t0{0.0f, 1.0f};
150150
T t = cuda::std::move(t0);
151151
assert(cuda::std::get<0>(t) == 0.0f);
152152
assert(cuda::std::get<1>(t) == 1.0f);
153153
}))
154-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
154+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
155155

156156
{
157157
using T = cuda::std::tuple<MoveOnly, MoveOnly, MoveOnly>;

libcudacxx/test/libcudacxx/std/utilities/tuple/tuple.tuple/tuple.cnstr/non_const_tuple_like.pass.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ TEST_FUNC constexpr bool test()
9494
assert(cuda::std::get<1>(t).v == 2.0f);
9595
}
9696

97-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
97+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
9898
NV_IF_TARGET(NV_IS_HOST, ({
9999
std::complex<float> p{1.0f, 2.0f};
100100
cuda::std::tuple<ConvertibleFrom<float>, ConvertibleFrom<float>> t = p;
101101
assert(cuda::std::get<0>(t).v.val == 1.0f);
102102
assert(cuda::std::get<1>(t).v == 2.0f);
103103
}))
104-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
104+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
105105

106106
// test explicit conversions.
107107
{
@@ -168,14 +168,14 @@ TEST_FUNC constexpr bool test()
168168
assert(cuda::std::get<1>(t).v == 2.0f);
169169
}
170170

171-
#if _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
171+
#if _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
172172
NV_IF_TARGET(NV_IS_HOST, ({
173173
std::complex<float> p{1.0f, 2.0f};
174174
cuda::std::tuple<ExplicitConstructibleFrom<float>, ConvertibleFrom<float>> t{p};
175175
assert(cuda::std::get<0>(t).v.val == 1.0f);
176176
assert(cuda::std::get<1>(t).v == 2.0f);
177177
}))
178-
#endif // _CCCL_HAS_HOST_STD_LIB() && defined(__cpp_lib_tuple_like)
178+
#endif // _CCCL_HAS_HOST_STD_LIB() && __cpp_lib_tuple_like >= 202311L
179179

180180
// non const overload should be called
181181
{

0 commit comments

Comments
 (0)