| 108 | const ggml_status status = ggml_backend_graph_compute(backend, graph); |
| 109 | const auto end = std::chrono::steady_clock::now(); |
| 110 | if (status != GGML_STATUS_SUCCESS) { |
| 111 | std::ostringstream oss; |
| 112 | oss << "backend graph compute failed with status " << static_cast<int>(status); |
| 113 | throw std::runtime_error(oss.str()); |
| 114 | } |
| 115 | RunResult result{output.shape, {}}; |
| 116 | result.compute_ms = std::chrono::duration<double, std::milli>(end - start).count(); |
| 117 | engine::core::read_tensor_f32_into(output.tensor, result.values); |
| 118 | return result; |
| 119 | } |
| 120 | }; |