diff --git a/tools/cmake/preset/llm.cmake b/tools/cmake/preset/llm.cmake index f3d3ab8ef8f..231a25f0c1e 100644 --- a/tools/cmake/preset/llm.cmake +++ b/tools/cmake/preset/llm.cmake @@ -13,11 +13,18 @@ set_overridable_option(EXECUTORCH_BUILD_EXTENSION_LLM_RUNNER ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_MODULE ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_NAMED_DATA_MAP ON) set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON) -set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON) set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON) -set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON) set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON) +# Turn on the quantized and LLM kernels unless on windows cuda build which +# currently doesn't support this due to using msvc. +if(NOT (EXECUTORCH_BUILD_CUDA AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" + OR CMAKE_SYSTEM_NAME STREQUAL "WIN32")) +) + set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON) + set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON) +endif() + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") set_overridable_option(EXECUTORCH_BUILD_COREML ON) set_overridable_option(EXECUTORCH_BUILD_MPS ON) @@ -29,7 +36,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WIN32" ) - # Windows or other OS-specific code here + elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") # Android-specific code here else()