[Openmp-commits] [PATCH] D107008: [OpenMP] Clean up for hidden helper task

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 29 16:12:39 PDT 2021


tianshilei1992 added inline comments.


================
Comment at: openmp/runtime/src/kmp_taskdeps.h:148-151
+            kmp_int32 encountering_gtid =
+                next_taskdata->td_alloc_thread->th.th_info.ds.ds_gtid;
+            kmp_int32 encountering_tid = __kmp_tid_from_gtid(encountering_gtid);
+            __kmpc_give_task(successor->dn.task, encountering_tid);
----------------
protze.joachim wrote:
> This shouldn't be the encountering tid, but any random number in [0,teamsize).
> The value is used as an index to the array of threads for the team to which the task binds.
`__kmp_tid_from_gtid` can make sure we get the right `tid`, aka `[0, team size)`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107008/new/

https://reviews.llvm.org/D107008



More information about the Openmp-commits mailing list