mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-29 23:34:12 +08:00
Marked the CUDA packet primitives as EIGEN_DEVICE_FUNC since they'll end up being executed on the GPU device.
This commit is contained in:
parent
92ceb02c6d
commit
7765039f1c
@ -18,49 +18,49 @@ namespace internal {
|
|||||||
// introduce conflicts between these packet_traits definitions and the ones
|
// introduce conflicts between these packet_traits definitions and the ones
|
||||||
// we'll use on the host side (SSE, AVX, ...)
|
// we'll use on the host side (SSE, AVX, ...)
|
||||||
#if defined(__CUDACC__) && defined(EIGEN_USE_GPU)
|
#if defined(__CUDACC__) && defined(EIGEN_USE_GPU)
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
float4 plog<float4>(const float4& a)
|
float4 plog<float4>(const float4& a)
|
||||||
{
|
{
|
||||||
return make_float4(logf(a.x), logf(a.y), logf(a.z), logf(a.w));
|
return make_float4(logf(a.x), logf(a.y), logf(a.z), logf(a.w));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
double2 plog<double2>(const double2& a)
|
double2 plog<double2>(const double2& a)
|
||||||
{
|
{
|
||||||
return make_double2(log(a.x), log(a.y));
|
return make_double2(log(a.x), log(a.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
float4 pexp<float4>(const float4& a)
|
float4 pexp<float4>(const float4& a)
|
||||||
{
|
{
|
||||||
return make_float4(expf(a.x), expf(a.y), expf(a.z), expf(a.w));
|
return make_float4(expf(a.x), expf(a.y), expf(a.z), expf(a.w));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
double2 pexp<double2>(const double2& a)
|
double2 pexp<double2>(const double2& a)
|
||||||
{
|
{
|
||||||
return make_double2(exp(a.x), exp(a.y));
|
return make_double2(exp(a.x), exp(a.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
float4 psqrt<float4>(const float4& a)
|
float4 psqrt<float4>(const float4& a)
|
||||||
{
|
{
|
||||||
return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w));
|
return make_float4(sqrtf(a.x), sqrtf(a.y), sqrtf(a.z), sqrtf(a.w));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
double2 psqrt<double2>(const double2& a)
|
double2 psqrt<double2>(const double2& a)
|
||||||
{
|
{
|
||||||
return make_double2(sqrt(a.x), sqrt(a.y));
|
return make_double2(sqrt(a.x), sqrt(a.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
float4 prsqrt<float4>(const float4& a)
|
float4 prsqrt<float4>(const float4& a)
|
||||||
{
|
{
|
||||||
return make_float4(rsqrtf(a.x), rsqrtf(a.y), rsqrtf(a.z), rsqrtf(a.w));
|
return make_float4(rsqrtf(a.x), rsqrtf(a.y), rsqrtf(a.z), rsqrtf(a.w));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<> EIGEN_STRONG_INLINE
|
template<> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
|
||||||
double2 prsqrt<double2>(const double2& a)
|
double2 prsqrt<double2>(const double2& a)
|
||||||
{
|
{
|
||||||
return make_double2(rsqrt(a.x), rsqrt(a.y));
|
return make_double2(rsqrt(a.x), rsqrt(a.y));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user