From 68ac5c1738083796084fb554c5d167056bb92fc8 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Mon, 29 Feb 2016 18:11:58 -0800 Subject: Improved the performance of large outer reductions on cuda --- unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h index bad5c1425..444766f96 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h @@ -281,7 +281,7 @@ __global__ void OuterReductionKernel(Reducer reducer, const Self input, Index nu } // Do the reduction. - const Index max_iter = num_preserved_coeffs * numext::maxi(1, (num_coeffs_to_reduce - NumPerThread + 1)); + const Index max_iter = num_preserved_coeffs * divup(num_coeffs_to_reduce, NumPerThread); for (Index i = thread_id; i < max_iter; i += num_threads) { const Index input_col = i % num_preserved_coeffs; const Index input_row = (i / num_preserved_coeffs) * NumPerThread; -- cgit v1.2.3