QNN LPAI Data Structures and Enumerations

QnnBackend_Property_t

This structure provides backend property. This data structure is defined in QnnBackend header file present at <QNN_SDK_DIR>/include/QNN/.

Parameters

Desctiption

QnnBackend_PropertyOption_t option

Option is used by clients to set or get any backend property.

QnnBackend_CustomProperty_t customProperty

Pointer to the backend property requested by client.

QnnLpaiBackend_GetPropertyOption_t

This enum contains the set of properties supported by the LPAI backend. Objects of this type are to be referenced through QnnBackend_CustomProperty_t. This enum is defined in QnnLpaiBackend header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Property

Desctiption

QNN_LPAI_BACKEND_GET_PROP_ALIGNMENT_REQ

Used to get the start address alignment and size alignment requirement of buffers. Struct: QnnLpaiBackend_BufferAlignmentReq_t

QNN_LPAI_BACKEND_GET_PROP_REQUIRE_PERSISTENT_BINARY

Used to query if cached binary buffer needs to be persistent until QnnContext_free is called. If yes, then need to specify QNN_CONTEXT_CONFIG_PERSISTENT_BINARY during QnnContext_createFromBinary

QNN_LPAI_BACKEND_GET_PROP_UNDEFINED

Unused

QnnContext_Config_t

The QnnContext_ConfigOption_t structure provides context configuration. This data structure is defined in QnnContext header file present at <QNN_SDK_DIR>/include/QNN/.

Parameters

Desctiption

QnnContext_ConfigOption_t option

Provides option to set context configs. See QnnContext_ConfigOption_t

uint8_t isPersistentBinary

Used with QNN_CONTEXT_CONFIG_PERSISTENT_BINARY

QnnContext_ConfigOption_t

This enum defines context config options. This enum has multiple options, but the following option is specific to QNN-LPAI BE. This enum is defined in QnnContext header file present at <QNN_SDK_DIR>/include/QNN/.

Property

Desctiption

QNN_CONTEXT_CONFIG_PERSISTENT_BINARY

Indicates that the context binary pointer is available during QnnContext_createFromBinary and until QnnContext_free is called.

QnnLpaiDevice_DeviceInfoExtension_t

QnnDevice_getPlatformInfo() uses this structure to list the supported device features/information. This data structure is defined in QnnLpaiDevice header file present at <QNN_SDK_DIR>/include/QNN/LPAI/

Parameters

Desctiption

uint32_t socModel

An enum value defined in Qnn Header that represents SoC model

uint32_t arch

It shows the architecture of the device

const char* domainName

It shows the domain name of the device

QnnLpaiGraph_Mem_t

QnnGraph_setConfig() API used this structure to set custom configs for scratch and persistent buffer. This data structure is defined in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI.

Parameters

Desctiption

QnnLpaiMem_MemType_t memType

An enum value defined in enum QnnLpaiMem_MemType_t to memory type of buffer.

uint32_t size

Size of buffer

void* addr

Pointer to buffer

QnnLpaiMem_MemType_t

This enum contains memory type supported by LPAI backend. This enum is defined in QnnLpaiMem header file present at <QNN_SDK_DIR>/include/QNN/LPAI.

Property

Desctiption

QNN_LPAI_MEM_TYPE_DDR

Main memory, only available in non-island mode

QNN_LPAI_MEM_TYPE_LLC

Last level cache

QNN_LPAI_MEM_TYPE_TCM

Tightly coupled memory for hardware

QNN_LPAI_MEM_TYPE_UNDEFINED

Unused

QnnGraph_Config_t

This structure provides graph configuration. This data structure is declared in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/.

Parameters

Desctiption

QnnGraph_ConfigOption_t option

An enum value defined in enum QnnGraph_ConfigOption_t to set custom graph configs.

QnnGraph_CustomConfig_t customConfig

Pointer to custom graph configs

QnnLpaiGraph_CustomConfig_t

This structure is used by QnnGraph_setConfig() to set backend specific configurations before finalizing the graph. This data structure is declared in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Parameters

Desctiption

uint32_t option

An enum value defined in QnnLpaiGraph_SetConfigOption_t set backend specific configs to graph

| set backend specific configs to graph |

QnnLpaiGraph_SetConfigOption_t

This enum contains custom configs for LPAI backend graph. This enum is defined in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI.

Property

Desctiption

QNN_LPAI_GRAPH_SET_CFG_SCRATCH_MEM

Used to set scratch memory configs. Struct: QnnLpaiGraph_Mem_t

QNN_LPAI_GRAPH_SET_CFG_PERSISTENT_MEM

Used to set persistent memory configs. Struct: QnnLpaiGraph_Mem_t

QNN_LPAI_GRAPH_SET_CFG_PERF_CFG

Used to set custom client perf configs. Struct: QnnLpaiGraph_PerfCfg_t

QNN_LPAI_GRAPH_SET_CFG_CORE_AFFINITY

Used to set core affinity configs. Struct: QnnLpaiGraph_CoreAffinity_t

QNN_LPAI_GRAPH_SET_CFG_UNDEFINED

Unused

QnnLpaiBackend_BufferAlignmentReq_t

This structure contains parameters needed to align the start address of buffer and size of buffer. This data structure is declared in QnnLpaiBackend header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Parameters

Desctiption

uint32_t startAddrAlignment

Represents start address alignment of buffer. The start address of the buffer must be startAddrAlignment-byte aligned

uint32_t sizeAlignment

Represents buffer size alignment. The allocated buffer must be a multiple of sizeAlignment bytes

QnnLpaiGraph_CustomProperty_t

This structure is used by QnnGraph_getProperty() API to get backend specific configurations. This data structure is defined in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Parameters

Desctiption

uint32_t option

An enum value defined in enum QnnLpaiGraph_GetPropertyOption_t to retrieve backend specific property.

void* property

Pointer to custom property

QnnLpaiGraph_GetPropertyOption_t

This enum contains the set of properties supported by the LPAI backend. Objects of this type are to be referenced through QnnLpaiGraph_CustomProperty_t. This enum is defined in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Property

Desctiption

QNN_LPAI_GRAPH_GET_PROP_SCRATCH_MEM_SIZE

Get the size requirement of scratch memory

QNN_LPAI_GRAPH_GET_PROP_PERSISTENT_MEM_SIZE

Get the size requirement of persistent memory

QNN_LPAI_GRAPH_GET_PROP_UNDEFINED

Unused

QnnLpaiGraph_CoreAffinity_t

This structure is used by QnnGraph_getProperty() to get backend specific configurations. This data structure is defined in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Parameters

Desctiption

QnnLpaiGraph_CoreAffinityType_t affinity

Used to set the affinity of selected eNPU core QnnLpaiGraph_CoreAffinityType_t

uint32_t coreSelection

Pointer to custom property

QnnLpaiGraph_CoreAffinityType_t

This enum contains the possible set of affinities supported by eNPU HW. This enum is defined in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Property

Desctiption

QNN_LPAI_GRAPH_CORE_AFFINITY_SOFT

Used to set affinity to soft. Struct: QnnLpaiGraph_CoreAffinity_t.

QNN_LPAI_GRAPH_CORE_AFFINITY_HARD

Used to set affinity to hard Struct: QnnLpaiGraph_CoreAffinity_t.

QNN_LPAI_GRAPH_CORE_AFFINITY_UNDEFINED

Unused

QnnLpaiGraph_PerfCfg_t

This structure is used to set Client’s performance requirement for eNPU Usage. User can configure it before finalizing the graph. This data structure is declared in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Parameters

Desctiption

uint32_t fps

Used to set frame per second (fps)

uint32_t ftrtRatio

Used to set FTRT ratio

QnnLpaiGraph_ClientPerfType_t clientType

Used to set client type (Real time or Non-real time) enum: QnnLpaiGraph_ClientPerfType_t

QnnLpaiGraph_ClientPerfType_t

This enum contains the type of client which can be configured by user before finalizing the graph. This data structure is declared in QnnLpaiGraph header file present at <QNN_SDK_DIR>/include/QNN/LPAI/.

Property

Desctiption

QNN_LPAI_GRAPH_CLIENT_PERF_TYPE_REAL_TIME

Used to set client as REAL TIME. Struct: QnnLpaiGraph_PerfCfg_t.

QNN_LPAI_GRAPH_CLIENT_PERF_TYPE_NON_REAL_TIME

Used to set client as NON-REAL TIME Struct: QnnLpaiGraph_PerfCfg_t.

QNN_LPAI_GRAPH_CLIENT_PERF_TYPE__UNDEFINED

Unused