|
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 |
@@ -74,32 +73,32 @@ Error RPCServerTy::runServer(plugin::GenericDeviceTy &Device) { |
74 | 73 | std::min(Device.requestedRPCPortCount(), rpc::MAX_PORT_COUNT); |
75 | 74 | rpc::Server Server(NumPorts, Buffers[Device.getDeviceId()]); |
76 | 75 |
|
77 | | - auto port = Server.try_open(Device.getWarpSize()); |
78 | | - if (!port) |
| 76 | + auto Port = Server.try_open(Device.getWarpSize()); |
| 77 | + if (!Port) |
79 | 78 | return Error::success(); |
80 | 79 |
|
81 | 80 | int Status = rpc::SUCCESS; |
82 | | - switch (port->get_opcode()) { |
| 81 | + switch (Port->get_opcode()) { |
83 | 82 | case RPC_MALLOC: { |
84 | | - port->recv_and_send([&](rpc::Buffer *Buffer, uint32_t) { |
| 83 | + Port->recv_and_send([&](rpc::Buffer *Buffer, uint32_t) { |
85 | 84 | Buffer->data[0] = reinterpret_cast<uintptr_t>(Device.allocate( |
86 | 85 | Buffer->data[0], nullptr, TARGET_ALLOC_DEVICE_NON_BLOCKING)); |
87 | 86 | }); |
88 | 87 | break; |
89 | 88 | } |
90 | 89 | case RPC_FREE: { |
91 | | - port->recv([&](rpc::Buffer *Buffer, uint32_t) { |
| 90 | + Port->recv([&](rpc::Buffer *Buffer, uint32_t) { |
92 | 91 | Device.free(reinterpret_cast<void *>(Buffer->data[0]), |
93 | 92 | TARGET_ALLOC_DEVICE_NON_BLOCKING); |
94 | 93 | }); |
95 | 94 | break; |
96 | 95 | } |
97 | 96 | default: |
98 | 97 | // Let the `libc` library handle any other unhandled opcodes. |
99 | | - Status = libc_handle_rpc_port(&*port, Device.getWarpSize()); |
| 98 | + Status = handle_libc_opcodes(*Port, Device.getWarpSize()); |
100 | 99 | break; |
101 | 100 | } |
102 | | - port->close(); |
| 101 | + Port->close(); |
103 | 102 |
|
104 | 103 | if (Status != rpc::SUCCESS) |
105 | 104 | return createStringError("RPC server given invalid opcode!"); |
|
0 commit comments