diff options
| author | AndreyChurbanov <andrey.churbanov@intel.com> | 2021-07-30 17:04:42 +0300 |
|---|---|---|
| committer | AndreyChurbanov <andrey.churbanov@intel.com> | 2021-07-30 17:04:42 +0300 |
| commit | 8b81524c6dd27b8dd7a36d525e5569cdf8d5e188 (patch) | |
| tree | 5239589336ca8e5b3319eae0610175624ee5f9ae /openmp/runtime/src/kmp_tasking.cpp | |
| parent | 0a175ad445f095caf59f7175fbc035464919b7a3 (diff) | |
[OpenMP][NFC] libomp: silence warnings on unused variables.
Put declarations/definitions of unused variables under corresponding macros
to silence clang build warnings.
Differential Revision: https://reviews.llvm.org/D106608
Diffstat (limited to 'openmp/runtime/src/kmp_tasking.cpp')
| -rw-r--r-- | openmp/runtime/src/kmp_tasking.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp index 9c840ab187c4..ea94b3c15c88 100644 --- a/openmp/runtime/src/kmp_tasking.cpp +++ b/openmp/runtime/src/kmp_tasking.cpp @@ -825,8 +825,9 @@ static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task, kmp_info_t *thread = __kmp_threads[gtid]; kmp_task_team_t *task_team = thread->th.th_task_team; // might be NULL for serial teams... +#if KMP_DEBUG kmp_int32 children = 0; - +#endif KA_TRACE(10, ("__kmp_task_finish(enter): T#%d finishing task %p and resuming " "task %p\n", gtid, taskdata, resumed_task)); @@ -942,8 +943,10 @@ static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task, taskdata->td_flags.hidden_helper) { __kmp_release_deps(gtid, taskdata); // Predecrement simulated by "- 1" calculation - children = - KMP_ATOMIC_DEC(&taskdata->td_parent->td_incomplete_child_tasks) - 1; +#if KMP_DEBUG + children = -1 + +#endif + KMP_ATOMIC_DEC(&taskdata->td_parent->td_incomplete_child_tasks); KMP_DEBUG_ASSERT(children >= 0); if (taskdata->td_taskgroup) KMP_ATOMIC_DEC(&taskdata->td_taskgroup->count); @@ -2832,15 +2835,14 @@ static kmp_task_t *__kmp_steal_task(kmp_info_t *victim_thr, kmp_int32 gtid, // We need to un-mark this victim as a finished victim. This must be done // before releasing the lock, or else other threads (starting with the // primary thread victim) might be prematurely released from the barrier!!! - kmp_int32 count; - - count = KMP_ATOMIC_INC(unfinished_threads); - +#if KMP_DEBUG + kmp_int32 count = +#endif + KMP_ATOMIC_INC(unfinished_threads); KA_TRACE( 20, ("__kmp_steal_task: T#%d inc unfinished_threads to %d: task_team=%p\n", gtid, count + 1, task_team)); - *thread_finished = FALSE; } TCW_4(victim_td->td.td_deque_ntasks, ntasks - 1); @@ -3032,9 +3034,10 @@ static inline int __kmp_execute_tasks_template( // done. This decrement might be to the spin location, and result in the // termination condition being satisfied. if (!*thread_finished) { - kmp_int32 count; - - count = KMP_ATOMIC_DEC(unfinished_threads) - 1; +#if KMP_DEBUG + kmp_int32 count = -1 + +#endif + KMP_ATOMIC_DEC(unfinished_threads); KA_TRACE(20, ("__kmp_execute_tasks_template: T#%d dec " "unfinished_threads to %d task_team=%p\n", gtid, count, task_team)); @@ -3885,11 +3888,12 @@ static void __kmp_first_top_half_finish_proxy(kmp_taskdata_t *taskdata) { } static void __kmp_second_top_half_finish_proxy(kmp_taskdata_t *taskdata) { +#if KMP_DEBUG kmp_int32 children = 0; - // Predecrement simulated by "- 1" calculation - children = - KMP_ATOMIC_DEC(&taskdata->td_parent->td_incomplete_child_tasks) - 1; + children = -1 + +#endif + KMP_ATOMIC_DEC(&taskdata->td_parent->td_incomplete_child_tasks); KMP_DEBUG_ASSERT(children >= 0); // Remove the imaginary children |
