From 6e654f33794df0b329160d011e6d3ec035e679ae Mon Sep 17 00:00:00 2001 From: Eugene Zhulenev Date: Mon, 16 Jul 2018 14:26:39 -0700 Subject: [PATCH] Reduce number of allocations in TensorContractionThreadPool. --- .../CXX11/src/Tensor/TensorContractionThreadPool.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h index c774d15e2..8b86d7aaf 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h @@ -598,11 +598,13 @@ struct TensorEvaluator 1) { + Index mid = (start + end) / 2; + device_.enqueueNoNotification( + [=]() { enqueue_packing_helper(mid, end, k, rhs); }); + end = mid; + } + enqueue_packing_helper(start, end, k, rhs); } }