File QnnSystemDlc.h

Parent directory (include/QNN/System)

QNN System Context API.

Definition (include/QNN/System/QnnSystemDlc.h)

Detailed Description

This is a system API header to provide Deep Learning Container (DLC) services to users.

Includes

Full File Listing

QNN System Context API.

    This is a system API header to provide
    Deep Learning Container (DLC) services to users.

Typedefs

typedef void *QnnSystemDlc_Handle_t

A typedef to indicate a QNN System DLC handle.

Enums

enum QnnSystemDlc_Error_t

QNN System Context API result / error codes.

Values:

enumerator QNN_SYSTEM_DLC_MINERROR = 30000
enumerator QNN_SYSTEM_DLC_NO_ERROR = QNN_SYSTEM_COMMON_NO_ERROR

Qnn System Context success.

enumerator QNN_SYSTEM_DLC_ERROR_UNSUPPORTED_FEATURE = QNN_SYSTEM_COMMON_ERROR_UNSUPPORTED_FEATURE

There is optional API component that is not supported yet.

enumerator QNN_SYSTEM_DLC_ERROR_INVALID_HANDLE = QNN_SYSTEM_COMMON_ERROR_INVALID_HANDLE

QNN System DLC invalid handle.

enumerator QNN_SYSTEM_DLC_ERROR_INVALID_ARGUMENT = QNN_SYSTEM_COMMON_ERROR_INVALID_ARGUMENT

One or more arguments to a System DLC API is/are NULL/invalid.

enumerator QNN_SYSTEM_DLC_ERROR_OPERATION_FAILED = QNN_SYSTEM_DLC_MINERROR + 2

Generic Failure in achieving the objective of a System DLC API.

enumerator QNN_SYSTEM_DLC_ERROR_MALFORMED_BINARY = QNN_SYSTEM_DLC_MINERROR + 10

Malformed DLC Binary.

enumerator QNN_SYSTEM_DLC_MAXERROR = 49999
enum QnnSystemContext_GraphConfigInfoVersion_t

Version of the graph config info.

Values:

enumerator QNN_SYSTEM_DLC_GRAPH_CONFIG_INFO_VERSION_1 = 0x01
enumerator QNN_SYSTEM_DLC_GRAPH_CONFIG_INFO_UNDEFINED = 0x7FFFFFFF

Functions

Qnn_ErrorHandle_t QnnSystemDlc_createFromFile(Qnn_LogHandle_t logger, const char *dlcPath, QnnSystemDlc_Handle_t *dlcHandle)

A function to create an instance of the DLC from a file.

Parameters
  • dlcPath[in] path the DLC

  • logger[in] a log handle produced from QnnSystemLog_create(). Can be NULL

  • dlcHandle[out] A handle to the created instance of a systemContext entity

Returns

Error code

  • QNN_SUCCESS: Successfully created a systemContext entity

  • QNN_SYSTEM_DLC_ERROR_INVALID_ARGUMENT: sysCtxHandle is NULL

  • QNN_COMMON_ERROR_MEM_ALLOC: Error encountered in allocating memory for systemContext instance

  • QNN_SYSTEM_DLC_ERROR_UNSUPPORTED_FEATURE: system context features not supported

Qnn_ErrorHandle_t QnnSystemDlc_createFromBinary(Qnn_LogHandle_t logger, const uint8_t *buffer, const Qnn_ContextBinarySize_t bufferSize, QnnSystemDlc_Handle_t *dlcHandle)

A function to create an instance of the DLC from a binary buffer.

Parameters
  • buffer[in] pointer to buffer representing the DLC

  • logger[in] a log handle produced from QnnSystemLog_create(). Can be NULL

  • bufferSize[in] size of the binary buffer

  • dlcHandle[out] A handle to the created instance of a systemContext entity

Returns

Error code

  • QNN_SUCCESS: Successfully created a systemContext entity

  • QNN_SYSTEM_DLC_ERROR_INVALID_ARGUMENT: sysCtxHandle is NULL

  • QNN_COMMON_ERROR_MEM_ALLOC: Error encountered in allocating memory for systemContext instance

  • QNN_SYSTEM_DLC_ERROR_UNSUPPORTED_FEATURE: system context features not supported

Qnn_ErrorHandle_t QnnSystemDlc_composeGraphs(QnnSystemDlc_Handle_t dlcHandle, const QnnSystemDlc_GraphConfigInfo_t **graphConfigs, const uint32_t numGraphConfigs, Qnn_BackendHandle_t backend, Qnn_ContextHandle_t context, QnnInterface_t interface, QnnSystemContext_GraphInfoVersion_t graphVersion, QnnSystemContext_GraphInfo_t **graphs, uint32_t *numGraphs)

A function to compose graphs from a DLC on a particular backend, backend, through an interface interface. Memory allocated in graphs is owned by clients and may be released with calls to free().

Parameters
  • dlcHandle[in] the DLC to retrieve graphs from

  • graphConfigs[in] the graph configuration information for a particular graph

  • numGraphConfigs[in] number of graph configurations

  • backend[in] the backend on which to compose the graphs

  • context[in] the context on which to compose the graphs

  • interface[in] the interface used to compose the graph.

  • logger[in] a log handle produced by QnnSystemLog_create()

  • graphVersion[in] version of the graph info structure to be returned

  • graphs[out] An array of graph information representing what was created with the backend.

  • numGraphs[out] the number of created graphs

Returns

Error code

  • QNN_SUCCESS: Successfully composed graphs.

  • QNN_SYSTEM_DLC_ERROR_INVALID_ARGUMENT: Argument is NULL

  • QNN_COMMON_ERROR_MEM_ALLOC: Error encountered in allocating memory for

  • QNN_SYSTEM_DLC_ERROR_INVALID_HANDLE: Invalid Dlc handle to free

  • QNN_SYSTEM_DLC_ERROR_UNSUPPORTED_FEATURE: DLC features not supported

Qnn_ErrorHandle_t QnnSystemDlc_getOpMappings(QnnSystemDlc_Handle_t dlcHandle, const Qnn_OpMapping_t **opMappings, uint32_t *numOpMappings)

A function to retrieve Op Mapping information from a DLC.

Parameters
  • dlcHandle[in] Handle to the DLC

  • opMappings[out] a list of op mappings. The memory allocated here is owned by the System library and is released when the corresponding DLC Handle is freed.

  • numOpMappings[out] the number of opMappings

Returns

Error code

  • QNN_SUCCESS: Successfully freed instance of System Context

  • QNN_SYSTEM_DLC_ERROR_INVALID_HANDLE: Invalid Dlc handle to free

  • QNN_SYSTEM_DLC_ERROR_UNSUPPORTED_FEATURE: not supported

Qnn_ErrorHandle_t QnnSystemDlc_free(QnnSystemDlc_Handle_t dlcHandle)

A function to free the instance of the System Context object. This API clears any intermediate memory allocated and associated with a valid handle.

Parameters

sysCtxHandle[in] Handle to the System Context object

Returns

Error code

  • QNN_SUCCESS: Successfully freed instance of System Context

  • QNN_SYSTEM_DLC_ERROR_INVALID_HANDLE: Invalid System Context handle to free

  • QNN_SYSTEM_DLC_ERROR_UNSUPPORTED_FEATURE: not supported

struct QnnSystemDlc_GraphConfigInfoV1_t
#include <QnnSystemDlc.h>

Public Members

const char *graphName
const QnnGraph_Config_t **graphConfigs
uint32_t numConfigs
struct QnnSystemDlc_GraphConfigInfo_t
#include <QnnSystemDlc.h>

structure to define

union unnamed
#include <QnnSystemDlc.h>