diff --git a/paddle/utils/CpuId.cpp b/paddle/utils/CpuId.cpp index ab73be9e89b13d1aae5803c231d92b975cb6d084..909c347945beeef509532f024680904d1d0ff5b3 100644 --- a/paddle/utils/CpuId.cpp +++ b/paddle/utils/CpuId.cpp @@ -34,7 +34,7 @@ static InitFunction __init_simd_flags( SIMDFlags::SIMDFlags() { unsigned int cpuInfo[4]; - + // CPUID: https://en.wikipedia.org/wiki/CPUID CPUID(cpuInfo, 0x00000001); simd_flags_ |= cpuInfo[3] & (1 << 25) ? SIMD_SSE : SIMD_NONE; simd_flags_ |= cpuInfo[3] & (1 << 26) ? SIMD_SSE2 : SIMD_NONE; diff --git a/paddle/utils/CpuId.h b/paddle/utils/CpuId.h index bb77d37712bb4dc2113b5d4d9b07693b5dcb95b8..59a917c857828dccb76dac3ecacbaf163b6a16e7 100644 --- a/paddle/utils/CpuId.h +++ b/paddle/utils/CpuId.h @@ -61,7 +61,7 @@ private: #define HAS_SSE3 SIMDFlags::instance()->isSSE3() #define HAS_SSSE3 SIMDFlags::instance()->isSSSE3() #define HAS_SSE41 SIMDFlags::instance()->isSSE41() -#define HAS_SSS42 SIMDFlags::instance()->isSSE42() +#define HAS_SSE42 SIMDFlags::instance()->isSSE42() #define HAS_FMA3 SIMDFlags::instance()->isFMA3() #define HAS_FMA4 SIMDFlags::instance()->isFMA4() #define HAS_AVX SIMDFlags::instance()->isAVX() diff --git a/paddle/utils/tests/test_SIMDFlags.cpp b/paddle/utils/tests/test_SIMDFlags.cpp index 583a649b84605a973113cb31705a4822b0d83eb0..382d69a4a60243819ec666e710a88641ba42d2d5 100644 --- a/paddle/utils/tests/test_SIMDFlags.cpp +++ b/paddle/utils/tests/test_SIMDFlags.cpp @@ -20,17 +20,14 @@ using namespace paddle; // NOLINT TEST(SIMDFlags, gccTest) { #if (defined(__GNUC__) || defined(__GNUG__)) && !(defined(__clang__)) - CHECK(__builtin_cpu_supports("sse") == HAS_SSE); - CHECK(__builtin_cpu_supports("sse2") == HAS_SSE2); - CHECK(__builtin_cpu_supports("sse3") == HAS_SSE3); - CHECK(__builtin_cpu_supports("ssse3")== HAS_SSSE3); + CHECK(__builtin_cpu_supports("sse") == HAS_SSE); + CHECK(__builtin_cpu_supports("sse2") == HAS_SSE2); + CHECK(__builtin_cpu_supports("sse3") == HAS_SSE3); + CHECK(__builtin_cpu_supports("ssse3") == HAS_SSSE3); CHECK(__builtin_cpu_supports("sse4.1")== HAS_SSE41); CHECK(__builtin_cpu_supports("sse4.2")== HAS_SSE42); - CHECK(__builtin_cpu_supports("fma3")== HAS_FMA3); - CHECK(__builtin_cpu_supports("fma4")== HAS_FMA4); - CHECK(__builtin_cpu_supports("avx")== HAS_AVX); - CHECK(__builtin_cpu_supports("avx2")== HAS_AVX2); - CHECK(__builtin_cpu_supports("avx512f")== HAS_AVX512); + CHECK(__builtin_cpu_supports("avx") == HAS_AVX); + CHECK(__builtin_cpu_supports("avx2") == HAS_AVX2); #endif }