Updated on 2022-03-13 GMT+08:00

Graph::CreateGraph (Creating a Graph Based on the Protobuf Data Format)

Creates and starts the entire graph based on the Protobuf data format. This API is defined in graph.h.

It can be called only on the host or Ascend 310 RC.

Syntax

static HIAI_StatusT Graph::CreateGraph(const GraphConfigList& graphConfig)

Parameter Description

Parameter

Description

Value Range

graphConfig

Protobuf data format.

When writing code, you can define the graphConfig parameter as follows:

  • Define a parameter of the GraphConfigList type as the input parameter graphConfig of the Graph::CreateGraph(const GraphConfigList& graphConfig) API.
  • After the API in Parsing the Matrix Configuration File is called, obtain the graphConfigList parameter and use it as the input parameter graphConfig of the Graph::CreateGraph(const GraphConfigList& graphConfig) API.

The number of engines in a graph must be less than or equal to 512.

Return Value

For details about the returned error codes, see "Error Codes."

Error Codes

No.

Error Code

Description

1

HIAI_OK

The running is OK.

2

HIAI_GRAPH_GET_INSTANCE_NULL

A null instance is obtained.