[Openmp-commits] [PATCH] D112083: [OpenMP] Remove macro guards for device debugging

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Oct 19 09:15:00 PDT 2021


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

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112083

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


Index: openmp/libomptarget/plugins/cuda/src/rtl.cpp
===================================================================
--- openmp/libomptarget/plugins/cuda/src/rtl.cpp
+++ openmp/libomptarget/plugins/cuda/src/rtl.cpp
@@ -892,10 +892,8 @@
                                     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;
Index: openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
===================================================================
--- openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
+++ openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
@@ -1321,11 +1321,9 @@
     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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112083.380709.patch
Type: text/x-patch
Size: 1320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20211019/986a4254/attachment.bin>


More information about the Openmp-commits mailing list