[
https://issues.apache.org/jira/browse/ARROW-16478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17533721#comment-17533721
]
Yibo Cai commented on ARROW-16478:
----------------------------------
cpuinfo from pytoch looks a good implementation,
https://github.com/pytorch/cpuinfo.
The code is non-trivial. It's indeed very hard to write a robust cpu info
detection library due to the complexity of {{OS x Arch x Compiler}}.
*cpuinfo output on x86_64, Linux*
{code:bash}
$ ./cpu-info
Packages:
0: Intel Xeon Gold 5218
Microarchitectures:
32x Sky Lake
Cores:
0: 1 processor (0), Intel Sky Lake
......
$ ./cache-info
Max cache size (upper bound): 23068672 bytes
L1 instruction cache: 32 x 32 KB, 8-way set associative (64 sets), 64 byte
lines, shared by 1 processors
L1 data cache: 32 x 32 KB, 8-way set associative (64 sets), 64 byte lines,
shared by 1 processors
L2 unified cache: 32 x 1 MB (exclusive), 16-way set associative (1024 sets), 64
byte lines, shared by 1 processors
L3 unified cache: 2 x 22 MB (exclusive), 11-way set associative (32768 sets,
complex indexing), 64 byte lines, shared by 16 processors
$ ./isa-info
Scalar instructions:
LAHF/SAHF: yes
LZCNT: yes
POPCNT: yes
TBM: no
BMI: yes
BMI2: yes
ADCX/ADOX: yes
Memory instructions:
MOVBE: yes
PREFETCH: no
PREFETCHW: yes
PREFETCHWT1: no
CLZERO: no
SIMD extensions:
MMX: yes
MMX+: yes
3dnow!: no
3dnow!+: no
3dnow! Geode: no
DAZ: yes
SSE: yes
SSE2: yes
SSE3: yes
SSSE3: yes
SSE4.1: yes
SSE4.2: yes
SSE4a: no
Misaligned SSE: no
AVX: yes
FMA3: yes
FMA4: no
XOP: no
F16C: yes
AVX2: yes
AVX512F: yes
AVX512PF: no
AVX512ER: no
AVX512CD: yes
AVX512DQ: yes
AVX512BW: yes
AVX512VL: yes
AVX512IFMA: no
AVX512VBMI: no
AVX512VBMI2: no
AVX512BITALG: no
AVX512VPOPCNTDQ: no
AVX512VNNI: yes
AVX512BF16: no
AVX512VP2INTERSECT: no
AVX512_4VNNIW: no
AVX512_4FMAPS: no
Multi-threading extensions:
MONITOR/MWAIT: yes
MONITORX/MWAITX: no
CMPXCHG16B: yes
HLE: no
RTM: no
XTEST: no
RDPID: no
Cryptography extensions:
AES: yes
VAES: no
PCLMULQDQ: yes
VPCLMULQDQ: no
GFNI: no
RDRAND: yes
RDSEED: yes
SHA: no
Profiling instructions:
RDTSCP: yes
MPX: yes
System instructions:
CLWB: yes
FXSAVE/FXSTOR: yes
XSAVE/XSTOR: yes
{code}
> [C++] cpu_info.cc fails clang-12 debug build on Arm
> ---------------------------------------------------
>
> Key: ARROW-16478
> URL: https://issues.apache.org/jira/browse/ARROW-16478
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Reporter: Yibo Cai
> Assignee: Yibo Cai
> Priority: Major
> Fix For: 9.0.0
>
>
> {code:bash}
> ../src/arrow/util/cpu_info.cc:124:13: error: implicit conversion loses
> integer precision: '__ssize_t' (aka 'long') to 'int'
> [-Werror,-Wshorten-64-to-32]
> int res = getline(&content, &file_len, cache_file);
> ~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
> {code}
> Not a blocking issue IMO.
> Looks there are more code needs refine in cpu_info.cc.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)