Function QnnBackend_create

Function Documentation

Qnn_ErrorHandle_t QnnBackend_create(Qnn_LogHandle_t logger, const QnnBackend_Config_t **config, Qnn_BackendHandle_t *backend)

Initialize a backend library and create a backend handle. Function is re-entrant and thread-safe.

Parameters
  • logger[in] A handle to the logger, use NULL handle to disable logging. QnnBackend doesn’t manage the lifecycle of logger and must be freed by using QnnLog_free().

  • 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.

  • backend[out] A handle to the created backend.

Returns

Error code:

  • QNN_SUCCESS: No error encountered

  • QNN_BACKEND_ERROR_UNSUPPORTED_PLATFORM: Backend attempted to be created on unsupported platform

  • QNN_BACKEND_ERROR_INCONSISTENT_CONFIG: One or more backend configurations are inconsistent between multiple create calls. Refer to backend headers for which configuration options must be consistent.

  • QNN_BACKEND_ERROR_CANNOT_INITIALIZE: backend failed to initialize

  • QNN_BACKEND_ERROR_MEM_ALLOC: error related to memory allocation

  • QNN_BACKEND_ERROR_INVALID_HANDLE: logger is not a valid handle

  • QNN_BACKEND_ERROR_INVALID_CONFIG: one or more config values is invalid

  • QNN_BACKEND_ERROR_NOT_SUPPORTED: an optional feature is not supported

Note

Use corresponding API through QnnInterface_t.