Skip to content

Commit ddabcf7

Browse files
committed
Update
[ghstack-poisoned]
2 parents fc4ec44 + 18c64ad commit ddabcf7

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

backends/xnnpack/CMakeLists.txt

+19-13
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ if(NOT PYTHON_EXECUTABLE)
3333
resolve_python_executable()
3434
endif()
3535

36-
# NB: Enabling this will serialize execution of delegate instances
37-
# Keeping this OFF by default to maintain existing behavior, to be revisited.
36+
# NB: Enabling this will serialize execution of delegate instances Keeping this
37+
# OFF by default to maintain existing behavior, to be revisited.
3838
option(EXECUTORCH_XNNPACK_SHARED_WORKSPACE
39-
"Enable workspace sharing across different delegate instances" ON)
40-
# Keeping this OFF by default due to regressions in decode
41-
# and model load with kleidi kernels
42-
option(EXECUTORCH_XNNPACK_ENABLE_KLEIDI
43-
"Enable Arm Kleidi kernels" OFF)
39+
"Enable workspace sharing across different delegate instances" ON
40+
)
41+
# Keeping this OFF by default due to regressions in decode and model load with
42+
# kleidi kernels
43+
option(EXECUTORCH_XNNPACK_ENABLE_KLEIDI "Enable Arm Kleidi kernels" OFF)
4444
if(EXECUTORCH_XNNPACK_SHARED_WORKSPACE)
4545
add_definitions(-DENABLE_XNNPACK_SHARED_WORKSPACE)
4646
endif()
@@ -100,8 +100,7 @@ include(cmake/Dependencies.cmake)
100100
list(TRANSFORM _xnnpack_backend__srcs PREPEND "${EXECUTORCH_ROOT}/")
101101
add_library(xnnpack_backend STATIC ${_xnnpack_backend__srcs})
102102
target_link_libraries(
103-
xnnpack_backend PRIVATE ${xnnpack_third_party} executorch_core
104-
xnnpack_schema
103+
xnnpack_backend PRIVATE ${xnnpack_third_party} executorch_core xnnpack_schema
105104
)
106105

107106
target_include_directories(
@@ -119,6 +118,12 @@ target_include_directories(
119118
target_compile_options(xnnpack_backend PUBLIC ${_common_compile_options})
120119
target_link_options_shared_lib(xnnpack_backend)
121120

121+
if(EXECUTORCH_BUILD_KERNELS_OPTIMIZED)
122+
list(APPEND xnn_executor_runner_libs optimized_native_cpu_ops_lib)
123+
else()
124+
list(APPEND xnn_executor_runner_libs portable_ops_lib)
125+
endif()
126+
122127
list(APPEND xnn_executor_runner_libs xnnpack_backend executorch)
123128

124129
# ios can only build library but not binary
@@ -134,13 +139,14 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
134139
if(EXECUTORCH_BUILD_DEVTOOLS)
135140
list(APPEND xnn_executor_runner_libs etdump)
136141
else()
137-
message(SEND_ERROR "Use of 'EXECUTORCH_ENABLE_EVENT_TRACER' requires 'EXECUTORCH_BUILD_DEVTOOLS' to be enabled.")
142+
message(
143+
SEND_ERROR
144+
"Use of 'EXECUTORCH_ENABLE_EVENT_TRACER' requires 'EXECUTORCH_BUILD_DEVTOOLS' to be enabled."
145+
)
138146
endif()
139147
endif()
140148

141-
target_link_libraries(
142-
xnn_executor_runner gflags optimized_native_cpu_ops_lib ${xnn_executor_runner_libs}
143-
)
149+
target_link_libraries(xnn_executor_runner gflags ${xnn_executor_runner_libs})
144150
target_compile_options(xnn_executor_runner PUBLIC ${_common_compile_options})
145151
if(EXECUTORCH_BUILD_PTHREADPOOL)
146152
target_link_libraries(xnn_executor_runner extension_threadpool pthreadpool)

0 commit comments

Comments
 (0)