提交 55e2cc3d 编写于 作者: Y Yu Yang

FetchOp Force sync

上级 5a02739c
......@@ -47,9 +47,11 @@ void FetchOpHandle::WaitAndMergeCPUTensors() const {
}
void FetchOpHandle::RunImpl() {
auto cpu_ctx =
platform::DeviceContextPool::Instance().Get(platform::CPUPlace());
for (auto *input : inputs_) {
auto *var = static_cast<VarHandle *>(input);
var->generated_op_->Wait(this->dev_ctx_[var->place_]);
var->generated_op_->Wait(cpu_ctx);
}
tensors_.resize(inputs_.size());
......
......@@ -209,10 +209,6 @@ void ThreadedSSAGraphExecutor::RunOp(
VLOG(10) << op->DebugString();
op->Run(use_event_);
for (auto &dev_ctx : op->dev_ctx_) {
dev_ctx.second->Wait(); // Sync error
}
for (auto *ready : *ready_buffer) {
ready->store(true, std::memory_order_release);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册