diff --git a/unsupported/Eigen/CXX11/src/util/CXX11Meta.h b/unsupported/Eigen/CXX11/src/util/CXX11Meta.h index 1e3aef8c2..197fddab6 100644 --- a/unsupported/Eigen/CXX11/src/util/CXX11Meta.h +++ b/unsupported/Eigen/CXX11/src/util/CXX11Meta.h @@ -36,11 +36,21 @@ struct type_list { constexpr static int count = sizeof...(tt); }; template struct type_list { constexpr static int count = sizeof...(tt) + 1; typedef t first_type; }; +#ifndef EIGEN_USE_SYCL template struct numeric_list { constexpr static std::size_t count = sizeof...(nn); }; template -struct numeric_list { constexpr static std::size_t count = sizeof...(nn) + 1; constexpr static T first_value = n; }; +struct numeric_list { static const std::size_t count = sizeof...(nn) + 1; const static T first_value = n; }; + +#else +template +struct numeric_list { + static constexpr std::size_t count = sizeof...(nn); + const T values[count] = {nn...}; +}; + +#endif /* numeric list constructors * @@ -123,9 +133,19 @@ template struct get<0, type_lis template struct get> : get> {}; template struct get<0, numeric_list> { constexpr static T value = a; }; -template constexpr inline const T array_get(const numeric_list&) { - return get<(int)n, numeric_list>::value; -} +#ifndef EIGEN_USE_SYCL +template constexpr T array_get(const numeric_list&) { + return get<(int)n, numeric_list>::value; +} +#else +template constexpr T array_get(const numeric_list& l) { + return l.values[n]; +} +template constexpr T array_get(const numeric_list& ) { + return T(0); +} + +#endif /* always get type, regardless of dummy; good for parameter pack expansion */