[Openmp-commits] [openmp] fb12df4 - [OpenMP][NVPTX] Disable building NVPTX deviceRTL by default on a non-CUDA system

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 27 14:11:01 PST 2021


Author: Shilei Tian
Date: 2021-01-27T17:06:14-05:00
New Revision: fb12df4a8e33d759938057718273dfb434b2d9c4

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

LOG: [OpenMP][NVPTX] Disable building NVPTX deviceRTL by default on a non-CUDA system

D95466 dropped CUDA to build NVPTX deviceRTL and enabled it by default.
However, the building requires some libraries that are not available on non-CUDA
system by default, which could break the compilation. This patch disabled the
build by default. It can be enabled with `LIBOMPTARGET_BUILD_NVPTX_BCLIB=ON`.

Reviewed By: kparzysz

Differential Revision: https://reviews.llvm.org/D95556

Added: 
    

Modified: 
    openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
index 4661bf08af1c..23efbba29d66 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
+++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
@@ -10,6 +10,15 @@
 #
 ##===----------------------------------------------------------------------===##
 
+# By default we will not build NVPTX deviceRTL on a non-CUDA
+set(LIBOMPTARGET_BUILD_NVPTX_BCLIB FALSE CACHE BOOL
+  "Whether build NVPTX deviceRTL on non-CUDA system.")
+
+if (NOT (LIBOMPTARGET_DEP_CUDA_FOUND OR LIBOMPTARGET_BUILD_NVPTX_BCLIB))
+  libomptarget_say("Not building NVPTX deviceRTL by default on non-CUDA system.")
+  return()
+endif()
+
 # Check if we can create an LLVM bitcode implementation of the runtime library
 # that could be inlined in the user application. For that we need to find
 # a Clang compiler capable of compiling our CUDA files to LLVM bitcode and


        


More information about the Openmp-commits mailing list