mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-27 23:32:02 +08:00
Fix NVCC builds for CUDA 10+.
This commit is contained in:
parent
dae09773fc
commit
695e49d1bd
@ -115,6 +115,7 @@ struct random_float_impl<Scalar, false> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if !EIGEN_COMP_NVCC
|
||||||
// random implementation for long double
|
// random implementation for long double
|
||||||
// this specialization is not compatible with double-double scalars
|
// this specialization is not compatible with double-double scalars
|
||||||
template <bool Specialize = (sizeof(long double) == 2 * sizeof(uint64_t)) &&
|
template <bool Specialize = (sizeof(long double) == 2 * sizeof(uint64_t)) &&
|
||||||
@ -146,6 +147,7 @@ struct random_longdouble_impl<false> {
|
|||||||
};
|
};
|
||||||
template <>
|
template <>
|
||||||
struct random_float_impl<long double> : random_longdouble_impl<> {};
|
struct random_float_impl<long double> : random_longdouble_impl<> {};
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename Scalar>
|
template <typename Scalar>
|
||||||
struct random_default_impl<Scalar, false, false> {
|
struct random_default_impl<Scalar, false, false> {
|
||||||
|
@ -83,7 +83,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __NVCC__
|
#if defined __NVCC__ && defined __CUDACC__
|
||||||
// MSVC 14.16 (required by CUDA 9.*) does not support the _Pragma keyword, so
|
// MSVC 14.16 (required by CUDA 9.*) does not support the _Pragma keyword, so
|
||||||
// we instead use Microsoft's __pragma extension.
|
// we instead use Microsoft's __pragma extension.
|
||||||
#if defined _MSC_VER
|
#if defined _MSC_VER
|
||||||
|
@ -69,7 +69,7 @@ static constexpr auto lastp1 = last + fix<1>;
|
|||||||
#else
|
#else
|
||||||
// Using a FixedExpr<1> expression is important here to make sure the compiler
|
// Using a FixedExpr<1> expression is important here to make sure the compiler
|
||||||
// can fully optimize the computation starting indices with zero overhead.
|
// can fully optimize the computation starting indices with zero overhead.
|
||||||
static constexpr lastp1_t lastp1(last + fix<1>());
|
static constexpr lastp1_t lastp1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** \var end
|
/** \var end
|
||||||
|
@ -1083,14 +1083,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void ignore_unused_variable(cons
|
|||||||
#define EIGEN_USING_STD(FUNC) using std::FUNC;
|
#define EIGEN_USING_STD(FUNC) using std::FUNC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if EIGEN_COMP_MSVC_STRICT && EIGEN_COMP_NVCC
|
#if EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653)
|
||||||
// Wwhen compiling with NVCC, using the base operator is necessary,
|
|
||||||
// otherwise we get duplicate definition errors
|
|
||||||
// For later MSVC versions, we require explicit operator= definition, otherwise we get
|
|
||||||
// use of implicitly deleted operator errors.
|
|
||||||
// (cf Bugs 920, 1000, 1324, 2291)
|
|
||||||
#define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) using Base::operator=;
|
|
||||||
#elif EIGEN_COMP_CLANG // workaround clang bug (see http://forum.kde.org/viewtopic.php?f=74&t=102653)
|
|
||||||
#define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
|
#define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
|
||||||
using Base::operator=; \
|
using Base::operator=; \
|
||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { \
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const Derived& other) { \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user