summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
authorAndreyChurbanov <andrey.churbanov@intel.com>2019-11-27 15:26:51 +0300
committerAndreyChurbanov <andrey.churbanov@intel.com>2019-11-27 15:26:51 +0300
commitbd2fb41c2dd537d1ab0dbce5795a1fef3de6cd52 (patch)
tree54efca4c984ed33ea32a0056e3a7ddbc4202b852 /openmp/runtime/src
parent755dfaa1048ef216cfdce68b05185d8ab1b00ae7 (diff)
downloadbcm5719-llvm-bd2fb41c2dd537d1ab0dbce5795a1fef3de6cd52.tar.gz
bcm5719-llvm-bd2fb41c2dd537d1ab0dbce5795a1fef3de6cd52.zip
[openmp] Fixed nonmonotonic schedule when #threads > #chunks in a loop.
Differential Revision: https://reviews.llvm.org/D70713
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/kmp_dispatch.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/openmp/runtime/src/kmp_dispatch.cpp b/openmp/runtime/src/kmp_dispatch.cpp
index 161a2c69635..aee1a649741 100644
--- a/openmp/runtime/src/kmp_dispatch.cpp
+++ b/openmp/runtime/src/kmp_dispatch.cpp
@@ -379,14 +379,15 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
}
break;
} else {
- KD_TRACE(100, ("__kmp_dispatch_init_algorithm: T#%d falling-through to "
- "kmp_sch_static_balanced\n",
- gtid));
- schedule = kmp_sch_static_balanced;
- /* too few iterations: fall-through to kmp_sch_static_balanced */
+ /* too few chunks: switching to kmp_sch_dynamic_chunked */
+ schedule = kmp_sch_dynamic_chunked;
+ KD_TRACE(100, ("__kmp_dispatch_init_algorithm: T#%d switching to "
+ "kmp_sch_dynamic_chunked\n",
+ gtid));
+ if (pr->u.p.parm1 <= 0)
+ pr->u.p.parm1 = KMP_DEFAULT_CHUNK;
+ break;
} // if
- /* FALL-THROUGH to static balanced */
- KMP_FALLTHROUGH();
} // case
#endif
case kmp_sch_static_balanced: {
OpenPOWER on IntegriCloud