[Openmp-commits] [PATCH] D45530: [OpenMP] Make bc file compilation sensitive to LIBOMPTARGET_NVPTX_DEBUG flag

Guansong Zhang via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Apr 11 10:28:14 PDT 2018


guansong created this revision.
guansong added a reviewer: grokos.
guansong added a project: OpenMP.
Herald added a subscriber: mgorny.
guansong retitled this revision from "Make bc file compilation sensitive to LIBOMPTARGET_NVPTX_DEBUG flag" to "[OpenMP] Make bc file compilation sensitive to LIBOMPTARGET_NVPTX_DEBUG flag".

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.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D45530

Files:
  libomptarget/deviceRTLs/nvptx/CMakeLists.txt


Index: libomptarget/deviceRTLs/nvptx/CMakeLists.txt
===================================================================
--- libomptarget/deviceRTLs/nvptx/CMakeLists.txt
+++ libomptarget/deviceRTLs/nvptx/CMakeLists.txt
@@ -142,6 +142,15 @@
         set(CUDA_PTX_VERSION ptx42)
       endif()
  
+      # Activate RTL message dumps if requested by the user.
+      set(LIBOMPTARGET_BC_DEBUG FALSE CACHE BOOL
+        "Activate BC code device RTL debug messages.")
+      if(${LIBOMPTARGET_NVPTX_DEBUG})
+        set(BC_DEBUG -DOMPTARGET_NVPTX_DEBUG=-1)
+      else()
+        set(BC_DEBUG -DOMPTARGET_NVPTX_DEBUG=0)
+      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
@@ -151,7 +160,8 @@
           -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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45530.142040.patch
Type: text/x-patch
Size: 1162 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180411/0cb6025a/attachment-0001.bin>


More information about the Openmp-commits mailing list