[Openmp-commits] [PATCH] D144436: [libomptarget] Remove unused image from global data movement function

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 20 15:11:48 PST 2023


jhuber6 created this revision.
jhuber6 added reviewers: gregrodgers, tianshilei1992, jdoerfert, JonChesterfield, kevinsala, jplehr.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144436

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


Index: openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h
===================================================================
--- openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h
+++ openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h
@@ -112,7 +112,6 @@
   /// 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 @@
   /// 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 @@
   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);
   }
 
Index: openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
===================================================================
--- openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
+++ openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp
@@ -73,16 +73,15 @@
     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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144436.498971.patch
Type: text/x-patch
Size: 3184 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230220/2a1817a6/attachment-0001.bin>


More information about the Openmp-commits mailing list