Guard use of long double on GPU device.

This commit is contained in:
Antonio Sánchez
2023-02-24 21:49:59 +00:00
committed by Rasmus Munk Larsen
parent e4598fedbe
commit bc5cdc7a67
3 changed files with 20 additions and 1 deletions

View File

@@ -135,7 +135,10 @@ using remove_all_t = typename remove_all<T>::type;
template<typename T> struct is_arithmetic { enum { value = false }; };
template<> struct is_arithmetic<float> { enum { value = true }; };
template<> struct is_arithmetic<double> { enum { value = true }; };
// GPU devices treat `long double` as `double`.
#ifndef EIGEN_GPU_COMPILE_PHASE
template<> struct is_arithmetic<long double> { enum { value = true }; };
#endif
template<> struct is_arithmetic<bool> { enum { value = true }; };
template<> struct is_arithmetic<char> { enum { value = true }; };
template<> struct is_arithmetic<signed char> { enum { value = true }; };