From 36f5a10198a8bc745633121fc4e8794a00b559e7 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Wed, 13 Apr 2016 18:44:48 -0700 Subject: [PATCH] Properly gate the definition of the error and gamma functions for fp16 --- Eigen/src/Core/arch/CUDA/Half.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Eigen/src/Core/arch/CUDA/Half.h b/Eigen/src/Core/arch/CUDA/Half.h index dfab34d32..482b654ac 100644 --- a/Eigen/src/Core/arch/CUDA/Half.h +++ b/Eigen/src/Core/arch/CUDA/Half.h @@ -442,6 +442,8 @@ template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half floor(const Eigen:: template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half ceil(const Eigen::half& a) { return Eigen::half(::ceilf(float(a))); } + +#ifdef EIGEN_HAS_C99_MATH template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half lgamma(const Eigen::half& a) { return Eigen::half(Eigen::numext::lgamma(static_cast(a))); } @@ -466,7 +468,7 @@ template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half igamma(const Eigen: template<> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC Eigen::half igammac(const Eigen::half& a, const Eigen::half& x) { return Eigen::half(Eigen::numext::igammac(static_cast(a), static_cast(x))); } - +#endif } // end namespace numext } // end namespace Eigen