| 123 | }; |
| 124 | |
| 125 | static test_context_with_graph make_context() { |
| 126 | ggml_init_params params{}; |
| 127 | params.mem_size = 48 * ggml_tensor_overhead() + ggml_graph_overhead(); |
| 128 | params.no_alloc = true; |
| 129 | |
| 130 | ggml_context * ctx = ggml_init(params); |
| 131 | ggml_context_ptr ctx_ptr = ggml_context_ptr(ctx); |
| 132 | ggml_cgraph * graph = ggml_new_graph(ctx); |
| 133 | return { ctx, graph, std::move(ctx_ptr) }; |
| 134 | } |
| 135 | |
| 136 | static ggml_tensor * make_input_1d(ggml_context * ctx, int64_t n_elements) { |
| 137 | ggml_tensor * t = ggml_new_tensor_1d(ctx, GGML_TYPE_F32, n_elements); |
no test coverage detected