fix two more public APIs to use int32_t for n_threads

This commit is contained in:
Max Krasnyansky 2024-08-28 21:56:53 -07:00
parent c49d634071
commit 3b5f7c2a9b
2 changed files with 4 additions and 4 deletions

View file

@ -847,10 +847,10 @@ extern "C" {
LLAMA_API void llama_set_n_threads(struct llama_context * ctx, int32_t n_threads, int32_t n_threads_batch);
// Get the number of threads used for generation of a single token.
LLAMA_API int llama_n_threads(struct llama_context * ctx);
LLAMA_API int32_t llama_n_threads(struct llama_context * ctx);
// Get the number of threads used for prompt and batch processing (multiple token).
LLAMA_API int llama_n_threads_batch(struct llama_context * ctx);
LLAMA_API int32_t llama_n_threads_batch(struct llama_context * ctx);
// Set whether the model is in embeddings mode or not
// If true, embeddings will be returned but logits will not

View file

@ -19394,11 +19394,11 @@ void llama_set_n_threads(struct llama_context * ctx, int32_t n_threads, int32_t
ctx->cparams.n_threads_batch = n_threads_batch;
}
int llama_n_threads(struct llama_context * ctx) {
int32_t llama_n_threads(struct llama_context * ctx) {
return ctx->cparams.n_threads;
}
int llama_n_threads_batch(struct llama_context * ctx) {
int32_t llama_n_threads_batch(struct llama_context * ctx) {
return ctx->cparams.n_threads_batch;
}