Skip to content

Commit 22d618f

Browse files
committed
[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
1 parent b068c87 commit 22d618f

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,15 @@ Error GenericGlobalHandlerTy::moveGlobalBetweenDeviceAndHost(
7373
return Err;
7474

7575
// Perform the actual transfer.
76-
return moveGlobalBetweenDeviceAndHost(Device, Image, HostGlobal, DeviceGlobal,
76+
return moveGlobalBetweenDeviceAndHost(Device, HostGlobal, DeviceGlobal,
7777
Device2Host);
7878
}
7979

8080
/// Actually move memory between host and device. See readGlobalFromDevice and
8181
/// writeGlobalToDevice for the interface description.
8282
Error GenericGlobalHandlerTy::moveGlobalBetweenDeviceAndHost(
83-
GenericDeviceTy &Device, DeviceImageTy &DeviceImage,
84-
const GlobalTy &HostGlobal, const GlobalTy &DeviceGlobal,
85-
bool Device2Host) {
83+
GenericDeviceTy &Device, const GlobalTy &HostGlobal,
84+
const GlobalTy &DeviceGlobal, bool Device2Host) {
8685

8786
// Transfer the data from the source to the destination.
8887
if (Device2Host) {

openmp/libomptarget/plugins-nextgen/common/PluginInterface/GlobalHandler.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ class GenericGlobalHandlerTy {
112112
/// Actually move memory between host and device. See readGlobalFromDevice and
113113
/// writeGlobalToDevice for the interface description.
114114
Error moveGlobalBetweenDeviceAndHost(GenericDeviceTy &Device,
115-
DeviceImageTy &Image,
116115
const GlobalTy &HostGlobal,
117116
const GlobalTy &DeviceGlobal,
118117
bool Device2Host);
@@ -140,11 +139,10 @@ class GenericGlobalHandlerTy {
140139
/// Copy the memory associated with a global from the device to its
141140
/// counterpart on the host. The name, size, and destination are defined by
142141
/// \p HostGlobal. The origin is defined by \p DeviceGlobal.
143-
Error readGlobalFromDevice(GenericDeviceTy &Device, DeviceImageTy &Image,
142+
Error readGlobalFromDevice(GenericDeviceTy &Device,
144143
const GlobalTy &HostGlobal,
145144
const GlobalTy &DeviceGlobal) {
146-
return moveGlobalBetweenDeviceAndHost(Device, Image, HostGlobal,
147-
DeviceGlobal,
145+
return moveGlobalBetweenDeviceAndHost(Device, HostGlobal, DeviceGlobal,
148146
/* D2H */ true);
149147
}
150148

@@ -163,8 +161,7 @@ class GenericGlobalHandlerTy {
163161
Error writeGlobalToDevice(GenericDeviceTy &Device, DeviceImageTy &Image,
164162
const GlobalTy &HostGlobal,
165163
const GlobalTy &DeviceGlobal) {
166-
return moveGlobalBetweenDeviceAndHost(Device, Image, HostGlobal,
167-
DeviceGlobal,
164+
return moveGlobalBetweenDeviceAndHost(Device, HostGlobal, DeviceGlobal,
168165
/* D2H */ false);
169166
}
170167

0 commit comments

Comments
 (0)