diff options
Diffstat (limited to 'Eigen/src/Core/arch/CUDA/PacketMathHalf.h')
-rw-r--r-- | Eigen/src/Core/arch/CUDA/PacketMathHalf.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h index ae54225f8..35cb0efd5 100644 --- a/Eigen/src/Core/arch/CUDA/PacketMathHalf.h +++ b/Eigen/src/Core/arch/CUDA/PacketMathHalf.h @@ -34,6 +34,7 @@ template<> struct packet_traits<Eigen::half> : default_packet_traits HasSqrt = 1, HasRsqrt = 1, HasExp = 1, + HasExpm1 = 1, HasLog = 1, HasLog1p = 1 }; @@ -267,7 +268,7 @@ template<> __device__ EIGEN_STRONG_INLINE Eigen::half predux_mul<half2>(const ha #endif } -template<> __device__ EIGEN_STRONG_INLINE half2 plog1p<half2>(const half2& a) { +template<> __device__ EIGEN_STRONG_INLINE half2 pexpm1<half2>(const half2& a) { float a1 = __low2float(a); float a2 = __high2float(a); float r1 = log1pf(a1); @@ -275,6 +276,14 @@ template<> __device__ EIGEN_STRONG_INLINE half2 plog1p<half2>(const half2& a) { return __floats2half2_rn(r1, r2); } +template<> __device__ EIGEN_STRONG_INLINE half2 pexpm1<half2>(const half2& a) { + float a1 = __low2float(a); + float a2 = __high2float(a); + float r1 = expm1f(a1); + float r2 = expm1f(a2); + return __floats2half2_rn(r1, r2); +} + #if defined __CUDACC_VER__ && __CUDACC_VER__ >= 80000 && defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 530 template<> __device__ EIGEN_STRONG_INLINE |