FetchOp Force sync

helinwang-patch-1
Yu Yang 7 years ago
parent 5a02739ce9
commit 55e2cc3d87

@ -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);
}

Loading…
Cancel
Save