Browse Source

ggml : init time on first ggml_init() call

Georgi Gerganov 2 years ago
parent
commit
b51c717d5c
1 changed files with 3 additions and 0 deletions
  1. 3 0
      ggml.c

+ 3 - 0
ggml.c

@@ -2748,6 +2748,9 @@ struct ggml_context * ggml_init(struct ggml_init_params params) {
     static bool is_first_call = true;
     static bool is_first_call = true;
 
 
     if (is_first_call) {
     if (is_first_call) {
+        // initialize time system (required on Windows)
+        ggml_time_init();
+
         // initialize GELU, SILU and EXP F32 tables
         // initialize GELU, SILU and EXP F32 tables
         {
         {
             const uint64_t t_start = ggml_time_us(); UNUSED(t_start);
             const uint64_t t_start = ggml_time_us(); UNUSED(t_start);