Function QnnGraph_prepareExecutionEnvironment¶
Defined in File QnnGraph.h
Function Documentation¶
-
Qnn_ErrorHandle_t QnnGraph_prepareExecutionEnvironment(Qnn_GraphHandle_t graphHandle, QnnGraph_ExecuteEnvironment_t **envs, uint32_t envSize)¶
A function to optionally prepare an execution environment. Client can provide environment options to a backend such that optimizations can be applied a backend or discovered by the client. The options are:
QNN_GRAPH_EXECUTE_ENVIRONMENT_OPTION_BIND_MEM_HANDLES: An option to achieve zero copy of tensor data during execution. Done by grouping sets of I/O tensors and binding their memory layout to a graph handle before execution.
QNN_GRAPH_EXECUTE_ENVIRONMENT_OPTION_POPULATE_CLIENT_BUFS: An option to achieve zero copy of tensor data in cases of backend-allocated memory. Clients should use this option to discover memory layout of input and output tensors allocated by the backend.
- Parameters
graphHandle – [in] A handle to the graph that is being prepared for execution
[in/out] – envs An array of pointers to execution environment options of length envSize. The option field is required to be set for all environments in the array. A backend may not support all options provided. If extra environment options are provided, the backend will set them to a default value (e.g. QNN_TENSOR_SET_INIT).
envSize – [in] Size of the array pointed to by envs.
- Returns
Error code:
QNN_SUCCESS: The execution environment was successfully prepared.
QNN_GRAPH_ERROR_INVALID_HANDLE: graph is not a valid handle.
QNN_GRAPH_ERROR_INVALID_ARGUMENT: One or more fields in the provided envs is NULL or invalid.
QNN_GRAPH_ERROR_UNSUPPORTED_FEATURE: One or more env options is not supported by the backend.
Note
See SDK documentation for backend specific behaviour. Backend support for environment options can be determined by querying the corresponding capability.
Note
Use corresponding API through QnnInterface_t.