Skip to content

Fix XNNPACK build on Windows #13259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: gh/GregoryComer/115/head
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backends/xnnpack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ foreach(fbs_file ${_xnnpack_schema__srcs})
)
endforeach()

if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Windows")
set(MV_COMMAND
powershell -Command
"Move-Item -Path ${_xnnpack_flatbuffer__outputs} -Destination ${_xnnpack_schema__outputs}"
Expand Down
8 changes: 7 additions & 1 deletion tools/cmake/preset/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ set_overridable_option(EXECUTORCH_BUILD_EXTENSION_FLAT_TENSOR ON)
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON)
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL ON)
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)

# These XNNPACK options don't currently build on Windows.
set_overridable_option(XNNPACK_ENABLE_AVX256SKX OFF)
set_overridable_option(XNNPACK_ENABLE_AVX256VNNI OFF)
set_overridable_option(XNNPACK_ENABLE_AVX256VNNIGFNI OFF)
set_overridable_option(XNNPACK_ENABLE_AVX512BF16 OFF)

# Below options are not yet buildable on Windows, but should be.
set(EXECUTORCH_BUILD_PORTABLE_OPS OFF CACHE BOOL "")
#set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON)
#set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
#set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON)
#set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)
Loading