|
14 | 14 |
|
15 | 15 | // TODO: This should be included unconditionally and cleaned up. |
16 | 16 | #if defined(LIBOMPTARGET_RPC_SUPPORT) |
17 | | -#include "llvmlibc_rpc_server.h" |
18 | 17 | #include "shared/rpc.h" |
19 | 18 | #include "shared/rpc_opcodes.h" |
20 | 19 | #endif |
@@ -79,32 +78,32 @@ Error RPCServerTy::runServer(plugin::GenericDeviceTy &Device) { |
79 | 78 | std::min(Device.requestedRPCPortCount(), rpc::MAX_PORT_COUNT); |
80 | 79 | rpc::Server Server(NumPorts, Buffers[Device.getDeviceId()]); |
81 | 80 |
|
82 | | - auto port = Server.try_open(Device.getWarpSize()); |
83 | | - if (!port) |
| 81 | + auto Port = Server.try_open(Device.getWarpSize()); |
| 82 | + if (!Port) |
84 | 83 | return Error::success(); |
85 | 84 |
|
86 | 85 | int Status = rpc::SUCCESS; |
87 | | - switch (port->get_opcode()) { |
| 86 | + switch (Port->get_opcode()) { |
88 | 87 | case RPC_MALLOC: { |
89 | | - port->recv_and_send([&](rpc::Buffer *Buffer, uint32_t) { |
| 88 | + Port->recv_and_send([&](rpc::Buffer *Buffer, uint32_t) { |
90 | 89 | Buffer->data[0] = reinterpret_cast<uintptr_t>(Device.allocate( |
91 | 90 | Buffer->data[0], nullptr, TARGET_ALLOC_DEVICE_NON_BLOCKING)); |
92 | 91 | }); |
93 | 92 | break; |
94 | 93 | } |
95 | 94 | case RPC_FREE: { |
96 | | - port->recv([&](rpc::Buffer *Buffer, uint32_t) { |
| 95 | + Port->recv([&](rpc::Buffer *Buffer, uint32_t) { |
97 | 96 | Device.free(reinterpret_cast<void *>(Buffer->data[0]), |
98 | 97 | TARGET_ALLOC_DEVICE_NON_BLOCKING); |
99 | 98 | }); |
100 | 99 | break; |
101 | 100 | } |
102 | 101 | default: |
103 | 102 | // Let the `libc` library handle any other unhandled opcodes. |
104 | | - Status = libc_handle_rpc_port(&*port, Device.getWarpSize()); |
| 103 | + Status = handle_libc_opcodes(*Port, Device.getWarpSize()); |
105 | 104 | break; |
106 | 105 | } |
107 | | - port->close(); |
| 106 | + Port->close(); |
108 | 107 |
|
109 | 108 | if (Status != rpc::SUCCESS) |
110 | 109 | return createStringError("RPC server given invalid opcode!"); |
|
0 commit comments