MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ~llama_context

Method ~llama_context

subprojects/llama.cpp/src/llama-context.cpp:360–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360llama_context::~llama_context() {
361 if (!model.hparams.no_alloc) {
362 for (size_t i = 0; i < backend_ptrs.size(); ++i) {
363 ggml_backend_t backend = backend_ptrs[i];
364 ggml_backend_buffer_type_t buft = backend_buft[i];
365
366 const size_t size_exp = backend_buf_exp_size[i];
367 const size_t size_act = ggml_backend_sched_get_buffer_size(sched.get(), backend);
368 if (size_exp == size_act) {
369 LLAMA_LOG_DEBUG("%s: %10s compute buffer size is %8.4f MiB, matches expectation of %8.4f MiB\n",
370 __func__, ggml_backend_buft_name(buft), size_act / (1024.0*1024.0), size_exp / (1024.0*1024.0));
371 } else {
372 LLAMA_LOG_WARN("%s: %10s compute buffer size of %8.4f MiB, does not match expectation of %8.4f MiB\n",
373 __func__, ggml_backend_buft_name(buft), size_act / (1024.0*1024.0), size_exp / (1024.0*1024.0));
374 }
375 }
376 }
377 ggml_opt_free(opt_ctx);
378}
379
380void llama_context::sched_reserve() {
381 if (!sched_need_reserve) {

Callers

nothing calls this directly

Calls 5

ggml_backend_buft_nameFunction · 0.85
ggml_opt_freeFunction · 0.85
sizeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected