diff --git a/backends/xnnpack/CMakeLists.txt b/backends/xnnpack/CMakeLists.txt index 5e2bc3d3f9b..028709fcedc 100644 --- a/backends/xnnpack/CMakeLists.txt +++ b/backends/xnnpack/CMakeLists.txt @@ -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}" diff --git a/tools/cmake/preset/windows.cmake b/tools/cmake/preset/windows.cmake index e6be8aa6c3b..52397e73186 100644 --- a/tools/cmake/preset/windows.cmake +++ b/tools/cmake/preset/windows.cmake @@ -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)