[Openmp-commits] [PATCH] D120671: [OpenMP][libomp] omp_in_explicit_task() implementation.
Andrey Churbanov via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Sat Mar 5 10:41:41 PST 2022
AndreyChurbanov added inline comments.
================
Comment at: openmp/runtime/src/kmp_ftn_entry.h:1574
+#else
+ int gtid = __kmp_entry_gtid();
+ return __kmp_thread_from_gtid(gtid)->th.th_current_task->td_flags.tasktype;
----------------
protze.joachim wrote:
> Is this code sufficient for all scenarios of lazily initialized OpenMP threads?
> Should this function handle uninitialized
The `__kmp_entry_gtid()` initializes the library if needed and initializes the calling thread including its implicit task.
Thus the structures cannot be uninitialized here.
================
Comment at: openmp/runtime/test/api/omp_in_explicit_task.c:32
+ }
+ #pragma omp task
+ {
----------------
protze.joachim wrote:
> Would it make sense to test different kinds of tasks, like undeferred (and detachable) tasks, instead of two simple tasks?
> At the moment it should not make a difference, but things might change in the future.
I doubt an explicit task can become implicit in future. That would be very strange. And we can always adjust the test in future, or write a new one for some particular case.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120671/new/
https://reviews.llvm.org/D120671
More information about the Openmp-commits
mailing list