Reduce number of allocations in TensorContractionThreadPool.

This commit is contained in:
Eugene Zhulenev 2018-07-16 14:26:39 -07:00
parent 7ccb623746
commit 6e654f3379

View File

@ -598,11 +598,13 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
else else
pack_lhs(start, k); pack_lhs(start, k);
} else { } else {
while (end - start > 1) {
Index mid = (start + end) / 2; Index mid = (start + end) / 2;
device_.enqueueNoNotification( device_.enqueueNoNotification(
[=]() { enqueue_packing_helper(mid, end, k, rhs); }); [=]() { enqueue_packing_helper(mid, end, k, rhs); });
device_.enqueueNoNotification( end = mid;
[=]() { enqueue_packing_helper(start, mid, k, rhs); }); }
enqueue_packing_helper(start, end, k, rhs);
} }
} }