1
0

CMakeLists.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. cmake_minimum_required(VERSION 3.14) # for add_link_options and implicit target directories.
  2. project("ggml" C CXX ASM)
  3. ### GGML Version
  4. set(GGML_VERSION_MAJOR 0)
  5. set(GGML_VERSION_MINOR 9)
  6. set(GGML_VERSION_PATCH 4)
  7. set(GGML_VERSION_BASE "${GGML_VERSION_MAJOR}.${GGML_VERSION_MINOR}.${GGML_VERSION_PATCH}")
  8. find_program(GIT_EXE NAMES git git.exe NO_CMAKE_FIND_ROOT_PATH)
  9. if(GIT_EXE)
  10. # Get current git commit hash
  11. execute_process(COMMAND ${GIT_EXE} rev-parse --short HEAD
  12. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  13. OUTPUT_VARIABLE GGML_BUILD_COMMIT
  14. OUTPUT_STRIP_TRAILING_WHITESPACE
  15. ERROR_QUIET
  16. )
  17. # Check if the working directory is dirty (i.e., has uncommitted changes)
  18. execute_process(COMMAND ${GIT_EXE} diff-index --quiet HEAD -- .
  19. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  20. RESULT_VARIABLE GGML_GIT_DIRTY
  21. ERROR_QUIET
  22. )
  23. endif()
  24. set(GGML_VERSION "${GGML_VERSION_BASE}")
  25. if(NOT GGML_BUILD_COMMIT)
  26. set(GGML_BUILD_COMMIT "unknown")
  27. endif()
  28. # Build the commit string with optional dirty flag
  29. if(DEFINED GGML_GIT_DIRTY AND GGML_GIT_DIRTY EQUAL 1)
  30. set(GGML_BUILD_COMMIT "${GGML_BUILD_COMMIT}-dirty")
  31. endif()
  32. include(CheckIncludeFileCXX)
  33. set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
  34. if (NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
  35. set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
  36. set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
  37. endif()
  38. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
  39. set(GGML_STANDALONE ON)
  40. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
  41. # configure project version
  42. # TODO
  43. else()
  44. set(GGML_STANDALONE OFF)
  45. endif()
  46. if (EMSCRIPTEN)
  47. set(BUILD_SHARED_LIBS_DEFAULT OFF)
  48. option(GGML_WASM_SINGLE_FILE "ggml: embed WASM inside the generated ggml.js" ON)
  49. else()
  50. if (MINGW)
  51. set(BUILD_SHARED_LIBS_DEFAULT OFF)
  52. else()
  53. set(BUILD_SHARED_LIBS_DEFAULT ON)
  54. endif()
  55. endif()
  56. # remove the lib prefix on win32 mingw
  57. if (WIN32)
  58. set(CMAKE_STATIC_LIBRARY_PREFIX "")
  59. set(CMAKE_SHARED_LIBRARY_PREFIX "")
  60. set(CMAKE_SHARED_MODULE_PREFIX "")
  61. endif()
  62. option(BUILD_SHARED_LIBS "ggml: build shared libraries" ${BUILD_SHARED_LIBS_DEFAULT})
  63. option(GGML_BACKEND_DL "ggml: build backends as dynamic libraries (requires BUILD_SHARED_LIBS)" OFF)
  64. set(GGML_BACKEND_DIR "" CACHE PATH "ggml: directory to load dynamic backends from (requires GGML_BACKEND_DL")
  65. #
  66. # option list
  67. #
  68. # TODO: mark all options as advanced when not GGML_STANDALONE
  69. if (APPLE)
  70. set(GGML_METAL_DEFAULT ON)
  71. set(GGML_BLAS_DEFAULT ON)
  72. set(GGML_BLAS_VENDOR_DEFAULT "Apple")
  73. else()
  74. set(GGML_METAL_DEFAULT OFF)
  75. set(GGML_BLAS_DEFAULT OFF)
  76. set(GGML_BLAS_VENDOR_DEFAULT "Generic")
  77. endif()
  78. if (CMAKE_CROSSCOMPILING OR DEFINED ENV{SOURCE_DATE_EPOCH})
  79. message(STATUS "Setting GGML_NATIVE_DEFAULT to OFF")
  80. set(GGML_NATIVE_DEFAULT OFF)
  81. else()
  82. set(GGML_NATIVE_DEFAULT ON)
  83. endif()
  84. # defaults
  85. if (NOT GGML_LLAMAFILE_DEFAULT)
  86. set(GGML_LLAMAFILE_DEFAULT OFF)
  87. endif()
  88. if (NOT GGML_CUDA_GRAPHS_DEFAULT)
  89. set(GGML_CUDA_GRAPHS_DEFAULT OFF)
  90. endif()
  91. # general
  92. option(GGML_STATIC "ggml: static link libraries" OFF)
  93. option(GGML_NATIVE "ggml: optimize the build for the current system" ${GGML_NATIVE_DEFAULT})
  94. option(GGML_LTO "ggml: enable link time optimization" OFF)
  95. option(GGML_CCACHE "ggml: use ccache if available" ON)
  96. # debug
  97. option(GGML_ALL_WARNINGS "ggml: enable all compiler warnings" ON)
  98. option(GGML_ALL_WARNINGS_3RD_PARTY "ggml: enable all compiler warnings in 3rd party libs" OFF)
  99. option(GGML_GPROF "ggml: enable gprof" OFF)
  100. # build
  101. option(GGML_FATAL_WARNINGS "ggml: enable -Werror flag" OFF)
  102. # sanitizers
  103. option(GGML_SANITIZE_THREAD "ggml: enable thread sanitizer" OFF)
  104. option(GGML_SANITIZE_ADDRESS "ggml: enable address sanitizer" OFF)
  105. option(GGML_SANITIZE_UNDEFINED "ggml: enable undefined sanitizer" OFF)
  106. # instruction set specific
  107. if (GGML_NATIVE OR NOT GGML_NATIVE_DEFAULT)
  108. set(INS_ENB OFF)
  109. else()
  110. set(INS_ENB ON)
  111. endif()
  112. message(DEBUG "GGML_NATIVE : ${GGML_NATIVE}")
  113. message(DEBUG "GGML_NATIVE_DEFAULT : ${GGML_NATIVE_DEFAULT}")
  114. message(DEBUG "INS_ENB : ${INS_ENB}")
  115. option(GGML_CPU_HBM "ggml: use memkind for CPU HBM" OFF)
  116. option(GGML_CPU_REPACK "ggml: use runtime weight conversion of Q4_0 to Q4_X_X" ON)
  117. option(GGML_CPU_KLEIDIAI "ggml: use KleidiAI optimized kernels if applicable" OFF)
  118. option(GGML_SSE42 "ggml: enable SSE 4.2" ${INS_ENB})
  119. option(GGML_AVX "ggml: enable AVX" ${INS_ENB})
  120. option(GGML_AVX_VNNI "ggml: enable AVX-VNNI" OFF)
  121. option(GGML_AVX2 "ggml: enable AVX2" ${INS_ENB})
  122. option(GGML_BMI2 "ggml: enable BMI2" ${INS_ENB})
  123. option(GGML_AVX512 "ggml: enable AVX512F" OFF)
  124. option(GGML_AVX512_VBMI "ggml: enable AVX512-VBMI" OFF)
  125. option(GGML_AVX512_VNNI "ggml: enable AVX512-VNNI" OFF)
  126. option(GGML_AVX512_BF16 "ggml: enable AVX512-BF16" OFF)
  127. if (NOT MSVC)
  128. # in MSVC F16C and FMA is implied with AVX2/AVX512
  129. option(GGML_FMA "ggml: enable FMA" ${INS_ENB})
  130. option(GGML_F16C "ggml: enable F16C" ${INS_ENB})
  131. # MSVC does not seem to support AMX
  132. option(GGML_AMX_TILE "ggml: enable AMX-TILE" OFF)
  133. option(GGML_AMX_INT8 "ggml: enable AMX-INT8" OFF)
  134. option(GGML_AMX_BF16 "ggml: enable AMX-BF16" OFF)
  135. endif()
  136. option(GGML_LASX "ggml: enable lasx" ON)
  137. option(GGML_LSX "ggml: enable lsx" ON)
  138. option(GGML_RVV "ggml: enable rvv" ON)
  139. option(GGML_RV_ZFH "ggml: enable riscv zfh" ON)
  140. option(GGML_RV_ZVFH "ggml: enable riscv zvfh" ON)
  141. option(GGML_RV_ZICBOP "ggml: enable riscv zicbop" ON)
  142. option(GGML_XTHEADVECTOR "ggml: enable xtheadvector" OFF)
  143. option(GGML_VXE "ggml: enable vxe" ${GGML_NATIVE})
  144. option(GGML_CPU_ALL_VARIANTS "ggml: build all variants of the CPU backend (requires GGML_BACKEND_DL)" OFF)
  145. set(GGML_CPU_ARM_ARCH "" CACHE STRING "ggml: CPU architecture for ARM")
  146. set(GGML_CPU_POWERPC_CPUTYPE "" CACHE STRING "ggml: CPU type for PowerPC")
  147. if (MINGW)
  148. set(GGML_WIN_VER "0xA00" CACHE STRING "ggml: Windows version")
  149. endif()
  150. # ggml core
  151. set(GGML_SCHED_MAX_COPIES "4" CACHE STRING "ggml: max input copies for pipeline parallelism")
  152. option(GGML_CPU "ggml: enable CPU backend" ON)
  153. # 3rd party libs / backends
  154. option(GGML_ACCELERATE "ggml: enable Accelerate framework" ON)
  155. option(GGML_BLAS "ggml: use BLAS" ${GGML_BLAS_DEFAULT})
  156. set(GGML_BLAS_VENDOR ${GGML_BLAS_VENDOR_DEFAULT} CACHE STRING
  157. "ggml: BLAS library vendor")
  158. option(GGML_LLAMAFILE "ggml: use LLAMAFILE" ${GGML_LLAMAFILE_DEFAULT})
  159. option(GGML_CUDA "ggml: use CUDA" OFF)
  160. option(GGML_MUSA "ggml: use MUSA" OFF)
  161. option(GGML_CUDA_FORCE_MMQ "ggml: use mmq kernels instead of cuBLAS" OFF)
  162. option(GGML_CUDA_FORCE_CUBLAS "ggml: always use cuBLAS instead of mmq kernels" OFF)
  163. set (GGML_CUDA_PEER_MAX_BATCH_SIZE "128" CACHE STRING
  164. "ggml: max. batch size for using peer access")
  165. option(GGML_CUDA_NO_PEER_COPY "ggml: do not use peer to peer copies" OFF)
  166. option(GGML_CUDA_NO_VMM "ggml: do not try to use CUDA VMM" OFF)
  167. option(GGML_CUDA_FA "ggml: compile ggml FlashAttention CUDA kernels" ON)
  168. option(GGML_CUDA_FA_ALL_QUANTS "ggml: compile all quants for FlashAttention" OFF)
  169. option(GGML_CUDA_GRAPHS "ggml: use CUDA graphs (llama.cpp only)" ${GGML_CUDA_GRAPHS_DEFAULT})
  170. set (GGML_CUDA_COMPRESSION_MODE "size" CACHE STRING
  171. "ggml: cuda link binary compression mode; requires cuda 12.8+")
  172. set_property(CACHE GGML_CUDA_COMPRESSION_MODE PROPERTY STRINGS "none;speed;balance;size")
  173. option(GGML_HIP "ggml: use HIP" OFF)
  174. option(GGML_HIP_GRAPHS "ggml: use HIP graph, experimental, slow" OFF)
  175. option(GGML_HIP_NO_VMM "ggml: do not try to use HIP VMM" ON)
  176. option(GGML_HIP_ROCWMMA_FATTN "ggml: enable rocWMMA for FlashAttention" OFF)
  177. option(GGML_HIP_MMQ_MFMA "ggml: enable MFMA MMA for CDNA in MMQ" ON)
  178. option(GGML_HIP_EXPORT_METRICS "ggml: enable kernel perf metrics output" OFF)
  179. option(GGML_MUSA_GRAPHS "ggml: use MUSA graph, experimental, unstable" OFF)
  180. option(GGML_MUSA_MUDNN_COPY "ggml: enable muDNN for accelerated copy" OFF)
  181. option(GGML_VULKAN "ggml: use Vulkan" OFF)
  182. option(GGML_VULKAN_CHECK_RESULTS "ggml: run Vulkan op checks" OFF)
  183. option(GGML_VULKAN_DEBUG "ggml: enable Vulkan debug output" OFF)
  184. option(GGML_VULKAN_MEMORY_DEBUG "ggml: enable Vulkan memory debug output" OFF)
  185. option(GGML_VULKAN_SHADER_DEBUG_INFO "ggml: enable Vulkan shader debug info" OFF)
  186. option(GGML_VULKAN_VALIDATE "ggml: enable Vulkan validation" OFF)
  187. option(GGML_VULKAN_RUN_TESTS "ggml: run Vulkan tests" OFF)
  188. option(GGML_WEBGPU "ggml: use WebGPU" OFF)
  189. option(GGML_WEBGPU_DEBUG "ggml: enable WebGPU debug output" OFF)
  190. option(GGML_WEBGPU_CPU_PROFILE "ggml: enable WebGPU profiling (CPU)" OFF)
  191. option(GGML_WEBGPU_GPU_PROFILE "ggml: enable WebGPU profiling (GPU)" OFF)
  192. option(GGML_ZDNN "ggml: use zDNN" OFF)
  193. option(GGML_METAL "ggml: use Metal" ${GGML_METAL_DEFAULT})
  194. option(GGML_METAL_NDEBUG "ggml: disable Metal debugging" OFF)
  195. option(GGML_METAL_SHADER_DEBUG "ggml: compile Metal with -fno-fast-math" OFF)
  196. option(GGML_METAL_EMBED_LIBRARY "ggml: embed Metal library" ${GGML_METAL})
  197. set (GGML_METAL_MACOSX_VERSION_MIN "" CACHE STRING
  198. "ggml: metal minimum macOS version")
  199. set (GGML_METAL_STD "" CACHE STRING "ggml: metal standard version (-std flag)")
  200. option(GGML_OPENMP "ggml: use OpenMP" ON)
  201. option(GGML_RPC "ggml: use RPC" OFF)
  202. option(GGML_SYCL "ggml: use SYCL" OFF)
  203. option(GGML_SYCL_F16 "ggml: use 16 bit floats for sycl calculations" OFF)
  204. option(GGML_SYCL_GRAPH "ggml: enable graphs in the SYCL backend" ON)
  205. option(GGML_SYCL_DNN "ggml: enable oneDNN in the SYCL backend" ON)
  206. set (GGML_SYCL_TARGET "INTEL" CACHE STRING
  207. "ggml: sycl target device")
  208. set (GGML_SYCL_DEVICE_ARCH "" CACHE STRING
  209. "ggml: sycl device architecture")
  210. option(GGML_OPENCL "ggml: use OpenCL" OFF)
  211. option(GGML_OPENCL_PROFILING "ggml: use OpenCL profiling (increases overhead)" OFF)
  212. option(GGML_OPENCL_EMBED_KERNELS "ggml: embed kernels" ON)
  213. option(GGML_OPENCL_USE_ADRENO_KERNELS "ggml: use optimized kernels for Adreno" ON)
  214. set (GGML_OPENCL_TARGET_VERSION "300" CACHE STRING
  215. "gmml: OpenCL API version to target")
  216. option(GGML_HEXAGON "ggml: enable Hexagon backend" OFF)
  217. # toolchain for vulkan-shaders-gen
  218. set (GGML_VULKAN_SHADERS_GEN_TOOLCHAIN "" CACHE FILEPATH "ggml: toolchain file for vulkan-shaders-gen")
  219. # extra artifacts
  220. option(GGML_BUILD_TESTS "ggml: build tests" ${GGML_STANDALONE})
  221. option(GGML_BUILD_EXAMPLES "ggml: build examples" ${GGML_STANDALONE})
  222. #
  223. # dependencies
  224. #
  225. set(CMAKE_C_STANDARD 11)
  226. set(CMAKE_C_STANDARD_REQUIRED true)
  227. set(CMAKE_CXX_STANDARD 17)
  228. set(CMAKE_CXX_STANDARD_REQUIRED true)
  229. set(THREADS_PREFER_PTHREAD_FLAG ON)
  230. find_package(Threads REQUIRED)
  231. include(GNUInstallDirs)
  232. #
  233. # build the library
  234. #
  235. add_subdirectory(src)
  236. #
  237. # tests and examples
  238. #
  239. if (GGML_BUILD_TESTS)
  240. enable_testing()
  241. add_subdirectory(tests)
  242. endif ()
  243. if (GGML_BUILD_EXAMPLES)
  244. add_subdirectory(examples)
  245. endif ()
  246. #
  247. # install
  248. #
  249. include(CMakePackageConfigHelpers)
  250. # all public headers
  251. set(GGML_PUBLIC_HEADERS
  252. include/ggml.h
  253. include/ggml-cpu.h
  254. include/ggml-alloc.h
  255. include/ggml-backend.h
  256. include/ggml-blas.h
  257. include/ggml-cann.h
  258. include/ggml-cpp.h
  259. include/ggml-cuda.h
  260. include/ggml-opt.h
  261. include/ggml-metal.h
  262. include/ggml-rpc.h
  263. include/ggml-sycl.h
  264. include/ggml-vulkan.h
  265. include/ggml-webgpu.h
  266. include/gguf.h)
  267. set_target_properties(ggml PROPERTIES PUBLIC_HEADER "${GGML_PUBLIC_HEADERS}")
  268. #if (GGML_METAL)
  269. # set_target_properties(ggml PROPERTIES RESOURCE "${CMAKE_CURRENT_SOURCE_DIR}/src/ggml-metal.metal")
  270. #endif()
  271. install(TARGETS ggml LIBRARY PUBLIC_HEADER)
  272. install(TARGETS ggml-base LIBRARY)
  273. if (GGML_STANDALONE)
  274. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ggml.pc.in
  275. ${CMAKE_CURRENT_BINARY_DIR}/ggml.pc
  276. @ONLY)
  277. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ggml.pc
  278. DESTINATION share/pkgconfig)
  279. endif()
  280. #
  281. # Create CMake package
  282. #
  283. # Capture variables prefixed with GGML_.
  284. set(variable_set_statements
  285. "
  286. ####### Expanded from @GGML_VARIABLES_EXPANED@ by configure_package_config_file() #######
  287. ####### Any changes to this file will be overwritten by the next CMake run #######
  288. ")
  289. set(GGML_SHARED_LIB ${BUILD_SHARED_LIBS})
  290. get_cmake_property(all_variables VARIABLES)
  291. foreach(variable_name IN LISTS all_variables)
  292. if(variable_name MATCHES "^GGML_")
  293. string(REPLACE ";" "\\;"
  294. variable_value "${${variable_name}}")
  295. set(variable_set_statements
  296. "${variable_set_statements}set(${variable_name} \"${variable_value}\")\n")
  297. endif()
  298. endforeach()
  299. set(GGML_VARIABLES_EXPANDED ${variable_set_statements})
  300. # Create the CMake package and set install location.
  301. set(GGML_INSTALL_VERSION ${GGML_VERSION})
  302. set(GGML_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "Location of header files")
  303. set(GGML_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Location of library files")
  304. set(GGML_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Location of binary files")
  305. configure_package_config_file(
  306. ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ggml-config.cmake.in
  307. ${CMAKE_CURRENT_BINARY_DIR}/ggml-config.cmake
  308. INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ggml
  309. PATH_VARS GGML_INCLUDE_INSTALL_DIR
  310. GGML_LIB_INSTALL_DIR
  311. GGML_BIN_INSTALL_DIR)
  312. write_basic_package_version_file(
  313. ${CMAKE_CURRENT_BINARY_DIR}/ggml-version.cmake
  314. VERSION ${GGML_INSTALL_VERSION}
  315. COMPATIBILITY SameMajorVersion)
  316. target_compile_definitions(ggml-base PRIVATE
  317. GGML_VERSION="${GGML_INSTALL_VERSION}"
  318. GGML_COMMIT="${GGML_BUILD_COMMIT}"
  319. )
  320. message(STATUS "ggml version: ${GGML_INSTALL_VERSION}")
  321. message(STATUS "ggml commit: ${GGML_BUILD_COMMIT}")
  322. install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ggml-config.cmake
  323. ${CMAKE_CURRENT_BINARY_DIR}/ggml-version.cmake
  324. DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ggml)
  325. if (MSVC)
  326. set(MSVC_WARNING_FLAGS
  327. /wd4005 # Macro redefinition
  328. /wd4244 # Conversion from one type to another type, possible loss of data
  329. /wd4267 # Conversion from 'size_t' to a smaller type, possible loss of data
  330. /wd4305 # Conversion from 'type1' to 'type2', possible loss of data
  331. /wd4566 # Conversion from 'char' to 'wchar_t', possible loss of data
  332. /wd4996 # Disable POSIX deprecation warnings
  333. /wd4702 # Unreachable code warnings
  334. )
  335. function(disable_msvc_warnings target_name)
  336. if(TARGET ${target_name})
  337. target_compile_options(${target_name} PRIVATE ${MSVC_WARNING_FLAGS})
  338. endif()
  339. endfunction()
  340. disable_msvc_warnings(ggml-base)
  341. disable_msvc_warnings(ggml)
  342. disable_msvc_warnings(ggml-cpu)
  343. disable_msvc_warnings(ggml-cpu-x64)
  344. disable_msvc_warnings(ggml-cpu-sse42)
  345. disable_msvc_warnings(ggml-cpu-sandybridge)
  346. disable_msvc_warnings(ggml-cpu-haswell)
  347. disable_msvc_warnings(ggml-cpu-skylakex)
  348. disable_msvc_warnings(ggml-cpu-icelake)
  349. disable_msvc_warnings(ggml-cpu-alderlake)
  350. if (GGML_BUILD_EXAMPLES)
  351. disable_msvc_warnings(common-ggml)
  352. disable_msvc_warnings(common)
  353. disable_msvc_warnings(mnist-common)
  354. disable_msvc_warnings(mnist-eval)
  355. disable_msvc_warnings(mnist-train)
  356. disable_msvc_warnings(gpt-2-ctx)
  357. disable_msvc_warnings(gpt-2-alloc)
  358. disable_msvc_warnings(gpt-2-backend)
  359. disable_msvc_warnings(gpt-2-sched)
  360. disable_msvc_warnings(gpt-2-quantize)
  361. disable_msvc_warnings(gpt-2-batched)
  362. disable_msvc_warnings(gpt-j)
  363. disable_msvc_warnings(gpt-j-quantize)
  364. disable_msvc_warnings(magika)
  365. disable_msvc_warnings(yolov3-tiny)
  366. disable_msvc_warnings(sam)
  367. disable_msvc_warnings(simple-ctx)
  368. disable_msvc_warnings(simple-backend)
  369. endif()
  370. if (GGML_BUILD_TESTS)
  371. disable_msvc_warnings(test-mul-mat)
  372. disable_msvc_warnings(test-arange)
  373. disable_msvc_warnings(test-backend-ops)
  374. disable_msvc_warnings(test-cont)
  375. disable_msvc_warnings(test-conv-transpose)
  376. disable_msvc_warnings(test-conv-transpose-1d)
  377. disable_msvc_warnings(test-conv1d)
  378. disable_msvc_warnings(test-conv2d)
  379. disable_msvc_warnings(test-conv2d-dw)
  380. disable_msvc_warnings(test-customop)
  381. disable_msvc_warnings(test-dup)
  382. disable_msvc_warnings(test-opt)
  383. disable_msvc_warnings(test-pool)
  384. endif ()
  385. endif()