forked from OSchip/llvm-project
[OpenMP] libomp: fix mutexinoutset dependence for proxy tasks
Once __kmp_task_finish is not executed for proxy tasks, move mutexinoutset dependency code to __kmp_release_deps which is executed for all task kinds. Differential Revision: https://reviews.llvm.org/D92326
This commit is contained in:
parent
78c04fe99e
commit
f6f28b44ad
|
@ -89,6 +89,16 @@ static inline void __kmp_release_deps(kmp_int32 gtid, kmp_taskdata_t *task) {
|
|||
kmp_info_t *thread = __kmp_threads[gtid];
|
||||
kmp_depnode_t *node = task->td_depnode;
|
||||
|
||||
// Check mutexinoutset dependencies, release locks
|
||||
if (UNLIKELY(node && (node->dn.mtx_num_locks < 0))) {
|
||||
// negative num_locks means all locks were acquired
|
||||
node->dn.mtx_num_locks = -node->dn.mtx_num_locks;
|
||||
for (int i = node->dn.mtx_num_locks - 1; i >= 0; --i) {
|
||||
KMP_DEBUG_ASSERT(node->dn.mtx_locks[i] != NULL);
|
||||
__kmp_release_lock(node->dn.mtx_locks[i], gtid);
|
||||
}
|
||||
}
|
||||
|
||||
if (task->td_dephash) {
|
||||
KA_TRACE(
|
||||
40, ("__kmp_release_deps: T#%d freeing dependencies hash of task %p.\n",
|
||||
|
|
|
@ -849,17 +849,6 @@ static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task,
|
|||
}
|
||||
}
|
||||
|
||||
// Check mutexinoutset dependencies, release locks
|
||||
kmp_depnode_t *node = taskdata->td_depnode;
|
||||
if (node && (node->dn.mtx_num_locks < 0)) {
|
||||
// negative num_locks means all locks were acquired
|
||||
node->dn.mtx_num_locks = -node->dn.mtx_num_locks;
|
||||
for (int i = node->dn.mtx_num_locks - 1; i >= 0; --i) {
|
||||
KMP_DEBUG_ASSERT(node->dn.mtx_locks[i] != NULL);
|
||||
__kmp_release_lock(node->dn.mtx_locks[i], gtid);
|
||||
}
|
||||
}
|
||||
|
||||
// bookkeeping for resuming task:
|
||||
// GEH - note tasking_ser => task_serial
|
||||
KMP_DEBUG_ASSERT(
|
||||
|
|
Loading…
Reference in New Issue