This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomp] omp_in_explicit_task() implementation.
ClosedPublic

Authored by AndreyChurbanov on Feb 28 2022, 12:01 PM.

Details

Summary

Implementation of OpenMP 5.2 omp_in_explicit_task().

Diff Detail

Event Timeline

AndreyChurbanov requested review of this revision.Feb 28 2022, 12:01 PM
jlpeyton accepted this revision.Mar 2 2022, 2:55 PM

LGTM

This revision is now accepted and ready to land.Mar 2 2022, 2:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 2:55 PM
protze.joachim added inline comments.
openmp/runtime/src/kmp_ftn_entry.h
1574

Is this code sufficient for all scenarios of lazily initialized OpenMP threads?
Should this function handle uninitialized

openmp/runtime/test/api/omp_in_explicit_task.c
33

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.

openmp/runtime/src/kmp_ftn_entry.h
1574

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.

openmp/runtime/test/api/omp_in_explicit_task.c
33

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.