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

Debug

上级 f3e983e4
......@@ -742,26 +742,29 @@ void ParallelExecutor::Run(const std::vector<std::string> &fetch_tensors,
void ParallelExecutor::RunOp(
std::unordered_map<VarHandleBase *, std::atomic<bool>> &pending_vars,
OpHandle *op) const {
std::vector<std::atomic<bool> *> ready_buffer;
std::vector<std::atomic<bool> *> *ready_buffer =
new std::vector<std::atomic<bool> *>();
for (auto *var : op->outputs_) {
ready_buffer.emplace_back(&pending_vars[var]);
ready_buffer->emplace_back(&pending_vars[var]);
}
auto op_run = [ready_buffer, op, this] {
try {
VLOG(10) << op->DebugString();
op->Run();
for (auto *ready : ready_buffer) {
for (auto *ready : *ready_buffer) {
ready->store(true, std::memory_order_release);
}
delete ready_buffer;
} catch (platform::EnforceNotMet ex) {
member_->exception_.reset(new platform::EnforceNotMet(ex));
} catch (...) {
LOG(FATAL) << "Unknown exception catched";
}
};
VLOG(3) << "Enqueue";
member_->pool_.enqueue(op_run);
VLOG(3) << "Done";
}
} // namespace framework
} // namespace paddle
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册