MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / format

Function format

llama.cpp:173–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171
172LLAMA_ATTRIBUTE_FORMAT(1, 2)
173static std::string format(const char * fmt, ...) {
174 va_list ap;
175 va_list ap2;
176 va_start(ap, fmt);
177 va_copy(ap2, ap);
178 int size = vsnprintf(NULL, 0, fmt, ap);
179 GGML_ASSERT(size >= 0 && size < INT_MAX); // NOLINT
180 std::vector<char> buf(size + 1);
181 int size2 = vsnprintf(buf.data(), size + 1, fmt, ap2);
182 GGML_ASSERT(size2 == size);
183 va_end(ap2);
184 va_end(ap);
185 return std::string(buf.data(), size);
186}
187
188static size_t llama_set_vram_budget(double budget_gb, int gpu_device) {
189#if defined(GGML_USE_CUBLAS)

Callers 15

operator()Method · 0.70
operator()Method · 0.70
llama_fileMethod · 0.70
read_rawMethod · 0.70
write_rawMethod · 0.70
llama_mmapMethod · 0.70
llama_model_loaderMethod · 0.70
create_tensorMethod · 0.70
done_getting_tensorsMethod · 0.70
file_offsetMethod · 0.70
llm_load_hparamsFunction · 0.70
llm_load_gpu_splitFunction · 0.70

Calls 2

stringFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected