aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Eigen/src/Core/NumTraits.h5
-rw-r--r--Eigen/src/Core/SpecialFunctions.h2
-rw-r--r--Eigen/src/Core/util/Meta.h5
3 files changed, 11 insertions, 1 deletions
diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h
index 2ea5eb272..6a596bb7d 100644
--- a/Eigen/src/Core/NumTraits.h
+++ b/Eigen/src/Core/NumTraits.h
@@ -90,6 +90,11 @@ template<typename T> struct GenericNumTraits
static inline T lowest() {
return IsInteger ? (numext::numeric_limits<T>::min)() : (-(numext::numeric_limits<T>::max)());
}
+
+ EIGEN_DEVICE_FUNC
+ static inline T infinity() {
+ return numext::numeric_limits<T>::infinity();
+ }
};
template<typename T> struct NumTraits : GenericNumTraits<T>
diff --git a/Eigen/src/Core/SpecialFunctions.h b/Eigen/src/Core/SpecialFunctions.h
index 6b4598e3e..b02ad9a1f 100644
--- a/Eigen/src/Core/SpecialFunctions.h
+++ b/Eigen/src/Core/SpecialFunctions.h
@@ -283,7 +283,7 @@ struct digamma_impl {
Scalar p, q, nz, s, w, y;
bool negative;
- const Scalar maxnum = std::numeric_limits<Scalar>::infinity();
+ const Scalar maxnum = numext::numeric_limits<Scalar>::infinity();
const Scalar m_pi = 3.14159265358979323846;
negative = 0;
diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h
index b01437d88..1cab8278c 100644
--- a/Eigen/src/Core/util/Meta.h
+++ b/Eigen/src/Core/util/Meta.h
@@ -147,6 +147,7 @@ template<typename T> struct numeric_limits
static T epsilon() { return 0; }
static T (max)() { assert(false && "Highest not supported for this type"); }
static T (min)() { assert(false && "Lowest not supported for this type"); }
+ static T infinity() { assert(false && "Infinity not supported for this type"); }
};
template<> struct numeric_limits<float>
{
@@ -156,6 +157,8 @@ template<> struct numeric_limits<float>
static float (max)() { return CUDART_MAX_NORMAL_F; }
EIGEN_DEVICE_FUNC
static float (min)() { return FLT_MIN; }
+ EIGEN_DEVICE_FUNC
+ static float infinity() { return CUDART_INF_F; }
};
template<> struct numeric_limits<double>
{
@@ -165,6 +168,8 @@ template<> struct numeric_limits<double>
static double (max)() { return DBL_MAX; }
EIGEN_DEVICE_FUNC
static double (min)() { return DBL_MIN; }
+ EIGEN_DEVICE_FUNC
+ static float infinity() { return CUDART_INF; }
};
template<> struct numeric_limits<int>
{