fix performance issue of gpu reduction
Merge pull request #478 from jet47:gpu-reduction-fix