1
1
/*
2
- * Copyright 2008-2021 NVIDIA Corporation
2
+ * Copyright 2008-2024 NVIDIA Corporation
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -57,23 +57,8 @@ THRUST_NAMESPACE_BEGIN
57
57
* integer_sequence_push_back \see <a
58
58
* href="https://en.cppreference.com/w/cpp/utility/integer_sequence"><tt>std::integer_sequence</tt></a>
59
59
*/
60
- #if _CCCL_STD_VER >= 2014
61
60
template <typename T, T... Is>
62
61
using integer_sequence = ::cuda::std::integer_sequence<T, Is...>;
63
- #else
64
- template <typename T, T... Is>
65
- struct integer_sequence
66
- {
67
- using type = integer_sequence;
68
- using value_type = T;
69
- using size_type = ::cuda::std::size_t ;
70
-
71
- _CCCL_HOST_DEVICE static constexpr size_type size () noexcept
72
- {
73
- return sizeof ...(Is);
74
- }
75
- };
76
- #endif
77
62
78
63
// /////////////////////////////////////////////////////////////////////////////
79
64
@@ -90,46 +75,8 @@ struct integer_sequence
90
75
* \see integer_sequence_push_back
91
76
* \see <a href="https://en.cppreference.com/w/cpp/utility/integer_sequence"><tt>std::index_sequence</tt></a>
92
77
*/
93
- #if _CCCL_STD_VER >= 2014
94
78
template <::cuda::std::size_t ... Is>
95
79
using index_sequence = ::cuda::std::index_sequence<Is...>;
96
- #else
97
- template <::cuda::std::size_t ... Is>
98
- using index_sequence = integer_sequence<::cuda::std::size_t , Is...>;
99
- #endif
100
-
101
- #if _CCCL_STD_VER < 2014
102
- /* ! \cond
103
- */
104
-
105
- namespace detail
106
- {
107
-
108
- /* ! \brief Create a new \c integer_sequence containing the elements of \c
109
- * Sequence0 followed by the elements of \c Sequence1. \c Sequence0::size() is
110
- * added to each element from \c Sequence1 in the new sequence.
111
- *
112
- * \see integer_sequence
113
- * \see index_sequence
114
- * \see make_reversed_integer_sequence
115
- * \see make_index_sequence
116
- * \see make_reversed_index_sequence
117
- * \see merge_and_renumber_reversed_integer_sequences_impl
118
- */
119
- template <typename Sequence0, typename Sequence1>
120
- struct merge_and_renumber_integer_sequences_impl ;
121
- template <typename Sequence0, typename Sequence1>
122
- using merge_and_renumber_integer_sequences =
123
- typename merge_and_renumber_integer_sequences_impl<Sequence0, Sequence1>::type;
124
-
125
- template <typename T, ::cuda::std::size_t N>
126
- struct make_integer_sequence_impl ;
127
-
128
- } // namespace detail
129
-
130
- /* ! \endcond
131
- */
132
- #endif
133
80
134
81
/* ! \brief Create a new \c integer_sequence with elements
135
82
* <tt>0, 1, 2, ..., N - 1</tt> of type \c T.
@@ -141,49 +88,8 @@ struct make_integer_sequence_impl;
141
88
* \see make_reversed_index_sequence
142
89
* \see <a href="https://en.cppreference.com/w/cpp/utility/integer_sequence"><tt>std::make_integer_sequence</tt></a>
143
90
*/
144
- #if _CCCL_STD_VER >= 2014
145
91
template <typename T, ::cuda::std::size_t N>
146
92
using make_integer_sequence = ::cuda::std::make_integer_sequence<T, N>;
147
- #else
148
- template <typename T, ::cuda::std::size_t N>
149
- using make_integer_sequence = typename detail::make_integer_sequence_impl<T, N>::type;
150
-
151
- /* ! \cond
152
- */
153
-
154
- namespace detail
155
- {
156
-
157
- template <typename T, T... Is0, T... Is1>
158
- struct merge_and_renumber_integer_sequences_impl <integer_sequence<T, Is0...>, integer_sequence<T, Is1...>>
159
- {
160
- using type = integer_sequence<T, Is0..., (sizeof ...(Is0) + Is1)...>;
161
- };
162
-
163
- template <typename T, ::cuda::std::size_t N>
164
- struct make_integer_sequence_impl
165
- {
166
- using type =
167
- merge_and_renumber_integer_sequences<make_integer_sequence<T, N / 2 >, make_integer_sequence<T, N - N / 2 >>;
168
- };
169
-
170
- template <typename T>
171
- struct make_integer_sequence_impl <T, 0 >
172
- {
173
- using type = integer_sequence<T>;
174
- };
175
-
176
- template <typename T>
177
- struct make_integer_sequence_impl <T, 1 >
178
- {
179
- using type = integer_sequence<T, 0 >;
180
- };
181
-
182
- } // namespace detail
183
-
184
- /* ! \endcond
185
- */
186
- #endif
187
93
188
94
// /////////////////////////////////////////////////////////////////////////////
189
95
@@ -198,13 +104,8 @@ struct make_integer_sequence_impl<T, 1>
198
104
* \see make_reversed_index_sequence
199
105
* \see <a href="https://en.cppreference.com/w/cpp/utility/integer_sequence"><tt>std::make_index_sequence</tt></a>
200
106
*/
201
- #if _CCCL_STD_VER >= 2014
202
107
template <::cuda::std::size_t N>
203
108
using make_index_sequence = ::cuda::std::make_index_sequence<N>;
204
- #else
205
- template <::cuda::std::size_t N>
206
- using make_index_sequence = make_integer_sequence<::cuda::std::size_t , N>;
207
- #endif
208
109
209
110
// /////////////////////////////////////////////////////////////////////////////
210
111
0 commit comments