title: CUDA register usage
body: <p>CUDA manual specifies the number of <strong>32-bit</strong> registers per multiprocessor. Does it mean that:</p>
  
  <ol>
  <li><p>Double variable takes two registers?</p></li>
  <li><p>Pointer variable takes two registers? - It has to be more than one register on Fermi with 6 GB memory, right?</p></li>
  <li><p>If answer to question 2 is yes, it must be better to use less pointer variables and more <code>int</code> indices.</p>
  
  <p>E. g., this kernel code:</p>
  
  <pre><code>float* p1;               // two regs
  float* p2 = p1 + 1000;   // two regs
  int i;                   // one reg
  for ( i = 0; i &lt; n; i++ )
  {
      CODE THAT USES p1[i] and p2[i]
  }
  </code></pre>
  
  <p>theoretically requires more registers than this kernel code:</p>
  
  <pre><code>float* p1;               // two regs
  int i;                   // one reg
  int j;                   // one reg
  for ( i = 0, j = 1000; i &lt; n; i++, j++ )
  {
      CODE THAT USES p1[i] and p1[j]
  }
  </code></pre></li>
  </ol>