Skip to content

Commit 4aa3ab7

Browse files
committed
Revert "[OPENMP] rpc fix from Joseph. Now consistent with trunk"
This reverts commit b3ca277.
1 parent 7cec167 commit 4aa3ab7

File tree

2 files changed

+4
-40
lines changed

2 files changed

+4
-40
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,6 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
797797
/// Setup the global device memory pool, if the plugin requires one.
798798
Error setupDeviceMemoryPool(GenericPluginTy &Plugin, DeviceImageTy &Image,
799799
uint64_t PoolSize);
800-
801-
// Setup the RPC server for this device if needed. This may not run on some
802-
// plugins like the CPU targets. By default, it will not be executed so it is
803-
// up to the target to override this using the shouldSetupRPCServer function.
804-
Error setupRPCServer(GenericPluginTy &Plugin, DeviceImageTy &Image);
805-
806800
/// Synchronize the current thread with the pending operations on the
807801
/// __tgt_async_info structure.
808802
Error synchronize(__tgt_async_info *AsyncInfo);

offload/plugins-nextgen/common/src/PluginInterface.cpp

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,10 +1133,6 @@ GenericDeviceTy::loadBinary(GenericPluginTy &Plugin,
11331133
} else if (auto Err = setupDeviceMemoryPool(Plugin, *Image, HeapSize))
11341134
return std::move(Err);
11351135
}
1136-
1137-
if (auto Err = setupRPCServer(Plugin, *Image))
1138-
return std::move(Err);
1139-
11401136
#ifdef OMPT_SUPPORT
11411137
if (ompt::Initialized) {
11421138
size_t Bytes =
@@ -1250,33 +1246,6 @@ Error GenericDeviceTy::setupDeviceMemoryPool(GenericPluginTy &Plugin,
12501246
return GHandler.writeGlobalToDevice(*this, Image, DevEnvGlobal);
12511247
}
12521248

1253-
Error GenericDeviceTy::setupRPCServer(GenericPluginTy &Plugin,
1254-
DeviceImageTy &Image) {
1255-
// The plugin either does not need an RPC server or it is unavailable.
1256-
if (!shouldSetupRPCServer())
1257-
return Plugin::success();
1258-
1259-
// Check if this device needs to run an RPC server.
1260-
RPCServerTy &Server = Plugin.getRPCServer();
1261-
auto UsingOrErr =
1262-
Server.isDeviceUsingRPC(*this, Plugin.getGlobalHandler(), Image);
1263-
if (!UsingOrErr)
1264-
return UsingOrErr.takeError();
1265-
1266-
if (!UsingOrErr.get())
1267-
return Plugin::success();
1268-
1269-
if (auto Err = Server.initDevice(*this, Plugin.getGlobalHandler(), Image))
1270-
return Err;
1271-
1272-
if (auto Err = Server.startThread())
1273-
return Err;
1274-
1275-
RPCServer = &Server;
1276-
DP("Running an RPC server on device %d\n", getDeviceId());
1277-
return Plugin::success();
1278-
}
1279-
12801249
Error PinnedAllocationMapTy::insertEntry(void *HstPtr, void *DevAccessiblePtr,
12811250
size_t Size, bool ExternallyLocked) {
12821251
// Insert the new entry into the map.
@@ -1895,12 +1864,13 @@ Error GenericPluginTy::deinit() {
18951864
if (GlobalHandler)
18961865
delete GlobalHandler;
18971866

1898-
if (RPCServer && RPCServer->Thread->Running.load(std::memory_order_relaxed))
1867+
#if RPC_FIXME
1868+
if (RPCServer) {
18991869
if (Error Err = RPCServer->shutDown())
19001870
return Err;
1901-
1902-
if (RPCServer)
19031871
delete RPCServer;
1872+
}
1873+
#endif
19041874

19051875
if (RecordReplay)
19061876
delete RecordReplay;

0 commit comments

Comments
 (0)