diff --git a/.ci/env/apt.sh b/.ci/env/apt.sh index 955cf2bccbf..2034d3d1cf5 100755 --- a/.ci/env/apt.sh +++ b/.ci/env/apt.sh @@ -37,7 +37,7 @@ function install_dpcpp { } function install_mkl { - sudo apt-get install -y intel-oneapi-mkl-devel + sudo apt-get install -y intel-oneapi-mkl-devel=2024.2.1-103 } function install_clang-format { diff --git a/.ci/pipeline/ci.yml b/.ci/pipeline/ci.yml index af05468e7f0..c19a367a1b6 100755 --- a/.ci/pipeline/ci.yml +++ b/.ci/pipeline/ci.yml @@ -28,7 +28,8 @@ variables: TBB_VERSION : 'v2021.10.0' VM_IMAGE : 'ubuntu-22.04' SYSROOT_OS: 'jammy' - WINDOWS_BASEKIT_URL: 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d91caaa0-7306-46ea-a519-79a0423e1903/w_BaseKit_p_2024.2.1.101_offline.exe' + WIN_BASEKIT_VERSION: '2024.2.1.101' + WINDOWS_BASEKIT_URL: 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d91caaa0-7306-46ea-a519-79a0423e1903/w_BaseKit_p_$(WIN_BASEKIT_VERSION)_offline.exe' WINDOWS_DPCPP_COMPONENTS: 'intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.tbb.devel' jobs: diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 17e6dcdfe0b..c63762ef76d 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -25,7 +25,8 @@ permissions: contents: read variables: - WINDOWS_BASEKIT_URL: 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d91caaa0-7306-46ea-a519-79a0423e1903/w_BaseKit_p_2024.2.1.101_offline.exe' + WIN_BASEKIT_VERSION: '2024.2.1.101' + WINDOWS_BASEKIT_URL: 'https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d91caaa0-7306-46ea-a519-79a0423e1903/w_BaseKit_p_$(WIN_BASEKIT_VERSION)_offline.exe' WINDOWS_ALL_COMPONENTS: 'intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel' jobs: diff --git a/cpp/daal/src/externals/service_math_mkl.h b/cpp/daal/src/externals/service_math_mkl.h index 8dcf83f6986..bb61cadf389 100644 --- a/cpp/daal/src/externals/service_math_mkl.h +++ b/cpp/daal/src/externals/service_math_mkl.h @@ -28,13 +28,8 @@ #include #include "src/services/service_defines.h" -#if !defined(__DAAL_CONCAT5) - #define __DAAL_CONCAT5(a, b, c, d, e) __DAAL_CONCAT51(a, b, c, d, e) - #define __DAAL_CONCAT51(a, b, c, d, e) a##b##c##d##e -#endif - -#define VMLFN_CALL(f_name, f_args) \ - v##f_name f_args; \ +#define __DAAL_MKLFN_CALL_MATH(f_name, f_args) \ + f_name f_args; \ return; namespace daal @@ -106,27 +101,57 @@ struct MklMath return r; } - static void vPowx(SizeType n, const double * in, double in1, double * out) { VMLFN_CALL(dPowx, ((int)n, in, in1, out)); } + static void vPowx(SizeType n, const double * in, double in1, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdPowx, ((int)n, in, in1, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vCeil(SizeType n, const double * in, double * out) { VMLFN_CALL(dCeil, ((int)n, in, out)); } + static void vCeil(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdCeil, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vErfInv(SizeType n, const double * in, double * out) { VMLFN_CALL(dErfInv, ((int)n, in, out)); } + static void vErfInv(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdErfInv, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vErf(SizeType n, const double * in, double * out) { VMLFN_CALL(dErf, ((int)n, in, out)); } + static void vErf(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdErf, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vExp(SizeType n, const double * in, double * out) { VMLFN_CALL(dExp, ((int)n, in, out)); } + static void vExp(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdExp, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } static double vExpThreshold() { return -650.0; } - static void vTanh(SizeType n, const double * in, double * out) { VMLFN_CALL(dTanh, ((int)n, in, out)); } + static void vTanh(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdTanh, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vSqrt(SizeType n, const double * in, double * out) { VMLFN_CALL(dSqrt, ((int)n, in, out)); } + static void vSqrt(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdSqrt, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vLog(SizeType n, const double * in, double * out) { VMLFN_CALL(dLn, ((int)n, in, out)); } + static void vLog(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdLn, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vLog1p(SizeType n, const double * in, double * out) { VMLFN_CALL(dLog1p, ((int)n, in, out)); } + static void vLog1p(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdLog1p, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vCdfNormInv(SizeType n, const double * in, double * out) { VMLFN_CALL(dCdfNormInv, ((int)n, in, out)); } + static void vCdfNormInv(SizeType n, const double * in, double * out) + { + __DAAL_MKLFN_CALL_MATH(vmdCdfNormInv, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } }; /* @@ -188,27 +213,57 @@ struct MklMath return r; } - static void vPowx(SizeType n, const float * in, float in1, float * out) { VMLFN_CALL(sPowx, ((int)n, in, in1, out)); } + static void vPowx(SizeType n, const float * in, float in1, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsPowx, ((int)n, in, in1, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vCeil(SizeType n, const float * in, float * out) { VMLFN_CALL(sCeil, ((int)n, in, out)); } + static void vCeil(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsCeil, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vErfInv(SizeType n, const float * in, float * out) { VMLFN_CALL(sErfInv, ((int)n, in, out)); } + static void vErfInv(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsErfInv, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vErf(SizeType n, const float * in, float * out) { VMLFN_CALL(sErf, ((int)n, in, out)); } + static void vErf(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsErf, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vExp(SizeType n, const float * in, float * out) { VMLFN_CALL(sExp, ((int)n, in, out)); } + static void vExp(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsExp, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } static float vExpThreshold() { return -75.0f; } - static void vTanh(SizeType n, const float * in, float * out) { VMLFN_CALL(sTanh, ((int)n, in, out)); } + static void vTanh(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsTanh, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vSqrt(SizeType n, const float * in, float * out) { VMLFN_CALL(sSqrt, ((int)n, in, out)); } + static void vSqrt(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsSqrt, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vLog(SizeType n, const float * in, float * out) { VMLFN_CALL(sLn, ((int)n, in, out)); } + static void vLog(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsLn, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vLog1p(SizeType n, const float * in, float * out) { VMLFN_CALL(sLog1p, ((int)n, in, out)); } + static void vLog1p(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsLog1p, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } - static void vCdfNormInv(SizeType n, const float * in, float * out) { VMLFN_CALL(sCdfNormInv, ((int)n, in, out)); } + static void vCdfNormInv(SizeType n, const float * in, float * out) + { + __DAAL_MKLFN_CALL_MATH(vmsCdfNormInv, ((int)n, in, out, (VML_LA | VML_FTZDAZ_ON | VML_ERRMODE_STDERR))); + } }; } // namespace mkl diff --git a/cpp/daal/src/externals/service_service_mkl.h b/cpp/daal/src/externals/service_service_mkl.h index 4873d163829..a78d4521c9c 100644 --- a/cpp/daal/src/externals/service_service_mkl.h +++ b/cpp/daal/src/externals/service_service_mkl.h @@ -25,6 +25,7 @@ #define __SERVICE_SERVICE_MKL_H__ #include "services/daal_defines.h" +#include "src/services/service_topo.h" #include #include #include @@ -61,22 +62,19 @@ struct MklService // return memmove_s(dest, destSize, src, smax); } - static int serv_get_ht() - { - // TODO: real detection of hypertheading - return 0; - } + static int serv_get_ht() { return (serv_get_ncorespercpu() > 1 ? 1 : 0); } static int serv_get_ncpus() { - // TODO: detection of npus - return 1; + unsigned int ncores = daal::services::internal::_internal_daal_GetSysProcessorCoreCount(); + return (ncores ? ncores : 1); } static int serv_get_ncorespercpu() { - // TODO: detection of ncores per cpu - return 1; + unsigned int nlogicalcpu = daal::services::internal::_internal_daal_GetSysLogicalProcessorCount(); + unsigned int ncpus = serv_get_ncpus(); + return (ncpus > 0 && nlogicalcpu > 0 && nlogicalcpu > ncpus ? nlogicalcpu / ncpus : 1); } // TODO: The real call should be delegated to a backend library if the option is supported diff --git a/cpp/daal/src/externals/service_stat_rng_mkl.h b/cpp/daal/src/externals/service_stat_rng_mkl.h index bc7db32f1f6..f3c8f05758b 100644 --- a/cpp/daal/src/externals/service_stat_rng_mkl.h +++ b/cpp/daal/src/externals/service_stat_rng_mkl.h @@ -24,11 +24,6 @@ #ifndef __SERVICE_STAT_RNG_MKL_H__ #define __SERVICE_STAT_RNG_MKL_H__ -#if !defined(__DAAL_CONCAT5) - #define __DAAL_CONCAT5(a, b, c, d, e) __DAAL_CONCAT51(a, b, c, d, e) - #define __DAAL_CONCAT51(a, b, c, d, e) a##b##c##d##e -#endif - #define __DAAL_VSLFN_CALL_NR(f_name, f_args, errcode) __DAAL_VSLFN_CALL_NO_V(f_name, f_args, errcode) #define __DAAL_VSLFN_CALL_NR_WHILE(f_name, f_args, errcode) \ { \ diff --git a/cpp/daal/src/externals/service_stat_rng_ref.h b/cpp/daal/src/externals/service_stat_rng_ref.h index 182d16ca8b1..eb5526242a7 100644 --- a/cpp/daal/src/externals/service_stat_rng_ref.h +++ b/cpp/daal/src/externals/service_stat_rng_ref.h @@ -27,11 +27,6 @@ #include "src/externals/service_stat_rng_ref.h" -#if !defined(__DAAL_CONCAT2) - #define __DAAL_CONCAT2(a, b) a##b -#endif - -#define __DAAL_VSLFN(f_pref, f_name) __DAAL_CONCAT2(f_pref, f_name) #define __DAAL_VSLFN_CALL_NR(f_pref, f_name, f_args, errcode) __DAAL_VSLFN_CALL(f_pref, f_name, f_args, errcode) #define __DAAL_VSLFN_CALL_NR_WHILE(f_pref, f_name, f_args, errcode) \ { \ diff --git a/cpp/daal/src/services/service_topo.h b/cpp/daal/src/services/service_topo.h index c2c0ad142d9..b53b61ffc29 100644 --- a/cpp/daal/src/services/service_topo.h +++ b/cpp/daal/src/services/service_topo.h @@ -352,7 +352,7 @@ static int __internal_daal_countBits(DWORD_PTR x); unsigned _internal_daal_GetMaxCPUSupportedByOS(); unsigned _internal_daal_GetOSLogicalProcessorCount(); unsigned _internal_daal_GetSysProcessorPackageCount(); -unsigned _internal_daal_GetProcessorCoreCount(); +unsigned _internal_daal_GetSysProcessorCoreCount(); unsigned _internal_daal_GetLogicalProcessorCount(); unsigned _internal_daal_GetCoresPerPackageProcessorCount(); unsigned _internal_daal_GetProcessorPackageCount();