ggml : prevent builds with -ffinite-math-only

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-06-04 08:28:18 +03:00
parent bde7cd3cd9
commit 41e8f8cce4
No known key found for this signature in database
GPG key ID: BF970631944C16B7

5
ggml.c
View file

@ -2272,6 +2272,11 @@ inline static float ggml_silu_f32(float x) {
return x/(1.0f + expf(-x));
}
#if __FINITE_MATH_ONLY__
#error "some routines in ggml.c require non-finite math arithmetics -- pass -fno-finite-math-only to the compiler to fix"
#error "ref: https://github.com/ggerganov/llama.cpp/pull/7154#issuecomment-2143844461
#endif
#if defined(__ARM_NEON) && defined(__aarch64__)
// adapted from arm limited optimized routine