From 1cc9d59838a560ce24cfd8d4f517427316b482c2 Mon Sep 17 00:00:00 2001 From: peizhilin Date: Wed, 19 Dec 2018 16:48:48 +0800 Subject: [PATCH] disable xbyak on windows test=develop --- cmake/external/mklml.cmake | 4 +--- cmake/external/xbyak.cmake | 4 ++-- .../operators/elementwise/elementwise_mul_mkldnn_op.cc | 3 --- paddle/fluid/operators/math/detail/lstm_cpu_kernel.h | 6 ------ paddle/fluid/operators/math/jit_gen.h | 3 --- 5 files changed, 3 insertions(+), 17 deletions(-) diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index 96676f0be..1a766f3c3 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -79,9 +79,7 @@ INCLUDE_DIRECTORIES(${MKLML_INC_DIR}) ADD_LIBRARY(mklml SHARED IMPORTED GLOBAL) SET_PROPERTY(TARGET mklml PROPERTY IMPORTED_LOCATION ${MKLML_LIB}) -if(NOT WIN32) - ADD_DEPENDENCIES(mklml ${MKLML_PROJECT}) -endif() +ADD_DEPENDENCIES(mklml ${MKLML_PROJECT}) LIST(APPEND external_project_dependencies mklml) IF(WITH_C_API) diff --git a/cmake/external/xbyak.cmake b/cmake/external/xbyak.cmake index 42e39fb81..384c2f932 100644 --- a/cmake/external/xbyak.cmake +++ b/cmake/external/xbyak.cmake @@ -13,8 +13,8 @@ # limitations under the License. set(WITH_XBYAK ON) -if(APPLE) - SET(WITH_XBYAK OFF CACHE STRING "Disable XBYAK in MacOS" FORCE) +if(WIN32 OR APPLE) + SET(WITH_XBYAK OFF CACHE STRING "Disable XBYAK in Windows and MacOS" FORCE) return() endif() diff --git a/paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc b/paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc index bf9aef913..c600d1e3d 100644 --- a/paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc +++ b/paddle/fluid/operators/elementwise/elementwise_mul_mkldnn_op.cc @@ -19,9 +19,6 @@ limitations under the License. */ #include "paddle/fluid/platform/mkldnn_helper.h" #include "paddle/fluid/operators/math/jit_kernel.h" -#if defined(_WIN32) && defined(_WINSOCKAPI_) -#define _WINSOCK2API_ /* Prevent inclusion of winsock2.h */ -#endif #include "xbyak/xbyak.h" #include "xbyak/xbyak_util.h" diff --git a/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h b/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h index 2e3779ff0..ccbd05c82 100644 --- a/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h +++ b/paddle/fluid/operators/math/detail/lstm_cpu_kernel.h @@ -17,12 +17,6 @@ limitations under the License. */ #include "paddle/fluid/operators/math/detail/activation_functions.h" #include "paddle/fluid/operators/math/lstm_compute.h" -#if defined(_WIN32) -#if defined(__AVX2__) || defined(__AVX__) -inline __m256 operator+=(__m256 a, __m256 b) { return _mm256_add_ps(a, b); } -#endif -#endif - namespace paddle { namespace operators { namespace math { diff --git a/paddle/fluid/operators/math/jit_gen.h b/paddle/fluid/operators/math/jit_gen.h index 2bc740e59..6abf3434c 100644 --- a/paddle/fluid/operators/math/jit_gen.h +++ b/paddle/fluid/operators/math/jit_gen.h @@ -18,9 +18,6 @@ limitations under the License. */ #include #include "paddle/fluid/platform/macros.h" -#if defined(_WIN32) && defined(_WINSOCKAPI_) -#define _WINSOCK2API_ /* Prevent inclusion of winsock2.h */ -#endif #define XBYAK_USE_MMAP_ALLOCATOR #include "xbyak/xbyak.h" #include "xbyak/xbyak_util.h" -- GitLab