Skip to content

Commit d937d9d

Browse files
committed
Fix the android demo app tutorial
Add more details to XNNPACK JNI lib
1 parent 2ce7329 commit d937d9d

File tree

1 file changed

+12
-3
lines changed
  • examples/demo-apps/android/ExecuTorchDemo

1 file changed

+12
-3
lines changed

examples/demo-apps/android/ExecuTorchDemo/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@ cmake .. \
7575
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON
7676
```
7777

78-
2. Configure a library with XNNPACK and Qualcomm HTP backend
78+
When we make `EXECUTORCH_BUILD_XNNPACK=ON`, we will build the target [`xnn_executor_runner_lib`](../../../../backends/xnnpack/CMakeLists.txt) and this is built into in [CMake](../jni/CMakeLists.txt).
79+
80+
`libexecutorchdemo.so` wraps up the required XNNPACK Backend runtime library from `xnn_executor_runner_lib`, and add an additional JNI layer using fbjni. This is later exposed to Java app.
81+
82+
2. *Optional:* Configure a library with XNNPACK and [Qualcomm HTP backend](../../../../backends/qualcomm/README.md)
83+
84+
Qualcomm SDK is required for this step.
7985

8086
```bash
8187
rm -rf cmake-out && mkdir cmake-out && cd cmake-out
@@ -92,6 +98,8 @@ cmake .. \
9298
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON
9399
```
94100

101+
Similar to the previous XNNPACK library, with this setup, `libexecutorchdemo.so` wraps up the XNNPACK Backend and Qualcomm HTP runtime library and fbjni. This is later exposed to Java app.
102+
95103
## Building and Copying Libraries
96104

97105
1. Build the libraries:
@@ -134,11 +142,12 @@ Note: Please refer to [XNNPACK backend](../../../backend/README.md) and [Qualcom
134142
export FLATC_EXECUTABLE=$(realpath third-party/flatbuffers/cmake-out/flatc)
135143
python3 -m examples.backend.xnnpack_examples --model_name="dl3" --delegate
136144
python3 -m examples.backend.xnnpack_examples --model_name="ic4" --delegate
137-
cp dl3_xnnpack_fp32.pte ic4_xnnpack_fp32.pte examples/android_demo_apps/ExecuTorchDemo/app/src/main/assets/
145+
mkdir -p examples/demo-apps/android/ExecuTorchDemo/app/src/main/assets/
146+
cp dl3_xnnpack_fp32.pte ic4_xnnpack_fp32.pte examples/demo-apps/android/ExecuTorchDemo/app/src/main/assets/
138147
```
139148

140149
## Final Steps
141150

142-
1. Open the project `examples/android_demo_apps/ExecuTorchDemo` with Android Studio.
151+
1. Open the project `examples/demo-apps/android/ExecuTorchDemo` with Android Studio.
143152

144153
2. [Run](https://developer.android.com/studio/run) the app (^R)

0 commit comments

Comments
 (0)