2c16eb3157
This patch adds support for inoutset depend-kind in depend clauses. It is very similar to the in depend-kind in that a task with a dependency with that depend-kind is dependent on all previously created sibling tasks with matching address unless they have the same depend-kind. In the in depend-kind case everything is dependent except for in -> in dependency, for inoutset everything is dependent except for inoutset -> inoutset dependency. mutexinoutset is also similar (everything is dependent except for mutexinoutset -> mutexinoutset dependency), but there is also the additional restriction that only one task with mutexinoutset for each address can be scheduled at once (i.e. mutual exclusitivty). For now we support mutexinoutset the same as inout/out, but the inoutset support is full. In order not to bump the ABI for dependencies each time (we've bumped it already once, the old ABI supports only inout/out and in depend-kind, the new ABI supports inout/out, mutexinoutset, in and depobj), this patch arranges for inoutset to be at least for the time being always handled as if it was specified through depobj even when it is not. So it uses the new ABI for that and inoutset are represented like depobj - pointer to a pair of pointers where the first one will be the actual address of the object mentioned in depend clause and second pointer will be (void *) GOMP_DEPEND_INOUTSET. 2022-05-17 Jakub Jelinek <jakub@redhat.com> gcc/ * tree-core.h (enum omp_clause_depend_kind): Add OMP_CLAUSE_DEPEND_INOUTSET. * tree-pretty-print.cc (dump_omp_clause): Handle OMP_CLAUSE_DEPEND_INOUTSET. * gimplify.cc (gimplify_omp_depend): Likewise. * omp-low.cc (lower_depend_clauses): Likewise. gcc/c-family/ * c-omp.cc (c_finish_omp_depobj): Handle OMP_CLAUSE_DEPEND_INOUTSET. gcc/c/ * c-parser.cc (c_parser_omp_clause_depend): Parse inoutset depend-kind. (c_parser_omp_depobj): Likewise. gcc/cp/ * parser.cc (cp_parser_omp_clause_depend): Parse inoutset depend-kind. (cp_parser_omp_depobj): Likewise. * cxx-pretty-print.cc (cxx_pretty_printer::statement): Handle OMP_CLAUSE_DEPEND_INOUTSET. gcc/testsuite/ * c-c++-common/gomp/all-memory-1.c (boo): Add test with inoutset depend-kind. * c-c++-common/gomp/all-memory-2.c (boo): Likewise. * c-c++-common/gomp/depobj-1.c (f1): Likewise. (f2): Adjusted expected diagnostics. * g++.dg/gomp/depobj-1.C (f4): Adjust expected diagnostics. include/ * gomp-constants.h (GOMP_DEPEND_INOUTSET): Define. libgomp/ * libgomp.h (struct gomp_task_depend_entry): Change is_in type from bool to unsigned char. * task.c (gomp_task_handle_depend): Handle GOMP_DEPEND_INOUTSET. Ignore dependencies where task->depend[i].is_in && task->depend[i].is_in == ent->is_in rather than just task->depend[i].is_in && ent->is_in. Remember whether GOMP_DEPEND_IN loop is needed and guard the loop with that conditional. (gomp_task_maybe_wait_for_dependencies): Handle GOMP_DEPEND_INOUTSET. Ignore dependencies where elem.is_in && elem.is_in == ent->is_in rather than just elem.is_in && ent->is_in. * testsuite/libgomp.c-c++-common/depend-1.c (test): Add task with inoutset depend-kind. * testsuite/libgomp.c-c++-common/depend-2.c (test): Likewise. * testsuite/libgomp.c-c++-common/depend-3.c (test): Likewise. * testsuite/libgomp.c-c++-common/depend-inoutset-1.c: New test. |
||
---|---|---|
.. | ||
alloc-1.c | ||
alloc-2.c | ||
alloc-3.c | ||
alloc-4.c | ||
alloc-5.c | ||
alloc-6.c | ||
alloc-7.c | ||
alloc-8.c | ||
alloc-9.c | ||
alloc-10.c | ||
allocate-1.c | ||
allocate-2.c | ||
allocate-3.c | ||
atomic-18.c | ||
atomic-19.c | ||
atomic-20.c | ||
atomic-21.c | ||
cancel-parallel-1.c | ||
cancel-taskgroup-1.c | ||
cancel-taskgroup-2.c | ||
cancel-taskgroup-3.c | ||
cancel-taskgroup-4.c | ||
critical-hint-1.c | ||
critical-hint-2.c | ||
declare_target-1.c | ||
default-1.c | ||
depend-1.c | ||
depend-2.c | ||
depend-3.c | ||
depend-inoutset-1.c | ||
depend-iterator-1.c | ||
depend-iterator-2.c | ||
depend-mutexinout-1.c | ||
depend-mutexinout-2.c | ||
depobj-1.c | ||
display-affinity-1.c | ||
error-1.c | ||
for-1.c | ||
for-1.h | ||
for-2.c | ||
for-2.h | ||
for-3.c | ||
for-4.c | ||
for-5.c | ||
for-6.c | ||
for-7.c | ||
for-8.c | ||
for-9.c | ||
for-10.c | ||
for-11.c | ||
for-12.c | ||
for-13.c | ||
for-14.c | ||
for-15.c | ||
for-16.c | ||
function-not-offloaded-aux.c | ||
function-not-offloaded.c | ||
get-mapped-ptr-1.c | ||
get-mapped-ptr-2.c | ||
get-mapped-ptr-3.c | ||
get-mapped-ptr-4.c | ||
icv-3.c | ||
icv-4.c | ||
lastprivate-conditional-1.c | ||
lastprivate-conditional-2.c | ||
lastprivate-conditional-3.c | ||
lastprivate-conditional-4.c | ||
lastprivate-conditional-5.c | ||
lastprivate-conditional-6.c | ||
lastprivate-conditional-7.c | ||
lastprivate-conditional-8.c | ||
lastprivate-conditional-9.c | ||
lastprivate-conditional-10.c | ||
loop-1.c | ||
loop-13.c | ||
loop-14.c | ||
loop-15.c | ||
masked-1.c | ||
master-combined-1.c | ||
monotonic-1.c | ||
monotonic-2.c | ||
nested-parallel-unbalanced.c | ||
nonmonotonic-1.c | ||
nonmonotonic-2.c | ||
nothing-1.c | ||
on_device_arch.h | ||
order-reproducible-1.c | ||
order-reproducible-2.c | ||
ordered-4.c | ||
pause-1.c | ||
pause-2.c | ||
pr45784.c | ||
pr64824.c | ||
pr64868.c | ||
pr66199-1.c | ||
pr66199-2.c | ||
pr66199-3.c | ||
pr66199-4.c | ||
pr66199-5.c | ||
pr66199-6.c | ||
pr66199-7.c | ||
pr66199-8.c | ||
pr66199-9.c | ||
pr66199-10.c | ||
pr66199-11.c | ||
pr66199-12.c | ||
pr66199-13.c | ||
pr66199-14.c | ||
pr69389.c | ||
pr81875.c | ||
pr83046.c | ||
pr93515.c | ||
pr94366.c | ||
pr96390.c | ||
ptr-attach-1.c | ||
reduction-1.c | ||
reduction-2.c | ||
reduction-3.c | ||
reduction-4.c | ||
reduction-5.c | ||
reduction-6.c | ||
reduction-16.c | ||
reduction-17.c | ||
refcount-1.c | ||
scope-1.c | ||
simd-1.c | ||
simd-14.c | ||
simd-15.c | ||
simd-16.c | ||
simd-17.c | ||
struct-elem-1.c | ||
struct-elem-2.c | ||
struct-elem-3.c | ||
struct-elem-4.c | ||
struct-elem-5.c | ||
target-1.c | ||
target-2.c | ||
target-10.c | ||
target-13.c | ||
target-40.c | ||
target-41.c | ||
target-42.c | ||
target-45.c | ||
target-has-device-addr-1.c | ||
target-implicit-map-1.c | ||
target-implicit-map-2.c | ||
target-in-reduction-1.c | ||
target-in-reduction-2.c | ||
target-is-accessible-1.c | ||
target-same-name-1-a.c | ||
target-same-name-1-b.c | ||
target-same-name-1.c | ||
task-detach-1.c | ||
task-detach-2.c | ||
task-detach-3.c | ||
task-detach-4.c | ||
task-detach-5.c | ||
task-detach-6.c | ||
task-detach-7.c | ||
task-detach-8.c | ||
task-detach-9.c | ||
task-detach-10.c | ||
task-detach-11.c | ||
task-detach-12.c | ||
task-detach-13.c | ||
task-reduction-1.c | ||
task-reduction-2.c | ||
task-reduction-3.c | ||
task-reduction-4.c | ||
task-reduction-5.c | ||
task-reduction-6.c | ||
task-reduction-7.c | ||
task-reduction-8.c | ||
task-reduction-9.c | ||
task-reduction-11.c | ||
task-reduction-12.c | ||
task-reduction-13.c | ||
task-reduction-14.c | ||
task-reduction-15.c | ||
task-reduction-16.c | ||
taskgroup-1.c | ||
taskloop-1.c | ||
taskloop-2.c | ||
taskloop-3.c | ||
taskloop-4.c | ||
taskloop-5.c | ||
taskloop-reduction-1.c | ||
taskloop-reduction-2.c | ||
taskloop-reduction-3.c | ||
taskloop-reduction-4.c | ||
taskwait-depend-1.c | ||
teams-1.c | ||
teams-2.c | ||
thread-limit-1.c | ||
udr-1.c | ||
unmap-infinity-2.c | ||
variable-not-offloaded.c |