[Openmp-commits] [openmp] 22d618f - [libomptarget] Remove unused image from global data movement function

Joseph Huber via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 21 05:09:45 PST 2023


Author: Joseph Huber
Date: 2023-02-21T07:09:36-06:00
New Revision: 22d618f543cbd5b03f0da1ecf32fd121d61e4dc5

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

LOG: [libomptarget] Remove unused image from global data movement function

This interface function does not actually need the device image type.
It's unused in the function, so it should be able to be safely removed.
The motivation for this is to facilitate downsteam porting of the
amd-stg-open RPC module into the nextgen plugin so we can delete the old
plugin entirely. For that to work we need to be able to call this
function at kernel-launch time, which doesn't have the image. Also it's
cleaner.

Reviewed By: jplehr

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

Added: 
    

Modified: 
    openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
    openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h

Removed: 
    


################################################################################
diff  --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
index da20164cb2119..a7664f0d23211 100644
--- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
+++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
@@ -73,16 +73,15 @@ Error GenericGlobalHandlerTy::moveGlobalBetweenDeviceAndHost(
     return Err;
 
   // Perform the actual transfer.
-  return moveGlobalBetweenDeviceAndHost(Device, Image, HostGlobal, DeviceGlobal,
+  return moveGlobalBetweenDeviceAndHost(Device, HostGlobal, DeviceGlobal,
                                         Device2Host);
 }
 
 /// Actually move memory between host and device. See readGlobalFromDevice and
 /// writeGlobalToDevice for the interface description.
 Error GenericGlobalHandlerTy::moveGlobalBetweenDeviceAndHost(
-    GenericDeviceTy &Device, DeviceImageTy &DeviceImage,
-    const GlobalTy &HostGlobal, const GlobalTy &DeviceGlobal,
-    bool Device2Host) {
+    GenericDeviceTy &Device, const GlobalTy &HostGlobal,
+    const GlobalTy &DeviceGlobal, bool Device2Host) {
 
   // Transfer the data from the source to the destination.
   if (Device2Host) {

diff  --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h
index 77eb6e3ae4f98..51a6f4ffd8858 100644
--- a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h
+++ b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h
@@ -112,7 +112,6 @@ class GenericGlobalHandlerTy {
   /// Actually move memory between host and device. See readGlobalFromDevice and
   /// writeGlobalToDevice for the interface description.
   Error moveGlobalBetweenDeviceAndHost(GenericDeviceTy &Device,
-                                       DeviceImageTy &Image,
                                        const GlobalTy &HostGlobal,
                                        const GlobalTy &DeviceGlobal,
                                        bool Device2Host);
@@ -140,11 +139,10 @@ class GenericGlobalHandlerTy {
   /// Copy the memory associated with a global from the device to its
   /// counterpart on the host. The name, size, and destination are defined by
   /// \p HostGlobal. The origin is defined by \p DeviceGlobal.
-  Error readGlobalFromDevice(GenericDeviceTy &Device, DeviceImageTy &Image,
+  Error readGlobalFromDevice(GenericDeviceTy &Device,
                              const GlobalTy &HostGlobal,
                              const GlobalTy &DeviceGlobal) {
-    return moveGlobalBetweenDeviceAndHost(Device, Image, HostGlobal,
-                                          DeviceGlobal,
+    return moveGlobalBetweenDeviceAndHost(Device, HostGlobal, DeviceGlobal,
                                           /* D2H */ true);
   }
 
@@ -163,8 +161,7 @@ class GenericGlobalHandlerTy {
   Error writeGlobalToDevice(GenericDeviceTy &Device, DeviceImageTy &Image,
                             const GlobalTy &HostGlobal,
                             const GlobalTy &DeviceGlobal) {
-    return moveGlobalBetweenDeviceAndHost(Device, Image, HostGlobal,
-                                          DeviceGlobal,
+    return moveGlobalBetweenDeviceAndHost(Device, HostGlobal, DeviceGlobal,
                                           /* D2H */ false);
   }
 


        


More information about the Openmp-commits mailing list