aboutsummaryrefslogtreecommitdiff
path: root/libgomp/task.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-10-12 18:39:20 +0200
committerJakub Jelinek <jakub@redhat.com>2022-10-12 18:39:20 +0200
commit0ec4e93fb9fa5e9d2424683c5fab1310c8ae2f76 (patch)
treefc09141e665147810f3e29e784bf0d1cb5f61fdc /libgomp/task.c
parenta58a965eb73253759f6a3e1c7380392557da89c8 (diff)
downloadgcc-0ec4e93fb9fa5e9d2424683c5fab1310c8ae2f76.zip
gcc-0ec4e93fb9fa5e9d2424683c5fab1310c8ae2f76.tar.gz
gcc-0ec4e93fb9fa5e9d2424683c5fab1310c8ae2f76.tar.bz2
libgomp: Add omp_in_explicit_task support
This is pretty straightforward, if gomp_thread ()->task is NULL, it can't be explicit task, otherwise if gomp_thread ()->task->kind == GOMP_TASK_IMPLICIT, it is an implicit task, otherwise explicit task. 2022-10-12 Jakub Jelinek <jakub@redhat.com> * omp.h.in (omp_in_explicit_task): Declare. * omp_lib.h.in (omp_in_explicit_task): Likewise. * omp_lib.f90.in (omp_in_explicit_task): New interface. * libgomp.map (OMP_5.2): New symbol version, export omp_in_explicit_task and omp_in_explicit_task_. * task.c (omp_in_explicit_task): New function. * fortran.c (omp_in_explicit_task): Add ialias_redirect. (omp_in_explicit_task_): New function. * libgomp.texi (OpenMP 5.2): Mark omp_in_explicit_task as implemented. * testsuite/libgomp.c-c++-common/task-in-explicit-1.c: New test. * testsuite/libgomp.c-c++-common/task-in-explicit-2.c: New test. * testsuite/libgomp.c-c++-common/task-in-explicit-3.c: New test.
Diffstat (limited to 'libgomp/task.c')
-rw-r--r--libgomp/task.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libgomp/task.c b/libgomp/task.c
index 7766535..a7e67e8 100644
--- a/libgomp/task.c
+++ b/libgomp/task.c
@@ -2687,6 +2687,16 @@ omp_in_final (void)
ialias (omp_in_final)
+int
+omp_in_explicit_task (void)
+{
+ struct gomp_thread *thr = gomp_thread ();
+ struct gomp_task *task = thr->task;
+ return task && task->kind != GOMP_TASK_IMPLICIT;
+}
+
+ialias (omp_in_explicit_task)
+
void
omp_fulfill_event (omp_event_handle_t event)
{