Skip to content

Commit

Permalink
Put the StringSplit operation out of the teller.
Browse files Browse the repository at this point in the history
  • Loading branch information
wzzju committed Nov 3, 2021
1 parent 0f86f5f commit ee88c06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions paddle/fluid/framework/paddle2cinn/build_cinn_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,18 @@ void ReplaceSubGraphWithCinnOpNode(const GraphNodeSet& cluster,
// all of op node supported by CINN. We using OpMapperRegistry
// to check whether the op node supported by CINN.
void SearchAllSubgraphs(Graph* graph) {
auto teller = [](const Node* node) {
auto allow_ops = StringSplit(FLAGS_allow_cinn_ops, kDelim);
auto deny_ops = StringSplit(FLAGS_deny_cinn_ops, kDelim);
auto teller = [&allow_ops, &deny_ops](const Node* node) {
bool registered = ::cinn::frontend::OpMapperRegistry::Global()->Find(
node->Name()) != nullptr;
// if the op type is registered in CINN and allow_ops is not empty, return
// true only when it is in allow_ops
auto allow_ops = StringSplit(FLAGS_allow_cinn_ops, kDelim);
if (allow_ops.size()) {
return registered && allow_ops.count(node->Name());
}
// if the op type is registered in CINN and deny_ops is not empty, return
// true only when it is not in deny_ops
auto deny_ops = StringSplit(FLAGS_deny_cinn_ops, kDelim);
if (deny_ops.size()) {
return registered && !deny_ops.count(node->Name());
}
Expand Down

0 comments on commit ee88c06

Please sign in to comment.