[Openmp-commits] [PATCH] D31071: GOMP compatibility: add missing OMP4.0 taskdeps handling code
Paul Osmialowski via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Mar 23 05:35:39 PDT 2017
pawosm01 updated this revision to Diff 92784.
pawosm01 added a comment.
now using gomp_flags
Repository:
rL LLVM
https://reviews.llvm.org/D31071
Files:
runtime/src/kmp_gsupport.cpp
Index: runtime/src/kmp_gsupport.cpp
===================================================================
--- runtime/src/kmp_gsupport.cpp
+++ runtime/src/kmp_gsupport.cpp
@@ -918,7 +918,11 @@
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();
@@ -962,6 +966,28 @@
}
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;
+ if (i >= nout) {
+ dep_list[i].flags.in = 1;
+ dep_list[i].flags.out = 0;
+ } else {
+ dep_list[i].flags.in = 1;
+ dep_list[i].flags.out = 1;
+ }
+ }
+ __kmpc_omp_task_with_deps(&loc, gtid, task, ndeps, dep_list, 0, NULL);
+ }
+ else
+#endif
__kmpc_omp_task(&loc, gtid, task);
}
else {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31071.92784.patch
Type: text/x-patch
Size: 1483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20170323/c5f1f670/attachment.bin>
More information about the Openmp-commits
mailing list