Skip to content

Commit b462b43

Browse files
committed
[skip-tests] Enable complex interop on MSVC
currently we did not enable the interoperability of `cuda::std::complex` with `std::complex` for MSVC Fix this to enable it for `thrust::complex`
1 parent 1ce614e commit b462b43

File tree

6 files changed

+19
-18
lines changed

6 files changed

+19
-18
lines changed

libcudacxx/.upstream-tests/test/cuda/complex_interop/complex.assign.pass.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//===----------------------------------------------------------------------===//
99

1010
// UNSUPPORTED: nvrtc
11-
// UNSUPPORTED: msvc
11+
1212
#include <nv/target>
1313

1414
#include <complex>

libcudacxx/.upstream-tests/test/cuda/complex_interop/complex.comp.pass.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//===----------------------------------------------------------------------===//
99

1010
// UNSUPPORTED: nvrtc
11-
// UNSUPPORTED: msvc
11+
1212
#include <nv/target>
1313

1414
#include <complex>

libcudacxx/.upstream-tests/test/cuda/complex_interop/complex.cons.pass.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//===----------------------------------------------------------------------===//
99

1010
// UNSUPPORTED: nvrtc
11-
// UNSUPPORTED: msvc
11+
1212
#include <nv/target>
1313

1414
#include <complex>

libcudacxx/.upstream-tests/test/cuda/complex_interop/complex.conv.pass.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//===----------------------------------------------------------------------===//
99

1010
// UNSUPPORTED: nvrtc
11-
// UNSUPPORTED: msvc
11+
1212
#include <nv/target>
1313

1414
#include <complex>

libcudacxx/.upstream-tests/test/std/iterators/iterator.requirements/alg.req.sortable/sortable.compile.pass.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//===----------------------------------------------------------------------===//
99

1010
// UNSUPPORTED: c++03, c++11, c++14
11+
// UNSUPPORTED: msvc-19.16 && nvcc-11.1
1112

1213
// template<class I, class R = ranges::less, class P = identity>
1314
// concept sortable = see below; // since C++20

libcudacxx/include/cuda/std/detail/libcxx/include/complex

+14-14
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,12 @@ template<class T> complex<T> tanh (const complex<T>&);
256256
#endif // !_LIBCUDACXX_HAS_NO_LOCALIZATION && !_LIBCUDACXX_COMPILER_NVRTC
257257

258258
// Compatability helpers for thrust to convert between `std::complex` and `cuda::std::complex`
259-
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
259+
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
260260
#include <complex>
261261

262262
#define _LIBCUDACXX_ACCESS_STD_COMPLEX_REAL(__c) reinterpret_cast<const _Up (&)[2]>(__c)[0]
263263
#define _LIBCUDACXX_ACCESS_STD_COMPLEX_IMAG(__c) reinterpret_cast<const _Up (&)[2]>(__c)[1]
264-
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
264+
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
265265

266266
#ifndef __cuda_std__
267267
#include <__pragma_push>
@@ -312,7 +312,7 @@ public:
312312
complex(const complex<_Xp>& __c)
313313
: __re_(__c.real()), __im_(__c.imag()) {}
314314

315-
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
315+
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
316316
template <class _Up>
317317
_LIBCUDACXX_INLINE_VISIBILITY
318318
complex(const ::std::complex<_Up>& __other)
@@ -329,7 +329,7 @@ public:
329329

330330
_LIBCUDACXX_HOST _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
331331
operator ::std::complex<_Tp>() const { return { __re_, __im_ }; }
332-
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
332+
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
333333

334334
_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 value_type real() const {return __re_;}
335335
_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 value_type imag() const {return __im_;}
@@ -414,7 +414,7 @@ public:
414414
explicit constexpr complex(const complex<long double>& __c);
415415
#endif // _LIBCUDACXX_HAS_COMPLEX_LONG_DOUBLE
416416

417-
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
417+
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
418418
template <class _Up>
419419
_LIBCUDACXX_INLINE_VISIBILITY
420420
complex(const ::std::complex<_Up>& __other)
@@ -431,7 +431,7 @@ public:
431431

432432
_LIBCUDACXX_HOST _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
433433
operator ::std::complex<float>() const { return { __re_, __im_ }; }
434-
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
434+
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
435435

436436
_LIBCUDACXX_INLINE_VISIBILITY constexpr float real() const {return __re_;}
437437
_LIBCUDACXX_INLINE_VISIBILITY constexpr float imag() const {return __im_;}
@@ -512,7 +512,7 @@ public:
512512
explicit constexpr complex(const complex<long double>& __c);
513513
#endif //_LIBCUDACXX_HAS_COMPLEX_LONG_DOUBLE
514514

515-
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
515+
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
516516
template <class _Up>
517517
_LIBCUDACXX_INLINE_VISIBILITY
518518
complex(const ::std::complex<_Up>& __other)
@@ -529,7 +529,7 @@ public:
529529

530530
_LIBCUDACXX_HOST _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
531531
operator ::std::complex<double>() const { return { __re_, __im_ }; }
532-
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
532+
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
533533

534534
_LIBCUDACXX_INLINE_VISIBILITY constexpr double real() const {return __re_;}
535535
_LIBCUDACXX_INLINE_VISIBILITY constexpr double imag() const {return __im_;}
@@ -608,7 +608,7 @@ public:
608608
_LIBCUDACXX_INLINE_VISIBILITY
609609
constexpr complex(const complex<double>& __c);
610610

611-
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
611+
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
612612
template <class _Up>
613613
_LIBCUDACXX_INLINE_VISIBILITY
614614
complex(const ::std::complex<_Up>& __other)
@@ -625,7 +625,7 @@ public:
625625

626626
_LIBCUDACXX_HOST _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
627627
operator ::std::complex<long double>() const { return { __re_, __im_ }; }
628-
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
628+
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
629629

630630
_LIBCUDACXX_INLINE_VISIBILITY constexpr long double real() const {return __re_;}
631631
_LIBCUDACXX_INLINE_VISIBILITY constexpr long double imag() const {return __im_;}
@@ -1051,7 +1051,7 @@ operator==(const _Tp& __x, const complex<_Tp>& __y)
10511051
return __x == __y.real() && 0 == __y.imag();
10521052
}
10531053

1054-
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
1054+
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
10551055
template <class _Tp, class _Up>
10561056
inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
10571057
bool
@@ -1067,7 +1067,7 @@ operator==(const ::std::complex<_Up>& __x, const complex<_Tp>& __y) {
10671067
return __y.real() == _LIBCUDACXX_ACCESS_STD_COMPLEX_REAL(__x)
10681068
&& __y.imag() == _LIBCUDACXX_ACCESS_STD_COMPLEX_IMAG(__x);
10691069
}
1070-
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
1070+
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
10711071

10721072
template<class _Tp>
10731073
inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
@@ -1093,7 +1093,7 @@ operator!=(const _Tp& __x, const complex<_Tp>& __y)
10931093
return !(__x == __y);
10941094
}
10951095

1096-
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
1096+
#if defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
10971097
template <class _Tp, class _Up>
10981098
inline _LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11
10991099
bool
@@ -1107,7 +1107,7 @@ bool
11071107
operator!=(const ::std::complex<_Up>& __x, const complex<_Tp>& __y) {
11081108
return !(__x == __y);
11091109
}
1110-
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC) && !defined(_LIBCUDACXX_COMPILER_MSVC)
1110+
#endif // defined(__cuda_std__) && !defined(_LIBCUDACXX_COMPILER_NVRTC)
11111111

11121112
// 26.3.7 values:
11131113

0 commit comments

Comments
 (0)