Skip to content

Commit 3904a9f

Browse files
committed
fix nvrtc and msvc2017 builds
1 parent 34b36a6 commit 3904a9f

File tree

6 files changed

+20
-25
lines changed

6 files changed

+20
-25
lines changed

libcudacxx/include/cuda/std/__ranges/concepts.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ template <class _Range, class _Tp>
302302
_CCCL_CONCEPT __container_compatible_range = _CCCL_FRAGMENT(__container_compatible_range_, _Range, _Tp);
303303
# endif // _CCCL_NO_CONCEPTS
304304

305-
#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017)
305+
#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017)
306306

307307
_LIBCUDACXX_END_NAMESPACE_RANGES
308308

libcudacxx/include/cuda/std/__ranges/dangling.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
_LIBCUDACXX_BEGIN_NAMESPACE_RANGES
2929

30-
#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017)
30+
#if _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017)
3131

3232
struct dangling
3333
{
@@ -47,7 +47,7 @@ using borrowed_iterator_t = enable_if_t<range<_Rp>, _If<borrowed_range<_Rp>, ite
4747

4848
// borrowed_subrange_t defined in <__ranges/subrange.h>
4949

50-
#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017)
50+
#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017)
5151

5252
_LIBCUDACXX_END_NAMESPACE_RANGES
5353

libcudacxx/include/cuda/std/__ranges/size.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ inline namespace __cpo
193193
_CCCL_GLOBAL_CONSTANT auto ssize = __ssize::__fn{};
194194
} // namespace __cpo
195195

196-
#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017)
196+
#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017)
197197

198198
_LIBCUDACXX_END_NAMESPACE_RANGES
199199

libcudacxx/include/cuda/std/__ranges/views.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# pragma system_header
2222
#endif // no system header
2323

24-
#if _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017)
24+
#if _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017)
2525

2626
_LIBCUDACXX_BEGIN_NAMESPACE_VIEWS
2727

@@ -33,6 +33,6 @@ namespace views = ranges::views;
3333

3434
_LIBCUDACXX_END_NAMESPACE_STD
3535

36-
#endif // _CCCL_STD_VER >= 2017 && !_CCCL_COMPILER(MSVC2017)
36+
#endif // _CCCL_STD_VER >= 2014 && !_CCCL_COMPILER(MSVC2017)
3737

3838
#endif // _LIBCUDACXX___RANGES_VIEWS

libcudacxx/include/cuda/std/detail/libcxx/include/span

+10-15
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,6 @@ _CCCL_INLINE_VAR constexpr bool __is_std_span<span<_Tp, _Extent>> = true;
203203
template <class _From, class _To>
204204
_CCCL_CONCEPT __span_array_convertible = _CCCL_TRAIT(is_convertible, _From (*)[], _To (*)[]);
205205

206-
template <class _Tp>
207-
_CCCL_INLINE_VAR constexpr bool __is_std_initializer_list = false;
208-
209-
template <class _Tp>
210-
_CCCL_INLINE_VAR constexpr bool __is_std_initializer_list<initializer_list<_Tp>> = true;
211-
212206
# if !_CCCL_COMPILER(MSVC2017)
213207
template <class _Range, class _ElementType>
214208
_CCCL_CONCEPT_FRAGMENT(
@@ -235,22 +229,23 @@ _CCCL_INLINE_VAR constexpr bool __span_compatible_range<
235229
_Range,
236230
_ElementType,
237231
void_t<
238-
// is a contiguous range
239-
enable_if_t<_CUDA_VRANGES::contiguous_range<_Range>, nullptr_t>,
240-
// is a sized range
241-
enable_if_t<_CUDA_VRANGES::sized_range<_Range>, nullptr_t>,
242-
// is a borrowed range or ElementType is const
243-
enable_if_t<(_CUDA_VRANGES::borrowed_range<_Range> || _CCCL_TRAIT(is_const, _ElementType)), nullptr_t>,
232+
// // is a contiguous range
233+
// enable_if_t<_CUDA_VRANGES::contiguous_range<_Range>, nullptr_t>,
234+
// // is a sized range
235+
// enable_if_t<_CUDA_VRANGES::sized_range<_Range>, nullptr_t>,
236+
// // is a borrowed range or ElementType is const
237+
// enable_if_t<(_CUDA_VRANGES::borrowed_range<_Range> || _CCCL_TRAIT(is_const, _ElementType)), nullptr_t>,
244238
// is not a C-style array
245239
enable_if_t<!_CCCL_TRAIT(is_array, remove_cvref_t<_Range>), nullptr_t>,
246240
// is not a specialization of span
247241
enable_if_t<!__is_std_span<remove_cvref_t<_Range>>, nullptr_t>,
248242
// is not a specialization of array
249243
enable_if_t<!__is_std_array<remove_cvref_t<_Range>>, nullptr_t>,
250244
// remove_pointer_t<decltype(data(cont))>(*)[] is convertible to ElementType(*)[]
251-
enable_if_t<
252-
_CCCL_TRAIT(is_convertible, remove_reference_t<_CUDA_VRANGES::range_reference_t<_Range>> (*)[], _ElementType (*)[]),
253-
nullptr_t>>> = true;
245+
enable_if_t<_CCCL_TRAIT(is_convertible,
246+
remove_pointer_t<decltype(_CUDA_VSTD::data(declval<_Container&>()))> (*)[],
247+
_ElementType (*)[]),
248+
nullptr_t>>> = true;
254249
# endif // _CCCL_COMPILER(MSVC2017)
255250

256251
# if _CCCL_STD_VER >= 2020

libcudacxx/test/support/test_iterators.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -1803,16 +1803,16 @@ struct ProxyIteratorBase<
18031803
};
18041804

18051805
template <class Base>
1806-
auto get_iter_concept_impl(cuda::std::__priority_tag<3>)
1806+
__host__ __device__ auto get_iter_concept_impl(cuda::std::__priority_tag<3>)
18071807
-> cuda::std::enable_if_t<cuda::std::random_access_iterator<Base>, cuda::std::random_access_iterator_tag>;
18081808
template <class Base>
1809-
auto get_iter_concept_impl(cuda::std::__priority_tag<2>)
1809+
__host__ __device__ auto get_iter_concept_impl(cuda::std::__priority_tag<2>)
18101810
-> cuda::std::enable_if_t<cuda::std::bidirectional_iterator<Base>, cuda::std::bidirectional_iterator_tag>;
18111811
template <class Base>
1812-
auto get_iter_concept_impl(cuda::std::__priority_tag<1>)
1812+
__host__ __device__ auto get_iter_concept_impl(cuda::std::__priority_tag<1>)
18131813
-> cuda::std::enable_if_t<cuda::std::forward_iterator<Base>, cuda::std::forward_iterator_tag>;
18141814
template <class Base>
1815-
auto get_iter_concept_impl(cuda::std::__priority_tag<0>) -> cuda::std::input_iterator_tag;
1815+
__host__ __device__ auto get_iter_concept_impl(cuda::std::__priority_tag<0>) -> cuda::std::input_iterator_tag;
18161816

18171817
template <class Base, cuda::std::enable_if_t<cuda::std::input_iterator<Base>, int> = 0>
18181818
__host__ __device__ constexpr auto get_iterator_concept()

0 commit comments

Comments
 (0)