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

Function main

subprojects/llama.cpp/tests/test-autorelease.cpp:11–24  ·  view source on GitHub ↗

This creates a new context inside a pthread and then tries to exit cleanly.

Source from the content-addressed store, hash-verified

9
10// This creates a new context inside a pthread and then tries to exit cleanly.
11int main(int argc, char ** argv) {
12 auto * model_path = get_model_or_exit(argc, argv);
13
14 std::thread([&model_path]() {
15 llama_backend_init();
16 auto * model = llama_model_load_from_file(model_path, llama_model_default_params());
17 auto * ctx = llama_init_from_model(model, llama_context_default_params());
18 llama_free(ctx);
19 llama_model_free(model);
20 llama_backend_free();
21 }).join();
22
23 return 0;
24}

Callers

nothing calls this directly

Calls 10

get_model_or_exitFunction · 0.85
llama_backend_initFunction · 0.85
llama_init_from_modelFunction · 0.85
llama_freeFunction · 0.85
llama_model_freeFunction · 0.85
llama_backend_freeFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected