diff --git a/paddle/fluid/operators/math/detail/activation_functions.h b/paddle/fluid/operators/math/detail/activation_functions.h index 42fb45a8a5ea9d83b9d98001d234cc4d228b1e2e..2b3d38d95a18fad9b76e616cdf2cb6c3eb07da3a 100644 --- a/paddle/fluid/operators/math/detail/activation_functions.h +++ b/paddle/fluid/operators/math/detail/activation_functions.h @@ -16,12 +16,6 @@ limitations under the License. */ #include #include -#ifdef _WIN32 -#undef __AVX__ -#undef __AVX__2 -#endif - - #include "paddle/fluid/platform/enforce.h" #include "paddle/fluid/platform/hostdevice.h" diff --git a/paddle/fluid/platform/cpu_info.h b/paddle/fluid/platform/cpu_info.h index 6810a1651a14cdb2080af846b21cad242b70bf35..1b4840d9a117b3aa3cf3c056cd841503ad8a78b3 100644 --- a/paddle/fluid/platform/cpu_info.h +++ b/paddle/fluid/platform/cpu_info.h @@ -14,6 +14,11 @@ limitations under the License. */ #pragma once +#ifdef _WIN32 +#undef __AVX__ +#undef __AVX2__ +#endif + #include namespace paddle { diff --git a/paddle/fluid/platform/enforce.h b/paddle/fluid/platform/enforce.h index a251bfcd9914422cb6300adbbcdef3dfa79f441c..c03bbd59ac922faf9264f0211bf4a358d75c29ad 100644 --- a/paddle/fluid/platform/enforce.h +++ b/paddle/fluid/platform/enforce.h @@ -14,6 +14,11 @@ limitations under the License. */ #pragma once +#ifdef _WIN32 +#undef __AVX__ +#undef __AVX2__ +#endif + #ifdef __GNUC__ #include // for __cxa_demangle #endif // __GNUC__