mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-10-10 23:21:29 +08:00
Add a yield instruction in the two spinloops of the threaded matmul implementation.
This commit is contained in:
parent
99ffad1971
commit
ab310943d6
@ -97,6 +97,7 @@ struct general_matrix_matrix_product<Index, LhsScalar, LhsStorageOrder, Conjugat
|
|||||||
// Then, we set info->task_info[tid].users to the number of threads to mark that all other threads are going to
|
// Then, we set info->task_info[tid].users to the number of threads to mark that all other threads are going to
|
||||||
// use it.
|
// use it.
|
||||||
while (info->task_info[tid].users != 0) {
|
while (info->task_info[tid].users != 0) {
|
||||||
|
std::this_thread::yield();
|
||||||
}
|
}
|
||||||
info->task_info[tid].users = threads;
|
info->task_info[tid].users = threads;
|
||||||
|
|
||||||
@ -115,6 +116,7 @@ struct general_matrix_matrix_product<Index, LhsScalar, LhsStorageOrder, Conjugat
|
|||||||
// However, no need to wait for the B' part which has been updated by the current thread!
|
// However, no need to wait for the B' part which has been updated by the current thread!
|
||||||
if (shift > 0) {
|
if (shift > 0) {
|
||||||
while (info->task_info[i].sync != k) {
|
while (info->task_info[i].sync != k) {
|
||||||
|
std::this_thread::yield();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user