File tree Expand file tree Collapse file tree
backends/qualcomm/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,6 +127,13 @@ if [ "$BUILD_ANDROID" = true ]; then
127127
128128 # DSP_TYPE variable only matters when building direct_mode.
129129 # Ignore the variable for traditional mode.
130+
131+ if [ " $BUILD_HEXAGON " = " true" ]; then
132+ DIRECT_MODE_FLAG=" -DBUILD_DIRECT_MODE=ON"
133+ else
134+ DIRECT_MODE_FLAG=" -DBUILD_DIRECT_MODE=OFF"
135+ fi
136+
130137 cmake $PRJ_ROOT /$EXAMPLE_ROOT \
131138 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT /build/cmake/android.toolchain.cmake \
132139 -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
@@ -140,6 +147,7 @@ if [ "$BUILD_ANDROID" = true ]; then
140147 -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=BOTH \
141148 -DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
142149 -DDSP_TYPE=$DSP_TYPE \
150+ $DIRECT_MODE_FLAG \
143151 -B$EXAMPLE_ROOT
144152
145153 cmake --build $EXAMPLE_ROOT -j$BUILD_JOB_NUMBER
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/qaihub_scripts/stable_diffusion)
8989# direct-mode qnn_executor_direct_runner is build with ndk toolchain, paired
9090# with libraries built with hexagon toolchain, communicate through self-defined
9191# fastrpc protocol.
92- if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" AND DEFINED ENV{HEXAGON_SDK_ROOT})
92+ option (BUILD_DIRECT_MODE "Build direct mode executor runner" OFF )
93+ if (BUILD_DIRECT_MODE)
9394 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /direct_executor_runner )
9495endif ()
You can’t perform that action at this time.
0 commit comments