From 9e0686ed45f79bbe6a5434bf453509cab0b630ea Mon Sep 17 00:00:00 2001 From: Sing_chan <51314274+betterpig@users.noreply.github.com> Date: Fri, 14 Jan 2022 11:29:37 +0800 Subject: [PATCH] fix bug of -DPADDLE_WITH_SSE3 not set when WITH_AVX AND AVX_FOUND even SSE3_FOUND (#38931) --- cmake/configure.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/configure.cmake b/cmake/configure.cmake index 32ba2ff3ac6..88e8dde8add 100644 --- a/cmake/configure.cmake +++ b/cmake/configure.cmake @@ -31,10 +31,12 @@ endif(NOT WITH_PROFILER) if(WITH_AVX AND AVX_FOUND) set(SIMD_FLAG ${AVX_FLAG}) add_definitions(-DPADDLE_WITH_AVX) -elseif(SSE3_FOUND) - if(NOT WIN32) - set(SIMD_FLAG ${SSE3_FLAG}) - endif() +elseif(SSE3_FOUND AND NOT WIN32) + set(SIMD_FLAG ${SSE3_FLAG}) +endif() + +if (SSE3_FOUND) + # TODO: Runtime detection should be used here. add_definitions(-DPADDLE_WITH_SSE3) endif() -- GitLab