[Openmp-commits] [openmp] db32c4f - [OpenMP] Disable libomptarget profiling by default if built via the "runtimes" setup

Martin Storsjö via Openmp-commits openmp-commits at lists.llvm.org
Tue Dec 7 12:24:11 PST 2021


Author: Martin Storsjö
Date: 2021-12-07T22:23:50+02:00
New Revision: db32c4f45625dddc2c5cb683adf3d9cab7a9732f

URL: https://github.com/llvm/llvm-project/commit/db32c4f45625dddc2c5cb683adf3d9cab7a9732f
DIFF: https://github.com/llvm/llvm-project/commit/db32c4f45625dddc2c5cb683adf3d9cab7a9732f.diff

LOG: [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

Added: 
    

Modified: 
    openmp/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/CMakeLists.txt b/openmp/CMakeLists.txt
index c164f47681988..7f11a05f56227 100644
--- a/openmp/CMakeLists.txt
+++ b/openmp/CMakeLists.txt
@@ -61,10 +61,15 @@ if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG)
   set(ENABLE_LIBOMPTARGET OFF)
 endif()
 
+set(ENABLE_LIBOMPTARGET_PROFILING OFF)
+if (ENABLE_LIBOMPTARGET AND NOT LLVM_RUNTIMES_BUILD)
+  set(ENABLE_LIBOMPTARGET_PROFILING ON)
+endif()
+
 option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
        ${ENABLE_LIBOMPTARGET})
 option(OPENMP_ENABLE_LIBOMPTARGET_PROFILING "Enable time profiling for libomptarget."
-       ${ENABLE_LIBOMPTARGET})
+       ${ENABLE_LIBOMPTARGET_PROFILING})
 option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
 
 # Build host runtime library, after LIBOMPTARGET variables are set since they are needed


        


More information about the Openmp-commits mailing list