[Openmp-commits] [PATCH] D77609: [OpenMP][WIP] Added the support for unshackled task in RTL
Alex via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Sep 1 04:57:23 PDT 2020
adurang added inline comments.
================
Comment at: openmp/runtime/src/kmp_tasking.cpp:3771
+ if (task_team)
+ while (KMP_ATOMIC_LD_ACQ(&task_team->tt.tt_unfinished_unshackled_tasks))
+ ;
----------------
tianshilei1992 wrote:
> tianshilei1992 wrote:
> > adurang wrote:
> > > It seems to me that this is forcing any taskwait (and possibly taskgroup) to wait for any outstanding "async target" that exist on the team irrespectively of being a part of that synchronization domain or not.
> > Not any async target. Only those created in the team.
> Sorry I still didn't understand this part. Could you please expatiate it?
For the code below:
```
#pragma omp parallel num_threads(2)
{
#pragma omp target nowait
blah()
#pragma omp taskwait
}
```
With your current code (because you're using a shared counter for the whole team), both thread 1 and 2 are waiting for each others target regions ( so for example, even if target-th1 was finished thread1 would be blocked until target-th2 was completed). Each taskwait should only be waiting for their own child target tasks.
Hope this helps.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77609/new/
https://reviews.llvm.org/D77609
More information about the Openmp-commits
mailing list