MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / make_context

Function make_context

subprojects/llama.cpp/tests/test-alloc.cpp:125–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123};
124
125static 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
136static 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);

Callers 12

test_not_enough_chunksFunction · 0.85
test_fill_leftover_spaceFunction · 0.85
test_view_inplaceFunction · 0.85
test_reuse_and_freeFunction · 0.85
test_merge_free_blockFunction · 0.85
test_buffer_size_zeroFunction · 0.85
test_reallocationFunction · 0.85

Calls 4

ggml_tensor_overheadFunction · 0.85
ggml_graph_overheadFunction · 0.85
ggml_initFunction · 0.85
ggml_new_graphFunction · 0.85

Tested by

no test coverage detected