Function QnnDevice_create

Function Documentation

Qnn_ErrorHandle_t QnnDevice_create(Qnn_LogHandle_t logger, const QnnDevice_Config_t **config, Qnn_DeviceHandle_t *device)

Create a logical device handle to a subset of hardware resources available on the platform.

Parameters
  • logger[in] A handle to the logger, use NULL handle to disable logging. QnnDevice 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.

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

Returns

Error code:

  • QNN_SUCCESS: no error is encountered

  • QNN_DEVICE_ERROR_INVALID_ARGUMENT: device is NULL

  • QNN_DEVICE_ERROR_INVALID_HANDLE: logger is not a valid handle

  • QNN_DEVICE_ERROR_INVALID_CONFIG: one or more configuration values is invalid

  • QNN_DEVICE_ERROR_MEM_ALLOC: failure in allocating memory when creating device

  • QNN_DEVICE_ERROR_HARDWARE_UNAVAILABLE: requested hardware resources are unavailable

  • QNN_DEVICE_ERROR_UNSUPPORTED_FEATURE: API is not supported

  • QNN_COMMON_ERROR_SYSTEM_COMMUNICATION: SSR occurence (successful recovery)

  • QNN_COMMON_ERROR_SYSTEM_COMMUNICATION_FATAL: SSR occurence (unsuccessful recovery)

Note

NULL value for config creates a device handle with default configuration. Unless mentioned in backend specific headers, default configuration would enable all the devices and cores present on a platform for which a backend can control.

Note

Use corresponding API through QnnInterface_t.