[Openmp-commits] [PATCH] D106229: [OpenMP][Offloading] Add -g when compiling deviceRTLs in debug mode

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Jul 17 18:08:00 PDT 2021


tianshilei1992 created this revision.
tianshilei1992 added reviewers: JonChesterfield, jdoerfert.
Herald added subscribers: guansong, yaxunl, mgorny, jvesely.
tianshilei1992 requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

Currently when we compile the project in debug mode, `-g` will not be added to
compilation flag. The bc files generated in different mode are of different size.
When using GPU debuggers like `cuda-gdb`, it is expected to provide more info
with a debug version of bc lib.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D106229

Files:
  openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
  openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt


Index: openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
===================================================================
--- openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
+++ openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
@@ -164,7 +164,7 @@
              -I${devicertl_nvptx_directory}/src)
 
 if(${LIBOMPTARGET_NVPTX_DEBUG})
-  list(APPEND bc_flags -DOMPTARGET_NVPTX_DEBUG=-1)
+  list(APPEND bc_flags -DOMPTARGET_NVPTX_DEBUG=-1 -g)
 else()
   list(APPEND bc_flags -DOMPTARGET_NVPTX_DEBUG=0)
 endif()
Index: openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
===================================================================
--- openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
+++ openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
@@ -54,7 +54,7 @@
 
 # Activate RTL message dumps if requested by the user.
 if(LIBOMPTARGET_NVPTX_DEBUG)
-  set(CUDA_DEBUG -DOMPTARGET_NVPTX_DEBUG=-1)
+  set(CUDA_DEBUG -DOMPTARGET_NVPTX_DEBUG=-1 -g)
 endif()
 
 get_filename_component(devicertl_base_directory


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106229.359591.patch
Type: text/x-patch
Size: 1022 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210718/899433b5/attachment-0001.bin>


More information about the Openmp-commits mailing list