Skip to content

Commit 3483895

Browse files
committed
Fix XNNPACK build on Windows
ghstack-source-id: c75bd2e ghstack-comment-id: 3172080268 Pull-Request: #13259
1 parent a4b4115 commit 3483895

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-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: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ 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)
21+
set_overridable_option(XNNPACK_ENABLE_AVX512BF16 OFF)
1522

1623
# Below options are not yet buildable on Windows, but should be.
1724
set(EXECUTORCH_BUILD_PORTABLE_OPS OFF CACHE BOOL "")
1825
#set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON)
1926
#set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
2027
#set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON)
21-
#set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)

0 commit comments

Comments
 (0)