Commits

Yibo Cai authored cde5a080062
ARROW-16478: [C++] Refine cpu info detection This patch separates OS and ARCH depdendent code and removes CPU frequency detection (cycles_per_ms()) which is brittle and not very useful in practice. There are still many caveats, especially for Arm platform. It's better to adopt a mature library if we want more complete functionalities. E.g., github.com/pytorch/cpuinfo. Below are examples of cpu info detected on various platforms (some from virtual machines). Intel, Linux ------------ Vendor: Intel Model: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz Features (set bits): 0 1 2 3 4 5 6 7 8 9 10 11 12 Cache sizes: 32768 1048576 37486592 AMD, Linux ---------- Vendor: AMD Model: AMD EPYC 7251 8-Core Processor Features (set bits): 0 1 2 3 4 5 11 12 Cache sizes: 32768 524288 33554432 Intel, MacOS ------------ Vendor: Unknown Model: Unknown Features (set bits): 0 1 2 3 4 Cache sizes: 32768 262144 12582912 Intel, Windows -------------- Vendor: Intel Model: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz\0\0 Features (set bits): 0 1 2 3 4 5 6 7 8 9 10 11 12 Cache sizes: 131072 2097152 37486592 Intel, MinGW ------------ Vendor: Intel Model: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz\0\0\0\0\0\0\0 Features (set bits): 0 1 2 3 4 5 11 12 Cache sizes: 131072 524288 52428800 Arm, Linux ---------- Vendor: Unknown Model: Unknown Features (set bits): 32 Cache sizes: 65536 1048576 Unknown Arm, MacOS ---------- Vendor: Unknown Model: Unknown Features (set bits): 32 Cache sizes: 65536 4194304 Unknown Closes #13112 from cyb70289/cpuinfo-refine Authored-by: Yibo Cai <yibo.cai@arm.com> Signed-off-by: Yibo Cai <yibo.cai@arm.com>