kopia lustrzana https://github.com/f4exb/sdrangel
SIMD optimizations: do not use AVX2 flag globally
rodzic
57b50f47a9
commit
a40f31ed4a
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue