diff --git a/apps/blur/adb_run_on_device.sh b/apps/blur/adb_run_on_device.sh index 9f6cf392a529..ce319a1433c3 100755 --- a/apps/blur/adb_run_on_device.sh +++ b/apps/blur/adb_run_on_device.sh @@ -10,27 +10,24 @@ DEVICE_ENV="LD_LIBRARY_PATH=${DEVICE_PATH}:/vendor/lib64 ADSP_LIBRARY_PATH=\"${D HEXAGON_RUNTIME_PATH=../../src/runtime/hexagon_remote BIN=bin -#TODO: It would be nice to just use HL_TARGET, but that means one -#cannot enable extra target features without jumping through hoops. If -#we had a way to extra the 'base target' from an HL_TARGET environment -#variable... -APP_TARGET=arm-64-android - # Build the app. -make bin/${APP_TARGET}/test +make bin/${HL_TARGET}/test # Make a folder on device for the app and our dependencies. adb shell mkdir -p ${DEVICE_PATH} # Push the Hexagon runtime to $DEVICE_PATH. -adb push ${HEXAGON_RUNTIME_PATH}/bin/${APP_TARGET}/libhalide_hexagon_host.so ${DEVICE_PATH} -adb push ${HEXAGON_RUNTIME_PATH}/bin/v60/signed_by_debug/libhalide_hexagon_remote_skel.so ${DEVICE_PATH} +if [[ "$HL_TARGET" == *"-hvx"* ]]; then + RUNTIME=${HL_TARGET%%-hvx*} + adb push ${HEXAGON_RUNTIME_PATH}/bin/${RUNTIME}/libhalide_hexagon_host.so ${DEVICE_PATH} + adb push ${HEXAGON_RUNTIME_PATH}/bin/v60/signed_by_debug/libhalide_hexagon_remote_skel.so ${DEVICE_PATH} -# If there's a testsig installed in the usual location, copy it to -# $DEVICE_PATH so it is visible to our modified $ASDP_LIBRARY_PATH. -adb shell cp /system/lib/rfsa/adsp/testsig* ${DEVICE_PATH} > /dev/null || true + # If there's a testsig installed in the usual location, copy it to + # $DEVICE_PATH so it is visible to our modified $ASDP_LIBRARY_PATH. + adb shell cp /system/lib/rfsa/adsp/testsig* ${DEVICE_PATH} > /dev/null || true +fi # Push and run the app! -adb push ${BIN}/${APP_TARGET}/test ${DEVICE_PATH} +adb push ${BIN}/${HL_TARGET}/test ${DEVICE_PATH} adb shell chmod +x ${DEVICE_PATH}/test adb shell ${DEVICE_ENV} ${DEVICE_PATH}/test diff --git a/apps/support/Makefile.inc b/apps/support/Makefile.inc index 0611a6806c6e..754d9d0a0125 100644 --- a/apps/support/Makefile.inc +++ b/apps/support/Makefile.inc @@ -122,6 +122,8 @@ CXX-host-hvx ?= $(CXX) CXX-hexagon-32-qurt-hvx ?= hexagon-clang++ CXX-arm-64-android ?= ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ANDROID_NDK_HOST_PLATFORM}-x86_64/bin/aarch64-linux-android${ANDROID_API_VERSION}-clang++ CXX-arm-64-android-arm_dot_prod ?= $(CXX-arm-64-android) +CXX-arm-64-android-hvx ?= $(CXX-arm-64-android) +CXX-arm-64-android-hvx_128 ?= $(CXX-arm-64-android) CXX-arm-32-android ?= ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ANDROID_NDK_HOST_PLATFORM}-x86_64/bin/armv7a-linux-androideabi${ANDROID_API_VERSION}-clang++ CXX-arm-64-profile-android ?= $(CXX-arm-64-android) CXX-arm-32-profile-android ?= $(CXX-arm-32-android) @@ -132,6 +134,8 @@ CXXFLAGS-host-cuda ?= $(CXXFLAGS) CXXFLAGS-host-metal ?= $(CXXFLAGS) CXXFLAGS-arm-64-android ?= $(CXXFLAGS) CXXFLAGS-arm-64-android-arm_dot_prod ?= $(CXXFLAGS-arm-64-android) +CXXFLAGS-arm-64-android-hvx ?= $(CXXFLAGS-arm-64-android) +CXXFLAGS-arm-64-android-hvx_128 ?= $(CXXFLAGS-arm-64-android) CXXFLAGS-hexagon-32-qurt-hvx ?= -mv65 $(CXXFLAGS) -I$(HEXAGON_SDK_ROOT)/rtos/qurt/computev65/include/qurt -I$(HEXAGON_SDK_ROOT)/rtos/qurt/computev65/include/posix CXXFLAGS-arm-32-android ?= $(CXXFLAGS) @@ -144,6 +148,8 @@ AR-host-hvx ?= $(AR) AR-hexagon-32-qurt-hvx ?= ar AR-arm-64-android ?= ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ANDROID_NDK_HOST_PLATFORM}-x86_64/bin/llvm-ar AR-arm-64-android-arm_dot_prod ?= $(AR-arm-64-android) +AR-arm-64-android-hvx ?= $(AR-arm-64-android) +AR-arm-64-android-hvx_128 ?= $(AR-arm-64-android) AR-arm-32-android ?= ${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ANDROID_NDK_HOST_PLATFORM}-x86_64/bin/armv7a-linux-androideabi-ar AR-arm-64-profile-android ?= $(AR-arm-64-android) AR-arm-32-profile-android ?= $(AR-arm-32-android) @@ -158,6 +164,8 @@ LDFLAGS-hexagon-32-qurt-hvx = # of deployment. (Despite the name, this applies to libc++, not libstdc++) LDFLAGS-arm-64-android ?= -llog -fPIE -pie -static-libstdc++ LDFLAGS-arm-64-android-arm_dot_prod ?= $(LDFLAGS-arm-64-android) +LDFLAGS-arm-64-android-hvx ?= $(LDFLAGS-arm-64-android) +LDFLAGS-arm-64-android-hvx_128 ?= $(LDFLAGS-arm-64-android) LDFLAGS-arm-32-android ?= -llog -fPIE -pie -static-libstdc++ # Put HL_TARGET variants of all of these last, to avoid conflict with the android variants