Function QnnContext_getBinarySectionSize

Function Documentation

Qnn_ErrorHandle_t QnnContext_getBinarySectionSize(Qnn_ContextHandle_t context, Qnn_GraphHandle_t graph, QnnContext_SectionType_t section, Qnn_ContextBinarySize_t *binaryBufferSize)

Retrieve a section of the binary as specified by section. The size of this section depends on the type of section requested. For example, for QNN_CONTEXT_SECTION_UPDATABLE sections, this will have all the updatable tensor information.

Parameters
  • context[in] A context handle.

  • graph[in] A graph handle. This argument is optional. When supplied the return size only applies to the size of the context binary section pertaining to this graph. When excluded the returned binary contains associated updates to all graphs in the context. Some backends may require graph as an argument. Support is determined by QNN_PROPERTY_CONTEXT_SUPPORT_BINARY_SECTION_FULL_CONTEXT.

  • section[in] The section of the binary to retrieve.

  • binaryBufferSize[out] The amount of memory in bytes a client will need to allocate to hold context content updates in binary form.

Returns

Error code:

  • QNN_SUCCESS: no error is encountered

  • QNN_CONTEXT_ERROR_UNSUPPORTED_FEATURE: a feature is not supported

  • QNN_CONTEXT_ERROR_INVALID_HANDLE: context is not a valid handle

  • QNN_CONTEXT_ERROR_INVALID_ARGUMENT: binaryBufferSize is NULL

  • QNN_CONTEXT_ERROR_NOT_FINALIZED: if there were any non-finalized entities in the context

  • QNN_CONTEXT_ERROR_GET_BINARY_SIZE_FAILED: Operation failure due to other factors

  • QNN_COMMON_ERROR_OPERATION_NOT_PERMITTED: Attempting to get binary size for a context re-created from a cached binary.

  • QNN_CONTEXT_ERROR_MEM_ALLOC: Not enough memory is available to retrieve the context content.

Note

Use corresponding API through QnnInterface_t.