Fix more cache size queries.

libeigen/eigen!2295
This commit is contained in:
Antonio Sánchez
2026-03-14 15:43:24 +00:00
parent 9ae0e0f195
commit b2f95d3733
2 changed files with 8 additions and 4 deletions

View File

@@ -129,8 +129,11 @@
#include <intrin.h> #include <intrin.h>
#endif #endif
// Required for querying cache sizes on macOS. // Required for querying cache sizes on Linux and macOS.
#if EIGEN_OS_MAC #if EIGEN_OS_LINUX
#include <unistd.h>
#elif EIGEN_OS_MAC
#include <sys/types.h>
#include <sys/sysctl.h> #include <sys/sysctl.h>
#endif #endif

View File

@@ -318,6 +318,7 @@ EIGEN_DECLARE_TEST(redux) {
// bool packets are typically 16 bytes (SSE) or 32 bytes (AVX). // bool packets are typically 16 bytes (SSE) or 32 bytes (AVX).
// Test sizes around common packet sizes to catch off-by-one in remainder loops. // Test sizes around common packet sizes to catch off-by-one in remainder loops.
const Index bsizes[] = {1, 2, 3, 7, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65, 127, 128, 129}; const Index bsizes[] = {1, 2, 3, 7, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65, 127, 128, 129};
EIGEN_UNUSED_VARIABLE(bsizes);
for (int si = 0; si < 18; ++si) { for (int si = 0; si < 18; ++si) {
CALL_SUBTEST_11(boolRedux(bsizes[si], 1)); // column vector CALL_SUBTEST_11(boolRedux(bsizes[si], 1)); // column vector
CALL_SUBTEST_11(boolRedux(1, bsizes[si])); // row vector CALL_SUBTEST_11(boolRedux(1, bsizes[si])); // row vector