Move implementation of vectorized error function erf() to SpecialFunctionsImpl.h.

This commit is contained in:
Rasmus Munk Larsen
2019-09-27 13:56:04 -07:00
parent 7c8bc0d928
commit 13ef08e5ac
12 changed files with 67 additions and 142 deletions

View File

@@ -891,7 +891,6 @@ template<typename T> EIGEN_DEVICE_FUNC bool isnan_impl(const std::complex<T>& x)
template<typename T> EIGEN_DEVICE_FUNC bool isinf_impl(const std::complex<T>& x);
template<typename T> T generic_fast_tanh_float(const T& a_x);
template<typename T> T generic_fast_erf_float(const T& a_x);
} // end namespace internal
/****************************************************************************
@@ -1579,36 +1578,6 @@ template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double tanh(const double &x) { return ::tanh(x); }
#endif
#if EIGEN_HAS_CXX11
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
T erf(const T &x) {
EIGEN_USING_STD_MATH(erf);
return erf(x);
}
#else
template<typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
T erf(const T& x);
#endif
#if (!defined(EIGEN_GPUCC)) && EIGEN_FAST_MATH && !defined(SYCL_DEVICE_ONLY)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float erf(float x) { return internal::generic_fast_erf_float(x); }
#endif
#if defined(SYCL_DEVICE_ONLY)
SYCL_SPECIALIZE_FLOATING_TYPES_UNARY(erf, erf)
#endif
#if !EIGEN_HAS_CXX11 || defined(EIGEN_GPUCC)
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
float erf(const float &x) { return ::erff(x); }
template<> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
double erf(const double &x) { return ::erf(x); }
#endif
template <typename T>
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
T fmod(const T& a, const T& b) {