| 178 | |
| 179 | #ifdef GGML_ALLOCATOR_DEBUG |
| 180 | static void add_allocated_tensor(struct ggml_dyn_tallocr * alloc, struct buffer_address addr, const struct ggml_tensor * tensor) { |
| 181 | for (int i = 0; i < 1024; i++) { |
| 182 | if (alloc->allocated_tensors[i].tensor == NULL) { |
| 183 | alloc->allocated_tensors[i].tensor = tensor; |
| 184 | alloc->allocated_tensors[i].addr = addr; |
| 185 | return; |
| 186 | } |
| 187 | } |
| 188 | GGML_ABORT("out of allocated_tensors"); |
| 189 | } |
| 190 | static void remove_allocated_tensor(struct ggml_dyn_tallocr * alloc, struct buffer_address addr, const struct ggml_tensor * tensor) { |
| 191 | for (int i = 0; i < 1024; i++) { |
| 192 | if (alloc->allocated_tensors[i].addr.chunk == addr.chunk && alloc->allocated_tensors[i].addr.offset == addr.offset) { |
no outgoing calls
no test coverage detected