diff --git a/.upstream-tests/test/std/views/views.span/span.cons/array.fail.cpp b/.upstream-tests/test/std/views/views.span/span.cons/array.fail.cpp index 9fff987a5b..eab06786b7 100644 --- a/.upstream-tests/test/std/views/views.span/span.cons/array.fail.cpp +++ b/.upstream-tests/test/std/views/views.span/span.cons/array.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.cons/default.fail.cpp b/.upstream-tests/test/std/views/views.span/span.cons/default.fail.cpp index 5b6f9be1b7..6532c7c8c5 100644 --- a/.upstream-tests/test/std/views/views.span/span.cons/default.fail.cpp +++ b/.upstream-tests/test/std/views/views.span/span.cons/default.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.cons/iterator_len.verify.cpp b/.upstream-tests/test/std/views/views.span/span.cons/iterator_len.verify.cpp index 554b456b72..3136891097 100644 --- a/.upstream-tests/test/std/views/views.span/span.cons/iterator_len.verify.cpp +++ b/.upstream-tests/test/std/views/views.span/span.cons/iterator_len.verify.cpp @@ -7,6 +7,7 @@ // //===---------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.cons/range.verify.cpp b/.upstream-tests/test/std/views/views.span/span.cons/range.verify.cpp index 2915c21dc7..3a93971393 100644 --- a/.upstream-tests/test/std/views/views.span/span.cons/range.verify.cpp +++ b/.upstream-tests/test/std/views/views.span/span.cons/range.verify.cpp @@ -7,6 +7,7 @@ // //===---------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.cons/span.fail.cpp b/.upstream-tests/test/std/views/views.span/span.cons/span.fail.cpp index 3380ba8c6c..4ab16a10b4 100644 --- a/.upstream-tests/test/std/views/views.span/span.cons/span.fail.cpp +++ b/.upstream-tests/test/std/views/views.span/span.cons/span.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.elem/back.pass.cpp b/.upstream-tests/test/std/views/views.span/span.elem/back.pass.cpp index 483f7dbc95..a59249df7e 100644 --- a/.upstream-tests/test/std/views/views.span/span.elem/back.pass.cpp +++ b/.upstream-tests/test/std/views/views.span/span.elem/back.pass.cpp @@ -30,7 +30,7 @@ __host__ __device__ constexpr bool testConstexprSpan(Span sp) { ASSERT_NOEXCEPT(sp.back()); - return &sp.back() == sp.data() + sp.size() - 1; + return &sp.back() == sp.data() + (sp.size() - 1); } template @@ -38,7 +38,7 @@ __host__ __device__ void testRuntimeSpan(Span sp) { ASSERT_NOEXCEPT(sp.back()); - assert(&sp.back() == sp.data() + sp.size() - 1); + assert(&sp.back() == sp.data() + (sp.size() - 1)); } template diff --git a/.upstream-tests/test/std/views/views.span/span.objectrep/as_writable_bytes.verify.cpp b/.upstream-tests/test/std/views/views.span/span.objectrep/as_writable_bytes.verify.cpp index c244437cf5..bc205208b9 100644 --- a/.upstream-tests/test/std/views/views.span/span.objectrep/as_writable_bytes.verify.cpp +++ b/.upstream-tests/test/std/views/views.span/span.objectrep/as_writable_bytes.verify.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.obs/empty.nodiscard.verify.cpp b/.upstream-tests/test/std/views/views.span/span.obs/empty.nodiscard.verify.cpp index a3cb6100cf..1f5b68c14e 100644 --- a/.upstream-tests/test/std/views/views.span/span.obs/empty.nodiscard.verify.cpp +++ b/.upstream-tests/test/std/views/views.span/span.obs/empty.nodiscard.verify.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.sub/first.verify.cpp b/.upstream-tests/test/std/views/views.span/span.sub/first.verify.cpp index b793d050aa..a500d74062 100644 --- a/.upstream-tests/test/std/views/views.span/span.sub/first.verify.cpp +++ b/.upstream-tests/test/std/views/views.span/span.sub/first.verify.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.sub/last.verify.cpp b/.upstream-tests/test/std/views/views.span/span.sub/last.verify.cpp index e5947d705d..5deb1e7fc9 100644 --- a/.upstream-tests/test/std/views/views.span/span.sub/last.verify.cpp +++ b/.upstream-tests/test/std/views/views.span/span.sub/last.verify.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // diff --git a/.upstream-tests/test/std/views/views.span/span.sub/subspan.verify.cpp b/.upstream-tests/test/std/views/views.span/span.sub/subspan.verify.cpp index 6492c6c9eb..9cf47fffe4 100644 --- a/.upstream-tests/test/std/views/views.span/span.sub/subspan.verify.cpp +++ b/.upstream-tests/test/std/views/views.span/span.sub/subspan.verify.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11 +// UNSUPPORTED: nvrtc // This test also generates spurious warnings when instantiating std::span // with a very large extent (like size_t(-2)) -- silence those. diff --git a/include/cuda/std/detail/libcxx/include/span b/include/cuda/std/detail/libcxx/include/span index 374f0854f4..595e835eaf 100644 --- a/include/cuda/std/detail/libcxx/include/span +++ b/include/cuda/std/detail/libcxx/include/span @@ -218,8 +218,12 @@ public: { (void)__count; _LIBCUDACXX_ASSERT(_Extent == __count, "size mismatch in span's constructor (ptr, len)"); } _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 span(pointer __f, pointer __l) : __data{__f} { (void)__l; _LIBCUDACXX_ASSERT(_Extent == distance(__f, __l), "size mismatch in span's constructor (ptr, ptr)"); } - +#ifdef _LIBCUDACXX_COMPILER_NVRTC + template = nullptr> + _LIBCUDACXX_INLINE_VISIBILITY constexpr span(type_identity_t (&__arr)[_Sz]) noexcept : __data{__arr} {} +#else _LIBCUDACXX_INLINE_VISIBILITY constexpr span(type_identity_t (&__arr)[_Extent]) noexcept : __data{__arr} {} +#endif template ::value, nullptr_t> = nullptr> _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX14