Skip to content

Commit 44122e1

Browse files
committed
Revert plugin changes
The offload unit tests will no longer work on host Kernel execution will no longer work on CUDA
1 parent 3423f70 commit 44122e1

File tree

3 files changed

+3
-32
lines changed

3 files changed

+3
-32
lines changed

offload/plugins-nextgen/common/include/GlobalHandler.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ class GenericGlobalHandlerTy {
131131

132132
/// Get the address and size of a global in the image. Address and size are
133133
/// return in \p ImageGlobal, the global name is passed in \p ImageGlobal.
134-
virtual Error getGlobalMetadataFromImage(GenericDeviceTy &Device,
135-
DeviceImageTy &Image,
136-
GlobalTy &ImageGlobal);
134+
Error getGlobalMetadataFromImage(GenericDeviceTy &Device,
135+
DeviceImageTy &Image, GlobalTy &ImageGlobal);
137136

138137
/// Read the memory associated with a global from the image and store it on
139138
/// the host. The name, size, and destination are defined by \p HostGlobal.

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,34 +1327,6 @@ class CUDAGlobalHandlerTy final : public GenericGlobalHandlerTy {
13271327
DeviceGlobal.setPtr(reinterpret_cast<void *>(CUPtr));
13281328
return Plugin::success();
13291329
}
1330-
1331-
Error getGlobalMetadataFromImage(GenericDeviceTy &Device,
1332-
DeviceImageTy &Image,
1333-
GlobalTy &ImageGlobal) override {
1334-
// If the image is an ELF we can use the generic path, otherwise fall back
1335-
// and use cuModuleGetGlobal to query the image.
1336-
if (utils::elf::isELF(Image.getMemoryBuffer().getBuffer())) {
1337-
return GenericGlobalHandlerTy::getGlobalMetadataFromImage(Device, Image,
1338-
ImageGlobal);
1339-
}
1340-
1341-
CUDADeviceImageTy &CUDAImage = static_cast<CUDADeviceImageTy &>(Image);
1342-
1343-
const char *GlobalName = ImageGlobal.getName().data();
1344-
1345-
size_t CUSize;
1346-
CUdeviceptr CUPtr;
1347-
CUresult Res =
1348-
cuModuleGetGlobal(&CUPtr, &CUSize, CUDAImage.getModule(), GlobalName);
1349-
if (auto Err = Plugin::check(Res, "Error in cuModuleGetGlobal for '%s': %s",
1350-
GlobalName))
1351-
return Err;
1352-
1353-
// Setup the global symbol's address and size.
1354-
ImageGlobal.setPtr(reinterpret_cast<void *>(CUPtr));
1355-
ImageGlobal.setSize(CUSize);
1356-
return Plugin::success();
1357-
}
13581330
};
13591331

13601332
/// Class implementing the CUDA-specific functionalities of the plugin.

offload/plugins-nextgen/host/src/rtl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ struct GenELF64DeviceTy : public GenericDeviceTy {
289289

290290
/// This plugin does not support interoperability, do nothing
291291
Error initAsyncInfoImpl(AsyncInfoWrapperTy &AsyncInfoWrapper) override {
292-
return Plugin::success();
292+
return Plugin::error("initAsyncInfoImpl not supported");
293293
}
294294

295295
/// This plugin does not support interoperability

0 commit comments

Comments
 (0)