mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 00:16:30 +00:00
[Offload] Stop the RPC server faiilng with more than one GPU (#125982)
Summary: Pretty dumb mistake of me, forgot that this is run per-device and per-plugin, which fell through the cracks with my testing because I have two GPUs that use different plugins.
This commit is contained in:
parent
ed8a6d6155
commit
7a8779422d
@ -1058,8 +1058,9 @@ Error GenericDeviceTy::setupRPCServer(GenericPluginTy &Plugin,
|
||||
if (auto Err = Server.initDevice(*this, Plugin.getGlobalHandler(), Image))
|
||||
return Err;
|
||||
|
||||
if (auto Err = Server.startThread())
|
||||
return Err;
|
||||
if (!Server.Thread->Running.load(std::memory_order_acquire))
|
||||
if (auto Err = Server.startThread())
|
||||
return Err;
|
||||
|
||||
RPCServer = &Server;
|
||||
DP("Running an RPC server on device %d\n", getDeviceId());
|
||||
@ -1634,7 +1635,7 @@ Error GenericPluginTy::deinit() {
|
||||
if (GlobalHandler)
|
||||
delete GlobalHandler;
|
||||
|
||||
if (RPCServer && RPCServer->Thread->Running.load(std::memory_order_relaxed))
|
||||
if (RPCServer && RPCServer->Thread->Running.load(std::memory_order_acquire))
|
||||
if (Error Err = RPCServer->shutDown())
|
||||
return Err;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user