From 22d618f543cbd5b03f0da1ecf32fd121d61e4dc5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Mon, 20 Feb 2023 17:03:28 -0600 Subject: [PATCH] [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 --- .../plugins-nextgen/common/PluginInterface/GlobalHandler.cpp | 7 +++---- .../plugins-nextgen/common/PluginInterface/GlobalHandler.h | 9 +++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp b/openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp index da20164..a7664f0 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 77eb6e3..51a6f4f 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 @@ public: /// 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 @@ public: 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); } -- 2.7.4