compute with backend
| 60 | |
| 61 | // compute with backend |
| 62 | struct ggml_tensor * compute(const simple_model & model) { |
| 63 | struct ggml_cgraph * gf = build_graph(model); |
| 64 | |
| 65 | int n_threads = 1; // number of threads to perform some operations with multi-threading |
| 66 | |
| 67 | ggml_graph_compute_with_ctx(model.ctx, gf, n_threads); |
| 68 | |
| 69 | // in this case, the output tensor is the last one in the graph |
| 70 | return ggml_graph_node(gf, -1); |
| 71 | } |
| 72 | |
| 73 | int main(void) { |
| 74 | ggml_time_init(); |
no test coverage detected