File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,10 @@ TILEDARRAY_PRAGMA_GCC(diagnostic pop)
6363#endif
6464#endif // EIGEN_USE_LAPACKE || EIGEN_USE_LAPACKE_STRICT
6565
66- #if EIGEN_VERSION_AT_LEAST(3, 5, 0)
67- #define EIGEN_HAS_MAJOR_VERSION_5 1
66+ // Eigen >= 5.x is last to support C++14, future releases require C++17
67+ // https://gitlab.com/libeigen/eigen/-/releases/5.0.0
68+ #if EIGEN_MAJOR_VERSION > 4
69+ #define EIGEN_HAS_CXX17 1
6870#endif
6971
7072TILEDARRAY_PRAGMA_GCC (diagnostic pop)
Original file line number Diff line number Diff line change 2929// #include <boost/container/detail/std_fwd.hpp>
3030
3131// fwddecl Eigen::aligned_allocator
32+ // N.B. with Eigen >= 5.x, aligned_allocator no longer inherits from
33+ // std::allocator https://gitlab.com/libeigen/eigen/-/merge_requests/1795
3234namespace Eigen {
3335template <class >
3436class aligned_allocator ;
Original file line number Diff line number Diff line change @@ -185,8 +185,8 @@ class Tensor {
185185 : range_(range), nbatch_(nbatch) {
186186 size_t size = range_.volume () * nbatch;
187187 allocator_type allocator;
188- #if EIGEN_HAS_MAJOR_VERSION_5
189- // Eigen >=3.5.0 returns nullptr if size=0
188+ #if EIGEN_HAS_CXX17
189+ // Eigen (>= 5.x) allocate returns nullptr if size=0
190190 auto * ptr = (!size && range_.rank ())
191191 ? static_cast <pointer>(std::malloc (size))
192192 : allocator.allocate (size);
@@ -233,8 +233,8 @@ class Tensor {
233233 : range_(std::move(range)), nbatch_(nbatch) {
234234 size_t size = range_.volume () * nbatch;
235235 allocator_type allocator;
236- #if EIGEN_HAS_MAJOR_VERSION_5
237- // Eigen >=3.5.0 returns nullptr if size=0
236+ #if EIGEN_HAS_CXX17
237+ // Eigen (>= 5.x) allocate returns nullptr if size=0
238238 auto * ptr = (!size && range_.rank ())
239239 ? static_cast <pointer>(std::malloc (size))
240240 : allocator.allocate (size);
You can’t perform that action at this time.
0 commit comments