From: slaren Date: Sat, 21 Sep 2024 12:24:23 +0000 (+0200) Subject: ggml-alloc : fix list of allocated tensors with GGML_ALLOCATOR_DEBUG (llama/9573) X-Git-Tag: upstream/0.0.1642~353 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=a5de0f88e08afb6128227c4c295de9cb617165ec;p=pkg%2Fggml%2Fsources%2Fggml ggml-alloc : fix list of allocated tensors with GGML_ALLOCATOR_DEBUG (llama/9573) --- diff --git a/src/ggml-alloc.c b/src/ggml-alloc.c index e485326a..70187b9b 100644 --- a/src/ggml-alloc.c +++ b/src/ggml-alloc.c @@ -294,6 +294,12 @@ static void ggml_dyn_tallocr_reset(struct ggml_dyn_tallocr * alloc) { alloc->free_blocks[0].offset = 0; alloc->free_blocks[0].size = SIZE_MAX/2; // restrict maximum size of a measure allocator to half size_t max to avoid overflows alloc->max_size = 0; + +#ifdef GGML_ALLOCATOR_DEBUG + for (int i = 0; i < 1024; i++) { + alloc->allocated_tensors[i].tensor = NULL; + } +#endif } static struct ggml_dyn_tallocr * ggml_dyn_tallocr_new(size_t alignment) {