Skip to content

Commit

Permalink
GOMP compatibility: add missing OpenMP4.0 task deps handling code
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D31071

llvm-svn: 298605
  • Loading branch information
pawosm-arm committed Mar 23, 2017
1 parent e9ca32a commit 0788515
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion openmp/runtime/src/kmp_gsupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,11 @@ PARALLEL_LOOP_START(xexpand(KMP_API_NAME_GOMP_PARALLEL_LOOP_RUNTIME_START),

void
xexpand(KMP_API_NAME_GOMP_TASK)(void (*func)(void *), void *data, void (*copy_func)(void *, void *),
long arg_size, long arg_align, bool if_cond, unsigned gomp_flags)
long arg_size, long arg_align, bool if_cond, unsigned gomp_flags
#if OMP_40_ENABLED
, void **depend
#endif
)
{
MKLOC(loc, "GOMP_task");
int gtid = __kmp_entry_gtid();
Expand Down Expand Up @@ -962,6 +966,23 @@ xexpand(KMP_API_NAME_GOMP_TASK)(void (*func)(void *), void *data, void (*copy_fu
}

if (if_cond) {
#if OMP_40_ENABLED
if (gomp_flags & 8) {
KMP_ASSERT(depend);
const size_t ndeps = (kmp_intptr_t)depend[0];
const size_t nout = (kmp_intptr_t)depend[1];
kmp_depend_info_t dep_list[ndeps];

for (size_t i = 0U; i < ndeps; i++) {
dep_list[i].base_addr = (kmp_intptr_t)depend[2U + i];
dep_list[i].len = 0U;
dep_list[i].flags.in = 1;
dep_list[i].flags.out = (i < nout);
}
__kmpc_omp_task_with_deps(&loc, gtid, task, ndeps, dep_list, 0, NULL);
}
else
#endif
__kmpc_omp_task(&loc, gtid, task);
}
else {
Expand Down

0 comments on commit 0788515

Please sign in to comment.