Is there a way to determine the optimal cache size (L1 and L2 possibly) within C#? I’m asking this because formally worked with: http://en.wikipedia.org/wiki/Loop_tiling Loop Tiling to make sure large data (for example Matrix Multiplications of like [3000] by [3000].
Currently I just ran multiple tests per computer, increasing block size, and grabbed the optimal cache that way but I am looking for a much faster run time calculator, or API, or something to help me determine this within C#.
AFAIK, C# is not a language that cares about such low-level questions. .Net Framework and the underlying OS should take care of that. It’s not your problem as a .Net programmer.
If you DO want to know, you’ll have to use/write a function/library in some lower level language like C/C++ (like this)