Added support for fpclassify in Eigen::Numext

This commit is contained in:
Benoit Steiner
2016-04-27 12:10:25 -07:00
parent 1f48f47ab7
commit 6744d776ba
2 changed files with 31 additions and 0 deletions

View File

@@ -937,6 +937,15 @@ template<typename T> EIGEN_DEVICE_FUNC bool (isnan) (const T &x) { return inte
template<typename T> EIGEN_DEVICE_FUNC bool (isinf) (const T &x) { return internal::isinf_impl(x); }
template<typename T> EIGEN_DEVICE_FUNC bool (isfinite)(const T &x) { return internal::isfinite_impl(x); }
template<typename T> EIGEN_DEVICE_FUNC int (fpclassify)(const T& x){
#ifdef __CUDA_ARCH__
return (::fpclassify)(x);
#else
using std::fpclassify;
return fpclassify(x);
#endif
}
template<typename Scalar>
EIGEN_DEVICE_FUNC
inline EIGEN_MATHFUNC_RETVAL(round, Scalar) round(const Scalar& x)