mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Merged in ebrevdo/eigen (pull request PR-167)
Add infinity() support to numext::numeric_limits, use it in lgamma. I tested the code on my gtx-titan-black gpu, and it appears to work as expected.
This commit is contained in:
@@ -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 double infinity() { return CUDART_INF; }
|
||||
};
|
||||
template<> struct numeric_limits<int>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user