diff options
author | 2016-05-20 14:58:19 +0200 | |
---|---|---|
committer | 2016-05-20 14:58:19 +0200 | |
commit | 1395056fc0c077b0a1e9b1854c6f18d6bbb9ee61 (patch) | |
tree | 160159b3440d3c143e31fd65c014cc99e03baf91 /Eigen/src/Core | |
parent | 48bf5ec2164974c88935148aa1dff09a41d532b2 (diff) |
Make EIGEN_HAS_C99_MATH user configurable
Diffstat (limited to 'Eigen/src/Core')
-rw-r--r-- | Eigen/src/Core/SpecialFunctions.h | 12 | ||||
-rw-r--r-- | Eigen/src/Core/arch/CUDA/Half.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/Eigen/src/Core/SpecialFunctions.h b/Eigen/src/Core/SpecialFunctions.h index 4cf58c510..f34c7bcda 100644 --- a/Eigen/src/Core/SpecialFunctions.h +++ b/Eigen/src/Core/SpecialFunctions.h @@ -116,7 +116,7 @@ struct lgamma_retval { typedef Scalar type; }; -#ifdef EIGEN_HAS_C99_MATH +#if EIGEN_HAS_C99_MATH template <> struct lgamma_impl<float> { EIGEN_DEVICE_FUNC @@ -336,7 +336,7 @@ struct erf_retval { typedef Scalar type; }; -#ifdef EIGEN_HAS_C99_MATH +#if EIGEN_HAS_C99_MATH template <> struct erf_impl<float> { EIGEN_DEVICE_FUNC @@ -369,7 +369,7 @@ struct erfc_retval { typedef Scalar type; }; -#ifdef EIGEN_HAS_C99_MATH +#if EIGEN_HAS_C99_MATH template <> struct erfc_impl<float> { EIGEN_DEVICE_FUNC @@ -426,7 +426,7 @@ struct igamma_helper<double> { } }; -#ifndef EIGEN_HAS_C99_MATH +#if !EIGEN_HAS_C99_MATH template <typename Scalar> struct igammac_impl { @@ -608,7 +608,7 @@ struct igamma_retval { typedef Scalar type; }; -#ifndef EIGEN_HAS_C99_MATH +#if !EIGEN_HAS_C99_MATH template <typename Scalar> struct igamma_impl { @@ -967,7 +967,7 @@ struct polygamma_retval { typedef Scalar type; }; -#ifndef EIGEN_HAS_C99_MATH +#if !EIGEN_HAS_C99_MATH template <typename Scalar> struct polygamma_impl { diff --git a/Eigen/src/Core/arch/CUDA/Half.h b/Eigen/src/Core/arch/CUDA/Half.h index 3ead82829..d081c7392 100644 --- a/Eigen/src/Core/arch/CUDA/Half.h +++ b/Eigen/src/Core/arch/CUDA/Half.h @@ -466,7 +466,7 @@ template <> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half maxi(const Eigen:: #endif } -#ifdef EIGEN_HAS_C99_MATH +#if EIGEN_HAS_C99_MATH template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half lgamma(const Eigen::half& a) { return Eigen::half(Eigen::numext::lgamma(static_cast<float>(a))); } diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 7fb194a40..3fcef82b6 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -360,11 +360,15 @@ #endif // Does the compiler support C99? +#ifndef EIGEN_HAS_C99_MATH #if EIGEN_MAX_CPP_VER>=11 && \ ((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) \ || (defined(__GNUC__) && defined(_GLIBCXX_USE_C99)) \ || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER))) -#define EIGEN_HAS_C99_MATH 1 + #define EIGEN_HAS_C99_MATH 1 +#else + #define EIGEN_HAS_C99_MATH 0 +#endif #endif // Does the compiler support result_of? |