]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ggml : adjust is_first_call init value (llama/10193)
authorGeorgi Gerganov <redacted>
Wed, 6 Nov 2024 09:20:10 +0000 (11:20 +0200)
committerGeorgi Gerganov <redacted>
Fri, 15 Nov 2024 13:21:04 +0000 (15:21 +0200)
ggml-ci

ggml/src/ggml.c

index e6a7824baa167a6f56b0d9abccd67644701a82fa..266a0d6f044db8bb0dc6d4a238dbc0be866dcdf5 100644 (file)
@@ -1407,11 +1407,11 @@ static inline bool ggml_can_repeat_rows(const struct ggml_tensor * t0, const str
 ////////////////////////////////////////////////////////////////////////////////
 
 struct ggml_context * ggml_init(struct ggml_init_params params) {
-    static bool is_first_call = false;
+    static bool is_first_call = true;
 
     ggml_critical_section_start();
 
-    if (!is_first_call) {
+    if (is_first_call) {
         // initialize time system (required on Windows)
         ggml_time_init();
 
@@ -1422,7 +1422,8 @@ struct ggml_context * ggml_init(struct ggml_init_params params) {
             } u = {i};
             ggml_table_f32_f16[i] = GGML_COMPUTE_FP16_TO_FP32(u.fp16);
         }
-        is_first_call = true;
+
+        is_first_call = false;
     }
 
     ggml_critical_section_end();