diff --git a/CMakeLists.txt b/CMakeLists.txt index 2741568ed..f2b19fe01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,7 @@ option(LLAMA_AVX512 "llama: enable AVX512" option(LLAMA_AVX512_VBMI "llama: enable AVX512-VBMI" OFF) option(LLAMA_AVX512_VNNI "llama: enable AVX512-VNNI" OFF) option(LLAMA_FMA "llama: enable FMA" ${INS_ENB}) +option(LLAMA_AMX "llama: enable AMX" OFF) # in MSVC F16C is implied with AVX2/AVX512 if (NOT MSVC) option(LLAMA_F16C "llama: enable F16C" ${INS_ENB}) @@ -627,7 +628,7 @@ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86_64|i686|AMD64)$" OR "${CMAKE_GE if (LLAMA_NATIVE) include(cmake/FindSIMD.cmake) endif () - if (LLAMA_AVX512) + if (LLAMA_AVX512 OR LLAMA_AMX) add_compile_options($<$:/arch:AVX512>) add_compile_options($<$:/arch:AVX512>) # MSVC has no compile-time flags enabling specific @@ -675,6 +676,13 @@ elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "^(x86_64|i686|AMD64)$" OR "${CMAKE_GE if (LLAMA_AVX512_VNNI) add_compile_options(-mavx512vnni) endif() + if (LLAMA_AMX) + add_compile_options(-mavx512vl) + add_compile_options(-mavx512dq) + add_compile_options(-mamx-tile) + add_compile_options(-mamx-int8) + add_compile_options(-mamx-bf16) + endif() endif() elseif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64") message(STATUS "PowerPC detected")