summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuansong Zhang <zhang.guansong@gmail.com>2018-04-20 20:41:00 +0000
committerGuansong Zhang <zhang.guansong@gmail.com>2018-04-20 20:41:00 +0000
commit334c379e32b8fcc7f73ffaba3baf88a5be29a269 (patch)
treed269232019e34bbd47898b58c0697984b3328452
parent8368bd82c3df16526fbf23117cb89c10a0d96e9c (diff)
downloadbcm5719-llvm-334c379e32b8fcc7f73ffaba3baf88a5be29a269.tar.gz
bcm5719-llvm-334c379e32b8fcc7f73ffaba3baf88a5be29a269.zip
[OpenMP] Make bc file compilation sensitive to LIBOMPTARGET_NVPTX_DEBUG flag
Summary: The LIBOMPTARGET_NVPTX_DEBUG flag is inconsistent between using nvcc to generate .a file and clang to generate .bc file. Sync the two setting so we can get debug messages from the bc file path as well. Reviewers: grokos Subscribers: Hahnfeld, openmp-commits, mgorny Tags: #openmp Differential Revision: https://reviews.llvm.org/D45530 llvm-svn: 330477
-rw-r--r--openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt8
1 files changed, 7 insertions, 1 deletions
diff --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
index 312cc3de0f3..d9a76c2c6aa 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
+++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
@@ -141,6 +141,11 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND)
set(CUDA_PTX_VERSION ptx42)
endif()
+ set(BC_DEBUG -DOMPTARGET_NVPTX_DEBUG=0)
+ if(${LIBOMPTARGET_NVPTX_DEBUG})
+ set(BC_DEBUG -DOMPTARGET_NVPTX_DEBUG=-1)
+ endif()
+
# Set flags for Clang cuda compilation. Only Clang is supported because there is
# no other compiler capable of generating bitcode from cuda sources.
set(CUDA_FLAGS
@@ -149,7 +154,8 @@ if(LIBOMPTARGET_DEP_CUDA_FOUND)
-Xclang -target-feature
-Xclang +${CUDA_PTX_VERSION}
--cuda-device-only
- -DOMPTARGET_NVPTX_TEST=0 -DOMPTARGET_NVPTX_DEBUG=0
+ -DOMPTARGET_NVPTX_TEST=0
+ ${BC_DEBUG}
)
# CUDA 9 header files use the nv_weak attribute which clang is not yet prepared
OpenPOWER on IntegriCloud