MatchNext

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

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.

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.

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