Function QnnContext_getIncrementalBinary¶
Defined in File QnnContext.h
Function Documentation¶
-
Qnn_ErrorHandle_t QnnContext_getIncrementalBinary(Qnn_ContextHandle_t context, const void **binaryBuffer, Qnn_ContextBinarySize_t *startOffset, Qnn_ContextBinarySize_t *writtenBufferSize)¶
A function to get the next piece of the context binary, incrementally produced from the backend. The backend returns a pointer to constant data which it owns, the data’s size and the starting offset where the incremental binary buffer begins. The memory provided here must be released through QnnContext_releaseIncrementalBinary. Incremental pieces of the context binary may be provided in random order i.e. startOffset is independent of previous calls.
- Parameters
context – [in] A context handle.
binaryBuffer – [out] Pointer to backend provided/owned buffer
startOffset – [out] Starting offset for binary data.
writtenBufferSize – [out] Amount of memory actually written into binaryBuffer, in bytes.
- 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: one of the arguments to the API is invalid/NULL
QNN_CONTEXT_ERROR_NOT_FINALIZED: if there were any non-finalized entities in the context
QNN_CONTEXT_ERROR_GET_BINARY_FAILED: Operation failure due to other factors
QNN_COMMON_ERROR_OPERATION_NOT_PERMITTED: Attempting to get binary 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
modifications made to the context in between calls to QnnContext_getIncrementalBinary results in undefined behavior.
Note
Use corresponding API through QnnInterface_t.