Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HEXAGON] Permit hvx_128 instruction in Blur Target #8197

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions apps/blur/adb_run_on_device.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions apps/support/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

Expand All @@ -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)
Expand All @@ -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
Expand Down