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

Function ggml_backend_cpu_graph_plan_create

ggml-backend.c:316–329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314};
315
316static ggml_backend_graph_plan_t ggml_backend_cpu_graph_plan_create(ggml_backend_t backend, struct ggml_cgraph * cgraph) {
317 struct ggml_backend_cpu_context * cpu_ctx = (struct ggml_backend_cpu_context *)backend->context;
318
319 struct ggml_backend_plan_cpu * cpu_plan = malloc(sizeof(struct ggml_backend_plan_cpu));
320
321 cpu_plan->cplan = ggml_graph_plan(cgraph, cpu_ctx->n_threads);
322 cpu_plan->cgraph = *cgraph;
323
324 if (cpu_plan->cplan.work_size > 0) {
325 cpu_plan->cplan.work_data = malloc(cpu_plan->cplan.work_size);
326 }
327
328 return cpu_plan;
329}
330
331static void ggml_backend_cpu_graph_plan_free(ggml_backend_t backend, ggml_backend_graph_plan_t plan) {
332 struct ggml_backend_plan_cpu * cpu_plan = (struct ggml_backend_plan_cpu *)plan;

Callers

nothing calls this directly

Calls 1

ggml_graph_planFunction · 0.70

Tested by

no test coverage detected