|
46 | 46 | #include <cub/thread/thread_load.cuh>
|
47 | 47 | #include <cub/thread/thread_store.cuh>
|
48 | 48 |
|
49 |
| -#if !defined(_CCCL_COMPILER_NVRTC) |
50 |
| -# include <iostream> |
51 |
| -# include <iterator> |
52 |
| -#else |
53 |
| -# include <cuda/std/iterator> |
54 |
| -#endif |
55 |
| - |
56 | 49 | #include <cuda/std/iterator>
|
57 | 50 |
|
58 |
| -#if (THRUST_VERSION >= 100700) |
59 |
| -// This iterator is compatible with Thrust API 1.7 and newer |
| 51 | +#ifndef _CCCL_COMPILER_NVRTC |
60 | 52 | # include <thrust/iterator/iterator_facade.h>
|
61 | 53 | # include <thrust/iterator/iterator_traits.h>
|
62 |
| -#endif // THRUST_VERSION |
| 54 | + |
| 55 | +# include <ostream> |
| 56 | +#endif // _CCCL_COMPILER_NVRTC |
63 | 57 |
|
64 | 58 | CUB_NAMESPACE_BEGIN
|
65 | 59 |
|
@@ -116,20 +110,15 @@ public:
|
116 | 110 | /// The type of a reference to an element the iterator can point to
|
117 | 111 | using reference = ValueType;
|
118 | 112 |
|
119 |
| -#if !defined(_CCCL_COMPILER_NVRTC) |
120 |
| -# if (THRUST_VERSION >= 100700) |
121 |
| - // Use Thrust's iterator categories so we can use these iterators in Thrust 1.7 (or newer) methods |
| 113 | +#ifdef _CCCL_COMPILER_NVRTC |
| 114 | + using iterator_category = ::cuda::std::random_access_iterator_tag; |
| 115 | +#else // _CCCL_COMPILER_NVRTC |
122 | 116 | using iterator_category = typename THRUST_NS_QUALIFIER::detail::iterator_facade_category<
|
123 | 117 | THRUST_NS_QUALIFIER::any_system_tag,
|
124 | 118 | THRUST_NS_QUALIFIER::random_access_traversal_tag,
|
125 | 119 | value_type,
|
126 | 120 | reference>::type;
|
127 |
| -# else // THRUST_VERSION < 100700 |
128 |
| - using iterator_category = std::random_access_iterator_tag; |
129 |
| -# endif // THRUST_VERSION |
130 |
| -#else // defined(_CCCL_COMPILER_NVRTC) |
131 |
| - using iterator_category = ::cuda::std::random_access_iterator_tag; |
132 |
| -#endif // defined(_CCCL_COMPILER_NVRTC) |
| 121 | +#endif // _CCCL_COMPILER_NVRTC |
133 | 122 |
|
134 | 123 | private:
|
135 | 124 | ValueType val;
|
@@ -228,13 +217,13 @@ public:
|
228 | 217 | }
|
229 | 218 |
|
230 | 219 | /// ostream operator
|
231 |
| -#if !defined(_CCCL_COMPILER_NVRTC) |
| 220 | +#ifndef _CCCL_COMPILER_NVRTC |
232 | 221 | friend std::ostream& operator<<(std::ostream& os, const self_type& itr)
|
233 | 222 | {
|
234 | 223 | os << "[" << itr.val << "]";
|
235 | 224 | return os;
|
236 | 225 | }
|
237 |
| -#endif |
| 226 | +#endif // _CCCL_COMPILER_NVRTC |
238 | 227 | };
|
239 | 228 |
|
240 | 229 | CUB_NAMESPACE_END
|
0 commit comments