[Openmp-commits] [openmp] b1ce454 - [OpenMP] Remove macro guards for device debugging

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Tue Oct 19 09:22:01 PDT 2021


Author: Joseph Huber
Date: 2021-10-19T12:21:43-04:00
New Revision: b1ce4549307d776a045d09c9d30433757ec36981

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

LOG: [OpenMP] Remove macro guards for device debugging

The plugin currently uses a macro to check if this is a debug built
before assigning the debug kind variable to the device environment
struct. This is being deprecated because the new device runtime does not
maintain separate debug builds and should always be availible.

Reviewed By: tianshilei1992

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

Added: 
    

Modified: 
    openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
    openmp/libomptarget/plugins/cuda/src/rtl.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
index 3c70bcd98e79e..cd9f02902be12 100644
--- a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
@@ -1321,11 +1321,9 @@ struct device_environment {
     host_device_env.DeviceNum = device_id;
     host_device_env.DebugKind = 0;
     host_device_env.DynamicMemSize = 0;
-#ifdef OMPTARGET_DEBUG
     if (char *envStr = getenv("LIBOMPTARGET_DEVICE_RTL_DEBUG")) {
       host_device_env.DebugKind = std::stoi(envStr);
     }
-#endif
 
     int rc = get_symbol_info_without_loading((char *)image->ImageStart,
                                              img_size, sym(), &si);

diff  --git a/openmp/libomptarget/plugins/cuda/src/rtl.cpp b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
index 966c42ad05e13..90b6281e3e137 100644
--- a/openmp/libomptarget/plugins/cuda/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/cuda/src/rtl.cpp
@@ -892,10 +892,8 @@ class DeviceRTLTy {
                                     static_cast<uint32_t>(DeviceId),
                                     static_cast<uint32_t>(DynamicMemorySize)};
 
-#ifdef OMPTARGET_DEBUG
       if (const char *EnvStr = getenv("LIBOMPTARGET_DEVICE_RTL_DEBUG"))
         DeviceEnv.DebugKind = std::stoi(EnvStr);
-#endif
 
       const char *DeviceEnvName = "omptarget_device_environment";
       CUdeviceptr DeviceEnvPtr;


        


More information about the Openmp-commits mailing list