diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-08-26 15:28:59 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-08-26 15:28:59 +0200 |
commit | fe60856fed798f8ba358c112aa09a21e206bfced (patch) | |
tree | 23144dfa6210006c9cb9bd4989a2bc79423cfe5a /Eigen/src/Core/MathFunctions.h | |
parent | 0f56b5a6dea7e31b13e3f37018ffd53331507c4e (diff) |
Add overload of numext::log1p for float/double in CUDA
Diffstat (limited to 'Eigen/src/Core/MathFunctions.h')
-rw-r--r-- | Eigen/src/Core/MathFunctions.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 79ae797b5..256dc8e94 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -925,6 +925,14 @@ inline EIGEN_MATHFUNC_RETVAL(log1p, Scalar) log1p(const Scalar& x) return EIGEN_MATHFUNC_IMPL(log1p, Scalar)::run(x); } +#ifdef __CUDACC__ +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +float log1p(const float &x) { return ::log1pf(x); } + +template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +double log1p(const double &x) { return ::log1p(x); } +#endif + template<typename ScalarX,typename ScalarY> EIGEN_DEVICE_FUNC inline typename internal::pow_impl<ScalarX,ScalarY>::result_type pow(const ScalarX& x, const ScalarY& y) |