From fbbcedda01656e8e2183b2e88d5db2dbd2b08c7a Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Tue, 20 Mar 2018 16:46:55 +0800 Subject: [PATCH] Fix bug --- paddle/fluid/framework/parallel_executor.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index 121302880cb..2a1652f749d 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -108,14 +108,13 @@ struct OpHandle { } virtual void Wait(platform::DeviceContext *waited_dev) { - if (platform::is_cpu_place(waited_dev->GetPlace()) && events_.empty()) { + if (platform::is_cpu_place(waited_dev->GetPlace()) || events_.empty()) { for (auto &dev_ctx : dev_ctx_) { dev_ctx.second->Wait(); } } else { auto stream = static_cast(waited_dev)->stream(); - for (auto &ev : events_) { PADDLE_ENFORCE(cudaStreamWaitEvent(stream, ev.second, 0)); } -- GitLab