diff options
Diffstat (limited to 'openmp/runtime/src/kmp_sched.cpp')
| -rw-r--r-- | openmp/runtime/src/kmp_sched.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/openmp/runtime/src/kmp_sched.cpp b/openmp/runtime/src/kmp_sched.cpp index 3700ee04da6..d402db1dd76 100644 --- a/openmp/runtime/src/kmp_sched.cpp +++ b/openmp/runtime/src/kmp_sched.cpp @@ -51,8 +51,9 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, void *codeptr #endif ) { - KMP_COUNT_BLOCK(OMP_FOR_static); - KMP_TIME_PARTITIONED_BLOCK(FOR_static_scheduling); + KMP_COUNT_BLOCK(OMP_LOOP_STATIC); + KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static); + KMP_PUSH_PARTITIONED_TIMER(OMP_loop_static_scheduling); typedef typename traits_t<T>::unsigned_t UT; typedef typename traits_t<T>::signed_t ST; @@ -151,7 +152,6 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, &(task_info->task_data), 0, codeptr); } #endif - KMP_COUNT_VALUE(FOR_static_iterations, 0); return; } @@ -254,7 +254,6 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, loc); } } - KMP_COUNT_VALUE(FOR_static_iterations, trip_count); /* compute remaining parameters */ switch (schedtype) { @@ -390,6 +389,26 @@ static void __kmp_for_static_init(ident_t *loc, kmp_int32 global_tid, } #endif +#if KMP_STATS_ENABLED + { + kmp_int64 t; + kmp_int64 u = (kmp_int64)(*pupper); + kmp_int64 l = (kmp_int64)(*plower); + kmp_int64 i = (kmp_int64)incr; + /* compute trip count */ + if (i == 1) { + t = u - l + 1; + } else if (i == -1) { + t = l - u + 1; + } else if (i > 0) { + t = (u - l) / i + 1; + } else { + t = (l - u) / (-i) + 1; + } + KMP_COUNT_VALUE(OMP_loop_static_iterations, t); + KMP_POP_PARTITIONED_TIMER(); + } +#endif return; } |

