]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
ggml : add get_no_alloc api corresponding to set_no_alloc (#402)
authorJiahao Li <redacted>
Sun, 23 Jul 2023 15:17:06 +0000 (23:17 +0800)
committerGitHub <redacted>
Sun, 23 Jul 2023 15:17:06 +0000 (18:17 +0300)
include/ggml/ggml.h
src/ggml.c

index d1539027637367f8e99d50f43b9c11a711bab893..def39e35544f2e0ccfaa20a0f47a238235886631 100644 (file)
@@ -558,6 +558,7 @@ extern "C" {
     GGML_API size_t  ggml_used_mem(const struct ggml_context * ctx);
 
     GGML_API size_t  ggml_set_scratch (struct ggml_context * ctx, struct ggml_scratch scratch);
+    GGML_API bool    ggml_get_no_alloc(struct ggml_context * ctx);
     GGML_API void    ggml_set_no_alloc(struct ggml_context * ctx, bool no_alloc);
 
     GGML_API void *  ggml_get_mem_buffer     (const struct ggml_context * ctx);
index 931a20929eddf6627b04afa795d530e5641fcc1c..333e88450ae9f960f8818556bf1eab9d27095d0d 100644 (file)
@@ -4445,6 +4445,10 @@ size_t ggml_set_scratch(struct ggml_context * ctx, struct ggml_scratch scratch)
     return result;
 }
 
+bool ggml_get_no_alloc(struct ggml_context * ctx) {
+    return ctx->no_alloc;
+}
+
 void ggml_set_no_alloc(struct ggml_context * ctx, bool no_alloc) {
     ctx->no_alloc = no_alloc;
 }