diff options
author | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-08-17 10:12:12 +0000 |
---|---|---|
committer | Andrey Churbanov <Andrey.Churbanov@intel.com> | 2015-08-17 10:12:12 +0000 |
commit | ec23a956916807a66f1dbbfbaaeee94913495fc9 (patch) | |
tree | 221ec59749637671a3f669829660677c025e263c /openmp/runtime/src | |
parent | a39ef1c68fcd197ffb2fe148406492905376cda9 (diff) | |
download | bcm5719-llvm-ec23a956916807a66f1dbbfbaaeee94913495fc9.tar.gz bcm5719-llvm-ec23a956916807a66f1dbbfbaaeee94913495fc9.zip |
D11988: Force serial reduction when team size is 1
llvm-svn: 245209
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r-- | openmp/runtime/src/kmp_runtime.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/openmp/runtime/src/kmp_runtime.c b/openmp/runtime/src/kmp_runtime.c index 85c7bcc6c3c..6b2a5c69547 100644 --- a/openmp/runtime/src/kmp_runtime.c +++ b/openmp/runtime/src/kmp_runtime.c @@ -7641,7 +7641,9 @@ __kmp_determine_reduction_method( ident_t *loc, kmp_int32 global_tid, // KMP_FORCE_REDUCTION - if( __kmp_force_reduction_method != reduction_method_not_defined ) { + // If the team is serialized (team_size == 1), ignore the forced reduction + // method and stay with the unsynchronized method (empty_reduce_block) + if( __kmp_force_reduction_method != reduction_method_not_defined && team_size != 1) { PACKED_REDUCTION_METHOD_T forced_retval; @@ -7651,9 +7653,6 @@ __kmp_determine_reduction_method( ident_t *loc, kmp_int32 global_tid, { case critical_reduce_block: KMP_ASSERT( lck ); // lck should be != 0 - if( team_size <= 1 ) { - forced_retval = empty_reduce_block; - } break; case atomic_reduce_block: |