diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-01-13 12:54:34 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-01-13 12:54:34 +0000 |
commit | 06e3950561a5cd59b1295ed66071c8a53af8067a (patch) | |
tree | 8d5a506d14048a39f4848331f636b161c4523c10 /openmp | |
parent | 31156bbdb9b3d27cf762eeec6a1b06db6d6c652c (diff) | |
download | llvm-06e3950561a5cd59b1295ed66071c8a53af8067a.zip llvm-06e3950561a5cd59b1295ed66071c8a53af8067a.tar.gz llvm-06e3950561a5cd59b1295ed66071c8a53af8067a.tar.bz2 |
[OpenMP] Fix LIBOMP_USE_DEBUGGER=ON build (PR38612)
Summary:
Two things:
1. Those two variables had the wrong sigdness, which was resulting in "sign mismatch in comparison" warning.
2. The whole `kmp_debugger.cpp` wasn't being built, or rather, it was being built as-if `USE_DEBUGGER` was off,
thus, nothing provided the definition of `__kmp_omp_debug_struct_info`, `__kmp_debugging`.
Makes sense, because `USE_DEBUGGER` is set in `kmp_config.h`, which is not included explicitly.
It is included by `kmp.h`, but that one is only included inside of the `#if USE_DEBUGGER` block..
I *think* this is the only source file with this issue,
everything else seem to `#include` either `kmp.h` or `kmp_config.h`.
The alternative solution would be to add `add_compile_options(-include kmp_config.h)` in CMake.
I did verify that `__kmp_omp_debug_struct_info` becomes available with this patch.
Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=38612 | PR38612 ]].
Reviewers: AndreyChurbanov, jlpeyton, Hahnfeld
Reviewed By: jlpeyton
Subscribers: guansong, jfb, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D55783
llvm-svn: 351019
Diffstat (limited to 'openmp')
-rw-r--r-- | openmp/runtime/src/kmp.h | 4 | ||||
-rw-r--r-- | openmp/runtime/src/kmp_debugger.cpp | 2 | ||||
-rw-r--r-- | openmp/runtime/src/kmp_global.cpp | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h index a1b9b7e..599cbf2 100644 --- a/openmp/runtime/src/kmp.h +++ b/openmp/runtime/src/kmp.h @@ -3160,9 +3160,9 @@ extern kmp_global_t __kmp_global; /* global status */ extern kmp_info_t __kmp_monitor; // For Debugging Support Library -extern std::atomic<kmp_uint32> __kmp_team_counter; +extern std::atomic<kmp_int32> __kmp_team_counter; // For Debugging Support Library -extern std::atomic<kmp_uint32> __kmp_task_counter; +extern std::atomic<kmp_int32> __kmp_task_counter; #if USE_DEBUGGER #define _KMP_GEN_ID(counter) \ diff --git a/openmp/runtime/src/kmp_debugger.cpp b/openmp/runtime/src/kmp_debugger.cpp index c02d251..8de2cba 100644 --- a/openmp/runtime/src/kmp_debugger.cpp +++ b/openmp/runtime/src/kmp_debugger.cpp @@ -1,3 +1,5 @@ +#include "kmp_config.h" + #if USE_DEBUGGER /* * kmp_debugger.cpp -- debugger support. diff --git a/openmp/runtime/src/kmp_global.cpp b/openmp/runtime/src/kmp_global.cpp index ef8a116..5f38009 100644 --- a/openmp/runtime/src/kmp_global.cpp +++ b/openmp/runtime/src/kmp_global.cpp @@ -60,8 +60,8 @@ int __kmp_init_counter = 0; int __kmp_root_counter = 0; int __kmp_version = 0; -std::atomic<kmp_uint32> __kmp_team_counter = ATOMIC_VAR_INIT(0); -std::atomic<kmp_uint32> __kmp_task_counter = ATOMIC_VAR_INIT(0); +std::atomic<kmp_int32> __kmp_team_counter = ATOMIC_VAR_INIT(0); +std::atomic<kmp_int32> __kmp_task_counter = ATOMIC_VAR_INIT(0); unsigned int __kmp_init_wait = KMP_DEFAULT_INIT_WAIT; /* initial number of spin-tests */ |