From: MaiHD Date: Sat, 25 Mar 2023 20:43:24 +0000 (+0700) Subject: ggml : make it work on Windows (#46) X-Git-Tag: upstream/0.0.1642~1570 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=c55f50a18e401c612a7b7abd513aaf41935e8af9;p=pkg%2Fggml%2Fsources%2Fggml ggml : make it work on Windows (#46) --- diff --git a/src/ggml.c b/src/ggml.c index d67612c3..df2235f3 100644 --- a/src/ggml.c +++ b/src/ggml.c @@ -30,6 +30,9 @@ #include #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);