modified cmake to set USE_FMA
This commit is contained in:
@@ -7,6 +7,9 @@ OPTION(BUILD_SHARED_LIBS "Build also shared library." ON)
|
||||
|
||||
if(CPU_AVX_AVAILABLE)
|
||||
SET(USE_AVX ON CACHE BOOL "")
|
||||
if(CPU_FMA_AVAILABLE)
|
||||
SET(USE_FMA ON CACHE BOOL "")
|
||||
endif(CPU_FMA_AVAILABLE)
|
||||
endif(CPU_AVX_AVAILABLE)
|
||||
|
||||
if(CPU_SSE3_AVAILABLE)
|
||||
@@ -19,6 +22,8 @@ if(CPU_SSE3_AVAILABLE)
|
||||
endif(CPU_SSE3_AVAILABLE)
|
||||
|
||||
OPTION(USE_AVX "If AVX instruction set should be used." OFF)
|
||||
OPTION(USE_FMA "If FMA instruction set should be used." OFF)
|
||||
|
||||
OPTION(USE_SSE "If SSE instruction set should be used." OFF)
|
||||
OPTION(USE_SSE2 "If SSE 2 instruction set should be used." ON)
|
||||
|
||||
@@ -34,6 +39,10 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -mtune=native -O3")
|
||||
|
||||
if(USE_AVX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx -DUSE_AVX")
|
||||
if(USE_FMA)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfma -DUSE_FMA")
|
||||
endif(USE_FMA)
|
||||
|
||||
endif(USE_AVX)
|
||||
|
||||
if(USE_SSE)
|
||||
|
||||
Reference in New Issue
Block a user