Skip to content

Commit f79779f

Browse files
author
baiyfbupt
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into develop
2 parents 8023bc7 + 868bdc9 commit f79779f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

paddle/fluid/framework/data_device_transform.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ void TransDataDevice(const Tensor& in, const platform::Place& dst_place,
3636
VLOG(3) << "DeviceTransform in, src_place " << in.place()
3737
<< " dst_place: " << dst_place;
3838
auto* dev_ctx = GetDeviceContext(in.place(), dst_place);
39-
dev_ctx->Wait();
39+
4040
TensorCopy(in, dst_place, *dev_ctx, out);
41-
dev_ctx->Wait();
41+
if (platform::is_gpu_place(in.place()) && platform::is_cpu_place(dst_place)) {
42+
dev_ctx->Wait();
43+
}
4244
}
4345

4446
} // namespace framework

paddle/fluid/operators/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ if(WITH_DISTRIBUTE)
203203
set_source_files_properties(send_barrier_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
204204
set_source_files_properties(send_recv_op_test.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
205205
cc_test(test_send_recv SRCS send_recv_op_test.cc DEPS prefetch_op send_op listen_and_serv_op sum_op executor)
206-
cc_test(test_send_nccl_id SRCS test_send_nccl_id.cc DEPS send_op listen_and_serv_op executor)
207206
if(WITH_GPU)
207+
cc_test(test_send_nccl_id SRCS test_send_nccl_id.cc DEPS send_op listen_and_serv_op executor)
208208
op_library(gen_nccl_id_op DEPS nccl_common sendrecvop_grpc)
209209
set_source_files_properties(gen_nccl_id_op.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
210210
else()

0 commit comments

Comments
 (0)