MatchNext

Applicability

Product

Supported or Not

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Header File/Library File

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

Function Usage

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

It provides the interface for one-by-one matching. This helps resolve selection issues in overlapping-match scenarios. It can be called repeatedly to iterate through all available matches.

Remarks:

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

    In the following structure, C appears in two matching 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 a subgraph, the caller needs to match the subgraph.

Prototype

1
std::unique_ptr<MatchResult> MatchNext()

Parameters

None

Returns

Parameter

Type

Description

-

std::unique_ptr<MatchResult>

Matching results.

Constraints

None