Function QnnContext_getBinarySectionUpdate

Function Documentation

Qnn_ErrorHandle_t QnnContext_getBinarySectionUpdate(const QnnContext_Buffer_t *binaryBuffer, const QnnContext_Buffer_t *auxiliaryBuffer, const Qnn_Tensor_t **tensors, uint64_t numTensors, uint8_t keepUpdatable, Qnn_LogHandle_t logger, Qnn_ProfileHandle_t profile, Qnn_SignalHandle_t signal, QnnContext_Buffer_t *binarySectionUpdate)

Apply updates to a previously created binary section. Memory is owned by the backend and deallocated with a call to QnnContext_freeBinarySectionUpdate().

Parameters
  • binaryBuffer[in] Pointer to the user-allocated binary section memory containing a previously created updatable binary section.

  • auxiliaryBuffer[in] Pointer to user-allocated binary section memory containing an auxiliary binary section that is also needed to update binaryBuffer. This argument is currently unused and must be NULL.

  • tensors[in] Pointer to an array of tensor updates to apply to the previously created binary section contained in binaryBuffer.

  • numTensors[in] The size of the tensors array.

  • keepUpdatable[in] A boolean indicating whether the updated adapter should remain updatable so it can be re-used as an input to this function at a later time. If this argument is 0 (false), the output adapter will have its updatable metadata removed and will no longer be updatable. Any non-zero value is interpreted as true.

  • logger[in] A handle to a logger, use NULL handle to disable logging.

  • profile[in] The profile handle on which metrics are populated and can be queried. Use NULL handle to disable profile collection. A handle being re-used would reset and is populated with values from the current call.

  • signal[in] Signal object to control the execution of the binary section update process. NULL may be passed to indicate that no execution control is requested, and the update operation should continue to completion uninterrupted. The signal object, if not NULL, is considered to be in-use for the duration of the call.

  • binarySectionUpdate[out] Pointer to a QnnContext_Buffer_t which will be populated by the backend. The buffer pointed to by this object is owned and managed by the backend, and can be deallocated using QnnContext_freeBinarySectionUpdate(). Must be non-NULL.

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, tensors, or binarySectionUpdate is NULL

  • QNN_CONTEXT_ERROR_MEM_ALLOC: memory allocation error while updating binary section

  • QNN_TENSOR_ERROR_DOES_NOT_EXIST: a tensor ID in tensors is not recognized

  • QNN_TENSOR_ERROR_INCOMPATIBLE_TENSOR_UPDATE: provided tensor is invalid and cannot be applied as an update

Note

Use corresponding API through QnnInterface_t.