[Openmp-commits] [openmp] 14d5754 - [NFC][OpenMP] Fix compile warnings introduced in recent patches

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Sat Aug 5 16:39:07 PDT 2023


Author: Shilei Tian
Date: 2023-08-05T19:38:45-04:00
New Revision: 14d57545b261f0ad09b7b4c78e6509c6f585448d

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

LOG: [NFC][OpenMP] Fix compile warnings introduced in recent patches

Added: 
    

Modified: 
    openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
    openmp/libomptarget/src/device.cpp
    openmp/libomptarget/src/interface.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
index d54982ea447091..0834c9f932db43 100644
--- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
+++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp
@@ -395,7 +395,7 @@ uint64_t GenericKernelTy::getNumBlocks(GenericDeviceTy &GenericDevice,
       MinThreads = std::min(MinThreads, NumThreads);
 
       // Honor the thread_limit clause; only lower the number of threads.
-      auto OldNumThreads = NumThreads;
+      [[maybe_unused]] auto OldNumThreads = NumThreads;
       if (LoopTripCount >= DefaultNumBlocks * NumThreads) {
         // Enough parallelism for teams and threads.
         TripCountNumBlocks = ((LoopTripCount - 1) / NumThreads) + 1;

diff  --git a/openmp/libomptarget/src/device.cpp b/openmp/libomptarget/src/device.cpp
index cb3d49913086f5..f4d2038c5cd3d8 100644
--- a/openmp/libomptarget/src/device.cpp
+++ b/openmp/libomptarget/src/device.cpp
@@ -542,7 +542,7 @@ void DeviceTy::init() {
     llvm::omp::target::UInt64Envar OMPX_DeviceMemorySize(
         "LIBOMPTARGET_RR_DEVMEM_SIZE", 16);
     DP("Activating Record-Replay for Device %d with %lu GB memory\n",
-       RTLDeviceID, OMPX_DeviceMemorySize);
+       RTLDeviceID, OMPX_DeviceMemorySize.get());
 
     RTL->activate_record_replay(RTLDeviceID,
                                 OMPX_DeviceMemorySize * 1024 * 1024 * 1024,

diff  --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp
index 05de3af4a58380..1b7ce77cb7bc74 100644
--- a/openmp/libomptarget/src/interface.cpp
+++ b/openmp/libomptarget/src/interface.cpp
@@ -350,7 +350,8 @@ EXTERN int __tgt_activate_record_replay(int64_t DeviceId, uint64_t MemorySize,
   }
 
   DeviceTy &Device = *PM->Devices[DeviceId];
-  int Rc = target_activate_rr(Device, MemorySize, IsRecord, SaveOutput);
+  [[maybe_unused]] int Rc =
+      target_activate_rr(Device, MemorySize, IsRecord, SaveOutput);
   assert(Rc == OFFLOAD_SUCCESS &&
          "__tgt_activate_record_replay unexpected failure!");
   return OMP_TGT_SUCCESS;


        


More information about the Openmp-commits mailing list