Skip to content

Commit

Permalink
Fix Android CI (pytorch#2659)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#2659

Reviewed By: mcr229

Differential Revision: D55341606

Pulled By: kirklandsign

fbshipit-source-id: 7f26dcd76f3d5870a641a3ba9f5f73367452ce06
  • Loading branch information
kirklandsign authored and facebook-github-bot committed Mar 26, 2024
1 parent a3bf63b commit bddeb99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/demo-apps/android/ExecuTorchDemo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ cmake .. -DCMAKE_INSTALL_PREFIX=cmake-out \
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON
```

When we set `EXECUTORCH_BUILD_XNNPACK=ON`, we will build the target [`xnn_executor_runner_lib`](https://github.com/pytorch/executorch/blob/main/backends/xnnpack/CMakeLists.txt) which in turn is linked into libexecutorch_jni via [CMake](https://github.com/pytorch/executorch/blob/main/examples/demo-apps/android/jni/CMakeLists.txt).
When we set `EXECUTORCH_BUILD_XNNPACK=ON`, we will build the target [`xnnpack_backend`](https://github.com/pytorch/executorch/blob/main/backends/xnnpack/CMakeLists.txt) which in turn is linked into libexecutorch_jni via [CMake](https://github.com/pytorch/executorch/blob/main/examples/demo-apps/android/jni/CMakeLists.txt).

`libexecutorch_jni.so` wraps up the required XNNPACK Backend runtime library from `xnn_executor_runner_lib`, and adds an additional JNI layer using fbjni. This is later exposed to Java app.
`libexecutorch_jni.so` wraps up the required XNNPACK Backend runtime library from `xnnpack_backend`, and adds an additional JNI layer using fbjni. This is later exposed to Java app.

2. Build the libraries:

Expand Down
6 changes: 3 additions & 3 deletions extension/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ if(CMAKE_TOOLCHAIN_ANDROID)
target_link_libraries(executorch_jni qnn_executorch_backend)
endif()
if(EXECUTORCH_BUILD_XNNPACK)
target_link_libraries(executorch_jni xnn_executor_runner_lib)
target_link_libraries(executorch_jni xnnpack_backend)
endif()
if(EXECUTORCH_BUILD_VULKAN)
target_link_libraries(executorch_jni vulkan_executor_runner_lib)
endif()
target_compile_options(executorch_jni PUBLIC ${_common_compile_options})

add_library(executorch_llama_jni SHARED jni/jni_layer_llama.cpp)
target_link_libraries(executorch_llama_jni fbjni llama_runner)
target_link_libraries(executorch_llama_jni fbjni llama_runner portable_ops_lib)
if(EXECUTORCH_BUILD_XNNPACK)
target_link_libraries(executorch_llama_jni xnn_executor_runner_lib)
target_link_libraries(executorch_llama_jni xnnpack_backend)
endif()
if(EXECUTORCH_BUILD_VULKAN)
target_link_libraries(executorch_llama_jni vulkan_executor_runner_lib)
Expand Down

0 comments on commit bddeb99

Please sign in to comment.