title: Atomic max for floats in OpenCL
body: <p>I need an atomic max function for floats in OpenCL. This is my current naive code using atomic_xchg</p>
  
  <pre><code>float value = data[index];
  if ( value  &gt; *max_value )
  {
      atomic_xchg(max_value, value);
  }
  </code></pre>
  
  <p>This code gives the correct result when using an Intel CPU, but not for a Nvidia GPU. Is this code correct, or can anyone help me?</p>