Only prepare GPU with usecuda
Added custom reduction (based on NVIDIA example).