Search code examples
c++ubuntucpu-cache

Finding the cache block size


How do I find the cache block size in Ubuntu, programmatically (with C++) or otherwise?


Solution

  • You can find it in /proc/cpuinfo; cache size for the total size, and cache_alignment for the block size.