From c92faf9d841deeecd7e87d9544fab949f7f59ed2 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 6 Jul 2017 05:05:57 +0000 Subject: [PATCH] Merged in mehdi_goli/upstr_benoit/HiperbolicOP (pull request PR-13) Adding hyperbolic operations for sycl. * Adding hyperbolic operations. * Adding the hyperbolic operations for CPU as well. --- Eigen/src/Core/MathFunctions.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 0be4a25da..966a126c9 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -1375,9 +1375,19 @@ T acos(const T &x) { return acos(x); } + +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T acosh(const T &x) { + EIGEN_USING_STD_MATH(acosh); + return acosh(x); +} + #if defined(__SYCL_DEVICE_ONLY__) EIGEN_ALWAYS_INLINE float acos(float x) { return cl::sycl::acos(x); } EIGEN_ALWAYS_INLINE double acos(double x) { return cl::sycl::acos(x); } +EIGEN_ALWAYS_INLINE float acosh(float x) { return cl::sycl::acosh(x); } +EIGEN_ALWAYS_INLINE double acosh(double x) { return cl::sycl::acosh(x); } #endif // defined(__SYCL_DEVICE_ONLY__) #ifdef __CUDACC__ @@ -1395,9 +1405,18 @@ T asin(const T &x) { return asin(x); } +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T asinh(const T &x) { + EIGEN_USING_STD_MATH(asinh); + return asinh(x); +} + #if defined(__SYCL_DEVICE_ONLY__) EIGEN_ALWAYS_INLINE float asin(float x) { return cl::sycl::asin(x); } EIGEN_ALWAYS_INLINE double asin(double x) { return cl::sycl::asin(x); } +EIGEN_ALWAYS_INLINE float asinh(float x) { return cl::sycl::asinh(x); } +EIGEN_ALWAYS_INLINE double asinh(double x) { return cl::sycl::asinh(x); } #endif // defined(__SYCL_DEVICE_ONLY__) #ifdef __CUDACC__ @@ -1415,9 +1434,18 @@ T atan(const T &x) { return atan(x); } +template +EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE +T atanh(const T &x) { + EIGEN_USING_STD_MATH(atanh); + return atanh(x); +} + #if defined(__SYCL_DEVICE_ONLY__) EIGEN_ALWAYS_INLINE float atan(float x) { return cl::sycl::atan(x); } EIGEN_ALWAYS_INLINE double atan(double x) { return cl::sycl::atan(x); } +EIGEN_ALWAYS_INLINE float atanh(float x) { return cl::sycl::atanh(x); } +EIGEN_ALWAYS_INLINE double atanh(double x) { return cl::sycl::atanh(x); } #endif // defined(__SYCL_DEVICE_ONLY__) #ifdef __CUDACC__