MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_graph_view

Function ggml_graph_view

ggml.c:16385–16405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16383}
16384
16385struct ggml_cgraph * ggml_graph_view(struct ggml_context * ctx, struct ggml_cgraph * cgraph0, int i0, int i1) {
16386 const size_t obj_size = sizeof(struct ggml_cgraph);
16387 struct ggml_object * obj = ggml_new_object(ctx, GGML_OBJECT_GRAPH, obj_size);
16388 struct ggml_cgraph * cgraph = (struct ggml_cgraph *) ((char *) ctx->mem_buffer + obj->offs);
16389
16390 *cgraph = (struct ggml_cgraph) {
16391 /*.size =*/ 0,
16392 /*.n_nodes =*/ i1 - i0,
16393 /*.n_leafs =*/ 0,
16394 /*.nodes =*/ cgraph0->nodes + i0,
16395 /*.grads =*/ cgraph0->grads ? cgraph0->grads + i0 : NULL,
16396 /*.leafs =*/ NULL,
16397 /*.hash_table =*/ { 0, NULL },
16398 /*.order =*/ cgraph0->order,
16399 /*.perf_runs =*/ 0,
16400 /*.perf_cycles =*/ 0,
16401 /*.perf_time_us =*/ 0,
16402 };
16403
16404 return cgraph;
16405}
16406
16407void ggml_graph_cpy(struct ggml_cgraph * src, struct ggml_cgraph * dst) {
16408 GGML_ASSERT(dst->size >= src->n_leafs);

Callers 1

sched_split_graphFunction · 0.70

Calls 1

ggml_new_objectFunction · 0.70

Tested by

no test coverage detected