Fix more cache size queries.

libeigen/eigen!2296
This commit is contained in:
Antonio Sánchez
2026-03-14 16:07:44 +00:00
parent b2f95d3733
commit 929785924c
2 changed files with 3 additions and 3 deletions

View File

@@ -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<int>(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);

View File

@@ -14,8 +14,8 @@
#include "main.h"
template <typename MatrixType>
void matrixRedux(const MatrixType& m) {
template <typename MatrixType>
void matrixRedux(const MatrixType& m) {
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;