From 43bcb50f13abb9b20a0df6e718d3edf47f5f24e9 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 22 May 2024 16:17:00 +0200 Subject: [PATCH] squash! llama : add getters for n_threads/n_threads_batch Rename the getters to llama_n_threads and llama_n_threads_batch. Signed-off-by: Daniel Bevenius --- llama.cpp | 4 ++-- llama.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llama.cpp b/llama.cpp index bbf99b7d8..9c0eb856c 100644 --- a/llama.cpp +++ b/llama.cpp @@ -17183,11 +17183,11 @@ void llama_set_n_threads(struct llama_context * ctx, uint32_t n_threads, uint32_ ctx->cparams.n_threads_batch = n_threads_batch; } -uint32_t llama_get_n_threads(struct llama_context * ctx) { +uint32_t llama_n_threads(struct llama_context * ctx) { return ctx->cparams.n_threads; } -uint32_t llama_get_n_threads_batch(struct llama_context * ctx) { +uint32_t llama_n_threads_batch(struct llama_context * ctx) { return ctx->cparams.n_threads_batch; } diff --git a/llama.h b/llama.h index 2d0c8b01f..16cece5db 100644 --- a/llama.h +++ b/llama.h @@ -760,10 +760,10 @@ extern "C" { LLAMA_API void llama_set_n_threads(struct llama_context * ctx, uint32_t n_threads, uint32_t n_threads_batch); // Get the number of threads used for generation of a single token. - LLAMA_API uint32_t llama_get_n_threads(struct llama_context * ctx); + LLAMA_API uint32_t llama_n_threads(struct llama_context * ctx); // Get the number of threads used for prompt and batch processing (multiple token). - LLAMA_API uint32_t llama_get_n_threads_batch(struct llama_context * ctx); + LLAMA_API uint32_t llama_n_threads_batch(struct llama_context * ctx); // Set whether to use causal attention or not // If set to true, the model will only attend to the past tokens