ggerganov commited on
Commit
7e2b09b
·
1 Parent(s): f1ea157

ggml : adjust is_first_call init value (llama/10193)

Browse files
Files changed (1) hide show
  1. ggml/src/ggml.c +4 -3
ggml/src/ggml.c CHANGED
@@ -1407,11 +1407,11 @@ static inline bool ggml_can_repeat_rows(const struct ggml_tensor * t0, const str
1407
  ////////////////////////////////////////////////////////////////////////////////
1408
 
1409
  struct ggml_context * ggml_init(struct ggml_init_params params) {
1410
- static bool is_first_call = false;
1411
 
1412
  ggml_critical_section_start();
1413
 
1414
- if (!is_first_call) {
1415
  // initialize time system (required on Windows)
1416
  ggml_time_init();
1417
 
@@ -1422,7 +1422,8 @@ struct ggml_context * ggml_init(struct ggml_init_params params) {
1422
  } u = {i};
1423
  ggml_table_f32_f16[i] = GGML_COMPUTE_FP16_TO_FP32(u.fp16);
1424
  }
1425
- is_first_call = true;
 
1426
  }
1427
 
1428
  ggml_critical_section_end();
 
1407
  ////////////////////////////////////////////////////////////////////////////////
1408
 
1409
  struct ggml_context * ggml_init(struct ggml_init_params params) {
1410
+ static bool is_first_call = true;
1411
 
1412
  ggml_critical_section_start();
1413
 
1414
+ if (is_first_call) {
1415
  // initialize time system (required on Windows)
1416
  ggml_time_init();
1417
 
 
1422
  } u = {i};
1423
  ggml_table_f32_f16[i] = GGML_COMPUTE_FP16_TO_FP32(u.fp16);
1424
  }
1425
+
1426
+ is_first_call = false;
1427
  }
1428
 
1429
  ggml_critical_section_end();