aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch
diff options
context:
space:
mode:
authorGravatar Till Hoffmann <tillahoffmann@gmail.com>2016-04-01 14:35:21 +0100
committerGravatar Till Hoffmann <tillahoffmann@gmail.com>2016-04-01 14:35:21 +0100
commit57239f4a8149dbd603ad376e90a0a4574b846710 (patch)
tree4ff7041da6cd7121c19271bfb385c813ea66e0a8 /Eigen/src/Core/arch
parentdd5d390daf3a3a561a772b64f1b602e5f240bf8b (diff)
Added polygamma function.
Diffstat (limited to 'Eigen/src/Core/arch')
-rw-r--r--Eigen/src/Core/arch/CUDA/MathFunctions.h22
-rw-r--r--Eigen/src/Core/arch/CUDA/PacketMath.h1
2 files changed, 19 insertions, 4 deletions
diff --git a/Eigen/src/Core/arch/CUDA/MathFunctions.h b/Eigen/src/Core/arch/CUDA/MathFunctions.h
index 858775523..317499b29 100644
--- a/Eigen/src/Core/arch/CUDA/MathFunctions.h
+++ b/Eigen/src/Core/arch/CUDA/MathFunctions.h
@@ -93,17 +93,31 @@ double2 pdigamma<double2>(const double2& a)
}
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-float4 pzeta<float4>(const float4& a)
+float4 pzeta<float4>(const float4& x, const float4& q)
{
using numext::zeta;
- return make_float4(zeta(a.x), zeta(a.y), zeta(a.z), zeta(a.w));
+ return make_float4(zeta(x.x, q.x), zeta(x.y, q.y), zeta(x.z, q.z), zeta(x.w, q.w));
}
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
-double2 pzeta<double2>(const double2& a)
+double2 pzeta<double2>(const double2& x, const double2& q)
{
using numext::zeta;
- return make_double2(zeta(a.x), zeta(a.y));
+ return make_double2(zeta(x.x, q.x), zeta(x.y, q.y));
+}
+
+template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
+float4 ppolygamma<float4>(const float4& n, const float4& x)
+{
+ using numext::polygamma;
+ return make_float4(polygamma(n.x, x.x), polygamma(n.y, x.y), polygamma(n.z, x.z), polygamma(n.w, x.w));
+}
+
+template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
+double2 ppolygamma<double2>(const double2& n, const double2& x)
+{
+ using numext::polygamma;
+ return make_double2(polygamma(n.x, x.x), polygamma(n.y, x.y));
}
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
diff --git a/Eigen/src/Core/arch/CUDA/PacketMath.h b/Eigen/src/Core/arch/CUDA/PacketMath.h
index e0db18fbf..932df1092 100644
--- a/Eigen/src/Core/arch/CUDA/PacketMath.h
+++ b/Eigen/src/Core/arch/CUDA/PacketMath.h
@@ -41,6 +41,7 @@ template<> struct packet_traits<float> : default_packet_traits
HasLGamma = 1,
HasDiGamma = 1,
HasZeta = 1,
+ HasPolygamma = 1,
HasErf = 1,
HasErfc = 1,
HasIgamma = 1,