As briefly discussed in https://github.com/JuliaLang/julia/pull/22846 it would be quite useful for some algorithms to know the CPU cache size in order to branch based on the input size when looping over arrays. Right now I picked an arbitrary power of two that just happened to work on my laptop, and that really seems like a slippery sloppy slope.
On Linux, it looks like I can get the right information from /proc/cpuinfo, but I am somewhat clueless about and unable to test how to get this information on any other platform. So I'm a little wary of venturing into this area unguided ...
Does someone else have any experience with this? Or is this information already available somewhere undocumented? ... or documented? :slightly_frowning_face:
There is also https://github.com/m-j-w/CpuId.jl
We can have tighter integration of hwloc but don't use the cpuid package.
Is there anything to be done in base?
Depending on if there's any code in base that want to use this we might want to integrate it in base.
Let's hold off on that. It's easier to move it in if that turns out to be good than move it out.
Most helpful comment
https://github.com/JuliaParallel/Hwloc.jl