Skip to content

Commit db32c4f

Browse files
committed
[OpenMP] Disable libomptarget profiling by default if built via the "runtimes" setup
In the "runtimes" setup, the runtime (e.g. OpenMP) can be built for a target entirely different from the current host build (where LLVM and Clang are built). If profiling is enabled, libomptarget links against LLVMSupport (which only has been built for the host). Thus, don't enable profiling by default in this setup. This should allow relanding D113253. Differential Revision: https://reviews.llvm.org/D114083
1 parent 6116ff2 commit db32c4f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

openmp/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,15 @@ if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG)
6161
set(ENABLE_LIBOMPTARGET OFF)
6262
endif()
6363

64+
set(ENABLE_LIBOMPTARGET_PROFILING OFF)
65+
if (ENABLE_LIBOMPTARGET AND NOT LLVM_RUNTIMES_BUILD)
66+
set(ENABLE_LIBOMPTARGET_PROFILING ON)
67+
endif()
68+
6469
option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
6570
${ENABLE_LIBOMPTARGET})
6671
option(OPENMP_ENABLE_LIBOMPTARGET_PROFILING "Enable time profiling for libomptarget."
67-
${ENABLE_LIBOMPTARGET})
72+
${ENABLE_LIBOMPTARGET_PROFILING})
6873
option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
6974

7075
# Build host runtime library, after LIBOMPTARGET variables are set since they are needed

0 commit comments

Comments
 (0)