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

Function ggml_backend_cpu_graph_compute

ggml-backend.c:348–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348static void ggml_backend_cpu_graph_compute(ggml_backend_t backend, struct ggml_cgraph * cgraph) {
349 struct ggml_backend_cpu_context * cpu_ctx = (struct ggml_backend_cpu_context *)backend->context;
350
351 struct ggml_cplan cplan = ggml_graph_plan(cgraph, cpu_ctx->n_threads);
352
353 if (cpu_ctx->work_size < cplan.work_size) {
354 // TODO: may be faster to free and use malloc to avoid the copy
355 cpu_ctx->work_data = realloc(cpu_ctx->work_data, cplan.work_size);
356 cpu_ctx->work_size = cplan.work_size;
357 }
358
359 cplan.work_data = cpu_ctx->work_data;
360
361 ggml_graph_compute(cgraph, &cplan);
362}
363
364static bool ggml_backend_cpu_supports_op(ggml_backend_t backend, const struct ggml_tensor * op) {
365 return true;

Callers

nothing calls this directly

Calls 2

ggml_graph_planFunction · 0.70
ggml_graph_computeFunction · 0.70

Tested by

no test coverage detected