Skip to content

Commit d45e24a

Browse files
committed
Keep local_device_status as absl::StatusOr
1 parent bc870c8 commit d45e24a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

xla/pjrt/gpu/se_gpu_pjrt_client.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -799,31 +799,31 @@ StreamExecutorGpuClient::CrossHostTransferBuffers(
799799

800800
// Get the local_device_state and use it to schedule transfers. Fail
801801
// transfers early if we cannot get the local_device_state.
802-
absl::StatusOr<LocalDeviceState*> maybe_local_device_state =
802+
absl::StatusOr<LocalDeviceState*> local_device_state =
803803
tensorflow::down_cast<PjRtStreamExecutorDevice*>(device)
804804
->GetLocalDeviceState();
805-
if (!maybe_local_device_state.ok()) {
806-
SetEventAsError(transfer_event, maybe_local_device_state.status());
805+
if (!local_device_state.ok()) {
806+
SetEventAsError(transfer_event, local_device_state.status());
807807
continue;
808808
}
809-
LocalDeviceState* local_device_state = *maybe_local_device_state;
810809

811810
// Launch ScheduleTransfersOnLocalDevice on either the async dispatch thread
812811
// of the calling thread.
813-
if (local_device_state->async_dispatch_thread()) {
814-
local_device_state->async_dispatch_thread()->Schedule(
815-
tsl::WithCurrentContext(
812+
if ((*local_device_state)->async_dispatch_thread()) {
813+
(*local_device_state)
814+
->async_dispatch_thread()
815+
->Schedule(tsl::WithCurrentContext(
816816
[this, local_device_state, device_id, transfer_dependency_avs,
817817
curr_transfer_specs = std::move(curr_transfer_specs),
818818
transfer_event = std::move(transfer_event)]() mutable {
819819
ScheduleTransfersOnLocalDevice(
820-
local_device_state, device_id, std::move(transfer_event),
820+
*local_device_state, device_id, std::move(transfer_event),
821821
std::move(transfer_dependency_avs),
822822
std::move(curr_transfer_specs));
823823
}));
824824
} else {
825825
ScheduleTransfersOnLocalDevice(
826-
local_device_state, device_id, std::move(transfer_event),
826+
*local_device_state, device_id, std::move(transfer_event),
827827
transfer_dependency_avs, std::move(curr_transfer_specs));
828828
}
829829
}

0 commit comments

Comments
 (0)