Function QnnGraph_create¶
Defined in File QnnGraph.h
Function Documentation¶
-
Qnn_ErrorHandle_t QnnGraph_create(Qnn_ContextHandle_t contextHandle, const char *graphName, const QnnGraph_Config_t **config, Qnn_GraphHandle_t *graphHandle)¶
A function to create an empty graph. The function returns an opaque object to be used on all graph APIs (addNode, finalize, execute, …)
- Parameters
contextHandle – [in] A handle to the context in which the graph would be 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.
config – [in] Pointer to a NULL terminated array of config option pointers. NULL is allowed and indicates no config options are provided. All config options have default value, in case not provided. If same config option type is provided multiple times, the last option value will be used.
graphHandle – [out] The created graph handle.
- Returns
Error code:
QNN_SUCCESS: the graph was successfully created
QNN_GRAPH_ERROR_INVALID_ARGUMENT: graph is NULL or at least one config option was invalid
QNN_GRAPH_ERROR_INVALID_NAME: graphName is NULL or not unique within the context
QNN_GRAPH_ERROR_INVALID_HANDLE: context is not a valid handle
QNN_GRAPH_ERROR_MEM_ALLOC: create failed due to memory/resource allocation
QNN_GRAPH_ERROR_UNSUPPORTED_FEATURE: some API feature is not supported yet, e.g. config option
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().
QNN_GRAPH_ERROR_PROFILE_IN_USE: when a profile handle is passed as graph config, that profile handle can only be bound to one graph at a time
Note
Use corresponding API through QnnInterface_t.