Skip to content

Commit 75c27c3

Browse files
larryliu0820facebook-github-bot
authored andcommitted
Fix llama runner test (#2981)
Summary: Pull Request resolved: #2981 As titled, a quick follow up of D55907750 Reviewed By: lucylq Differential Revision: D55996735 fbshipit-source-id: f535b013b7b900c5a2c2ed79f6b6738dcf1f91ec
1 parent cb9caa3 commit 75c27c3

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

examples/models/llama2/CMakeLists.txt

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ cmake_dependent_option(
3434
cmake_dependent_option(EXECUTORCH_BUILD_CPUINFO "Build cpuinfo library." ON
3535
"NOT EXECUTORCH_BUILD_ARM_BAREMETAL" OFF)
3636

37-
3837
if(NOT PYTHON_EXECUTABLE)
3938
set(PYTHON_EXECUTABLE python3)
4039
endif()
@@ -111,32 +110,26 @@ if(EXECUTORCH_BUILD_CUSTOM)
111110
list(APPEND link_libraries custom_ops_lib)
112111
endif()
113112

113+
set(XNNPACK_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../backends/xnnpack)
114114
# Extra compile option and include dir for pthreadpool
115115
if(EXECUTORCH_BUILD_PTHREADPOOL)
116116
list(APPEND _common_compile_options -DET_USE_THREADPOOL)
117117
list(APPEND link_libraries pthreadpool)
118-
list(
119-
APPEND
120-
_srcs
121-
${CMAKE_CURRENT_SOURCE_DIR}/../../../backends/xnnpack/threadpool/threadpool.cpp
122-
${CMAKE_CURRENT_SOURCE_DIR}/../../../backends/xnnpack/threadpool/threadpool_guard.cpp
123-
)
124-
list(APPEND _common_include_directories ${CMAKE_CURRENT_SOURCE_DIR}/../../../backends/xnnpack/third-party/pthreadpool/include)
118+
# These 2 source files are included in xnnpack_backend
119+
if(NOT TARGET xnnpack_backend)
120+
list(APPEND _srcs ${XNNPACK_ROOT}/threadpool/threadpool.cpp
121+
${XNNPACK_ROOT}/threadpool/threadpool_guard.cpp)
122+
endif()
123+
list(APPEND _common_include_directories
124+
${XNNPACK_ROOT}/third-party/pthreadpool/include)
125125
endif()
126126

127127
# Extra sources for cpuinfo
128128
if(EXECUTORCH_BUILD_CPUINFO)
129129
list(APPEND link_libraries cpuinfo)
130-
list(
131-
APPEND
132-
_srcs
133-
${CMAKE_CURRENT_SOURCE_DIR}/../../../backends/xnnpack/threadpool/cpuinfo_utils.cpp
134-
)
135-
list(
136-
APPEND
137-
_common_include_directories
138-
${CMAKE_CURRENT_SOURCE_DIR}/../../../backends/xnnpack/third-party/cpuinfo/include
139-
)
130+
list(APPEND _srcs ${XNNPACK_ROOT}/threadpool/cpuinfo_utils.cpp)
131+
list(APPEND _common_include_directories
132+
${XNNPACK_ROOT}/third-party/cpuinfo/include)
140133
endif()
141134

142135
# XNNPACK

0 commit comments

Comments
 (0)