File indexing completed on 2025-01-19 09:51:40
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef EIGEN_MATH_FUNCTIONS_GPU_H
0011 #define EIGEN_MATH_FUNCTIONS_GPU_H
0012
0013 namespace Eigen {
0014
0015 namespace internal {
0016
0017
0018
0019
0020 #if defined(EIGEN_GPUCC) && defined(EIGEN_USE_GPU)
0021 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0022 float4 plog<float4>(const float4& a)
0023 {
0024 return make_float4(logf(a.x), logf(a.y), logf(a.z), logf(a.w));
0025 }
0026
0027 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0028 double2 plog<double2>(const double2& a)
0029 {
0030 using ::log;
0031 return make_double2(log(a.x), log(a.y));
0032 }
0033
0034 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0035 float4 plog1p<float4>(const float4& a)
0036 {
0037 return make_float4(log1pf(a.x), log1pf(a.y), log1pf(a.z), log1pf(a.w));
0038 }
0039
0040 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0041 double2 plog1p<double2>(const double2& a)
0042 {
0043 return make_double2(log1p(a.x), log1p(a.y));
0044 }
0045
0046 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0047 float4 pexp<float4>(const float4& a)
0048 {
0049 return make_float4(expf(a.x), expf(a.y), expf(a.z), expf(a.w));
0050 }
0051
0052 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0053 double2 pexp<double2>(const double2& a)
0054 {
0055 using ::exp;
0056 return make_double2(exp(a.x), exp(a.y));
0057 }
0058
0059 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0060 float4 pexpm1<float4>(const float4& a)
0061 {
0062 return make_float4(expm1f(a.x), expm1f(a.y), expm1f(a.z), expm1f(a.w));
0063 }
0064
0065 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0066 double2 pexpm1<double2>(const double2& a)
0067 {
0068 return make_double2(expm1(a.x), expm1(a.y));
0069 }
0070
0071 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0072 float4 psqrt<float4>(const float4& a)
0073 {
0074 return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w));
0075 }
0076
0077 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0078 double2 psqrt<double2>(const double2& a)
0079 {
0080 using ::sqrt;
0081 return make_double2(sqrt(a.x), sqrt(a.y));
0082 }
0083
0084 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0085 float4 prsqrt<float4>(const float4& a)
0086 {
0087 return make_float4(rsqrtf(a.x), rsqrtf(a.y), rsqrtf(a.z), rsqrtf(a.w));
0088 }
0089
0090 template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0091 double2 prsqrt<double2>(const double2& a)
0092 {
0093 return make_double2(rsqrt(a.x), rsqrt(a.y));
0094 }
0095
0096
0097 #endif
0098
0099 }
0100
0101 }
0102
0103 #endif