MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / add_allocated_tensor

Function add_allocated_tensor

external/ggml/src/ggml-alloc.c:180–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178
179#ifdef GGML_ALLOCATOR_DEBUG
180static 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}
190static 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) {

Callers 1

ggml_dyn_tallocr_allocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected