diff options
Diffstat (limited to 'Eigen/src/Core/NumTraits.h')
-rw-r--r-- | Eigen/src/Core/NumTraits.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Eigen/src/Core/NumTraits.h b/Eigen/src/Core/NumTraits.h index eb5306bf2..2b6633c9c 100644 --- a/Eigen/src/Core/NumTraits.h +++ b/Eigen/src/Core/NumTraits.h @@ -68,16 +68,22 @@ template<typename T> struct GenericNumTraits >::type NonInteger; typedef T Nested; - static inline Real epsilon() { return std::numeric_limits<T>::epsilon(); } + EIGEN_DEVICE_FUNC + static inline Real epsilon() + { + #if defined(__CUDA_ARCH__) + return internal::device::numeric_limits<T>::epsilon(); + #else + return std::numeric_limits<T>::epsilon(); + #endif + } EIGEN_DEVICE_FUNC static inline Real dummy_precision() { // make sure to override this for floating-point types return Real(0); } - EIGEN_DEVICE_FUNC static inline T highest() { return (std::numeric_limits<T>::max)(); } - EIGEN_DEVICE_FUNC static inline T lowest() { return IsInteger ? (std::numeric_limits<T>::min)() : (-(std::numeric_limits<T>::max)()); } #ifdef EIGEN2_SUPPORT |