| 174 | } |
| 175 | |
| 176 | struct ggml_cgraph * compute_graph(const test_model & model, ggml_gallocr_t allocr) { |
| 177 | struct ggml_cgraph * gf = build_graph(model); |
| 178 | |
| 179 | // allocate tensors |
| 180 | ggml_gallocr_alloc_graph(allocr, gf); |
| 181 | int n_threads = 1; |
| 182 | |
| 183 | if (ggml_backend_is_cpu(model.backend)) { |
| 184 | ggml_backend_cpu_set_n_threads(model.backend, n_threads); |
| 185 | } |
| 186 | |
| 187 | ggml_backend_graph_compute(model.backend, gf); |
| 188 | |
| 189 | //ggml_graph_print(gf); |
| 190 | |
| 191 | return gf; |
| 192 | } |
| 193 | |
| 194 | int main(void) |
| 195 | { |
no test coverage detected