Function QnnGraph_createSubgraph

Function Documentation

Qnn_ErrorHandle_t QnnGraph_createSubgraph(Qnn_GraphHandle_t graphHandle, const char *graphName, Qnn_GraphHandle_t *subgraphHandle)

A function to create an empty graph which will be a subgraph of another graph. The function returns an opaque object to be used to add nodes to the subgraph. A subgraph can not be explicitly finalized or executed. Only a graph with no parent graphs can be finalized and executed.

Parameters
  • graphHandle[in] Handle to the graph in which the subgraph is created.

  • graphName[in] A string which identifies the graph. Graph name allows retrieval of the graph after creating the context from cached binary. graphName must be unique within the context.

  • subgraphHandle[out] The created subgraph handle.

Returns

Error code:

  • QNN_SUCCESS: the graph was successfully created

  • QNN_GRAPH_ERROR_INVALID_ARGUMENT: subgraphHandle is NULL

  • QNN_GRAPH_ERROR_INVALID_NAME: graphName is NULL or not unique within the context

  • QNN_GRAPH_ERROR_INVALID_HANDLE: graphHandle is not a valid handle

  • QNN_GRAPH_ERROR_MEM_ALLOC: create failed due to memory/resource allocation

  • QNN_GRAPH_ERROR_UNSUPPORTED_FEATURE: This API is not yet supported

  • QNN_GRAPH_ERROR_CREATE_FAILED: create failed due to some other reason

  • QNN_COMMON_ERROR_OPERATION_NOT_PERMITTED: create failed when context is re-created from binary using QnnContext_createFromBinary().

Note

A subgraph can have another subgraph as a parent.

Note

Nodes and tensors can be added to a subgraph before and/or after the subgraph handle has been included as part of an op config added as a node.

Note

Use corresponding API through QnnInterface_t.