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 {
Index mid = (start + end) / 2; while (end - start > 1) {
device_.enqueueNoNotification( Index mid = (start + end) / 2;
[=]() { enqueue_packing_helper(mid, end, k, rhs); }); device_.enqueueNoNotification(
device_.enqueueNoNotification( [=]() { enqueue_packing_helper(mid, end, k, rhs); });
[=]() { enqueue_packing_helper(start, mid, k, rhs); }); end = mid;
}
enqueue_packing_helper(start, end, k, rhs);
} }
} }