Function QnnContext_validateBinary

Function Documentation

Qnn_ErrorHandle_t QnnContext_validateBinary(Qnn_BackendHandle_t backend, Qnn_DeviceHandle_t device, const QnnContext_Config_t **config, const void *binaryBuffer, Qnn_ContextBinarySize_t binaryBufferSize)

A function to validate a stored binary. The binary was previously obtained via QnnContext_getBinary() and stored by a client.

Parameters
  • backend[in] A backend handle.

  • device[in] A device handle to set hardware affinity for the created context. NULL value can be supplied for device handle and it is equivalent to calling QnnDevice_create() with NULL config.

  • config[in] Pointer to a NULL terminated array of config option pointers. NULL is allowed and indicates no config options are provided. In case they are not provided, all config options have a default value in accordance with the serialized context. If the same config option type is provided multiple times, the last option value will be used.

  • binaryBuffer[in] A pointer to the context binary.

  • binaryBufferSize[in] Holds the size of the context binary.

Returns

Error code:

  • QNN_SUCCESS: no error is encountered

  • QNN_CONTEXT_ERROR_UNSUPPORTED_FEATURE: a feature is not supported

  • QNN_CONTEXT_ERROR_INVALID_ARGUMENT: binaryBuffer is NULL

  • QNN_CONTEXT_ERROR_MEM_ALLOC: memory allocation error while validating binary cache

  • QNN_CONTEXT_ERROR_CREATE_FROM_BINARY: failed to validate binary cache

  • QNN_CONTEXT_ERROR_BINARY_VERSION: incompatible version of the binary

  • QNN_CONTEXT_ERROR_BINARY_CONFIGURATION: binary is not configured for this device

  • QNN_CONTEXT_ERROR_BINARY_SUBOPTIMAL: suboptimal binary is used when QNN_CONTEXT_BINARY_COMPATIBILITY_STRICT is specified in the config option

  • QNN_CONTEXT_ERROR_INVALID_HANDLE: backend, or device is not a valid handle

  • QNN_CONTEXT_ERROR_INVALID_CONFIG: one or more config values is invalid

Note

Use corresponding API through QnnInterface_t.