Skip to content

Commit 03b9b63

Browse files
jhuber6github-actions[bot]
authored andcommitted
Automerge: [libc] Fix server code when GPU is acting as the server
Summary: Small fix that just ignores all the extra lanes if we're running the server from a platform that potentially has more.
2 parents 51c0efd + 0c13988 commit 03b9b63

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libc/shared/rpc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ template <uint32_t opcode> RPC_ATTRS Client::Port Client::open() {
551551
/// port if it has a pending receive operation
552552
RPC_ATTRS rpc::optional<typename Server::Port>
553553
Server::try_open(uint32_t lane_size, uint32_t start) {
554+
if (rpc::get_lane_id() >= lane_size)
555+
return rpc::nullopt;
556+
554557
// Perform a naive linear scan for a port that has a pending request.
555558
for (uint32_t index = start; index < process.port_count; ++index) {
556559
uint64_t lane_mask = rpc::get_lane_mask();

0 commit comments

Comments
 (0)