From 54841deddf3b70c72e49ff0a9f2a38fdf82ecc9c Mon Sep 17 00:00:00 2001 From: Robin Lobel Date: Sat, 7 Jun 2025 06:41:20 +0200 Subject: [PATCH 1/2] fix compilation with MSVC for arm64 with __ARM_NEON defined __fp16 is an undeclared identifie with MSVC --- ggml/src/ggml-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml/src/ggml-impl.h b/ggml/src/ggml-impl.h index 6dc5ce0d92f..df78d7de95c 100644 --- a/ggml/src/ggml-impl.h +++ b/ggml/src/ggml-impl.h @@ -326,7 +326,7 @@ GGML_API void ggml_aligned_free(void * ptr, size_t size); // for old CUDA compilers (<= 11), we use uint16_t: ref https://github.com/ggml-org/llama.cpp/pull/10616 // for MUSA compilers , we use uint16_t: ref https://github.com/ggml-org/llama.cpp/pull/11843 // -#if defined(__ARM_NEON) && !(defined(__CUDACC__) && __CUDACC_VER_MAJOR__ <= 11) && !defined(__MUSACC__) +#if defined(__ARM_NEON) && !(defined(__CUDACC__) && __CUDACC_VER_MAJOR__ <= 11) && !defined(__MUSACC__) && !defined(_MSC_VER) #define GGML_COMPUTE_FP16_TO_FP32(x) ggml_compute_fp16_to_fp32(x) #define GGML_COMPUTE_FP32_TO_FP16(x) ggml_compute_fp32_to_fp16(x) From fa65770f6a0d4e07e610951dffd9409bd02a756b Mon Sep 17 00:00:00 2001 From: Robin Lobel Date: Sat, 7 Jun 2025 06:45:21 +0200 Subject: [PATCH 2/2] fix compilation with MSVC for arm64 with __ARM_NEON defined fix vaddlvq_s16 already defined as _CopyInt32FromFloat by MSVC arm64, and other similar functions --- ggml/src/ggml-cpu/ggml-cpu-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggml/src/ggml-cpu/ggml-cpu-impl.h b/ggml/src/ggml-cpu/ggml-cpu-impl.h index b3f1b5ca790..60596437675 100644 --- a/ggml/src/ggml-cpu/ggml-cpu-impl.h +++ b/ggml/src/ggml-cpu/ggml-cpu-impl.h @@ -81,7 +81,7 @@ struct ggml_compute_params { #define ggml_vld1q_u32(w,x,y,z) { (w), (x), (y), (z) } #endif // _MSC_VER -#if !defined(__aarch64__) +#if !defined(__aarch64__) && !defined(_MSC_VER) // 32-bit ARM compatibility