Halide 19.0.0
Halide compiler and libraries
|
Halide supports offloading work to Qualcomm Hexagon DSP on Qualcomm Snapdragon 845/710 devices or newer. The Hexagon DSP provides a set of 128 byte vector instruction extensions - the Hexagon Vector eXtensions (HVX). HVX is well suited for image processing, and Halide for Hexagon HVX will generate the appropriate HVX vector instructions from a program authored in Halide.
Halide can be used to compile Hexagon object files directly, by using a target such as hexagon-32-qurt-hvx
.
Halide can also be used to offload parts of a pipeline to Hexagon using the hexagon
scheduling directive. To enable the hexagon
scheduling directive, include the hvx
target feature in your target. The currently supported combination of targets is to use the HVX target features with an x86 linux host (to use the simulator) or with an ARM android target (to use Hexagon DSP hardware). For examples of using the hexagon
scheduling directive on both the simulator and a Hexagon DSP, see the blur example app.
To build and run an example app using the Hexagon target,
(Follow the instructions given previously, just be sure to check out the main
branch.)
Go to https://qpm.qualcomm.com/#/main/home
In addition to running Hexagon code on device, Halide also supports running Hexagon code on the simulator from the Hexagon tools.
To build and run the blur example in Halide/apps/blur on the simulator:
To build the example for Android, first ensure that you have Android NDK r19b or later installed, and the ANDROID_NDK_ROOT environment variable points to it. (Note that Qualcomm Hexagon SDK v4.3.0 includes Android NDK r19c, which is fine.)
Now build and run the blur example using the script to run it on device: