diff --git a/Eigen/src/Core/arch/GPU/Tuple.h b/Eigen/src/Core/arch/GPU/Tuple.h index bbcdf64ff..97c54e5b0 100644 --- a/Eigen/src/Core/arch/GPU/Tuple.h +++ b/Eigen/src/Core/arch/GPU/Tuple.h @@ -165,8 +165,8 @@ struct tuple_cat_impl, TupleImpl, // then recursively calls again. template static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - ReturnType run(Tuple1&& tuple1, index_sequence, - Tuple2&& tuple2, index_sequence, + ReturnType run(Tuple1&& tuple1, std::index_sequence, + Tuple2&& tuple2, std::index_sequence, MoreTuples&&... tuples) { return tuple_cat_impl::run( MergedTupleType(tuple_get_impl::run(std::forward(tuple1))..., @@ -178,8 +178,8 @@ struct tuple_cat_impl, TupleImpl, template static EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ReturnType run(Tuple1&& tuple1, Tuple2&& tuple2, MoreTuples&&... tuples) { - return run(std::forward(tuple1), make_index_sequence{}, - std::forward(tuple2), make_index_sequence{}, + return run(std::forward(tuple1), std::make_index_sequence{}, + std::forward(tuple2), std::make_index_sequence{}, std::forward(tuples)...); } }; diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 62566eec9..fe7386c23 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -681,16 +681,6 @@ #endif #endif -// Does the compiler support result_of? -// result_of was deprecated in c++17 and removed in c++ 20 -#ifndef EIGEN_HAS_STD_RESULT_OF -#if EIGEN_COMP_CXXVER < 17 -#define EIGEN_HAS_STD_RESULT_OF 1 -#else -#define EIGEN_HAS_STD_RESULT_OF 0 -#endif -#endif - // Does the compiler support std::hash? #ifndef EIGEN_HAS_STD_HASH // The std::hash struct is defined in C++11 but is not labelled as a __device__ @@ -710,28 +700,7 @@ #endif #endif -// Does the compiler fully support const expressions? (as in c++14) -#ifndef EIGEN_HAS_CONSTEXPR - #if defined(EIGEN_CUDACC) - // Const expressions are supported provided that c++11 is enabled and we're using either clang or nvcc 7.5 or above - #if (EIGEN_COMP_CLANG || EIGEN_COMP_NVCC >= 70500) - #define EIGEN_HAS_CONSTEXPR 1 - #endif - #else - #define EIGEN_HAS_CONSTEXPR 1 - #endif - - #ifndef EIGEN_HAS_CONSTEXPR - #define EIGEN_HAS_CONSTEXPR 0 - #endif - -#endif // EIGEN_HAS_CONSTEXPR - -#if EIGEN_HAS_CONSTEXPR #define EIGEN_CONSTEXPR constexpr -#else -#define EIGEN_CONSTEXPR -#endif // Does the compiler support C++11 math? // Let's be conservative and enable the default C++11 implementation only if we are sure it exists @@ -760,7 +729,7 @@ #endif #endif -#if defined(EIGEN_CUDACC) && EIGEN_HAS_CONSTEXPR +#if defined(EIGEN_CUDACC) // While available already with c++11, this is useful mostly starting with c++14 and relaxed constexpr rules #if defined(__NVCC__) // nvcc considers constexpr functions as __host__ __device__ with the option --expt-relaxed-constexpr diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 39b87edf3..67ec8c939 100755 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -243,17 +243,12 @@ EIGEN_CONSTEXPR auto index_list_size(T&& x) { /** \internal * Convenient struct to get the result type of a nullary, unary, binary, or * ternary functor. - * - * Pre C++11: - * Supports both a Func::result_type member and templated - * Func::result::type member. - * - * If none of these members is provided, then the type of the first - * argument is returned. - * - * Post C++11: + * + * Pre C++17: * This uses std::result_of. However, note the `type` member removes * const and converts references/pointers to their corresponding value type. + * + * Post C++17: Uses std::invoke_result */ #if EIGEN_HAS_STD_INVOKE_RESULT template struct result_of; @@ -263,179 +258,34 @@ struct result_of { typedef typename std::invoke_result::type type1; typedef typename remove_all::type type; }; -#elif EIGEN_HAS_STD_RESULT_OF -template struct result_of { - typedef typename std::result_of::type type1; - typedef typename remove_all::type type; -}; -#else -template struct result_of { }; -struct has_none {int a[1];}; -struct has_std_result_type {int a[2];}; -struct has_tr1_result {int a[3];}; - -template -struct nullary_result_of_select {}; - -template -struct nullary_result_of_select {typedef typename Func::result_type type;}; - -template -struct nullary_result_of_select {typedef typename Func::template result::type type;}; - -template -struct result_of { - template - static has_std_result_type testFunctor(T const *, typename T::result_type const * = 0); - template - static has_tr1_result testFunctor(T const *, typename T::template result::type const * = 0); - static has_none testFunctor(...); - - // note that the following indirection is needed for gcc-3.3 - enum {FunctorType = sizeof(testFunctor(static_cast(0)))}; - typedef typename nullary_result_of_select::type type; -}; - -template -struct unary_result_of_select {typedef typename internal::remove_all::type type;}; - -template -struct unary_result_of_select {typedef typename Func::result_type type;}; - -template -struct unary_result_of_select {typedef typename Func::template result::type type;}; - -template -struct result_of { - template - static has_std_result_type testFunctor(T const *, typename T::result_type const * = 0); - template - static has_tr1_result testFunctor(T const *, typename T::template result::type const * = 0); - static has_none testFunctor(...); - - // note that the following indirection is needed for gcc-3.3 - enum {FunctorType = sizeof(testFunctor(static_cast(0)))}; - typedef typename unary_result_of_select::type type; -}; - -template -struct binary_result_of_select {typedef typename internal::remove_all::type type;}; - -template -struct binary_result_of_select -{typedef typename Func::result_type type;}; - -template -struct binary_result_of_select -{typedef typename Func::template result::type type;}; - -template -struct result_of { - template - static has_std_result_type testFunctor(T const *, typename T::result_type const * = 0); - template - static has_tr1_result testFunctor(T const *, typename T::template result::type const * = 0); - static has_none testFunctor(...); - - // note that the following indirection is needed for gcc-3.3 - enum {FunctorType = sizeof(testFunctor(static_cast(0)))}; - typedef typename binary_result_of_select::type type; -}; - -template -struct ternary_result_of_select {typedef typename internal::remove_all::type type;}; - -template -struct ternary_result_of_select -{typedef typename Func::result_type type;}; - -template -struct ternary_result_of_select -{typedef typename Func::template result::type type;}; - -template -struct result_of { - template - static has_std_result_type testFunctor(T const *, typename T::result_type const * = 0); - template - static has_tr1_result testFunctor(T const *, typename T::template result::type const * = 0); - static has_none testFunctor(...); - - // note that the following indirection is needed for gcc-3.3 - enum {FunctorType = sizeof(testFunctor(static_cast(0)))}; - typedef typename ternary_result_of_select::type type; -}; - -#endif - -#if EIGEN_HAS_STD_INVOKE_RESULT template struct invoke_result { typedef typename std::invoke_result::type type1; typedef typename remove_all::type type; }; #else -template -struct invoke_result { - typedef typename result_of::type type1; +template struct result_of { + typedef typename std::result_of::type type1; typedef typename remove_all::type type; }; -#endif -// C++14 integer/index_sequence. -#if defined(__cpp_lib_integer_sequence) && __cpp_lib_integer_sequence >= 201304L - -using std::integer_sequence; -using std::make_integer_sequence; - -using std::index_sequence; -using std::make_index_sequence; - -#else - -template -struct integer_sequence { - static EIGEN_CONSTEXPR size_t size() EIGEN_NOEXCEPT { return sizeof...(Ints); } +template +struct invoke_result { + typedef typename result_of::type type1; + typedef typename remove_all::type type; }; - -template -struct append_integer; - -template -struct append_integer, N> { - using type = integer_sequence; -}; - -template -struct generate_integer_sequence { - using type = typename append_integer::type, N-1>::type; -}; - -template -struct generate_integer_sequence { - using type = integer_sequence; -}; - -template -using make_integer_sequence = typename generate_integer_sequence::type; - -template -using index_sequence = integer_sequence; - -template -using make_index_sequence = make_integer_sequence; - #endif // Reduces a sequence of bools to true if all are true, false otherwise. template -using reduce_all = std::is_same, integer_sequence >; +using reduce_all = std::is_same, + std::integer_sequence >; // Reduces a sequence of bools to true if any are true, false if all false. template using reduce_any = std::integral_constant, integer_sequence >::value>; + !std::is_same, std::integer_sequence >::value>; struct meta_yes { char a[1]; }; struct meta_no { char a[2]; }; diff --git a/bench/tensors/tensor_benchmarks.h b/bench/tensors/tensor_benchmarks.h index 0e8339e15..1a7a0fef5 100644 --- a/bench/tensors/tensor_benchmarks.h +++ b/bench/tensors/tensor_benchmarks.h @@ -219,14 +219,8 @@ template class BenchmarkSuite { size_b[1] = m_; TensorMap, Eigen::Aligned> B(b_, size_b); -#if defined(EIGEN_HAS_INDEX_LIST) Eigen::IndexPairList, Eigen::type2indexpair<2, 1> > paddings; -#else - Eigen::array, 2> paddings; - paddings[0] = Eigen::IndexPair(0, 0); - paddings[1] = Eigen::IndexPair(2, 1); -#endif #ifdef EIGEN_USE_SYCL // warmup for sycl for (int iter = 0; iter < 10; ++iter) { B.device(device_) = A.pad(paddings); @@ -251,15 +245,7 @@ template class BenchmarkSuite { size_b[1] = k_/2; TensorMap, Eigen::Aligned> B(b_, size_b); -#ifndef EIGEN_HAS_INDEX_LIST - Eigen::array strides; - strides[0] = 1; - strides[1] = 2; -#else - // Take advantage of cxx11 to give the compiler information it can use to - // optimize the code. Eigen::IndexList, Eigen::type2index<2> > strides; -#endif #ifdef EIGEN_USE_SYCL // warmup for sycl for (int iter = 0; iter < 10; ++iter) { @@ -284,17 +270,8 @@ template class BenchmarkSuite { size_c[0] = m_; size_c[1] = n_; TensorMap, Eigen::Aligned> C(c_, size_c); - -#ifndef EIGEN_HAS_INDEX_LIST - Eigen::array broadcast; - broadcast[0] = 1; - broadcast[1] = n_; -#else - // Take advantage of cxx11 to give the compiler information it can use to - // optimize the code. Eigen::IndexList, int> broadcast; broadcast.set(1, n_); -#endif #ifdef EIGEN_USE_SYCL // warmup for sycl for (int iter = 0; iter < 10; ++iter) { @@ -385,15 +362,7 @@ for (int iter = 0; iter < 10; ++iter) { Eigen::array output_size; output_size[0] = n_; TensorMap, Eigen::Aligned> C(c_, output_size); - -#ifndef EIGEN_HAS_INDEX_LIST - Eigen::array sum_along_dim; - sum_along_dim[0] = 0; -#else - // Take advantage of cxx11 to give the compiler information it can use to - // optimize the code. Eigen::IndexList> sum_along_dim; -#endif #ifdef EIGEN_USE_SYCL // warmup for sycl for (int iter = 0; iter < 10; ++iter) { C.device(device_) = B.sum(sum_along_dim); diff --git a/doc/PreprocessorDirectives.dox b/doc/PreprocessorDirectives.dox index 5a98539ee..4d232878e 100644 --- a/doc/PreprocessorDirectives.dox +++ b/doc/PreprocessorDirectives.dox @@ -65,7 +65,6 @@ functions by defining EIGEN_HAS_C99_MATH=1. - \b EIGEN_HAS_C99_MATH - controls the usage of C99 math functions such as erf, erfc, lgamma, etc. - \b EIGEN_HAS_CXX11_MATH - controls the implementation of some functions such as round, logp1, isinf, isnan, etc. - \b EIGEN_HAS_STD_RESULT_OF - defines whether std::result_of is supported - - \b EIGEN_HAS_CONSTEXPR - defines whether relaxed const expression are supported - \b EIGEN_NO_IO - Disables any usage and support for ``. \section TopicPreprocessorDirectivesAssertions Assertions diff --git a/test/gpu_test_helper.h b/test/gpu_test_helper.h index d7649f93b..2c5a46b18 100644 --- a/test/gpu_test_helper.h +++ b/test/gpu_test_helper.h @@ -59,7 +59,7 @@ struct extract_output_indices_helper; * \tparam Ts the remaining types. */ template -struct extract_output_indices_helper, T1, Ts...> { +struct extract_output_indices_helper, T1, Ts...> { using type = typename extract_output_indices_helper< N - 1, Idx + 1, @@ -67,21 +67,21 @@ struct extract_output_indices_helper, T // If is a non-const l-value reference, append index. std::is_lvalue_reference::value && !std::is_const::type>::value, - index_sequence, - index_sequence >::type, + std::index_sequence, + std::index_sequence >::type, Ts...>::type; }; // Base case. template -struct extract_output_indices_helper<0, Idx, index_sequence > { - using type = index_sequence; +struct extract_output_indices_helper<0, Idx, std::index_sequence > { + using type = std::index_sequence; }; // Extracts a set of indices into Types... that correspond to non-const // l-value references. template -using extract_output_indices = typename extract_output_indices_helper, Types...>::type; +using extract_output_indices = typename extract_output_indices_helper, Types...>::type; // Helper struct for dealing with Generic functors that may return void. struct void_helper { @@ -134,7 +134,7 @@ struct void_helper { // output_buffer_size is populated. template EIGEN_DEVICE_FUNC -void run_serialized(index_sequence, index_sequence, +void run_serialized(std::index_sequence, std::index_sequence, Kernel kernel, uint8_t* buffer, size_t capacity) { using test_detail::get; using test_detail::make_tuple; @@ -175,7 +175,7 @@ void run_serialized(index_sequence, index_sequence template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run_serialized(Kernel kernel, uint8_t* buffer, size_t capacity) { - run_serialized (make_index_sequence{}, + run_serialized (std::make_index_sequence{}, extract_output_indices{}, kernel, buffer, capacity); } @@ -206,8 +206,8 @@ void run_serialized_on_gpu_meta_kernel(const Kernel kernel, uint8_t* buffer, siz // buffer is not large enough to hold the outputs. template auto run_serialized_on_gpu(size_t buffer_capacity_hint, - index_sequence, - index_sequence, + std::index_sequence, + std::index_sequence, Kernel kernel, Args&&... args) -> decltype(kernel(args...)) { // Compute the required serialization buffer capacity. // Round up input size to next power of two to give a little extra room @@ -323,7 +323,7 @@ template auto run_on_gpu(Kernel kernel, Args&&... args) -> decltype(kernel(args...)){ return internal::run_serialized_on_gpu( /*buffer_capacity_hint=*/ 0, - internal::make_index_sequence{}, + std::make_index_sequence{}, internal::extract_output_indices{}, kernel, std::forward(args)...); } @@ -347,7 +347,7 @@ auto run_on_gpu_with_hint(size_t buffer_capacity_hint, Kernel kernel, Args&&... args) -> decltype(kernel(args...)){ return internal::run_serialized_on_gpu( buffer_capacity_hint, - internal::make_index_sequence{}, + std::make_index_sequence{}, internal::extract_output_indices{}, kernel, std::forward(args)...); } diff --git a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h index 6a4124519..b57b14c8d 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +++ b/unsupported/Eigen/CXX11/src/Tensor/Tensor.h @@ -388,7 +388,6 @@ class Tensor : public TensorBase EIGEN_DEVICE_FUNC void resize(const Eigen::IndexList& dimensions) { @@ -398,7 +397,6 @@ class Tensor : public TensorBase const Index array_get(c return n; } - -#if EIGEN_HAS_CONSTEXPR template struct index_known_statically_impl > { EIGEN_DEVICE_FUNC static constexpr bool run(const DenseIndex) { @@ -138,99 +136,6 @@ struct index_statically_lt_impl > { } }; -#else -template -struct index_known_statically_impl > { - EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE bool run(const DenseIndex) { - return true; - } -}; -template -struct index_known_statically_impl > { - EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE bool run(const DenseIndex) { - return true; - } -}; - -template -struct all_indices_known_statically_impl > { - EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE bool run() { - return true; - } -}; -template -struct all_indices_known_statically_impl > { - EIGEN_DEVICE_FUNC static EIGEN_ALWAYS_INLINE bool run() { - return true; - } -}; - -template -struct indices_statically_known_to_increase_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run() { - return true; - } -}; -template -struct indices_statically_known_to_increase_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run() { - return true; - } -}; - -template -struct index_statically_eq_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const DenseIndex, const DenseIndex) { - return false; - } -}; -template -struct index_statically_eq_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const DenseIndex, const DenseIndex) { - return false; - } -}; - -template -struct index_statically_ne_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const DenseIndex, const DenseIndex){ - return false; - } -}; -template -struct index_statically_ne_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const DenseIndex, const DenseIndex) { - return false; - } -}; - -template -struct index_statically_gt_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const DenseIndex, const DenseIndex) { - return false; - } -}; -template -struct index_statically_gt_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const DenseIndex, const DenseIndex) { - return false; - } -}; - -template -struct index_statically_lt_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const DenseIndex, const DenseIndex) { - return false; - } -}; -template -struct index_statically_lt_impl > { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const DenseIndex, const DenseIndex) { - return false; - } -}; -#endif - } // end namespace internal } // end namespace Eigen diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h index 84ae848e1..d44ab4c5b 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h @@ -297,7 +297,6 @@ struct DSizes : array { } } -#ifdef EIGEN_HAS_INDEX_LIST template EIGEN_DEVICE_FUNC explicit DSizes(const Eigen::IndexList& dimensions) { @@ -305,7 +304,6 @@ struct DSizes : array { (*this)[i] = dimensions[i]; } } -#endif #ifndef EIGEN_EMULATE_CXX11_META_H template diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h index e5030e965..0e9c7e59c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h @@ -12,10 +12,6 @@ #include "./InternalHeaderCheck.h" -#if EIGEN_HAS_CONSTEXPR - -#define EIGEN_HAS_INDEX_LIST - namespace Eigen { /** \internal @@ -609,81 +605,6 @@ struct index_pair_second_statically_eq_impl -struct index_known_statically_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(const Index) { - return false; - } -}; - -template -struct all_indices_known_statically_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run() { - return false; - } -}; - -template -struct indices_statically_known_to_increase_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run() { - return false; - } -}; - -template -struct index_statically_eq_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(Index, Index) { - return false; - } -}; - -template -struct index_statically_ne_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(Index, Index) { - return false; - } -}; - -template -struct index_statically_gt_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(Index, Index) { - return false; - } -}; - -template -struct index_statically_lt_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(Index, Index) { - return false; - } -}; - -template -struct index_pair_first_statically_eq_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(Index, Index) { - return false; - } -}; - -template -struct index_pair_second_statically_eq_impl { - static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool run(Index, Index) { - return false; - } -}; - - - -} // end namespace internal -} // end namespace Eigen - -#endif - namespace Eigen { namespace internal { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h index ba79907ea..e4426fe9c 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h @@ -109,13 +109,9 @@ struct TensorEvaluator, Device> // clang-format off static const ReshapingKind kind = -#if defined(EIGEN_HAS_INDEX_LIST) (NumOutputDims == 2 && internal::index_statically_eq(/*index=*/0, /*value=*/1)) ? OneByN : (NumOutputDims == 2 && internal::index_statically_eq(/*index=*/1, /*value=*/1)) ? NByOne : Runtime; -#else - Runtime; -#endif // clang-format on enum { diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h index a9706dac8..d111d80a3 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h @@ -512,35 +512,20 @@ struct TensorEvaluator, Device EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool isPaddingAtIndexForDim( Index index, int dim_index) const { -#if defined(EIGEN_HAS_INDEX_LIST) return (!internal::index_pair_first_statically_eq(dim_index, 0) && index < m_padding[dim_index].first) || (!internal::index_pair_second_statically_eq(dim_index, 0) && index >= m_dimensions[dim_index] - m_padding[dim_index].second); -#else - return (index < m_padding[dim_index].first) || - (index >= m_dimensions[dim_index] - m_padding[dim_index].second); -#endif } EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool isLeftPaddingCompileTimeZero( int dim_index) const { -#if defined(EIGEN_HAS_INDEX_LIST) return internal::index_pair_first_statically_eq(dim_index, 0); -#else - EIGEN_UNUSED_VARIABLE(dim_index); - return false; -#endif } EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool isRightPaddingCompileTimeZero( int dim_index) const { -#if defined(EIGEN_HAS_INDEX_LIST) return internal::index_pair_second_statically_eq(dim_index, 0); -#else - EIGEN_UNUSED_VARIABLE(dim_index); - return false; -#endif } diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h index 034252874..8bbe49edc 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h @@ -108,7 +108,6 @@ struct preserve_inner_most_dims { static const bool value = false; }; -#if EIGEN_HAS_CONSTEXPR template struct are_inner_most_dims{ static const bool tmp1 = indices_statically_known_to_increase(); @@ -137,7 +136,6 @@ struct preserve_inner_most_dims{ static const bool tmp2 = index_statically_lt(array_size::value - 1, NumTensorDims - 1); static const bool value = tmp1 & tmp2; }; -#endif template diff --git a/unsupported/test/cxx11_tensor_argmax_sycl.cpp b/unsupported/test/cxx11_tensor_argmax_sycl.cpp index 7ac71286e..41ea3cf7b 100644 --- a/unsupported/test/cxx11_tensor_argmax_sycl.cpp +++ b/unsupported/test/cxx11_tensor_argmax_sycl.cpp @@ -16,7 +16,6 @@ #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int64_t #define EIGEN_USE_SYCL -#define EIGEN_HAS_CONSTEXPR 1 #include "main.h" diff --git a/unsupported/test/cxx11_tensor_broadcasting.cpp b/unsupported/test/cxx11_tensor_broadcasting.cpp index 1523657de..2da35e4af 100644 --- a/unsupported/test/cxx11_tensor_broadcasting.cpp +++ b/unsupported/test/cxx11_tensor_broadcasting.cpp @@ -116,15 +116,7 @@ static void test_static_broadcasting() Tensor tensor(8,3,5); tensor.setRandom(); -#if defined(EIGEN_HAS_INDEX_LIST) Eigen::IndexList, Eigen::type2index<3>, Eigen::type2index<4>> broadcasts; -#else - Eigen::array broadcasts; - broadcasts[0] = 2; - broadcasts[1] = 3; - broadcasts[2] = 4; -#endif - Tensor broadcast; broadcast = tensor.broadcast(broadcasts); diff --git a/unsupported/test/cxx11_tensor_index_list.cpp b/unsupported/test/cxx11_tensor_index_list.cpp index 2166532c8..e8e101f3d 100644 --- a/unsupported/test/cxx11_tensor_index_list.cpp +++ b/unsupported/test/cxx11_tensor_index_list.cpp @@ -11,8 +11,6 @@ #include -#ifdef EIGEN_HAS_INDEX_LIST - static void test_static_index_list() { Tensor tensor(2,3,5,7); @@ -370,16 +368,12 @@ static void test_dim_check() } -#endif - EIGEN_DECLARE_TEST(cxx11_tensor_index_list) { -#ifdef EIGEN_HAS_INDEX_LIST CALL_SUBTEST(test_static_index_list()); CALL_SUBTEST(test_type2index_list()); CALL_SUBTEST(test_type2indexpair_list()); CALL_SUBTEST(test_dynamic_index_list()); CALL_SUBTEST(test_mixed_index_list()); CALL_SUBTEST(test_dim_check()); -#endif } diff --git a/unsupported/test/cxx11_tensor_morphing.cpp b/unsupported/test/cxx11_tensor_morphing.cpp index ed5d5ade3..d039a7e6b 100644 --- a/unsupported/test/cxx11_tensor_morphing.cpp +++ b/unsupported/test/cxx11_tensor_morphing.cpp @@ -43,7 +43,6 @@ static void test_simple_reshape() template static void test_static_reshape() { -#if defined(EIGEN_HAS_INDEX_LIST) using Eigen::type2index; Tensor tensor(2, 3, 1, 7, 1); @@ -60,7 +59,6 @@ static void test_static_reshape() { } } } -#endif } template diff --git a/unsupported/test/cxx11_tensor_reduction.cpp b/unsupported/test/cxx11_tensor_reduction.cpp index 9648b9c8b..a090e4a8f 100644 --- a/unsupported/test/cxx11_tensor_reduction.cpp +++ b/unsupported/test/cxx11_tensor_reduction.cpp @@ -370,13 +370,7 @@ static void test_static_dims() { Tensor out(72, 97); in.setRandom(); -#if !EIGEN_HAS_CONSTEXPR - array reduction_axis; - reduction_axis[0] = 1; - reduction_axis[1] = 3; -#else Eigen::IndexList, Eigen::type2index<3> > reduction_axis; -#endif out = in.maximum(reduction_axis); @@ -400,14 +394,8 @@ static void test_innermost_last_dims() { in.setRandom(); // Reduce on the innermost dimensions. -#if !EIGEN_HAS_CONSTEXPR - array reduction_axis; - reduction_axis[0] = 0; - reduction_axis[1] = 1; -#else // This triggers the use of packets for ColMajor. Eigen::IndexList, Eigen::type2index<1> > reduction_axis; -#endif out = in.maximum(reduction_axis); @@ -431,14 +419,8 @@ static void test_innermost_first_dims() { in.setRandom(); // Reduce on the innermost dimensions. -#if !EIGEN_HAS_CONSTEXPR - array reduction_axis; - reduction_axis[0] = 2; - reduction_axis[1] = 3; -#else // This triggers the use of packets for RowMajor. Eigen::IndexList, Eigen::type2index<3>> reduction_axis; -#endif out = in.maximum(reduction_axis); @@ -462,14 +444,8 @@ static void test_reduce_middle_dims() { in.setRandom(); // Reduce on the innermost dimensions. -#if !EIGEN_HAS_CONSTEXPR - array reduction_axis; - reduction_axis[0] = 1; - reduction_axis[1] = 2; -#else // This triggers the use of packets for RowMajor. Eigen::IndexList, Eigen::type2index<2>> reduction_axis; -#endif out = in.maximum(reduction_axis); diff --git a/unsupported/test/cxx11_tensor_reduction_sycl.cpp b/unsupported/test/cxx11_tensor_reduction_sycl.cpp index a297716e4..3afa62acf 100644 --- a/unsupported/test/cxx11_tensor_reduction_sycl.cpp +++ b/unsupported/test/cxx11_tensor_reduction_sycl.cpp @@ -16,7 +16,6 @@ #define EIGEN_DEFAULT_DENSE_INDEX_TYPE int64_t #define EIGEN_USE_SYCL -#define EIGEN_HAS_CONSTEXPR 1 #include "main.h"