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

Function ggml_gallocr_node_needs_realloc

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

Source from the content-addressed store, hash-verified

994}
995
996static bool ggml_gallocr_node_needs_realloc(ggml_gallocr_t galloc, struct ggml_tensor * node, struct tensor_alloc * talloc) {
997 size_t node_size = 0;
998 if (!node->data && !node->view_src) {
999 // If we previously had data but don't now then reallocate
1000 if (talloc->buffer_id < 0) {
1001 return false;
1002 }
1003 node_size = ggml_backend_buft_get_alloc_size(galloc->bufts[talloc->buffer_id], node);
1004 }
1005 return talloc->size_max >= node_size;
1006}
1007
1008static bool ggml_gallocr_needs_realloc(ggml_gallocr_t galloc, struct ggml_cgraph * graph) {
1009 if (galloc->n_nodes != graph->n_nodes) {

Callers 1

Calls 1

Tested by

no test coverage detected