Skip to content

Commit bd7669b

Browse files
committed
Fix XNNPACK build on Windows
ghstack-source-id: cf9cd1c ghstack-comment-id: 3172080268 Pull-Request: #13259
1 parent 34dd2fe commit bd7669b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

backends/xnnpack/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ foreach(fbs_file ${_xnnpack_schema__srcs})
5959
)
6060
endforeach()
6161

62-
if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
62+
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
6363
set(MV_COMMAND
6464
powershell -Command
6565
"Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs}"

tools/cmake/preset/windows.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,15 @@ set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
1212
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON)
1313
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL ON)
1414
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
15+
set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)
16+
17+
# These XNNPACK options don't currently build on Windows.
18+
set_overridable_option(XNNPACK_ENABLE_AVX256SKX OFF)
19+
set_overridable_option(XNNPACK_ENABLE_AVX256VNNI OFF)
20+
set_overridable_option(XNNPACK_ENABLE_AVX256VNNIGFNI OFF)
1521

1622
# Below options are not yet buildable on Windows, but should be.
1723
set(EXECUTORCH_BUILD_PORTABLE_OPS OFF CACHE BOOL "")
1824
#set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON)
1925
#set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
2026
#set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON)
21-
#set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)

0 commit comments

Comments
 (0)