title: How does ATLAS tuning work?
body: <p>It's fairly well-known that ATLAS uses "blocking" or "tiling" versions of matrix computation algorithms, which substantially improve performance.</p>
  
  <p>It also appears that ATLAS has some <a href="http://math-atlas.sourceforge.net/faq.html#WhyDef" rel="nofollow">architectural defaults</a>, which have been computed manually. And it's possible to do a search to determine other values for <code>NB</code> (a <code>#define</code> macro which I believe stands for number of blocks).</p>
  
  <p>But how does it work? How are the values determined? Do the algorithms just run a bunch of times with different values, Monte Carlo style, until some kind of optimum is found?</p>
  
  <p>Here's a hypothetical, too. Let's say you copied a blocked ATLAS algorithm into C++ templates and had a 128-bit rational type. Could you derive <code>NB</code> for the rational version of the algorithm in some way from an ATLAS-tuned <code>NB</code> value from the double version of the algorithm?</p>