diff options
Diffstat (limited to 'unsupported/Eigen/CXX11/src/util')
-rw-r--r-- | unsupported/Eigen/CXX11/src/util/CXX11Meta.h | 12 | ||||
-rw-r--r-- | unsupported/Eigen/CXX11/src/util/EmulateArray.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/unsupported/Eigen/CXX11/src/util/CXX11Meta.h b/unsupported/Eigen/CXX11/src/util/CXX11Meta.h index 49d315a66..bb584e3f9 100644 --- a/unsupported/Eigen/CXX11/src/util/CXX11Meta.h +++ b/unsupported/Eigen/CXX11/src/util/CXX11Meta.h @@ -268,6 +268,9 @@ template< typename Reducer > struct reduce<Reducer> { + #if defined(EIGEN_HIPCC) + EIGEN_DEVICE_FUNC + #endif constexpr static inline int run() { return Reducer::Identity; } }; @@ -276,6 +279,9 @@ template< typename A > struct reduce<Reducer, A> { + #if defined(EIGEN_HIPCC) + EIGEN_DEVICE_FUNC + #endif constexpr static inline A run(A a) { return a; } }; @@ -285,6 +291,9 @@ template< typename... Ts > struct reduce<Reducer, A, Ts...> { + #if defined(EIGEN_HIPCC) + EIGEN_DEVICE_FUNC + #endif constexpr static inline auto run(A a, Ts... ts) -> decltype(Reducer::run(a, reduce<Reducer, Ts...>::run(ts...))) { return Reducer::run(a, reduce<Reducer, Ts...>::run(ts...)); } @@ -324,6 +333,9 @@ struct greater_equal_zero_op { template<typename A> constexpr static inline auto // together in front... (13.0 doesn't work with array_prod/array_reduce/... anyway, but 13.1 // does... template<typename... Ts> +#if defined(EIGEN_HIPCC) +EIGEN_DEVICE_FUNC +#endif constexpr inline decltype(reduce<product_op, Ts...>::run((*((Ts*)0))...)) arg_prod(Ts... ts) { return reduce<product_op, Ts...>::run(ts...); diff --git a/unsupported/Eigen/CXX11/src/util/EmulateArray.h b/unsupported/Eigen/CXX11/src/util/EmulateArray.h index ddd54f4b3..5b01c5fb7 100644 --- a/unsupported/Eigen/CXX11/src/util/EmulateArray.h +++ b/unsupported/Eigen/CXX11/src/util/EmulateArray.h @@ -15,7 +15,7 @@ // The array class is only available starting with cxx11. Emulate our own here // if needed. Beware, msvc still doesn't advertise itself as a c++11 compiler! // Moreover, CUDA doesn't support the STL containers, so we use our own instead. -#if (__cplusplus <= 199711L && EIGEN_COMP_MSVC < 1900) || defined(EIGEN_CUDACC) || defined(EIGEN_AVOID_STL_ARRAY) +#if (__cplusplus <= 199711L && EIGEN_COMP_MSVC < 1900) || defined(EIGEN_CUDACC) || defined(EIGEN_HIPCC) || defined(EIGEN_AVOID_STL_ARRAY) namespace Eigen { template <typename T, size_t n> class array { |