interplane.Get Omega
Read in your language

ggml

[Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685)

Brought by drakestapleton

branch master Branches Tags History

ggml / CMakeLists.txt

503 lines · 21909 bytes Raw Blame History
1cmake_minimum_required(VERSION 3.14...3.28) # for add_link_options and implicit target directories.
2
3project("ggml" C CXX ASM)
4
5### GGML Version
6set(GGML_VERSION_MAJOR 0)
7set(GGML_VERSION_MINOR 29)
8set(GGML_VERSION_PATCH 0)
9set(GGML_VERSION_BASE "${GGML_VERSION_MAJOR}.${GGML_VERSION_MINOR}.${GGML_VERSION_PATCH}")
10
11list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
12
13find_program(GIT_EXE NAMES git git.exe NO_CMAKE_FIND_ROOT_PATH)
14if(GIT_EXE)
15 # Get current git commit hash
16 execute_process(COMMAND ${GIT_EXE} rev-parse --short HEAD
17 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
18 OUTPUT_VARIABLE GGML_BUILD_COMMIT
19 OUTPUT_STRIP_TRAILING_WHITESPACE
20 ERROR_QUIET
21 )
22
23 # Check if the working directory is dirty (i.e., has uncommitted changes)
24 execute_process(COMMAND ${GIT_EXE} diff-index --quiet HEAD -- .
25 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
26 RESULT_VARIABLE GGML_GIT_DIRTY
27 ERROR_QUIET
28 )
29endif()
30
31set(GGML_VERSION "${GGML_VERSION_BASE}")
32
33if(NOT GGML_BUILD_COMMIT)
34 set(GGML_BUILD_COMMIT "unknown")
35endif()
36
37# Build the commit string with optional dirty flag
38if(DEFINED GGML_GIT_DIRTY AND GGML_GIT_DIRTY EQUAL 1)
39 set(GGML_BUILD_COMMIT "${GGML_BUILD_COMMIT}-dirty")
40endif()
41
42include(CheckIncludeFileCXX)
43
44set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
45
46if (NOT XCODE AND NOT MSVC AND NOT CMAKE_BUILD_TYPE)
47 set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
48 set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
49endif()
50
51if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
52 set(GGML_STANDALONE ON)
53
54 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
55
56 # configure project version
57 # TODO
58else()
59 set(GGML_STANDALONE OFF)
60
61 if (NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
62 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
63 endif()
64endif()
65
66if (EMSCRIPTEN)
67 set(BUILD_SHARED_LIBS_DEFAULT OFF)
68
69 option(GGML_WASM_SINGLE_FILE "ggml: embed WASM inside the generated ggml.js" ON)
70else()
71 if (MINGW)
72 set(BUILD_SHARED_LIBS_DEFAULT OFF)
73 else()
74 set(BUILD_SHARED_LIBS_DEFAULT ON)
75 endif()
76endif()
77
78# remove the lib prefix on win32 mingw
79if (WIN32)
80 set(CMAKE_STATIC_LIBRARY_PREFIX "")
81 set(CMAKE_SHARED_LIBRARY_PREFIX "")
82 set(CMAKE_SHARED_MODULE_PREFIX "")
83endif()
84
85option(BUILD_SHARED_LIBS "ggml: build shared libraries" ${BUILD_SHARED_LIBS_DEFAULT})
86option(GGML_BACKEND_DL "ggml: build backends as dynamic libraries (requires BUILD_SHARED_LIBS)" OFF)
87set(GGML_BACKEND_DIR "" CACHE PATH "ggml: directory to load dynamic backends from (requires GGML_BACKEND_DL")
88
89#
90# option list
91#
92
93# TODO: mark all options as advanced when not GGML_STANDALONE
94
95if (APPLE)
96 set(GGML_METAL_DEFAULT ON)
97 set(GGML_BLAS_DEFAULT ON)
98 set(GGML_BLAS_VENDOR_DEFAULT "Apple")
99else()
100 set(GGML_METAL_DEFAULT OFF)
101 set(GGML_BLAS_DEFAULT OFF)
102 set(GGML_BLAS_VENDOR_DEFAULT "Generic")
103endif()
104
105if (CMAKE_CROSSCOMPILING OR DEFINED ENV{SOURCE_DATE_EPOCH})
106 message(STATUS "Setting GGML_NATIVE_DEFAULT to OFF")
107 set(GGML_NATIVE_DEFAULT OFF)
108else()
109 set(GGML_NATIVE_DEFAULT ON)
110endif()
111
112# defaults
113if (NOT GGML_LLAMAFILE_DEFAULT)
114 set(GGML_LLAMAFILE_DEFAULT OFF)
115endif()
116
117if (NOT GGML_CUDA_GRAPHS_DEFAULT)
118 set(GGML_CUDA_GRAPHS_DEFAULT OFF)
119endif()
120
121# general
122option(GGML_STATIC "ggml: static link libraries" OFF)
123option(GGML_NATIVE "ggml: optimize the build for the current system" ${GGML_NATIVE_DEFAULT})
124option(GGML_LTO "ggml: enable link time optimization" OFF)
125option(GGML_CCACHE "ggml: use ccache if available" ON)
126
127# debug
128option(GGML_ALL_WARNINGS "ggml: enable all compiler warnings" ON)
129option(GGML_ALL_WARNINGS_3RD_PARTY "ggml: enable all compiler warnings in 3rd party libs" OFF)
130option(GGML_GPROF "ggml: enable gprof" OFF)
131
132# build
133option(GGML_FATAL_WARNINGS "ggml: enable -Werror flag" OFF)
134
135# sanitizers
136option(GGML_SANITIZE_THREAD "ggml: enable thread sanitizer" OFF)
137option(GGML_SANITIZE_ADDRESS "ggml: enable address sanitizer" OFF)
138option(GGML_SANITIZE_UNDEFINED "ggml: enable undefined sanitizer" OFF)
139
140# instruction set specific
141if (GGML_NATIVE OR NOT GGML_NATIVE_DEFAULT)
142 set(INS_ENB OFF)
143else()
144 set(INS_ENB ON)
145endif()
146
147message(DEBUG "GGML_NATIVE : ${GGML_NATIVE}")
148message(DEBUG "GGML_NATIVE_DEFAULT : ${GGML_NATIVE_DEFAULT}")
149message(DEBUG "INS_ENB : ${INS_ENB}")
150
151option(GGML_CPU_HBM "ggml: use memkind for CPU HBM" OFF)
152option(GGML_CPU_REPACK "ggml: use runtime weight conversion of Q4_0 to Q4_X_X" ON)
153option(GGML_CPU_KLEIDIAI "ggml: use KleidiAI optimized kernels if applicable" OFF)
154option(GGML_SSE42 "ggml: enable SSE 4.2" ${INS_ENB})
155option(GGML_AVX "ggml: enable AVX" ${INS_ENB})
156option(GGML_AVX_VNNI "ggml: enable AVX-VNNI" OFF)
157option(GGML_AVX2 "ggml: enable AVX2" ${INS_ENB})
158option(GGML_BMI2 "ggml: enable BMI2" ${INS_ENB})
159option(GGML_AVX512 "ggml: enable AVX512F" OFF)
160option(GGML_AVX512_VBMI "ggml: enable AVX512-VBMI" OFF)
161option(GGML_AVX512_VNNI "ggml: enable AVX512-VNNI" OFF)
162option(GGML_AVX512_BF16 "ggml: enable AVX512-BF16" OFF)
163if (NOT MSVC)
164 # in MSVC F16C and FMA is implied with AVX2/AVX512
165 option(GGML_FMA "ggml: enable FMA" ${INS_ENB})
166 option(GGML_F16C "ggml: enable F16C" ${INS_ENB})
167 # MSVC does not seem to support AMX
168 option(GGML_AMX_TILE "ggml: enable AMX-TILE" OFF)
169 option(GGML_AMX_INT8 "ggml: enable AMX-INT8" OFF)
170 option(GGML_AMX_BF16 "ggml: enable AMX-BF16" OFF)
171endif()
172option(GGML_LASX "ggml: enable lasx" ON)
173option(GGML_LSX "ggml: enable lsx" ON)
174option(GGML_RVV "ggml: enable rvv" ON)
175option(GGML_RV_ZFH "ggml: enable riscv zfh" ON)
176option(GGML_RV_ZVFH "ggml: enable riscv zvfh" ON)
177option(GGML_RV_ZICBOP "ggml: enable riscv zicbop" ON)
178option(GGML_RV_ZIHINTPAUSE "ggml: enable riscv zihintpause" ON)
179option(GGML_RV_ZVFBFWMA "ggml: enable riscv zvfbfwma" OFF)
180option(GGML_XTHEADVECTOR "ggml: enable xtheadvector" OFF)
181option(GGML_VXE "ggml: enable vxe" ${GGML_NATIVE})
182
183option(GGML_CPU_ALL_VARIANTS "ggml: build all variants of the CPU backend (requires GGML_BACKEND_DL)" OFF)
184set(GGML_CPU_ARM_ARCH "" CACHE STRING "ggml: CPU architecture for ARM")
185set(GGML_CPU_POWERPC_CPUTYPE "" CACHE STRING "ggml: CPU type for PowerPC")
186
187# ggml core
188set(GGML_SCHED_MAX_COPIES "4" CACHE STRING "ggml: max input copies for pipeline parallelism")
189option(GGML_CPU "ggml: enable CPU backend" ON)
190option(GGML_SCHED_NO_REALLOC "ggml: disallow reallocations in ggml-alloc (for debugging)" OFF)
191
192# 3rd party libs / backends
193option(GGML_ACCELERATE "ggml: enable Accelerate framework" ON)
194option(GGML_BLAS "ggml: use BLAS" ${GGML_BLAS_DEFAULT})
195set(GGML_BLAS_VENDOR ${GGML_BLAS_VENDOR_DEFAULT} CACHE STRING
196 "ggml: BLAS library vendor")
197option(GGML_LLAMAFILE "ggml: use LLAMAFILE" ${GGML_LLAMAFILE_DEFAULT})
198
199option(GGML_CUDA "ggml: use CUDA" OFF)
200set (GGML_CUDA_CCCL_VERSION "" CACHE STRING "ggml: CCCL git tag to fetch, empty to use the version bundled with the installed CUDA Toolkit")
201option(GGML_MUSA "ggml: use MUSA" OFF)
202option(GGML_CUDA_FORCE_MMQ "ggml: use mmq kernels instead of cuBLAS" OFF)
203option(GGML_CUDA_FORCE_CUBLAS "ggml: always use cuBLAS instead of mmq kernels" OFF)
204option(GGML_CUDA_NO_PEER_COPY "ggml: do not use peer to peer copies" OFF)
205option(GGML_CUDA_NO_VMM "ggml: do not try to use CUDA VMM" OFF)
206option(GGML_CUDA_FA "ggml: compile ggml FlashAttention CUDA kernels" ON)
207option(GGML_CUDA_FA_ALL_QUANTS "ggml: compile all quants for FlashAttention" OFF)
208set (GGML_CUDA_FA_QUANTS "q4_0-q4_0;q8_0-q8_0;f16-f16;bf16-bf16" CACHE STRING
209 "ggml: FlashAttention K-V type combinations to compile, \"all\" or a list such as \"q8_0-q8_0;q8_0-q4_0\"")
210option(GGML_CUDA_GRAPHS "ggml: use CUDA graphs (llama.cpp only)" ${GGML_CUDA_GRAPHS_DEFAULT})
211option(GGML_CUDA_NCCL "ggml: use NVIDIA Collective Comm. Library" ON)
212set (GGML_CUDA_COMPRESSION_MODE "size" CACHE STRING
213 "ggml: cuda link binary compression mode; requires cuda 12.8+")
214set_property(CACHE GGML_CUDA_COMPRESSION_MODE PROPERTY STRINGS "none;speed;balance;size")
215
216option(GGML_HIP "ggml: use HIP" OFF)
217option(GGML_HIP_GRAPHS "ggml: use HIP graph" ON)
218option(GGML_HIP_RCCL "ggml: use ROCm Collective Comm. Library" OFF)
219option(GGML_HIP_NO_VMM "ggml: do not try to use HIP VMM" ON)
220option(GGML_HIP_MMQ_MFMA "ggml: enable MFMA MMA for CDNA in MMQ" ON)
221option(GGML_HIP_EXPORT_METRICS "ggml: enable kernel perf metrics output" OFF)
222option(GGML_MUSA_GRAPHS "ggml: use MUSA graph, experimental, unstable" OFF)
223option(GGML_MUSA_MUDNN_COPY "ggml: enable muDNN for accelerated copy" OFF)
224option(GGML_VULKAN "ggml: use Vulkan" OFF)
225option(GGML_VULKAN_CHECK_RESULTS "ggml: run Vulkan op checks" OFF)
226option(GGML_VULKAN_DEBUG "ggml: enable Vulkan debug output" OFF)
227option(GGML_VULKAN_MEMORY_DEBUG "ggml: enable Vulkan memory debug output" OFF)
228option(GGML_VULKAN_SHADER_DEBUG_INFO "ggml: enable Vulkan shader debug info" OFF)
229option(GGML_VULKAN_VALIDATE "ggml: enable Vulkan validation" OFF)
230option(GGML_VULKAN_RUN_TESTS "ggml: run Vulkan tests" OFF)
231option(GGML_WEBGPU "ggml: use WebGPU" OFF)
232option(GGML_WEBGPU_DEBUG "ggml: enable WebGPU debug output" OFF)
233option(GGML_WEBGPU_CPU_PROFILE "ggml: enable WebGPU profiling (CPU)" OFF)
234option(GGML_WEBGPU_GPU_PROFILE "ggml: enable WebGPU profiling (GPU)" OFF)
235option(GGML_WEBGPU_JSPI "ggml: use JSPI for WebGPU" ON)
236option(GGML_ZDNN "ggml: use zDNN" OFF)
237option(GGML_VIRTGPU "ggml: use the VirtGPU/Virglrenderer API Remoting frontend" OFF)
238option(GGML_VIRTGPU_BACKEND "ggml: build the VirtGPU/Virglrenderer API Remoting backend" OFF)
239option(GGML_METAL "ggml: use Metal" ${GGML_METAL_DEFAULT})
240option(GGML_METAL_NDEBUG "ggml: disable Metal debugging" OFF)
241option(GGML_METAL_SHADER_DEBUG "ggml: compile Metal with -fno-fast-math" OFF)
242option(GGML_METAL_EMBED_LIBRARY "ggml: embed Metal library" ${GGML_METAL})
243set (GGML_METAL_MACOSX_VERSION_MIN "" CACHE STRING
244 "ggml: metal minimum macOS version")
245set (GGML_METAL_STD "" CACHE STRING "ggml: metal standard version (-std flag)")
246set (GGML_METAL_TARGET_OS "macos" CACHE STRING
247 "ggml: metal -mtargetos OS name (macos, ios, xros, tvos)")
248option(GGML_OPENMP "ggml: use OpenMP" ON)
249option(GGML_OPENMP_FETCH "ggml: fetch LLVM OpenMP" OFF)
250option(GGML_RPC "ggml: use RPC" OFF)
251option(GGML_SYCL "ggml: use SYCL" OFF)
252option(GGML_SYCL_F16 "ggml: use 16 bit floats for sycl calculations" OFF)
253option(GGML_SYCL_SUPPORT_XMX "ggml: build the XMX (DPAS) code paths in the SYCL backend" ON)
254option(GGML_SYCL_GRAPH "ggml: enable graphs in the SYCL backend" ON)
255option(GGML_SYCL_HOST_MEM_FALLBACK "ggml: allow host memory fallback in SYCL reorder (requires kernel 6.8+)" ON)
256option(GGML_SYCL_SUPPORT_LEVEL_ZERO_API "ggml: use Level Zero API in SYCL backend" ON)
257option(GGML_SYCL_DNN "ggml: enable oneDNN in the SYCL backend" ON)
258set (GGML_SYCL_TARGET "INTEL" CACHE STRING
259 "ggml: sycl target device")
260set (GGML_SYCL_DEVICE_ARCH "" CACHE STRING
261 "ggml: sycl device architecture")
262
263option(GGML_OPENVINO "ggml: use OPENVINO" OFF)
264option(GGML_ET "ggml: use ET backend" OFF)
265option(GGML_ET_SYSEMU "ggml: use ET backend via sysemu" OFF)
266
267option(GGML_OPENCL "ggml: use OpenCL" OFF)
268option(GGML_OPENCL_PROFILING "ggml: use OpenCL profiling (increases overhead)" OFF)
269option(GGML_OPENCL_EMBED_KERNELS "ggml: embed kernels" ON)
270option(GGML_OPENCL_USE_ADRENO_KERNELS "ggml: use optimized kernels for Adreno" ON)
271set (GGML_OPENCL_TARGET_VERSION "300" CACHE STRING
272 "ggml: OpenCL API version to target")
273
274option(GGML_HEXAGON "ggml: enable Hexagon backend" OFF)
275
276# toolchain for vulkan-shaders-gen
277set (GGML_VULKAN_SHADERS_GEN_TOOLCHAIN "" CACHE FILEPATH "ggml: toolchain file for vulkan-shaders-gen")
278
279option(GGML_ZENDNN "ggml: use ZenDNN" OFF)
280option(ZENDNN_ROOT "ggml: path to ZenDNN installation" "")
281
282# extra artifacts
283option(GGML_BUILD_TESTS "ggml: build tests" ${GGML_STANDALONE})
284option(GGML_BUILD_EXAMPLES "ggml: build examples" ${GGML_STANDALONE})
285
286#
287# dependencies
288#
289
290set(CMAKE_C_STANDARD 11)
291set(CMAKE_C_STANDARD_REQUIRED true)
292
293set(CMAKE_CXX_STANDARD 17)
294set(CMAKE_CXX_STANDARD_REQUIRED true)
295
296set(THREADS_PREFER_PTHREAD_FLAG ON)
297
298find_package(Threads REQUIRED)
299
300include(GNUInstallDirs)
301
302#
303# build the library
304#
305
306add_subdirectory(src)
307
308#
309# tests and examples
310#
311
312if (GGML_BUILD_TESTS)
313 enable_testing()
314 add_subdirectory(tests)
315endif ()
316
317if (GGML_BUILD_EXAMPLES)
318 add_subdirectory(examples)
319endif ()
320
321#
322# install
323#
324
325include(CMakePackageConfigHelpers)
326
327# all public headers
328set(GGML_PUBLIC_HEADERS
329 include/ggml.h
330 include/ggml-cpu.h
331 include/ggml-alloc.h
332 include/ggml-backend.h
333 include/ggml-blas.h
334 include/ggml-cann.h
335 include/ggml-cpp.h
336 include/ggml-cuda.h
337 include/ggml-opt.h
338 include/ggml-metal.h
339 include/ggml-rpc.h
340 include/ggml-virtgpu.h
341 include/ggml-sycl.h
342 include/ggml-vulkan.h
343 include/ggml-webgpu.h
344 include/ggml-zendnn.h
345 include/ggml-openvino.h
346 include/gguf.h)
347
348set_target_properties(ggml PROPERTIES PUBLIC_HEADER "${GGML_PUBLIC_HEADERS}")
349install(TARGETS ggml LIBRARY PUBLIC_HEADER)
350install(TARGETS ggml-base LIBRARY)
351
352if (GGML_STANDALONE)
353 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ggml.pc.in
354 ${CMAKE_CURRENT_BINARY_DIR}/ggml.pc
355 @ONLY)
356
357 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ggml.pc
358 DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
359endif()
360
361#
362# Create CMake package
363#
364
365
366
367# Capture variables prefixed with GGML_.
368
369set(variable_set_statements
370"
371####### Expanded from @GGML_VARIABLES_EXPANED@ by configure_package_config_file() #######
372####### Any changes to this file will be overwritten by the next CMake run #######
373
374")
375
376set(GGML_SHARED_LIB ${BUILD_SHARED_LIBS})
377
378get_cmake_property(all_variables VARIABLES)
379foreach(variable_name IN LISTS all_variables)
380 if(variable_name MATCHES "^GGML_")
381 string(REPLACE ";" "\\;"
382 variable_value "${${variable_name}}")
383
384 set(variable_set_statements
385 "${variable_set_statements}set(${variable_name} \"${variable_value}\")\n")
386 endif()
387endforeach()
388
389set(GGML_VARIABLES_EXPANDED ${variable_set_statements})
390
391# Create the CMake package and set install location.
392
393set(GGML_INSTALL_VERSION ${GGML_VERSION})
394set(GGML_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR} CACHE PATH "Location of header files")
395set(GGML_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR} CACHE PATH "Location of library files")
396set(GGML_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR} CACHE PATH "Location of binary files")
397
398configure_package_config_file(
399 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ggml-config.cmake.in
400 ${CMAKE_CURRENT_BINARY_DIR}/ggml-config.cmake
401 INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ggml
402 PATH_VARS GGML_INCLUDE_INSTALL_DIR
403 GGML_LIB_INSTALL_DIR
404 GGML_BIN_INSTALL_DIR)
405
406write_basic_package_version_file(
407 ${CMAKE_CURRENT_BINARY_DIR}/ggml-config-version.cmake
408 VERSION ${GGML_INSTALL_VERSION}
409 COMPATIBILITY SameMajorVersion)
410
411message(STATUS "ggml version: ${GGML_INSTALL_VERSION}")
412message(STATUS "ggml commit: ${GGML_BUILD_COMMIT}")
413
414install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ggml-config.cmake
415 ${CMAKE_CURRENT_BINARY_DIR}/ggml-config-version.cmake
416 DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ggml)
417
418if (MSVC)
419 set(MSVC_WARNING_FLAGS
420 /wd4005 # Macro redefinition
421 /wd4244 # Conversion from one type to another type, possible loss of data
422 /wd4267 # Conversion from 'size_t' to a smaller type, possible loss of data
423 /wd4305 # Conversion from 'type1' to 'type2', possible loss of data
424 /wd4566 # Conversion from 'char' to 'wchar_t', possible loss of data
425 /wd4996 # Disable POSIX deprecation warnings
426 /wd4702 # Unreachable code warnings
427 )
428 set(MSVC_COMPILE_OPTIONS
429 "$<$<COMPILE_LANGUAGE:C>:/utf-8>"
430 "$<$<COMPILE_LANGUAGE:CXX>:/utf-8>"
431 )
432 function(configure_msvc_target target_name)
433 if(TARGET ${target_name})
434 target_compile_options(${target_name} PRIVATE ${MSVC_WARNING_FLAGS})
435 target_compile_options(${target_name} PRIVATE ${MSVC_COMPILE_OPTIONS})
436 endif()
437 endfunction()
438
439 configure_msvc_target(ggml-base)
440 configure_msvc_target(ggml)
441 configure_msvc_target(ggml-cpu)
442 configure_msvc_target(ggml-cpu-x64)
443 configure_msvc_target(ggml-cpu-sse42)
444 configure_msvc_target(ggml-cpu-sandybridge)
445 # __FMA__ and __F16C__ are not defined in MSVC, however they are implied with AVX2/AVX512
446 # skipping ggml-cpu-ivybridge
447 # skipping ggml-cpu-piledriver
448 configure_msvc_target(ggml-cpu-haswell)
449 configure_msvc_target(ggml-cpu-skylakex)
450 configure_msvc_target(ggml-cpu-cannonlake)
451 configure_msvc_target(ggml-cpu-cascadelake)
452 configure_msvc_target(ggml-cpu-icelake)
453 # MSVC 2022 doesn't support BF16 intrinsics without `/arch:AVX10.1` ?!
454 # https://learn.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list?view=msvc-170
455 # https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170
456 # skipping ggml-cpu-cooperlake
457 # skipping ggml-cpu-zen4
458 configure_msvc_target(ggml-cpu-alderlake)
459 # MSVC doesn't support AMX
460 # skipping ggml-cpu-sapphirerapids
461
462 if (GGML_BUILD_EXAMPLES)
463 configure_msvc_target(common-ggml)
464 configure_msvc_target(common)
465
466 configure_msvc_target(mnist-common)
467 configure_msvc_target(mnist-eval)
468 configure_msvc_target(mnist-train)
469
470 configure_msvc_target(gpt-2-ctx)
471 configure_msvc_target(gpt-2-alloc)
472 configure_msvc_target(gpt-2-backend)
473 configure_msvc_target(gpt-2-sched)
474 configure_msvc_target(gpt-2-quantize)
475 configure_msvc_target(gpt-2-batched)
476
477 configure_msvc_target(gpt-j)
478 configure_msvc_target(gpt-j-quantize)
479
480 configure_msvc_target(magika)
481 configure_msvc_target(yolov3-tiny)
482 configure_msvc_target(sam)
483
484 configure_msvc_target(simple-ctx)
485 configure_msvc_target(simple-backend)
486 endif()
487
488 if (GGML_BUILD_TESTS)
489 configure_msvc_target(test-mul-mat)
490 configure_msvc_target(test-arange)
491 configure_msvc_target(test-backend-ops)
492 configure_msvc_target(test-cont)
493 configure_msvc_target(test-conv-transpose)
494 configure_msvc_target(test-conv-transpose-1d)
495 configure_msvc_target(test-conv1d)
496 configure_msvc_target(test-conv2d)
497 configure_msvc_target(test-conv2d-dw)
498 configure_msvc_target(test-customop)
499 configure_msvc_target(test-dup)
500 configure_msvc_target(test-opt)
501 configure_msvc_target(test-pool)
502 endif ()
503endif()