From: Georgi Gerganov Date: Thu, 27 Oct 2022 14:22:10 +0000 (+0300) Subject: Print system info at start of program X-Git-Tag: upstream/1.7.4~1892 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ebb01b9e33f3fa3cf047bd485eab11b645b6d062;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp Print system info at start of program --- diff --git a/examples/bench/bench.cpp b/examples/bench/bench.cpp index d87bf37a..7395a50e 100644 --- a/examples/bench/bench.cpp +++ b/examples/bench/bench.cpp @@ -56,6 +56,11 @@ int main(int argc, char ** argv) { struct whisper_context * ctx = whisper_init(params.model.c_str()); + { + fprintf(stderr, "\n"); + fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info()); + } + if (ctx == nullptr) { fprintf(stderr, "error: failed to initialize whisper context\n"); return 2; @@ -74,9 +79,6 @@ int main(int argc, char ** argv) { whisper_print_timings(ctx); whisper_free(ctx); - fprintf(stderr, "\n"); - fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info()); - fprintf(stderr, "\n"); fprintf(stderr, "If you wish, you can submit these results here:\n"); fprintf(stderr, "\n"); diff --git a/examples/main/main.cpp b/examples/main/main.cpp index 0fe8efcf..91e4a375 100644 --- a/examples/main/main.cpp +++ b/examples/main/main.cpp @@ -343,6 +343,12 @@ int main(int argc, char ** argv) { } } + // print system information + { + fprintf(stderr, "\n"); + fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info()); + } + // print some info about the processing { fprintf(stderr, "\n"); @@ -412,8 +418,5 @@ int main(int argc, char ** argv) { whisper_print_timings(ctx); whisper_free(ctx); - fprintf(stderr, "\n"); - fprintf(stderr, "system_info: n_threads = %d / %d | %s\n", params.n_threads, std::thread::hardware_concurrency(), whisper_print_system_info()); - return 0; }