Cuda reductions

Resolved issues in previous pull request pointed out by @clementfarabet  (min/max/sum can now be called without passing in the output tensor) as well as a bug pointed out by @koraykv