From 929785924cf4c3d68946e9a24beebbd92b1d2b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20S=C3=A1nchez?= Date: Sat, 14 Mar 2026 16:07:44 +0000 Subject: [PATCH] Fix more cache size queries. libeigen/eigen!2296 --- Eigen/src/Core/util/Memory.h | 2 +- test/redux.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index efe0eb764..2d48eb538 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -1331,7 +1331,7 @@ inline void queryCacheSizes(int& l1, int& l2, int& l3) { val_size = sizeof(val); if (sysctlbyname("hw.l3cachesize", &val, &val_size, NULL, 0) == 0 && val > 0) l3 = static_cast(val); } -#elif defined(_SC_LEVEL1_DCACHE_SIZE) +#elif EIGEN_OS_UNIX && defined(_SC_LEVEL1_DCACHE_SIZE) // On Linux and other POSIX systems, use sysconf to query cache sizes. l1 = sysconf(_SC_LEVEL1_DCACHE_SIZE); l2 = sysconf(_SC_LEVEL2_CACHE_SIZE); diff --git a/test/redux.cpp b/test/redux.cpp index fa1ff994f..ad3ff1fe2 100644 --- a/test/redux.cpp +++ b/test/redux.cpp @@ -14,8 +14,8 @@ #include "main.h" - template - void matrixRedux(const MatrixType& m) { +template +void matrixRedux(const MatrixType& m) { typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar;