ggml : alloc ggml_contexts on the heap (whisper/2525)

This commit is contained in:
Georgi Gerganov 2024-11-01 10:23:05 +02:00
parent e597e50794
commit f221d56220
No known key found for this signature in database
GPG key ID: BF970631944C16B7
2 changed files with 23 additions and 51 deletions

View file

@ -217,7 +217,6 @@
#define GGML_MAX_DIMS 4
#define GGML_MAX_PARAMS 2048
#define GGML_MAX_CONTEXTS 64
#define GGML_MAX_SRC 10
#define GGML_MAX_N_THREADS 512
#define GGML_MAX_OP_PARAMS 64
@ -657,6 +656,7 @@ extern "C" {
};
// scratch buffer
// TODO: deprecate and remove
struct ggml_scratch {
size_t offs;
size_t size;
@ -760,8 +760,9 @@ extern "C" {
// main
GGML_API struct ggml_context * ggml_init(struct ggml_init_params params);
GGML_API void ggml_free(struct ggml_context * ctx);
GGML_API struct ggml_context * ggml_init (struct ggml_init_params params);
GGML_API void ggml_reset(struct ggml_context * ctx);
GGML_API void ggml_free (struct ggml_context * ctx);
GGML_API size_t ggml_used_mem(const struct ggml_context * ctx);