From 0aaa5941dfe1292d19249f177cb289d8b37595af Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 12 Nov 2015 19:11:43 -0800 Subject: Silenced some compilation warnings triggered by nvcc --- .../Eigen/CXX11/src/Tensor/TensorIndexList.h | 145 ++++++++++++--------- 1 file changed, 82 insertions(+), 63 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h index 859c16ab0..74ce6d0ec 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h @@ -314,10 +314,6 @@ struct index_known_statically_impl > { } }; -template -static constexpr bool index_known_statically(const DenseIndex i) { - return index_known_statically_impl::run(i); -} template struct all_indices_known_statically_impl { @@ -340,10 +336,6 @@ struct all_indices_known_statically_impl -static constexpr bool all_indices_known_statically() { - return all_indices_known_statically_impl::run(); -} template struct indices_statically_known_to_increase_impl { @@ -366,22 +358,17 @@ template } }; -template -static constexpr bool indices_statically_known_to_increase() { - return indices_statically_known_to_increase_impl::run(); -} - template struct index_statically_eq_impl { - static constexpr bool run(DenseIndex, DenseIndex) { + EIGEN_DEVICE_FUNC static constexpr bool run(DenseIndex, DenseIndex) { return false; } }; template struct index_statically_eq_impl > { - static constexpr bool run(const DenseIndex i, const DenseIndex value) { + EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return IndexList().value_known_statically(i) & (IndexList().get(i) == value); } @@ -389,28 +376,23 @@ struct index_statically_eq_impl > { template struct index_statically_eq_impl > { -static constexpr bool run(const DenseIndex i, const DenseIndex value) { + EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return IndexList().value_known_statically(i) & (IndexList().get(i) == value); } }; -template -static constexpr bool index_statically_eq(DenseIndex i, DenseIndex value) { - return index_statically_eq_impl::run(i, value); -} - template struct index_statically_ne_impl { - static constexpr bool run(DenseIndex, DenseIndex) { + EIGEN_DEVICE_FUNC static constexpr bool run(DenseIndex, DenseIndex) { return false; } }; template struct index_statically_ne_impl > { - static constexpr bool run(const DenseIndex i, const DenseIndex value) { + EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return IndexList().value_known_statically(i) & (IndexList().get(i) != value); } @@ -418,29 +400,23 @@ struct index_statically_ne_impl > { template struct index_statically_ne_impl > { -static constexpr bool run(const DenseIndex i, const DenseIndex value) { + EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return IndexList().value_known_statically(i) & (IndexList().get(i) != value); } }; -template -static constexpr bool index_statically_ne(DenseIndex i, DenseIndex value) { - return index_statically_ne_impl::run(i, value); -} - - template struct index_statically_gt_impl { - static constexpr bool run(DenseIndex, DenseIndex) { + EIGEN_DEVICE_FUNC static constexpr bool run(DenseIndex, DenseIndex) { return false; } }; template struct index_statically_gt_impl > { - static constexpr bool run(const DenseIndex i, const DenseIndex value) { + EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return IndexList().value_known_statically(i) & (IndexList().get(i) > value); } @@ -448,30 +424,24 @@ struct index_statically_gt_impl > { template struct index_statically_gt_impl > { -static constexpr bool run(const DenseIndex i, const DenseIndex value) { + EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return IndexList().value_known_statically(i) & (IndexList().get(i) > value); } }; -template -static constexpr bool index_statically_gt(DenseIndex i, DenseIndex value) { - return index_statically_gt_impl::run(i, value); -} - - template struct index_statically_lt_impl { - static constexpr bool run(DenseIndex, DenseIndex) { + EIGEN_DEVICE_FUNC static constexpr bool run(DenseIndex, DenseIndex) { return false; } }; template struct index_statically_lt_impl > { - static constexpr bool run(const DenseIndex i, const DenseIndex value) { + EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return IndexList().value_known_statically(i) & (IndexList().get(i) < value); } @@ -479,65 +449,114 @@ struct index_statically_lt_impl > { template struct index_statically_lt_impl > { -static constexpr bool run(const DenseIndex i, const DenseIndex value) { + EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex i, const DenseIndex value) { return IndexList().value_known_statically(i) & (IndexList().get(i) < value); } }; +} // end namespace internal +} // end namespace Eigen + +#else + +namespace Eigen { +namespace internal { + template -static constexpr bool index_statically_lt(DenseIndex i, DenseIndex value) { - return index_statically_lt_impl::run(i, value); -} +struct index_known_statically_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(const DenseIndex) { + return false; + } +}; +template +struct all_indices_known_statically_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run() { + return false; + } +}; + +template +struct indices_statically_known_to_increase_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run() { + return false; + } +}; + +template +struct index_statically_eq_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(DenseIndex, DenseIndex) { + return false; + } +}; + +template +struct index_statically_ne_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(DenseIndex, DenseIndex) { + return false; + } +}; + +template +struct index_statically_gt_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(DenseIndex, DenseIndex) { + return false; + } +}; + +template +struct index_statically_lt_impl { + EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE static bool run(DenseIndex, DenseIndex) { + return false; + } +}; } // end namespace internal } // end namespace Eigen -#else +#endif + namespace Eigen { namespace internal { - -// No C++11 support template -static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool index_known_statically(DenseIndex) { - return false; +static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_known_statically(DenseIndex i) { + return index_known_statically_impl::run(i); } template -static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool all_indices_known_statically() { - return false; +static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool all_indices_known_statically() { + return all_indices_known_statically_impl::run(); } template -static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool indices_statically_known_to_increase() { - return false; +static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool indices_statically_known_to_increase() { + return indices_statically_known_to_increase_impl::run(); } template -static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool indices_statically_eq(DenseIndex, DenseIndex) { - return false; +static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_eq(DenseIndex i, DenseIndex value) { + return index_statically_eq_impl::run(i, value); } template -static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool indices_statically_ne(DenseIndex, DenseIndex) { - return false; +static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_ne(DenseIndex i, DenseIndex value) { + return index_statically_ne_impl::run(i, value); } template -static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool indices_statically_gt(DenseIndex, DenseIndex) { - return false; +static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_gt(DenseIndex i, DenseIndex value) { + return index_statically_gt_impl::run(i, value); } template -static EIGEN_ALWAYS_INLINE EIGEN_DEVICE_FUNC bool indices_statically_lt(DenseIndex, DenseIndex) { - return false; +static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_lt(DenseIndex i, DenseIndex value) { + return index_statically_lt_impl::run(i, value); } } // end namespace internal } // end namespace Eigen -#endif #endif // EIGEN_CXX11_TENSOR_TENSOR_INDEX_LIST_H -- cgit v1.2.3