mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
Merged in srvasude/eigen/fix_cuda_exp (pull request PR-268)
Fix expm1 CUDA implementation (do not shadow exp CUDA implementation).
This commit is contained in:
commit
6811e6cf49
@ -13,8 +13,6 @@
|
||||
// source: http://www.geom.uiuc.edu/~huberty/math5337/groupe/digits.html
|
||||
// TODO this should better be moved to NumTraits
|
||||
#define EIGEN_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406L
|
||||
#define EIGEN_LN2 0.69314718055994530941723212145817656807550013436024425412068001L
|
||||
|
||||
|
||||
namespace Eigen {
|
||||
|
||||
@ -499,10 +497,11 @@ namespace std_fallback {
|
||||
|
||||
EIGEN_USING_STD_MATH(exp);
|
||||
Scalar u = exp(x);
|
||||
if (u == RealScalar(1)) {
|
||||
if (u == Scalar(1)) {
|
||||
return x;
|
||||
}
|
||||
if (u - RealScalar(1) == RealScalar(-1)) {
|
||||
Scalar um1 = u - RealScalar(1);
|
||||
if (um1 == Scalar(-1)) {
|
||||
return RealScalar(-1);
|
||||
}
|
||||
|
||||
|
@ -57,15 +57,14 @@ double2 pexp<double2>(const double2& a)
|
||||
}
|
||||
|
||||
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
float4 pexp<float4>(const float4& a)
|
||||
float4 pexpm1<float4>(const float4& a)
|
||||
{
|
||||
return make_float4(expm1f(a.x), expm1f(a.y), expm1f(a.z), expm1f(a.w));
|
||||
}
|
||||
|
||||
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||
double2 pexp<double2>(const double2& a)
|
||||
double2 pexpm1<double2>(const double2& a)
|
||||
{
|
||||
using ::expm1;
|
||||
return make_double2(expm1(a.x), expm1(a.y));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user