1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

SIMD optimizations: do not use AVX2 flag globally

This commit is contained in:
f4exb 2016-11-08 00:38:57 +01:00
parent 57b50f47a9
commit a40f31ed4a

View File

@ -416,17 +416,17 @@ message( STATUS "Architecture: ${ARCHITECTURE}" )
if (${ARCHITECTURE} MATCHES "x86_64|AMD64|x86")
EXECUTE_PROCESS( COMMAND grep flags /proc/cpuinfo OUTPUT_VARIABLE CPU_FLAGS )
if (${CPU_FLAGS} MATCHES "avx2")
set(HAS_AVX2 ON CACHE BOOL "Architecture has AVX2 SIMD enabled")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mavx2" )
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mavx2" )
message(STATUS "Use AVX2 SIMD instructions")
add_definitions(-DUSE_AVX2)
else()
set(HAS_AVX2 OFF CACHE BOOL "Architecture does not have AVX2 SIMD enabled")
endif()
endif()
# if (${CPU_FLAGS} MATCHES "avx2")
# set(HAS_AVX2 ON CACHE BOOL "Architecture has AVX2 SIMD enabled")
# if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
# set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mavx2" )
# set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mavx2" )
# message(STATUS "Use AVX2 SIMD instructions")
# add_definitions(-DUSE_AVX2)
# else()
# set(HAS_AVX2 OFF CACHE BOOL "Architecture does not have AVX2 SIMD enabled")
# endif()
# endif()
if (${CPU_FLAGS} MATCHES "sse4_1")
set(HAS_SSE4_1 ON CACHE BOOL "Architecture has SSE 4.1 SIMD enabled")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)