Skip to content

Commit 8e3d849

Browse files
authored
GH-47564: [C++] Update expected L2 CPU cache range to 32KiB-64MiB (#47563)
### Rationale for this change On newer Apple silicon CPUs there is more L2 CPU cache than expected by the current unit tests. This results in the unit test failing: ``` /tmp/nix-build-arrow-cpp-20.0.0.drv-0/source/cpp/src/arrow/util/io_util_test.cc:1099: Failure Value of: l2 >= 32 * 1024 && l2 <= 12 * 1024 * 1024 Actual: false Expected: true unexpected L2 size: 16777216 [ FAILED ] CpuInfo.Basic (0 ms) ``` ### What changes are included in this PR? The expected L2 CPU cache range is increased to 32KiB-64MiB to accommodate newer CPUs. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #47564 Authored-by: Artem Leshchev <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 5750e29 commit 8e3d849

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp/src/arrow/util/io_util_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,7 @@ TEST(CpuInfo, Basic) {
10961096
const auto l2 = ci->CacheSize(CpuInfo::CacheLevel::L2);
10971097
const auto l3 = ci->CacheSize(CpuInfo::CacheLevel::L3);
10981098
ASSERT_TRUE(l1 >= 4 * 1024 && l1 <= 512 * 1024) << "unexpected L1 size: " << l1;
1099-
ASSERT_TRUE(l2 >= 32 * 1024 && l2 <= 12 * 1024 * 1024) << "unexpected L2 size: " << l2;
1099+
ASSERT_TRUE(l2 >= 32 * 1024 && l2 <= 64 * 1024 * 1024) << "unexpected L2 size: " << l2;
11001100
ASSERT_TRUE(l3 >= 256 * 1024 && l3 <= 1024 * 1024 * 1024)
11011101
<< "unexpected L3 size: " << l3;
11021102
ASSERT_LE(l1, l2) << "L1 cache size " << l1 << " larger than L2 " << l2;

0 commit comments

Comments
 (0)