Polish code style

helinwang-patch-1
Yu Yang 7 years ago
parent 6f0dfd89a4
commit 8c9cd369dc

@ -379,17 +379,21 @@ void ParallelExecutor::ConstructDependencyGraph(
} }
} }
/** /*
* Dependency graph has been constructed. However, there are still data Dependency graph has been constructed. However, there are still data
* harzaeds need to be handled. harzaeds need to be handled.
*
* We only handle write after read(WAR), since it should not have a write
* after write in program. If there are write after write operators, we need
* prune them.
*
* https://en.wikipedia.org/wiki/Hazard_(computer_architecture)#Write_after_read_(WAR)
*/ */
PolishGraphToSupportDataHarzaeds();
}
/**
* We only handle write after read(WAR), since it should not have a write
* after write in program. If there are write after write operators, we need
* prune them.
*
* https://en.wikipedia.org/wiki/Hazard_(computer_architecture)#Write_after_read_(WAR)
*/
void ParallelExecutor::PolishGraphToSupportDataHarzaeds() const {
for (auto &place_pair : member_->vars_) { for (auto &place_pair : member_->vars_) {
for (auto &name_pair : place_pair.second) { for (auto &name_pair : place_pair.second) {
if (name_pair.second.size() <= 1) { if (name_pair.second.size() <= 1) {

@ -61,6 +61,8 @@ class ParallelExecutor {
void RunOp(std::unordered_map<VarHandleBase*, bool>& pending_vars, void RunOp(std::unordered_map<VarHandleBase*, bool>& pending_vars,
OpHandle* op) const; OpHandle* op) const;
void PolishGraphToSupportDataHarzaeds() const;
}; };
} // namespace framework } // namespace framework

Loading…
Cancel
Save