aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/arch/CUDA/MathFunctions.h
diff options
context:
space:
mode:
authorGravatar Eugene Brevdo <ebrevdo@gmail.com>2015-12-24 21:15:38 -0800
committerGravatar Eugene Brevdo <ebrevdo@gmail.com>2015-12-24 21:15:38 -0800
commitf7362772e3236cdb8ae4d9be175f83a0b19902a0 (patch)
treebc37d8bf30c8ad5621c5c2479e74e98e8daeb57e /Eigen/src/Core/arch/CUDA/MathFunctions.h
parentbdcbc66a5cca656e1cbdfa97668f3e400a7cb08d (diff)
Add digamma for CPU + CUDA. Includes tests.
Diffstat (limited to 'Eigen/src/Core/arch/CUDA/MathFunctions.h')
-rw-r--r--Eigen/src/Core/arch/CUDA/MathFunctions.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/Eigen/src/Core/arch/CUDA/MathFunctions.h b/Eigen/src/Core/arch/CUDA/MathFunctions.h
index ecd5c444e..a2c06a817 100644
--- a/Eigen/src/Core/arch/CUDA/MathFunctions.h
+++ b/Eigen/src/Core/arch/CUDA/MathFunctions.h
@@ -79,6 +79,20 @@ double2 plgamma<double2>(const double2& a)
}
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
+float4 pdigamma<float4>(const float4& a)
+{
+ using numext::digamma;
+ return make_float4(digamma(a.x), digamma(a.y), digamma(a.z), digamma(a.w));
+}
+
+template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
+double2 pdigamma<double2>(const double2& a)
+{
+ using numext::digamma;
+ return make_double2(digamma(a.x), digamma(a.y));
+}
+
+template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
float4 perf<float4>(const float4& a)
{
return make_float4(erf(a.x), erf(a.y), erf(a.z), erf(a.w));