diff --git a/unsupported/Eigen/CXX11/src/Core/util/CXX11Meta.h b/unsupported/Eigen/CXX11/src/Core/util/CXX11Meta.h index 4e2630bc2..3f149c6a3 100644 --- a/unsupported/Eigen/CXX11/src/Core/util/CXX11Meta.h +++ b/unsupported/Eigen/CXX11/src/Core/util/CXX11Meta.h @@ -283,11 +283,11 @@ template< /* generic binary operations */ struct sum_op { - template constexpr static inline auto run(A a, B b) -> decltype(a + b) { return a + b; } + template EIGEN_DEVICE_FUNC constexpr static inline auto run(A a, B b) -> decltype(a + b) { return a + b; } static constexpr int Identity = 0; }; struct product_op { - template constexpr static inline auto run(A a, B b) -> decltype(a * b) { return a * b; } + template EIGEN_DEVICE_FUNC constexpr static inline auto run(A a, B b) -> decltype(a * b) { return a * b; } static constexpr int Identity = 1; }; @@ -349,7 +349,7 @@ constexpr inline array array_reverse(array arr) // an infinite loop) template struct h_array_reduce { - constexpr static inline auto run(array arr, T identity) -> decltype(Reducer::run(h_array_reduce::run(arr, identity), array_get(arr))) + EIGEN_DEVICE_FUNC constexpr static inline auto run(array arr, T identity) -> decltype(Reducer::run(h_array_reduce::run(arr, identity), array_get(arr))) { return Reducer::run(h_array_reduce::run(arr, identity), array_get(arr)); } @@ -358,7 +358,7 @@ struct h_array_reduce { template struct h_array_reduce { - constexpr static inline T run(const array& arr, T) + EIGEN_DEVICE_FUNC constexpr static inline T run(const array& arr, T) { return array_get<0>(arr); } @@ -367,14 +367,14 @@ struct h_array_reduce template struct h_array_reduce { - constexpr static inline T run(const array&, T identity) + EIGEN_DEVICE_FUNC constexpr static inline T run(const array&, T identity) { return identity; } }; template -constexpr inline auto array_reduce(const array& arr, T identity) -> decltype(h_array_reduce::run(arr, identity)) +EIGEN_DEVICE_FUNC constexpr inline auto array_reduce(const array& arr, T identity) -> decltype(h_array_reduce::run(arr, identity)) { return h_array_reduce::run(arr, identity); } @@ -382,13 +382,13 @@ constexpr inline auto array_reduce(const array& arr, T identity) -> declty /* standard array reductions */ template -constexpr inline auto array_sum(const array& arr) -> decltype(array_reduce(arr, static_cast(0))) +EIGEN_DEVICE_FUNC constexpr inline auto array_sum(const array& arr) -> decltype(array_reduce(arr, static_cast(0))) { return array_reduce(arr, static_cast(0)); } template -constexpr inline auto array_prod(const array& arr) -> decltype(array_reduce(arr, static_cast(1))) +EIGEN_DEVICE_FUNC constexpr inline auto array_prod(const array& arr) -> decltype(array_reduce(arr, static_cast(1))) { return array_reduce(arr, static_cast(1)); }