From ec2e10c4443209da56b431b24dd0845b60e757fb Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 20 May 2023 11:06:11 +0300 Subject: llama : add llama_init_backend() API (close #1527) --- llama.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'llama.cpp') diff --git a/llama.cpp b/llama.cpp index dd449592..5e6980b4 100644 --- a/llama.cpp +++ b/llama.cpp @@ -839,6 +839,21 @@ bool llama_mlock_supported() { return llama_mlock::SUPPORTED; } +void llama_init_backend() { + ggml_time_init(); + + // needed to initialize f16 tables + { + struct ggml_init_params params = { 0, NULL, false }; + struct ggml_context * ctx = ggml_init(params); + ggml_free(ctx); + } +} + +int64_t llama_time_us() { + return ggml_time_us(); +} + // // model loading // -- cgit v1.2.3