]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : make it work on Windows (#46)
authorMaiHD <redacted>
Sat, 25 Mar 2023 20:43:24 +0000 (03:43 +0700)
committerGitHub <redacted>
Sat, 25 Mar 2023 20:43:24 +0000 (22:43 +0200)
src/ggml.c

index d67612c36a38f646c1fba12138bbd66894afb446..df2235f3ca470c970de9a15de46f7db377f33ee7 100644 (file)
@@ -30,6 +30,9 @@
 #include <errno.h>
 #endif
 
+// Need this to compile with Visual Studio 2017
+#define restrict __restrict
+
 typedef volatile LONG atomic_int;
 typedef atomic_int atomic_bool;
 
@@ -1485,6 +1488,9 @@ struct ggml_context * ggml_init(struct ggml_init_params params) {
     static bool is_first_call = true;
 
     if (is_first_call) {
+        // initialize time system (required on Windows)
+        ggml_time_init();
+
         // initialize GELU, EXP and F32 tables
         {
             const uint64_t t_start = ggml_time_us(); UNUSED(t_start);