mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-29 23:34:12 +08:00
Remove implicit this capture in lambdas
This commit is contained in:
parent
e44db21092
commit
b3e3b7b0ec
@ -932,7 +932,9 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
kernel(m, n, k, use_thread_local);
|
kernel(m, n, k, use_thread_local);
|
||||||
} else {
|
} else {
|
||||||
eigen_assert(!use_thread_local);
|
eigen_assert(!use_thread_local);
|
||||||
device_.enqueueNoNotification([=]() { kernel(m, n, k, use_thread_local); });
|
device_.enqueueNoNotification([this, m, n, k, use_thread_local]() {
|
||||||
|
kernel(m, n, k, use_thread_local);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -980,7 +982,9 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
} else {
|
} else {
|
||||||
while (end - start > 1) {
|
while (end - start > 1) {
|
||||||
Index mid = (start + end) / 2;
|
Index mid = (start + end) / 2;
|
||||||
device_.enqueueNoNotification([=]() { enqueue_packing_helper(mid, end, k, rhs); });
|
device_.enqueueNoNotification([this, mid, end, k, rhs]() {
|
||||||
|
enqueue_packing_helper(mid, end, k, rhs);
|
||||||
|
});
|
||||||
end = mid;
|
end = mid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -996,7 +1000,9 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
(k > 0 || std::this_thread::get_id() == created_by_thread_id_);
|
(k > 0 || std::this_thread::get_id() == created_by_thread_id_);
|
||||||
|
|
||||||
if (pack_async) {
|
if (pack_async) {
|
||||||
device_.enqueueNoNotification([=]() { enqueue_packing_helper(start, end, k, rhs); });
|
device_.enqueueNoNotification([this, start, end, k, rhs]() {
|
||||||
|
enqueue_packing_helper(start, end, k, rhs);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
enqueue_packing_helper(start, end, k, rhs);
|
enqueue_packing_helper(start, end, k, rhs);
|
||||||
}
|
}
|
||||||
@ -1277,7 +1283,9 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
|
|||||||
while (end_block_idx - start_block_idx > 1) {
|
while (end_block_idx - start_block_idx > 1) {
|
||||||
Index mid_block_idx = (start_block_idx + end_block_idx) / 2;
|
Index mid_block_idx = (start_block_idx + end_block_idx) / 2;
|
||||||
evaluator->m_device.enqueueNoNotification(
|
evaluator->m_device.enqueueNoNotification(
|
||||||
[this, mid_block_idx, end_block_idx]() { evalAsync<Alignment>(mid_block_idx, end_block_idx); });
|
[this, mid_block_idx, end_block_idx]() {
|
||||||
|
evalAsync<Alignment>(mid_block_idx, end_block_idx);
|
||||||
|
});
|
||||||
end_block_idx = mid_block_idx;
|
end_block_idx = mid_block_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ struct ThreadPoolDevice {
|
|||||||
// block_count leaves that do actual computations.
|
// block_count leaves that do actual computations.
|
||||||
Barrier barrier(static_cast<unsigned int>(block.count));
|
Barrier barrier(static_cast<unsigned int>(block.count));
|
||||||
std::function<void(Index, Index)> handleRange;
|
std::function<void(Index, Index)> handleRange;
|
||||||
handleRange = [=, &handleRange, &barrier, &f](Index firstIdx, Index lastIdx) {
|
handleRange = [this, block, &handleRange, &barrier, &f](Index firstIdx, Index lastIdx) {
|
||||||
while (lastIdx - firstIdx > block.size) {
|
while (lastIdx - firstIdx > block.size) {
|
||||||
// Split into halves and schedule the second half on a different thread.
|
// Split into halves and schedule the second half on a different thread.
|
||||||
const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size;
|
const Index midIdx = firstIdx + numext::div_ceil((lastIdx - firstIdx) / 2, block.size) * block.size;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user