char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Adrien Gallouëtcommon : make build info output stream configurable (#28322)c390d0abb

char/aliceai-t5-moe
959 B35 linesraw
1#include "build-info.h"
2
3#include <cstdio>
4#include <string>
5
6int LLAMA_BUILD_NUMBER = @LLAMA_BUILD_NUMBER@;
7char const * LLAMA_COMMIT = "@LLAMA_BUILD_COMMIT@";
8char const * LLAMA_COMPILER = "@BUILD_COMPILER@";
9char const * LLAMA_BUILD_TARGET = "@BUILD_TARGET@";
10
11int llama_build_number(void) {
12    return LLAMA_BUILD_NUMBER;
13}
14
15const char * llama_commit(void) {
16    return LLAMA_COMMIT;
17}
18
19const char * llama_compiler(void) {
20    return LLAMA_COMPILER;
21}
22
23const char * llama_build_target(void) {
24    return LLAMA_BUILD_TARGET;
25}
26
27const char * llama_build_info(void) {
28    static std::string s = "b" + std::to_string(LLAMA_BUILD_NUMBER) + "-" + LLAMA_COMMIT;
29    return s.c_str();
30}
31
32void llama_print_build_info(const char * llama_version, FILE * stream) {
33    fprintf(stream, "version: %s (build %d, commit %s)\n", llama_version, llama_build_number(), llama_commit());
34    fprintf(stream, "built with %s for %s\n", llama_compiler(), llama_build_target());
35}