Add digamma for CPU + CUDA. Includes tests.

This commit is contained in:
Eugene Brevdo
2015-12-24 21:15:38 -08:00
parent bdcbc66a5c
commit f7362772e3
9 changed files with 447 additions and 62 deletions

View File

@@ -78,6 +78,20 @@ double2 plgamma<double2>(const double2& a)
return make_double2(lgamma(a.x), lgamma(a.y));
}
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)
{