Solved by ptrblck in post #2 
              
              
                A difference of approx 1e-6 is explainable due to the float32 precision. 
In practice you can ignore it. If you need a higher precision, you could use float64 instead. 
Note that your performance will suffer on the GPU. 
Here is another example. Clearly the sums should yield the same number. However…