From 7729be2aae34b2e32c2528d46ec19d2dcb358155 Mon Sep 17 00:00:00 2001 From: Aaron Teo Date: Sat, 20 Dec 2025 15:25:42 +0800 Subject: [PATCH] ggml-blas: bring back openmp warnings Signed-off-by: Aaron Teo --- ggml/src/ggml-blas/ggml-blas.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ggml/src/ggml-blas/ggml-blas.cpp b/ggml/src/ggml-blas/ggml-blas.cpp index 7497ab925c..b431290b6c 100644 --- a/ggml/src/ggml-blas/ggml-blas.cpp +++ b/ggml/src/ggml-blas/ggml-blas.cpp @@ -14,6 +14,19 @@ #include #include +#if defined(GGML_BLAS_USE_ACCELERATE) +# include +#elif defined(GGML_BLAS_USE_MKL) +# include +#elif defined(GGML_BLAS_USE_BLIS) +# include +#elif defined(GGML_BLAS_USE_NVPL) +# include +#else +# include +#endif + + // BLAS backend - graph compute static void ggml_blas_compute_forward_mul_mat( @@ -367,6 +380,16 @@ ggml_backend_t ggml_backend_blas_init(void) { /* .context = */ ctx, }; +#if defined(OPENBLAS_VERSION) && defined(GGML_USE_OPENMP) + if (openblas_get_parallel() != OPENBLAS_OPENMP) { + GGML_LOG_DEBUG("%s: warning: ggml is using OpenMP, but OpenBLAS was compiled without OpenMP support\n", __func__); + } +#endif + +#if defined(BLIS_ENABLE_CBLAS) && defined(GGML_USE_OPENMP) && !defined(BLIS_ENABLE_OPENMP) + GGML_LOG_DEBUG("%s: warning: ggml is using OpenMP, but BLIS was compiled without OpenMP support\n", __func__); +#endif + if (blas_backend == NULL) { delete ctx; return NULL;