File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
examples/demo-apps/android/LlamaDemo Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ cmake . -DCMAKE_INSTALL_PREFIX="${CMAKE_OUT}" \
16
16
-DEXECUTORCH_BUILD_EXTENSION_DATA_LOADER=ON \
17
17
-DEXECUTORCH_BUILD_EXTENSION_MODULE=ON \
18
18
-DEXECUTORCH_BUILD_OPTIMIZED=ON \
19
+ -DEXECUTORCH_BUILD_XNNPACK=ON \
19
20
-DCMAKE_BUILD_TYPE=Release \
20
21
-B" ${CMAKE_OUT} "
21
22
@@ -30,6 +31,7 @@ cmake examples/models/llama2 \
30
31
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK /build/cmake/android.toolchain.cmake \
31
32
-DANDROID_ABI=" $ANDROID_ABI " \
32
33
-DCMAKE_INSTALL_PREFIX=" ${CMAKE_OUT} " \
34
+ -DEXECUTORCH_BUILD_XNNPACK=ON \
33
35
-DCMAKE_BUILD_TYPE=Release \
34
36
-B" ${CMAKE_OUT} " /examples/models/llama2
35
37
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
61
61
set (CUSTOM_OPS_PATH ${CMAKE_CURRENT_BINARY_DIR} /../../examples/models/llama2/custom_ops/libcustom_ops.a )
62
62
add_library (custom_ops STATIC IMPORTED )
63
63
set_property (TARGET custom_ops PROPERTY IMPORTED_LOCATION ${CUSTOM_OPS_PATH} )
64
+ target_link_options_shared_lib (custom_ops )
65
+
66
+ set (CUSTOM_OPS_LIB_PATH ${CMAKE_CURRENT_BINARY_DIR} /../../examples/models/llama2/custom_ops/libcustom_ops_lib.a )
67
+ add_library (custom_ops_lib STATIC IMPORTED )
68
+ set_property (TARGET custom_ops_lib PROPERTY IMPORTED_LOCATION ${CUSTOM_OPS_LIB_PATH} )
69
+ target_link_options_shared_lib (custom_ops_lib )
64
70
65
71
if (TARGET pthreadpool )
66
72
set (LLAMA_JNI_SRCS jni/jni_layer_llama.cpp ../../backends/xnnpack/threadpool/cpuinfo_utils.cpp )
@@ -77,6 +83,6 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
77
83
endif ()
78
84
target_include_directories (executorch_llama_jni PRIVATE ${_common_include_directories} )
79
85
target_link_libraries (executorch_llama_jni ${link_libraries} llama_runner
80
- custom_ops cpublas eigen_blas )
86
+ custom_ops custom_ops_lib cpublas eigen_blas )
81
87
target_compile_options (executorch_llama_jni PUBLIC ${_common_compile_options} )
82
88
endif ()
You can’t perform that action at this time.
0 commit comments