| 17481 | } |
| 17482 | |
| 17483 | void ggml_graph_compute_with_ctx(struct ggml_context * ctx, struct ggml_cgraph * cgraph, int n_threads) { |
| 17484 | struct ggml_cplan cplan = ggml_graph_plan(cgraph, n_threads); |
| 17485 | |
| 17486 | struct ggml_object * obj = ggml_new_object(ctx, GGML_OBJECT_WORK_BUFFER, cplan.work_size); |
| 17487 | |
| 17488 | cplan.work_data = (uint8_t *)ctx->mem_buffer + obj->offs; |
| 17489 | |
| 17490 | ggml_graph_compute(cgraph, &cplan); |
| 17491 | } |
| 17492 | |
| 17493 | struct ggml_tensor * ggml_graph_get_tensor(struct ggml_cgraph * cgraph, const char * name) { |
| 17494 | for (int i = 0; i < cgraph->n_leafs; i++) { |