whisper_print_timings(ctx);
whisper_free(ctx);
+ fprintf(stderr, "\n");
+ fprintf(stderr, "system_info: n_threads = %d | %s\n", params.n_threads, whisper_print_system_info());
+
+ fprintf(stderr, "\n");
+ fprintf(stderr, "If you wish, you can submit these results here:\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " https://github.com/ggerganov/whisper.cpp/issues/89\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, "Please include the following information:\n");
+ fprintf(stderr, "\n");
+ fprintf(stderr, " - CPU model\n");
+ fprintf(stderr, " - Operating system\n");
+ fprintf(stderr, " - Compiler\n");
+ fprintf(stderr, "\n");
+
return 0;
}
}
////////////////////////////////////////////////////////////////////////////////
+
+int ggml_cpu_has_avx2(void) {
+#if defined(__AVX2__)
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+int ggml_cpu_has_avx512(void) {
+#if defined(__AVX512F__)
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+int ggml_cpu_has_neon(void) {
+#if defined(__ARM_NEON__)
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+int ggml_cpu_has_fp16_va(void) {
+#if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC)
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+int ggml_cpu_has_wasm_simd(void) {
+#if defined(__wasm_simd128__)
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+int ggml_cpu_has_blas(void) {
+#if defined(GGML_USE_BLAS) || defined(GGML_USE_ACCELERATE)
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+////////////////////////////////////////////////////////////////////////////////
struct ggml_opt_params params,
struct ggml_tensor * f);
+//
+// system info
+//
+
+int ggml_cpu_has_avx2(void);
+int ggml_cpu_has_avx512(void);
+int ggml_cpu_has_neon(void);
+int ggml_cpu_has_fp16_va(void);
+int ggml_cpu_has_wasm_simd(void);
+int ggml_cpu_has_blas(void);
+
#ifdef __cplusplus
}
#endif
float whisper_full_get_token_p(struct whisper_context * ctx, int i_segment, int i_token) {
return ctx->result_all[i_segment].tokens[i_token].p;
}
+
+const char * whisper_print_system_info() {
+ static std::string s;
+
+ s = "";
+ s += "AVX2 = " + std::to_string(ggml_cpu_has_avx2()) + " | ";
+ s += "AVX512 = " + std::to_string(ggml_cpu_has_avx512()) + " | ";
+ s += "NEON = " + std::to_string(ggml_cpu_has_neon()) + " | ";
+ s += "FP16_VA = " + std::to_string(ggml_cpu_has_fp16_va()) + " | ";
+ s += "WASM_SIMD = " + std::to_string(ggml_cpu_has_wasm_simd()) + " | ";
+ s += "BLAS = " + std::to_string(ggml_cpu_has_blas()) + " | ";
+
+ return s.c_str();
+}
// Get the probability of the specified token in the specified segment.
WHISPER_API float whisper_full_get_token_p(struct whisper_context * ctx, int i_segment, int i_token);
+ // Print system information
+ WHISPER_API const char * whisper_print_system_info();
+
#ifdef __cplusplus
}
#endif