From 84c728013c069920e4c4afaae96c3f8bc898d075 Mon Sep 17 00:00:00 2001 From: zhouwei25 <52485244+zhouwei25@users.noreply.github.com> Date: Mon, 2 Sep 2019 11:15:45 +0800 Subject: [PATCH] fix the compilation issue on windows caused by mkl_CSRMM (#19533) --- paddle/fluid/operators/math/blas_impl.h | 6 ++++-- paddle/fluid/platform/dynload/mklml.h | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/math/blas_impl.h b/paddle/fluid/operators/math/blas_impl.h index 1a45752e11c..2f7aeb70585 100644 --- a/paddle/fluid/operators/math/blas_impl.h +++ b/paddle/fluid/operators/math/blas_impl.h @@ -128,11 +128,12 @@ struct CBlas { static void VMERF(ARGS... args) { platform::dynload::vmsErf(args...); } - +#if !defined(_WIN32) template static void CSRMM(ARGS... args) { platform::dynload::mkl_scsrmm(args...); } +#endif }; template <> @@ -238,11 +239,12 @@ struct CBlas { static void VMERF(ARGS... args) { platform::dynload::vmdErf(args...); } - +#if !defined(_WIN32) template static void CSRMM(ARGS... args) { platform::dynload::mkl_dcsrmm(args...); } +#endif }; #else diff --git a/paddle/fluid/platform/dynload/mklml.h b/paddle/fluid/platform/dynload/mklml.h index 200746ab9f7..5070be43756 100644 --- a/paddle/fluid/platform/dynload/mklml.h +++ b/paddle/fluid/platform/dynload/mklml.h @@ -88,12 +88,15 @@ extern void* mklml_dso_handle; __macro(vdInv); \ __macro(vmsErf); \ __macro(vmdErf); \ - __macro(mkl_scsrmm); \ - __macro(mkl_dcsrmm); \ __macro(MKL_Set_Num_Threads) MKLML_ROUTINE_EACH(DECLARE_DYNAMIC_LOAD_MKLML_WRAP); +#if !defined(_WIN32) +DYNAMIC_LOAD_MKLML_WRAP(mkl_scsrmm); +DYNAMIC_LOAD_MKLML_WRAP(mkl_dcsrmm); +#endif + #undef DYNAMIC_LOAD_MKLML_WRAP } // namespace dynload -- GitLab