提交 4137bb4e 编写于 作者: Y Yu Yang

Add wait

上级 3da4159f
...@@ -813,7 +813,7 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors, ...@@ -813,7 +813,7 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
fetch_ops.clear(); fetch_ops.clear();
*member_->global_scope_->Var(fetched_var_name)->GetMutable<LoDTensorArray>() = *member_->global_scope_->Var(fetched_var_name)->GetMutable<LoDTensorArray>() =
fetched_data->tensors_; fetched_data->tensors_;
VLOG(3) << "Before Wait";
// FIXME: // FIXME:
// It could be optimized by using multiple events in an operator. // It could be optimized by using multiple events in an operator.
// Manually sync computation during iter. // Manually sync computation during iter.
...@@ -824,6 +824,7 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors, ...@@ -824,6 +824,7 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
for (auto &p : member_->places_) { for (auto &p : member_->places_) {
platform::DeviceContextPool::Instance().Get(p)->Wait(); platform::DeviceContextPool::Instance().Get(p)->Wait();
} }
VLOG(3) << "Done wait";
} }
void ParallelExecutor::RunOp( void ParallelExecutor::RunOp(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册