From 54564cfb0ca12f2ea1767d301eb711fde97c5fc7 Mon Sep 17 00:00:00 2001 From: Alexandr-Solovev Date: Mon, 23 Sep 2024 05:52:50 -0700 Subject: [PATCH] fixes for threading --- .../src/externals/core_threading_win_dll.cpp | 393 ------------------ dev/make/deps.mkl.mk | 4 +- makefile | 4 +- 3 files changed, 4 insertions(+), 397 deletions(-) diff --git a/cpp/daal/src/externals/core_threading_win_dll.cpp b/cpp/daal/src/externals/core_threading_win_dll.cpp index 7a25a0eddd1..f24689a341e 100644 --- a/cpp/daal/src/externals/core_threading_win_dll.cpp +++ b/cpp/daal/src/externals/core_threading_win_dll.cpp @@ -788,396 +788,3 @@ DAAL_EXPORT void * _getThreadPinner(bool create_pinner, void (*read_topo)(int &, return _getThreadPinner_ptr(create_pinner, read_topo, deleter); } #endif - -#define CALL_VOID_FUNC_FROM_DLL(fn_dpref, fn_name, argdecl, argcall) \ - typedef void(*fn_dpref##fn_name##_t) argdecl; \ - static fn_dpref##fn_name##_t fn_dpref##fn_name##_ptr = NULL; \ - CALL_VOID_FUNC_FROM_DLL_CPU(fn_dpref, avx512_, fn_name, argdecl, argcall) \ - CALL_VOID_FUNC_FROM_DLL_CPU(fn_dpref, avx2_, fn_name, argdecl, argcall) \ - CALL_VOID_FUNC_FROM_DLL_CPU(fn_dpref, sse42_, fn_name, argdecl, argcall) \ - CALL_VOID_FUNC_FROM_DLL_CPU(fn_dpref, sse2_, fn_name, argdecl, argcall) - -#define CALL_VOID_FUNC_FROM_DLL_CPU(fn_dpref, fn_cpu, fn_name, argdecl, argcall) \ - extern "C" DAAL_EXPORT void fn_dpref##fn_cpu##fn_name argdecl \ - { \ - load_daal_thr_dll(); \ - if (fn_dpref##fn_name##_ptr == NULL) \ - { \ - fn_dpref##fn_name##_ptr = (fn_dpref##fn_name##_t)load_daal_thr_func(#fn_dpref #fn_cpu #fn_name); \ - } \ - fn_dpref##fn_name##_ptr argcall; \ - } - -#if defined(_WIN64) - #define CALL_VOID_FUNC_FROM_DLL_CPU_MIC(fn_dpref, fn_cpu, fn_name, argdecl, argcall) \ - extern "C" DAAL_EXPORT void fn_dpref##fn_cpu##fn_name argdecl \ - { \ - load_daal_thr_dll(); \ - if (fn_dpref##fn_name##_ptr == NULL) \ - { \ - fn_dpref##fn_name##_ptr = (fn_dpref##fn_name##_t)load_daal_thr_func(#fn_dpref #fn_cpu #fn_name); \ - } \ - fn_dpref##fn_name##_ptr argcall; \ - } -#else - #define CALL_VOID_FUNC_FROM_DLL_CPU_MIC(fn_dpref, fn_cpu, fn_name, argdecl, argcall) -#endif - -#define CALL_RET_FUNC_FROM_DLL(ret_type, fn_dpref, fn_name, argdecl, argcall) \ - typedef ret_type(*fn_dpref##fn_name##_t) argdecl; \ - static fn_dpref##fn_name##_t fn_dpref##fn_name##_ptr = NULL; \ - CALL_RET_FUNC_FROM_DLL_CPU(ret_type, fn_dpref, avx512_, fn_name, argdecl, argcall) \ - CALL_RET_FUNC_FROM_DLL_CPU(ret_type, fn_dpref, avx2_, fn_name, argdecl, argcall) \ - CALL_RET_FUNC_FROM_DLL_CPU(ret_type, fn_dpref, sse42_, fn_name, argdecl, argcall) \ - CALL_RET_FUNC_FROM_DLL_CPU(ret_type, fn_dpref, sse2_, fn_name, argdecl, argcall) - -#define CALL_RET_FUNC_FROM_DLL_CPU(ret_type, fn_dpref, fn_cpu, fn_name, argdecl, argcall) \ - extern "C" DAAL_EXPORT ret_type fn_dpref##fn_cpu##fn_name argdecl \ - { \ - load_daal_thr_dll(); \ - if (fn_dpref##fn_name##_ptr == NULL) \ - { \ - fn_dpref##fn_name##_ptr = (fn_dpref##fn_name##_t)load_daal_thr_func(#fn_dpref #fn_cpu #fn_name); \ - } \ - return fn_dpref##fn_name##_ptr argcall; \ - } - -#if defined(_WIN64) - #define CALL_RET_FUNC_FROM_DLL_CPU_MIC(ret_type, fn_dpref, fn_cpu, fn_name, argdecl, argcall) \ - extern "C" DAAL_EXPORT ret_type fn_dpref##fn_cpu##fn_name argdecl \ - { \ - load_daal_thr_dll(); \ - if (fn_dpref##fn_name##_ptr == NULL) \ - { \ - fn_dpref##fn_name##_ptr = (fn_dpref##fn_name##_t)load_daal_thr_func(#fn_dpref #fn_cpu #fn_name); \ - } \ - return fn_dpref##fn_name##_ptr argcall; \ - } -#else - #define CALL_RET_FUNC_FROM_DLL_CPU_MIC(ret_type, fn_dpref, fn_cpu, fn_name, argdecl, argcall) -#endif - -/* Used directly in Intel(R) oneAPI Data Analytics Library (oneDAL) */ -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, dsyrk, - (const char * uplo, const char * trans, const DAAL_INT * n, const DAAL_INT * k, const double * alpha, const double * a, - const DAAL_INT * lda, const double * beta, double * c, const DAAL_INT * ldc), - (uplo, trans, n, k, alpha, a, lda, beta, c, ldc)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, ssyrk, - (const char * uplo, const char * trans, const DAAL_INT * n, const DAAL_INT * k, const float * alpha, const float * a, - const DAAL_INT * lda, const float * beta, float * c, const DAAL_INT * ldc), - (uplo, trans, n, k, alpha, a, lda, beta, c, ldc)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, dsyr, - (const char * uplo, const DAAL_INT * n, const double * alpha, const double * x, const DAAL_INT * incx, double * a, - const DAAL_INT * lda), - (uplo, n, alpha, x, incx, a, lda)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, ssyr, - (const char * uplo, const DAAL_INT * n, const float * alpha, const float * x, const DAAL_INT * incx, float * a, - const DAAL_INT * lda), - (uplo, n, alpha, x, incx, a, lda)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, dgemm, - (const char * transa, const char * transb, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, const double * alpha, - const double * a, const DAAL_INT * lda, const double * b, const DAAL_INT * ldb, const double * beta, double * c, - const DAAL_INT * ldc), - (transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, sgemm, - (const char * transa, const char * transb, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, const float * alpha, - const float * a, const DAAL_INT * lda, const float * b, const DAAL_INT * ldb, const float * beta, float * c, - const DAAL_INT * ldc), - (transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, xdgemm, - (const char * transa, const char * transb, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, const double * alpha, - const double * a, const DAAL_INT * lda, const double * b, const DAAL_INT * ldb, const double * beta, double * c, - const DAAL_INT * ldc), - (transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, xsgemm, - (const char * transa, const char * transb, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, const float * alpha, - const float * a, const DAAL_INT * lda, const float * b, const DAAL_INT * ldb, const float * beta, float * c, - const DAAL_INT * ldc), - (transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, dsymm, - (const char * side, const char * uplo, const DAAL_INT * m, const DAAL_INT * n, const double * alpha, const double * a, - const DAAL_INT * lda, const double * b, const DAAL_INT * ldb, const double * beta, double * c, const DAAL_INT * ldc), - (side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, ssymm, - (const char * side, const char * uplo, const DAAL_INT * m, const DAAL_INT * n, const float * alpha, const float * a, - const DAAL_INT * lda, const float * b, const DAAL_INT * ldb, const float * beta, float * c, const DAAL_INT * ldc), - (side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, dgemv, - (const char * trans, const DAAL_INT * m, const DAAL_INT * n, const double * alpha, const double * a, const DAAL_INT * lda, - const double * x, const DAAL_INT * incx, const double * beta, double * y, const DAAL_INT * incy), - (trans, m, n, alpha, a, lda, x, incx, beta, y, incy)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, sgemv, - (const char * trans, const DAAL_INT * m, const DAAL_INT * n, const float * alpha, const float * a, const DAAL_INT * lda, - const float * x, const DAAL_INT * incx, const float * beta, float * y, const DAAL_INT * incy), - (trans, m, n, alpha, a, lda, x, incx, beta, y, incy)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, daxpy, - (const DAAL_INT * n, const double * alpha, const double * x, const DAAL_INT * incx, double * y, const DAAL_INT * incy), - (n, alpha, x, incx, y, incy)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, saxpy, - (const DAAL_INT * n, const float * alpha, const float * x, const DAAL_INT * incx, float * y, const DAAL_INT * incy), - (n, alpha, x, incx, y, incy)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, xdsyr, - (const char * uplo, const DAAL_INT * n, const double * alpha, const double * x, const DAAL_INT * incx, double * a, - const DAAL_INT * lda), - (uplo, n, alpha, x, incx, a, lda)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, xssyr, - (const char * uplo, const DAAL_INT * n, const float * alpha, const float * x, const DAAL_INT * incx, float * a, - const DAAL_INT * lda), - (uplo, n, alpha, x, incx, a, lda)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, xdsyrk, - (const char * uplo, const char * trans, const DAAL_INT * n, const DAAL_INT * k, const double * alpha, const double * a, - const DAAL_INT * lda, const double * beta, double * c, const DAAL_INT * ldc), - (uplo, trans, n, k, alpha, a, lda, beta, c, ldc)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, xssyrk, - (const char * uplo, const char * trans, const DAAL_INT * n, const DAAL_INT * k, const float * alpha, const float * a, - const DAAL_INT * lda, const float * beta, float * c, const DAAL_INT * ldc), - (uplo, trans, n, k, alpha, a, lda, beta, c, ldc)); - -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, xdsymm, - (const char * side, const char * uplo, const DAAL_INT * m, const DAAL_INT * n, const double * alpha, const double * a, - const DAAL_INT * lda, const double * b, const DAAL_INT * ldb, const double * beta, double * c, const DAAL_INT * ldc), - (side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)); -CALL_VOID_FUNC_FROM_DLL(fpk_blas_, xssymm, - (const char * side, const char * uplo, const DAAL_INT * m, const DAAL_INT * n, const float * alpha, const float * a, - const DAAL_INT * lda, const float * b, const DAAL_INT * ldb, const float * beta, float * c, const DAAL_INT * ldc), - (side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)); - -CALL_VOID_FUNC_FROM_DLL(fpk_spblas_, mkl_dcsrmultd, - (const char * transa, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, double * a, DAAL_INT * ja, DAAL_INT * ia, - double * b, DAAL_INT * jb, DAAL_INT * ib, double * c, DAAL_INT * ldc), - (transa, m, n, k, a, ja, ia, b, jb, ib, c, ldc)); -CALL_VOID_FUNC_FROM_DLL(fpk_spblas_, mkl_scsrmultd, - (const char * transa, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, float * a, DAAL_INT * ja, DAAL_INT * ia, - float * b, DAAL_INT * jb, DAAL_INT * ib, float * c, DAAL_INT * ldc), - (transa, m, n, k, a, ja, ia, b, jb, ib, c, ldc)); - -CALL_VOID_FUNC_FROM_DLL(fpk_spblas_, mkl_dcsrmv, - (const char * transa, const DAAL_INT * m, const DAAL_INT * k, const double * alpha, const char * matdescra, - const double * val, const DAAL_INT * indx, const DAAL_INT * pntrb, const DAAL_INT * pntre, const double * x, - const double * beta, double * y), - (transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)); -CALL_VOID_FUNC_FROM_DLL(fpk_spblas_, mkl_scsrmv, - (const char * transa, const DAAL_INT * m, const DAAL_INT * k, const float * alpha, const char * matdescra, const float * val, - const DAAL_INT * indx, const DAAL_INT * pntrb, const DAAL_INT * pntre, const float * x, const float * beta, float * y), - (transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dpotrf, (const char * uplo, const DAAL_INT * n, double * a, const DAAL_INT * lda, DAAL_INT * info, int iuplo), - (uplo, n, a, lda, info, iuplo)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, spotrf, (const char * uplo, const DAAL_INT * n, float * a, const DAAL_INT * lda, DAAL_INT * info, int iuplo), - (uplo, n, a, lda, info, iuplo)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dpotrs, - (const char * uplo, const DAAL_INT * n, const DAAL_INT * nrhs, const double * a, const DAAL_INT * lda, double * b, - const DAAL_INT * ldb, DAAL_INT * info, int iuplo), - (uplo, n, nrhs, a, lda, b, ldb, info, iuplo)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, spotrs, - (const char * uplo, const DAAL_INT * n, const DAAL_INT * nrhs, const float * a, const DAAL_INT * lda, float * b, - const DAAL_INT * ldb, DAAL_INT * info, int iuplo), - (uplo, n, nrhs, a, lda, b, ldb, info, iuplo)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dgetrf, - (const DAAL_INT * m, const DAAL_INT * n, const double * a, const DAAL_INT * lda, const DAAL_INT * ipiv, DAAL_INT * info), - (m, n, a, lda, ipiv, info)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sgetrf, - (const DAAL_INT * m, const DAAL_INT * n, const float * a, const DAAL_INT * lda, const DAAL_INT * ipiv, DAAL_INT * info), - (m, n, a, lda, ipiv, info)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dgetrs, - (const char * trans, const DAAL_INT * n, const DAAL_INT * nrhs, const double * a, const DAAL_INT * lda, const DAAL_INT * ipiv, - double * b, const DAAL_INT * ldb, DAAL_INT * info, int iuplo), - (trans, n, nrhs, a, lda, ipiv, b, ldb, info, iuplo)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sgetrs, - (const char * trans, const DAAL_INT * n, const DAAL_INT * nrhs, const float * a, const DAAL_INT * lda, const DAAL_INT * ipiv, - float * b, const DAAL_INT * ldb, DAAL_INT * info, int iuplo), - (trans, n, nrhs, a, lda, ipiv, b, ldb, info, iuplo)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dpotri, (const char * uplo, const DAAL_INT * n, double * a, const DAAL_INT * lda, DAAL_INT * info, int iuplo), - (uplo, n, a, lda, info, iuplo)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, spotri, (const char * uplo, const DAAL_INT * n, float * a, const DAAL_INT * lda, DAAL_INT * info, int iuplo), - (uplo, n, a, lda, info, iuplo)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dgerqf, - (const DAAL_INT * m, const DAAL_INT * n, double * a, const DAAL_INT * lda, double * tau, double * work, - const DAAL_INT * lwork, DAAL_INT * info), - (m, n, a, lda, tau, work, lwork, info)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sgerqf, - (const DAAL_INT * m, const DAAL_INT * n, float * a, const DAAL_INT * lda, float * tau, float * work, const DAAL_INT * lwork, - DAAL_INT * info), - (m, n, a, lda, tau, work, lwork, info)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dormrq, - (const char * side, const char * trans, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, const double * a, - const DAAL_INT * lda, const double * tau, double * c, const DAAL_INT * ldc, double * work, const DAAL_INT * lwork, - DAAL_INT * info, int iside, int itrans), - (side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info, iside, itrans)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sormrq, - (const char * side, const char * trans, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, const float * a, - const DAAL_INT * lda, const float * tau, float * c, const DAAL_INT * ldc, float * work, const DAAL_INT * lwork, - DAAL_INT * info, int iside, int itrans), - (side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info, iside, itrans)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dormqr, - (const char * side, const char * trans, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, const double * a, - const DAAL_INT * lda, const double * tau, double * c, const DAAL_INT * ldc, double * work, const DAAL_INT * lwork, - DAAL_INT * info, int iside, int itrans), - (side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info, iside, itrans)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sormqr, - (const char * side, const char * trans, const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, const float * a, - const DAAL_INT * lda, const float * tau, float * c, const DAAL_INT * ldc, float * work, const DAAL_INT * lwork, - DAAL_INT * info, int iside, int itrans), - (side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info, iside, itrans)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dtrtrs, - (const char * uplo, const char * trans, const char * diag, const DAAL_INT * n, const DAAL_INT * nrhs, const double * a, - const DAAL_INT * lda, double * b, const DAAL_INT * ldb, DAAL_INT * info, int iuplo, int itrans, int idiag), - (uplo, trans, diag, n, nrhs, a, lda, b, ldb, info, iuplo, itrans, idiag)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, strtrs, - (const char * uplo, const char * trans, const char * diag, const DAAL_INT * n, const DAAL_INT * nrhs, const float * a, - const DAAL_INT * lda, float * b, const DAAL_INT * ldb, DAAL_INT * info, int iuplo, int itrans, int idiag), - (uplo, trans, diag, n, nrhs, a, lda, b, ldb, info, iuplo, itrans, idiag)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dpptrf, (const char * uplo, const DAAL_INT * n, double * ap, DAAL_INT * info, int iuplo), - (uplo, n, ap, info, iuplo)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, spptrf, (const char * uplo, const DAAL_INT * n, float * ap, DAAL_INT * info, int iuplo), - (uplo, n, ap, info, iuplo)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dgeqrf, - (const DAAL_INT * m, const DAAL_INT * n, double * a, const DAAL_INT * lda, double * tau, double * work, - const DAAL_INT * lwork, DAAL_INT * info), - (m, n, a, lda, tau, work, lwork, info)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sgeqrf, - (const DAAL_INT * m, const DAAL_INT * n, float * a, const DAAL_INT * lda, float * tau, float * work, const DAAL_INT * lwork, - DAAL_INT * info), - (m, n, a, lda, tau, work, lwork, info)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dgeqp3, - (const DAAL_INT * m, const DAAL_INT * n, double * a, const DAAL_INT * lda, DAAL_INT * jpvt, double * tau, double * work, - const DAAL_INT * lwork, DAAL_INT * info), - (m, n, a, lda, jpvt, tau, work, lwork, info)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sgeqp3, - (const DAAL_INT * m, const DAAL_INT * n, float * a, const DAAL_INT * lda, DAAL_INT * jpvt, float * tau, float * work, - const DAAL_INT * lwork, DAAL_INT * info), - (m, n, a, lda, jpvt, tau, work, lwork, info)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dorgqr, - (const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, double * a, const DAAL_INT * lda, const double * tau, - double * work, const DAAL_INT * lwork, DAAL_INT * info), - (m, n, k, a, lda, tau, work, lwork, info)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sorgqr, - (const DAAL_INT * m, const DAAL_INT * n, const DAAL_INT * k, float * a, const DAAL_INT * lda, const float * tau, float * work, - const DAAL_INT * lwork, DAAL_INT * info), - (m, n, k, a, lda, tau, work, lwork, info)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dgesvd, - (const char * jobu, const char * jobvt, const DAAL_INT * m, const DAAL_INT * n, double * a, const DAAL_INT * lda, double * s, - double * u, const DAAL_INT * ldu, double * vt, const DAAL_INT * ldvt, double * work, const DAAL_INT * lwork, DAAL_INT * info, - int ijobu, int ijobvt), - (jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info, ijobu, ijobvt)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, sgesvd, - (const char * jobu, const char * jobvt, const DAAL_INT * m, const DAAL_INT * n, float * a, const DAAL_INT * lda, float * s, - float * u, const DAAL_INT * ldu, float * vt, const DAAL_INT * ldvt, float * work, const DAAL_INT * lwork, DAAL_INT * info, - int ijobu, int ijobvt), - (jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt, work, lwork, info, ijobu, ijobvt)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dsyevd, - (const char * jobz, const char * uplo, const DAAL_INT * n, double * a, const DAAL_INT * lda, double * w, double * work, - const DAAL_INT * lwork, DAAL_INT * iwork, const DAAL_INT * liwork, DAAL_INT * info, int ijobz, int iuplo), - (jobz, uplo, n, a, lda, w, work, lwork, iwork, liwork, info, ijobz, iuplo)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, ssyevd, - (const char * jobz, const char * uplo, const DAAL_INT * n, float * a, const DAAL_INT * lda, float * w, float * work, - const DAAL_INT * lwork, DAAL_INT * iwork, const DAAL_INT * liwork, DAAL_INT * info, int ijobz, int iuplo), - (jobz, uplo, n, a, lda, w, work, lwork, iwork, liwork, info, ijobz, iuplo)); - -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, dsyev, - (const char * jobz, const char * uplo, const DAAL_INT * n, double * a, const DAAL_INT * lda, double * w, double * work, - const DAAL_INT * lwork, DAAL_INT * info, int ijobz, int iuplo), - (jobz, uplo, n, a, lda, w, work, lwork, info, ijobz, iuplo)); -CALL_VOID_FUNC_FROM_DLL(fpk_lapack_, ssyev, - (const char * jobz, const char * uplo, const DAAL_INT * n, float * a, const DAAL_INT * lda, float * w, float * work, - const DAAL_INT * lwork, DAAL_INT * info, int ijobz, int iuplo), - (jobz, uplo, n, a, lda, w, work, lwork, info, ijobz, iuplo)); - -CALL_RET_FUNC_FROM_DLL(double, fpk_blas_, xddot, - (const DAAL_INT * n, const double * x, const DAAL_INT * incx, const double * y, const DAAL_INT * incy), (n, x, incx, y, incy)); -CALL_RET_FUNC_FROM_DLL(float, fpk_blas_, xsdot, (const DAAL_INT * n, const float * x, const DAAL_INT * incx, const float * y, const DAAL_INT * incy), - (n, x, incx, y, incy)); - -#define CSRMM_ARGS(FPTYPE) \ - const char *transa, const DAAL_INT *m, const DAAL_INT *n, const DAAL_INT *k, const FPTYPE *alpha, const char *matdescra, const FPTYPE *val, \ - const DAAL_INT *indx, const DAAL_INT *pntrb, const DAAL_INT *pntre, const FPTYPE *b, const DAAL_INT *ldb, const FPTYPE *beta, FPTYPE *c, \ - const DAAL_INT *ldc - -CALL_VOID_FUNC_FROM_DLL(fpk_spblas_, mkl_scsrmm, (CSRMM_ARGS(float)), - (transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, beta, c, ldc)); -CALL_VOID_FUNC_FROM_DLL(fpk_spblas_, mkl_dcsrmm, (CSRMM_ARGS(double)), - (transa, m, n, k, alpha, matdescra, val, indx, pntrb, pntre, b, ldb, beta, c, ldc)); - -typedef int IppStatus; -typedef unsigned char Ipp8u; -typedef unsigned short Ipp16u; -typedef unsigned int Ipp32u; -typedef signed short Ipp16s; -typedef signed int Ipp32s; -typedef float Ipp32f; -typedef double Ipp64f; - -/* Used in Intel(R) oneAPI Data Analytics Library (oneDAL) via SS */ -CALL_RET_FUNC_FROM_DLL(IppStatus, fpk_dft_, ippsSortRadixAscend_64f_I, (Ipp64f * pSrcDst, Ipp64f * pTmp, Ipp32s len), (pSrcDst, pTmp, len)); -CALL_RET_FUNC_FROM_DLL(IppStatus, fpk_dft_, ippsSortRadixAscend_32f_I, (Ipp32f * pSrcDst, Ipp32f * pTmp, Ipp32s len), (pSrcDst, pTmp, len)); - -#define CALL_VOID_FUNC_FROM_DLL_ALONE(fn_dpref, fn_name, argdecl, argcall) \ - typedef void(*fn_dpref##fn_name##_t) argdecl; \ - static fn_dpref##fn_name##_t fn_dpref##fn_name##_ptr = NULL; \ - extern "C" DAAL_EXPORT void fn_dpref##fn_name argdecl \ - { \ - load_daal_thr_dll(); \ - if (fn_dpref##fn_name##_ptr == NULL) \ - { \ - fn_dpref##fn_name##_ptr = (fn_dpref##fn_name##_t)load_daal_thr_func(#fn_dpref #fn_name); \ - } \ - fn_dpref##fn_name##_ptr argcall; \ - } - -#define CALL_RET_FUNC_FROM_DLL_ALONE(ret_type, fn_dpref, fn_name, argdecl, argcall) \ - typedef ret_type(*fn_dpref##fn_name##_t) argdecl; \ - static fn_dpref##fn_name##_t fn_dpref##fn_name##_ptr = NULL; \ - extern "C" DAAL_EXPORT ret_type fn_dpref##fn_name argdecl \ - { \ - load_daal_thr_dll(); \ - if (fn_dpref##fn_name##_ptr == NULL) \ - { \ - fn_dpref##fn_name##_ptr = (fn_dpref##fn_name##_t)load_daal_thr_func(#fn_dpref #fn_name); \ - } \ - return fn_dpref##fn_name##_ptr argcall; \ - } - -CALL_VOID_FUNC_FROM_DLL_ALONE(fpk_serv_, set_num_threads, (int nth), (nth)); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, get_max_threads, (void), ()); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, set_num_threads_local, (int nth), (nth)); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, get_ncpus, (void), ()); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, get_ncorespercpu, (void), ()); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, get_ht, (void), ()); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, get_nlogicalcores, (void), ()); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, cpuisknm, (void), ()); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, enable_instructions, (int nth), (nth)); -CALL_RET_FUNC_FROM_DLL_ALONE(int, fpk_serv_, memmove_s, (void * dest, size_t dmax, const void * src, size_t smax), (dest, dmax, src, smax)); - -typedef void (*func_type)(DAAL_INT, DAAL_INT, DAAL_INT, void *); - -CALL_VOID_FUNC_FROM_DLL_ALONE(fpk_vsl_serv_, threader_for, (DAAL_INT n, DAAL_INT threads_request, void * a, func_type func), - (n, threads_request, a, func)); -CALL_VOID_FUNC_FROM_DLL_ALONE(fpk_vsl_serv_, threader_for_ordered, (DAAL_INT n, DAAL_INT threads_request, void * a, func_type func), - (n, threads_request, a, func)); -CALL_VOID_FUNC_FROM_DLL_ALONE(fpk_vsl_serv_, threader_sections, (DAAL_INT threads_request, void * a, func_type func), (threads_request, a, func)); -CALL_VOID_FUNC_FROM_DLL_ALONE(fpk_vsl_serv_, threader_ordered, (DAAL_INT i, DAAL_INT th_idx, DAAL_INT th_num, void * a, func_type func), - (i, th_idx, th_num, a, func)); -CALL_RET_FUNC_FROM_DLL_ALONE(DAAL_INT, fpk_vsl_serv_, threader_get_num_threads_limit, (void), ()); diff --git a/dev/make/deps.mkl.mk b/dev/make/deps.mkl.mk index 42a666fd4fd..a253f837873 100644 --- a/dev/make/deps.mkl.mk +++ b/dev/make/deps.mkl.mk @@ -52,7 +52,7 @@ daaldep.fbsd32e.mkl.sycl := $(MKLGPUDIR.lib)/$(plib)mkl_sycl.$a daaldep.math_backend.core := $(daaldep.$(PLAT).mkl.core) daaldep.math_backend.interfaces := $(daaldep.$(PLAT).mkl.interfaces) -daaldep.math_backend.thr := $(daaldep.$(PLAT).mkl.thr) $(daaldep.$(PLAT).mkl.interfaces) $(daaldep.$(PLAT).mkl.core) +daaldep.math_backend.thr := $(daaldep.$(PLAT).mkl.thr) daaldep.math_backend.seq := $(daaldep.$(PLAT).mkl.seq) daaldep.math_backend.sycl := $(daaldep.$(PLAT).mkl.sycl) @@ -71,5 +71,5 @@ daaldep.fbsd32e.ipp := $(if $(COV.libia),$(COV.libia)/libcov.a) daaldep.vml := $(daaldep.$(PLAT).vml) daaldep.ipp := $(daaldep.$(PLAT).ipp) -daaldep.math_backend.ext := $(daaldep.ipp) $(daaldep.vml) $(daaldep.math_backend.interfaces) $(daaldep.math_backend.seq) $(daaldep.math_backend.core) +daaldep.math_backend.ext := $(daaldep.ipp) $(daaldep.vml) $(daaldep.math_backend.interfaces) $(daaldep.math_backend.thr) $(daaldep.math_backend.core) daaldep.math_backend.sycl := $(daaldep.math_backend.sycl) diff --git a/makefile b/makefile index 0daec72a87d..6a25185f316 100644 --- a/makefile +++ b/makefile @@ -808,14 +808,14 @@ THR_TBB.objs_y := $(addprefix $(THR.tmpdir_y)/,$(THR.srcs:%.cpp=%_tbb.$o)) -include $(THR.tmpdir_y)/*.d $(WORKDIR.lib)/$(thr_tbb_a): LOPT:= -$(WORKDIR.lib)/$(thr_tbb_a): $(THR_TBB.objs_a) $(daaldep.math_backend.thr) ; $(LINK.STATIC) +$(WORKDIR.lib)/$(thr_tbb_a): $(THR_TBB.objs_a) ; $(LINK.STATIC) $(THR.tmpdir_y)/%_link.def: $(THR.srcdir)/$(daaldep.$(PLAT).threxport) | $(THR.tmpdir_y)/. $(daaldep.$(_OS).threxport.create) > $@ $(WORKDIR.lib)/$(thr_tbb_y): LOPT += $(-fPIC) $(daaldep.rt.thr) $(WORKDIR.lib)/$(thr_tbb_y): LOPT += $(if $(OS_is_win),-IMPLIB:$(@:%.dll=%_dll.lib),) -$(WORKDIR.lib)/$(thr_tbb_y): $(THR_TBB.objs_y) $(daaldep.math_backend.thr) $(if $(OS_is_win),$(THR.tmpdir_y)/dll_tbb.res,) $(THR.tmpdir_y)/$(thr_tbb_y:%.$y=%_link.def) ; $(LINK.DYNAMIC) ; $(LINK.DYNAMIC.POST) +$(WORKDIR.lib)/$(thr_tbb_y): $(THR_TBB.objs_y) $(if $(OS_is_win),$(THR.tmpdir_y)/dll_tbb.res,) $(THR.tmpdir_y)/$(thr_tbb_y:%.$y=%_link.def) ; $(LINK.DYNAMIC) ; $(LINK.DYNAMIC.POST) THR.objs_a := $(THR_TBB.objs_a) THR.objs_y := $(THR_TBB.objs_y)