From: Nicholai Tukanov Date: Thu, 11 Jul 2024 16:49:15 +0000 (-0500) Subject: ggml : add NVPL BLAS support (ggml/8329) (llama/8425) X-Git-Tag: upstream/1.7.4~558 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=5a8ae474f071ddeb8e9925889c081f984d47eab7;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp ggml : add NVPL BLAS support (ggml/8329) (llama/8425) * ggml : add NVPL BLAS support * ggml : replace `_ENABLE_CBLAS` with `GGML_BLAS_USE_` --------- Co-authored-by: ntukanov --- diff --git a/ggml/src/ggml-blas.cpp b/ggml/src/ggml-blas.cpp index d709a357..a37aa407 100644 --- a/ggml/src/ggml-blas.cpp +++ b/ggml/src/ggml-blas.cpp @@ -8,11 +8,12 @@ # include #elif defined(GGML_BLAS_USE_MKL) # include +#elif defined(GGML_BLAS_USE_BLIS) +# include +#elif defined(GGML_BLAS_USE_NVPL) +# include #else # include -# ifdef BLIS_ENABLE_CBLAS -# include -# endif #endif struct ggml_backend_blas_context { @@ -140,10 +141,14 @@ static void ggml_backend_blas_mul_mat(ggml_backend_blas_context * ctx, struct gg openblas_set_num_threads(ctx->n_threads); #endif -#if defined(BLIS_ENABLE_CBLAS) +#if defined(GGML_BLAS_USE_BLIS) bli_thread_set_num_threads(ctx->n_threads); #endif +#if defined(GGML_BLAS_USE_NVPL) + nvpl_blas_set_num_threads(ctx->n_threads); +#endif + for (int64_t i13 = 0; i13 < ne13; i13++) { for (int64_t i12 = 0; i12 < ne12; i12++) { const int64_t i03 = i13/r3;