How to programmatically get the CPU cache page size in C++?

后端 未结 7 1568
渐次进展
渐次进展 2020-12-13 04:49

I\'d like my program to read the cache line size of the CPU it\'s running on in C++.

I know that this can\'t be done portably, so I will need a solution for Linux an

相关标签:
7条回答
  • 2020-12-13 05:52

    On Linux try the proccpuinfo library, an architecture independent C API for reading /proc/cpuinfo

    0 讨论(0)
提交回复
热议问题