summaryrefslogtreecommitdiff
path: root/llama.cpp
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-05-20 11:06:11 +0300
committerGeorgi Gerganov <ggerganov@gmail.com>2023-05-20 11:06:37 +0300
commitec2e10c4443209da56b431b24dd0845b60e757fb (patch)
tree0a285ebbdd3efa99eb60042631ddd86ae6dedd00 /llama.cpp
parentd2c59b8ba498ab01e65203dde6fe95236d20f6e7 (diff)
llama : add llama_init_backend() API (close #1527)
Diffstat (limited to 'llama.cpp')
-rw-r--r--llama.cpp15
1 files changed, 15 insertions, 0 deletions
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
//