Skip to content

Commit 07eb609

Browse files
SS-JIAfacebook-github-bot
authored andcommitted
Add Vulkan executor runner to Android JNIs (#2563)
Summary: Pull Request resolved: #2563 imported-using-ghimport Test Plan: Imported from OSS Reviewed By: kirklandsign Differential Revision: D55198671 Pulled By: SS-JIA fbshipit-source-id: db77d7952a40b71047c6df23545fd86eff90de2b
1 parent c45d6d5 commit 07eb609

File tree

2 files changed

+29
-19
lines changed

2 files changed

+29
-19
lines changed

backends/vulkan/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*iOS\.cmake$")
116116
target_compile_options(vulkan_executor_runner PUBLIC ${VULKAN_CXX_FLAGS})
117117

118118
add_library(vulkan_executor_runner_lib STATIC ${VULKAN_RUNNER_SRCS})
119-
target_link_libraries(vulkan_executor_runner_lib ${_executor_runner_libs}
120-
vulkan_schema vulkan_backend)
119+
target_link_libraries(
120+
vulkan_executor_runner_lib ${_executor_runner_libs} vulkan_schema
121+
vulkan_backend vulkan_api_lib ${VULKAN_STANDARD_OPS_LIBS})
121122
target_compile_options(vulkan_executor_runner_lib PUBLIC ${VULKAN_CXX_FLAGS})
122123
endif()
123124

extension/android/CMakeLists.txt

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
87
cmake_minimum_required(VERSION 3.19)
98

109
project(executorch_jni)
@@ -14,22 +13,32 @@ include(${EXECUTORCH_ROOT}/build/Utils.cmake)
1413

1514
set(_common_include_directories ${EXECUTORCH_ROOT}/..)
1615

17-
add_subdirectory(
18-
${EXECUTORCH_ROOT}/examples/third-party/fbjni
19-
${CMAKE_CURRENT_BINARY_DIR}/third-party/fbjni)
16+
add_subdirectory(${EXECUTORCH_ROOT}/examples/third-party/fbjni
17+
${CMAKE_CURRENT_BINARY_DIR}/third-party/fbjni)
2018

2119
if(CMAKE_TOOLCHAIN_ANDROID)
22-
add_library(executorch_jni SHARED jni/jni_layer.cpp)
23-
target_link_libraries(executorch_jni extension_data_loader
24-
extension_module xnn_executor_runner_lib fbjni)
25-
if(EXECUTORCH_BUILD_QNN)
26-
target_link_libraries(executorch_jni qnn_executorch_backend)
27-
endif()
28-
target_compile_options(executorch_jni PUBLIC ${_common_compile_options})
29-
30-
add_library(executorch_llama_jni SHARED jni/jni_layer_llama.cpp)
31-
target_link_libraries(executorch_llama_jni fbjni llama_runner
32-
xnn_executor_runner_lib)
33-
target_compile_options(executorch_llama_jni PUBLIC
34-
${_common_compile_options})
20+
add_library(executorch_jni SHARED jni/jni_layer.cpp)
21+
target_link_libraries(executorch_jni extension_data_loader extension_module
22+
fbjni)
23+
if(EXECUTORCH_BUILD_QNN)
24+
target_link_libraries(executorch_jni qnn_executorch_backend)
25+
endif()
26+
if(EXECUTORCH_BUILD_XNNPACK)
27+
target_link_libraries(executorch_jni xnn_executor_runner_lib)
28+
endif()
29+
if(EXECUTORCH_BUILD_VULKAN)
30+
target_link_libraries(executorch_jni vulkan_executor_runner_lib)
31+
endif()
32+
target_compile_options(executorch_jni PUBLIC ${_common_compile_options})
33+
34+
add_library(executorch_llama_jni SHARED jni/jni_layer_llama.cpp)
35+
target_link_libraries(executorch_llama_jni fbjni llama_runner)
36+
if(EXECUTORCH_BUILD_XNNPACK)
37+
target_link_libraries(executorch_llama_jni xnn_executor_runner_lib)
38+
endif()
39+
if(EXECUTORCH_BUILD_VULKAN)
40+
target_link_libraries(executorch_llama_jni vulkan_executor_runner_lib)
41+
endif()
42+
43+
target_compile_options(executorch_llama_jni PUBLIC ${_common_compile_options})
3544
endif()

0 commit comments

Comments
 (0)