Skip to content

Commit

Permalink
added GGML_ALLOCATOR_DEBUG code back
Browse files Browse the repository at this point in the history
  • Loading branch information
l3utterfly committed Oct 7, 2023
1 parent 4c3a7cd commit cd0022f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ggml-alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,10 @@ struct ggml_allocr * ggml_allocr_new(void * data, size_t size, size_t alignment)
memset((*alloc).hash_table, 0, sizeof((*alloc).hash_table));
memset((*alloc).parse_seq, 0, sizeof((*alloc).parse_seq));

#ifdef GGML_ALLOCATOR_DEBUG
memset((*alloc).allocated_tensors, 0, sizeof((*alloc).allocated_tensors));
#endif

ggml_allocr_reset(alloc);

return alloc;
Expand Down Expand Up @@ -380,7 +384,7 @@ struct ggml_allocr * ggml_allocr_new_measure(size_t alignment) {
memset((*alloc).parse_seq, 0, sizeof((*alloc).parse_seq));

#ifdef GGML_ALLOCATOR_DEBUG
(*alloc).allocated_tensors = {0};
memset((*alloc).allocated_tensors, 0, sizeof((*alloc).allocated_tensors));
#endif

ggml_allocr_reset(alloc);
Expand Down

0 comments on commit cd0022f

Please sign in to comment.