title: cuda atomicAdd example fails to yield correct output
body: <p>The following code was written with the goal of incrementing a 100 element array of floats by 1 ten times. In the output, I was expecting a 100 element array of 10.0f value for each element. Instead, I get random values. Can you please point out my error here?</p>
  
  <pre><code>__global__  void testAdd(float *a)
  {
      float temp;
      for (int i = 0; i &lt; 100 ; i++)
      {
          a[i] = atomicAdd(&amp;a[i], 1.0f);
      }
  }
  void cuTestAtomicAdd(float *a)
  {
      testAdd&lt;&lt;&lt;1, 10&gt;&gt;&gt;(a);
  }
  </code></pre>
  
  <p>My goal is to understand the workings of atomic operations, so as to apply them elsewhere.</p>