MatchNext

Applicable Products

All processors

Header File/Library File

  • Header file: #include <ge/fusion/pattern_matcher.h>
  • Library file: libge_compiler.so

Function Usage

Returns the next match result that conforms to the pattern definition, following the topological order of the current target graph.

This one-by-one matching API allows you to resolve selection issues in overlap scenarios. The API can be called iteratively in a loop.

Note:

  • The match results returned by the current API may overlap. The caller needs to process the results.

    In the following structure, C appears in two match results in sequence during ABC matching. The caller needs to determine which result to select.

             B  C   B
             \ / \ /
              A   A
  • This function matches only the current graph. If the target graph contains subgraphs, the caller needs to match the subgraphs.

Prototype

1
std::unique_ptr<MatchResult> MatchNext()

Parameters

None

Returns

Parameter

Type

Description

-

std::unique_ptr<MatchResult>

Match results.

Restrictions

None