DSP

This section provides information specific to QNN DSP backend.

API Specializations

This section contains information related to API specialization for the DSP backend. All QNN DSP backend specialization is available under <QNN_SDK_ROOT>/include/QNN/DSP/ directory.

The current version of the QNN DSP backend API is:

QNN DSP Performance Infrastructure API

Clients can invoke QnnBackend_getPerfInfrastructure after loading the QNN DSP library and then invoke methods that are available in file_include_QNN_DSP_QnnDspPerfInfrastructure.h. These APIs allow a client to control the DSP accelerator’s system settings thereby giving fine-grained control of the accelerator. A few use-cases are:

  1. Set up a voting policy by controlling the voltage corners.

  2. Set up DCVS modes to achieve different performance settings as applicable to a use-case.

  3. Set up the number of threads for the accelerator.

Note:

  1. The DCVS participation flag will be set to FALSE if the dcvsEnableConfig QnnDspPerfInfrastructure_DcvsEnable_t is not provided.

  2. In a power set call, the power mode will be set to power save mode if it is not specified as part of the configs.

QNN DSP Backend API

file_include_QNN_DSP_QnnDspBackend.h is the backend specialization header that goes along with file_include_QNN_QnnBackend.h. This header file allows clients to configure the QnnBackend to cater to specific use-cases using exhale_struct_structQnnDspBackend__CustomConfig .

QNN DSP Backend Config Options (QnnDspBackend_CustomConfig_t)

Option Name

Option Description

Default

When to use

QNN_DSP_BACKEND_CONFIG_OPTION_ARCH

Data structure to configure a Backend to set the DSP Arch. The driver will use ops that are compatible to this DSP Arch

QNN_DSP_BACKEND_ARCH_NONE

Client can provide as part of the custom config when there are multiple backends in use

QNN_DSP_BACKEND_CONFIG_OPTION_USE_SIGNED_PROCESS_DOMAIN

Enables signed process domain(PD). In order to use this flag, client also needs to push a signed dsp image to target

False (Unsigned Process Domain)

Client use signed process domain. Check Hexagon SDK document for more detail.

Client can set Dsp arch as shown below: Refer QnnDspBackend_DspArch_t for setting Dsp Arch.

1QnnDspBackend_CustomConfig_t customConfig;
2customConfig.option = QNN_DSP_BACKEND_CONFIG_OPTION_ARCH;
3customConfig.arch = QNN_DSP_BACKEND_DSP_ARCH_V66;
4
5QnnBackend_Config_t backendConfig;
6backendConfig.option = QNN_BACKEND_CONFIG_OPTION_CUSTOM;
7backendConfig.customConfig = &customConfig;
8
9const QnnBackend_Config_t* pBackendConfig[] = {&backendConfig, NULL};

Client can set signed PD as shown below:

1QnnDspBackend_CustomConfig_t customConfig;
2customConfig.option = QNN_DSP_BACKEND_CONFIG_OPTION_USE_SIGNED_PROCESS_DOMAIN;
3customConfig.useSignedProcessDomain = true;
4
5QnnBackend_Config_t backendConfig;
6backendConfig.option = QNN_BACKEND_CONFIG_OPTION_CUSTOM;
7backendConfig.customConfig = &customConfig;
8
9const QnnBackend_Config_t* pBackendConfig[] = {&backendConfig, NULL};