Izza Izza - 3 months ago 40
C++ Question

Finding the cache block size

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

Answer

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