Jelajahi Sumber

ggml : adjust is_first_call init value (#10193)

ggml-ci
Georgi Gerganov 1 tahun lalu
induk
melakukan
1dc04b2dee
1 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 4 3
      ggml/src/ggml.c

+ 4 - 3
ggml/src/ggml.c

@@ -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) {
 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();
     ggml_critical_section_start();
 
 
-    if (!is_first_call) {
+    if (is_first_call) {
         // initialize time system (required on Windows)
         // initialize time system (required on Windows)
         ggml_time_init();
         ggml_time_init();
 
 
@@ -1422,7 +1422,8 @@ struct ggml_context * ggml_init(struct ggml_init_params params) {
             } u = {i};
             } u = {i};
             ggml_table_f32_f16[i] = GGML_COMPUTE_FP16_TO_FP32(u.fp16);
             ggml_table_f32_f16[i] = GGML_COMPUTE_FP16_TO_FP32(u.fp16);
         }
         }
-        is_first_call = true;
+
+        is_first_call = false;
     }
     }
 
 
     ggml_critical_section_end();
     ggml_critical_section_end();