Sum reduction using thrust and the code from cuda_samples.