Skip to content

Commit

Permalink
ggml-alloc : fix list of allocated tensors with GGML_ALLOCATOR_DEBUG (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
slaren authored Sep 21, 2024
1 parent 41f4778 commit d09770c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ggml/src/ggml-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d09770c

Please sign in to comment.