diff options
| author | protze@itc.rwth-aachen.de <protze@itc.rwth-aachen.de> | 2019-11-18 01:23:31 +0100 |
|---|---|---|
| committer | protze@itc.rwth-aachen.de <protze@itc.rwth-aachen.de> | 2019-11-18 14:45:34 +0100 |
| commit | 2b8115b10b03013b9f8ae0aa56b0cd6a6a6dd4fd (patch) | |
| tree | 0432a21c8abc89249de1eae88269a3d88388d68e /openmp/runtime/src | |
| parent | c070a27acc474a2e4a159d8797d4506bcbe71a30 (diff) | |
| download | bcm5719-llvm-2b8115b10b03013b9f8ae0aa56b0cd6a6a6dd4fd.tar.gz bcm5719-llvm-2b8115b10b03013b9f8ae0aa56b0cd6a6a6dd4fd.zip | |
[OpenMP] Add implementation and tests of Archer tool
The tool provides TSAN annotations for OpenMP synchronization. The tool
is activated if no other OMPT tool is loaded.
The tool detects whether the application was built with TSan and rejects
activation according to the OMPT protocol if there is no TSan-rt.
Differential Revision: https://reviews.llvm.org/D45890
Diffstat (limited to 'openmp/runtime/src')
| -rw-r--r-- | openmp/runtime/src/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | openmp/runtime/src/ompt-general.cpp | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt index a5654d6d5ec..9f46b4bd443 100644 --- a/openmp/runtime/src/CMakeLists.txt +++ b/openmp/runtime/src/CMakeLists.txt @@ -153,6 +153,7 @@ if(NOT LIBOMP_LIBRARY_DIR) else() set(LIBOMP_LIBRARY_DIR ${LIBOMP_LIBRARY_DIR} PARENT_SCOPE) endif() +set(LIBOMP_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE) # Add symbolic links to libomp if(NOT WIN32) diff --git a/openmp/runtime/src/ompt-general.cpp b/openmp/runtime/src/ompt-general.cpp index 41b2827007b..22eac2ebf7b 100644 --- a/openmp/runtime/src/ompt-general.cpp +++ b/openmp/runtime/src/ompt-general.cpp @@ -268,6 +268,22 @@ ompt_try_start_tool(unsigned int omp_version, const char *runtime_version) { } __kmp_str_free(&libs); } + if (ret) + return ret; + +#if KMP_OS_UNIX + { // Non-standard: load archer tool if application is built with TSan + const char *fname = "libarcher.so"; + void *h = dlopen(fname, RTLD_LAZY); + if (h) { + start_tool = (ompt_start_tool_t)dlsym(h, "ompt_start_tool"); + if (start_tool) + ret = (*start_tool)(omp_version, runtime_version); + if (ret) + return ret; + } + } +#endif return ret; } |

