mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-01 16:24:28 +08:00
Reduce number of allocations in TensorContractionThreadPool.
This commit is contained in:
parent
7ccb623746
commit
6e654f3379
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user