Lines Matching defs:Device

24 rpc::Status handleOffloadOpcodes(plugin::GenericDeviceTy &Device,
30 Buffer->data[0] = reinterpret_cast<uintptr_t>(Device.allocate(
37 Device.free(reinterpret_cast<void *>(Buffer->data[0]),
65 static rpc::Status handleOffloadOpcodes(plugin::GenericDeviceTy &Device,
69 return handleOffloadOpcodes<1>(Device, Port);
71 return handleOffloadOpcodes<32>(Device, Port);
73 return handleOffloadOpcodes<64>(Device, Port);
78 static rpc::Status runServer(plugin::GenericDeviceTy &Device, void *Buffer) {
80 std::min(Device.requestedRPCPortCount(), rpc::MAX_PORT_COUNT);
83 auto Port = Server.try_open(Device.getWarpSize());
88 handleOffloadOpcodes(Device, *Port, Device.getWarpSize());
93 Status = handle_libc_opcodes(*Port, Device.getWarpSize());
134 for (const auto &[Buffer, Device] : llvm::zip_equal(Buffers, Devices)) {
135 if (!Buffer || !Device)
139 if (runServer(*Device, Buffer) != rpc::RPC_SUCCESS)
165 RPCServerTy::isDeviceUsingRPC(plugin::GenericDeviceTy &Device,
168 return Handler.isSymbolInImage(Device, Image, "__llvm_rpc_client");
171 Error RPCServerTy::initDevice(plugin::GenericDeviceTy &Device,
175 std::min(Device.requestedRPCPortCount(), rpc::MAX_PORT_COUNT);
176 void *RPCBuffer = Device.allocate(
177 rpc::Server::allocation_size(Device.getWarpSize(), NumPorts), nullptr,
181 "Failed to initialize RPC server for device %d", Device.getDeviceId());
186 Handler.getGlobalMetadataFromDevice(Device, Image, ClientGlobal))
190 if (auto Err = Device.dataSubmit(ClientGlobal.getPtr(), &client,
193 Buffers[Device.getDeviceId()] = RPCBuffer;
194 Devices[Device.getDeviceId()] = &Device;
199 Error RPCServerTy::deinitDevice(plugin::GenericDeviceTy &Device) {
200 Device.free(Buffers[Device.getDeviceId()], TARGET_ALLOC_HOST);
201 Buffers[Device.getDeviceId()] = nullptr;
202 Devices[Device.getDeviceId()] = nullptr;