提交 d3c82c35 编写于 作者: Y Yu Yang

Wait multiple stream

上级 c18c2f6a
...@@ -816,6 +816,10 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors, ...@@ -816,6 +816,10 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
// 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.
for (auto &s : member_->communication_streams_) {
s.second.ctx_->Wait();
}
for (auto &p : member_->places_) { for (auto &p : member_->places_) {
platform::DeviceContextPool::Instance().Get(p)->Wait(); platform::DeviceContextPool::Instance().Get(p)->Wait();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册