@@ -71,8 +71,6 @@ We build the required ExecuTorch runtime library (AAR) to run the model.
71
71
72
72
#### XNNPACK
73
73
74
- 1 . Build the AAR target for the library with XNNPACK backend:
75
-
76
74
``` bash
77
75
# go to ExecuTorch repo root
78
76
export ANDROID_NDK=< path-to-android-ndk>
@@ -81,21 +79,18 @@ export ANDROID_ABIS=arm64-v8a
81
79
# Run the following lines from the `executorch/` folder
82
80
./install_executorch.sh --clean
83
81
82
+ # Create a new directory `app/libs` for the AAR to live
83
+ pushd examples/demo-apps/android/ExecuTorchDemo
84
+ mkdir -p app/libs
85
+ popd
86
+
84
87
# Build the AAR. It will include XNNPACK backend by default.
88
+ export BUILD_AAR_DIR=$( realpath examples/demo-apps/android/ExecuTorchDemo/app/libs)
85
89
sh build/build_android_library.sh
86
90
```
87
91
88
- 2 . In ExecuTorchDemo root, create a new directory ` app/libs ` and copy the AAR there.
89
- ``` bash
90
- # go to ExecuTorchDemo root
91
- mkdir -p app/libs
92
- cp " $BUILD_AAR_DIR /executorch.aar" app/libs
93
- ````
94
-
95
92
#### Qualcomm Hexagon NPU
96
93
97
- 1. Build the AAR target for the library with XNNPACK and QNN backend:
98
-
99
94
``` bash
100
95
# go to ExecuTorch repo root
101
96
export ANDROID_NDK=< path-to-android-ndk>
@@ -105,20 +100,19 @@ export QNN_SDK_ROOT=<path-to-qnn-sdk-root>
105
100
# Run the following lines from the `executorch/` folder
106
101
./install_executorch.sh --clean
107
102
108
- # Build the AAR. It will include XNNPACK and QNN backend now.
103
+ # Create a new directory `app/libs` for the AAR to live
104
+ pushd examples/demo-apps/android/ExecuTorchDemo
105
+ mkdir -p app/libs
106
+ popd
107
+
108
+ # Build the AAR. It will include XNNPACK backend by default.
109
+ export BUILD_AAR_DIR=$( realpath examples/demo-apps/android/ExecuTorchDemo/app/libs)
109
110
sh build/build_android_library.sh
110
111
```
111
112
112
113
This is very similar to XNNPACK setup, but users now needs to define ` QNN_SDK_ROOT ` so that
113
114
QNN backend is built into the AAR.
114
115
115
- 2. In ExecuTorchDemo root, create a new directory ` app/libs` and copy the AAR there.
116
- ` ` ` bash
117
- # go to ExecuTorchDemo root
118
- mkdir -p app/libs
119
- cp " $BUILD_AAR_DIR /executorch.aar" app/libs
120
- ` ` ` `
121
-
122
116
## Running the App
123
117
124
118
1 . Open the project ` examples/demo-apps/android/ExecuTorchDemo ` with Android Studio.
0 commit comments