Commit 9b9b10ea for whisper.cpp
commit 9b9b10ea986db4caaa0d2f9f23188b9322f372b9
Author: EugeoSynthesisThirtyTwo <gabriel.dhimoila@gmail.com>
Date: Wed Nov 4 09:10:22 2026 +0100
ggml : fix bf16 (llama/31609)
Co-authored-by: Your Name <you@example.com>
diff --git a/ggml/src/ggml.c b/ggml/src/ggml.c
index 8183525a..e8114810 100644
--- a/ggml/src/ggml.c
+++ b/ggml/src/ggml.c
@@ -485,27 +485,25 @@ void ggml_fp16_to_fp32_row(const ggml_fp16_t * x, float * y, int64_t n) {
}
void ggml_fp32_to_fp16_row(const float * x, ggml_fp16_t * y, int64_t n) {
- int i = 0;
- for (; i < n; ++i) {
+ for (int64_t i = 0; i < n; i++) {
y[i] = GGML_FP32_TO_FP16(x[i]);
}
}
void ggml_bf16_to_fp32_row(const ggml_bf16_t * x, float * y, int64_t n) {
- int i = 0;
- for (; i < n; ++i) {
+ for (int64_t i = 0; i < n; i++) {
y[i] = GGML_BF16_TO_FP32(x[i]);
}
}
void ggml_fp32_to_bf16_row_ref(const float * x, ggml_bf16_t * y, int64_t n) {
- for (int i = 0; i < n; i++) {
+ for (int64_t i = 0; i < n; i++) {
y[i] = ggml_compute_fp32_to_bf16(x[i]);
}
}
void ggml_fp32_to_bf16_row(const float * x, ggml_bf16_t * y, int64_t n) {
- int i = 0;
+ int64_t i = 0;
#if defined(__AVX512BF16__)
// subnormals are flushed to zero on this platform
for (; i + 32 <= n; i += 32) {