build the compute graph to perform a matrix multiplication
| 49 | |
| 50 | // build the compute graph to perform a matrix multiplication |
| 51 | struct ggml_cgraph * build_graph(const simple_model& model) { |
| 52 | struct ggml_cgraph * gf = ggml_new_graph(model.ctx); |
| 53 | |
| 54 | // result = a*b^T |
| 55 | struct ggml_tensor * result = ggml_mul_mat(model.ctx, model.a, model.b); |
| 56 | |
| 57 | ggml_build_forward_expand(gf, result); |
| 58 | return gf; |
| 59 | } |
| 60 | |
| 61 | // compute with backend |
| 62 | struct ggml_tensor * compute(const simple_model & model) { |
no test coverage detected