From 4357cfc7929ec794b4364846fd78f73c8d4f41cd Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Sun, 18 Jul 2021 09:34:35 -0400 Subject: [PATCH] [OpenMP][Offloading] Add -g when compiling deviceRTLs in debug mode 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. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D106229 --- openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt | 2 +- openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt index 1c5b485..6371230 100644 --- a/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt +++ b/openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt @@ -54,7 +54,7 @@ set(optimization_level 2) # 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 diff --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt index 243b0ff..5120a9c 100644 --- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt +++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt @@ -164,7 +164,7 @@ set(bc_flags -S -x c++ -O1 -std=c++14 -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() -- 2.7.4