fine tuning optimization flag

using AGRESSIVE with gcc reduced runtime of the small example on my
laptop from 2:00 min to 0:44 min
This commit is contained in:
Martin Diehl 2022-02-01 14:47:18 +01:00
parent a14735f3db
commit 1eda18b9e5
1 changed files with 2 additions and 2 deletions

View File

@ -12,9 +12,9 @@ endif ()
if (OPTIMIZATION STREQUAL "OFF") if (OPTIMIZATION STREQUAL "OFF")
set (OPTIMIZATION_FLAGS "-O0") set (OPTIMIZATION_FLAGS "-O0")
elseif (OPTIMIZATION STREQUAL "DEFENSIVE") elseif (OPTIMIZATION STREQUAL "DEFENSIVE")
set (OPTIMIZATION_FLAGS "-O2 -mtune=generic") set (OPTIMIZATION_FLAGS "-O2 -mtune=generic -flto")
elseif (OPTIMIZATION STREQUAL "AGGRESSIVE") elseif (OPTIMIZATION STREQUAL "AGGRESSIVE")
set (OPTIMIZATION_FLAGS "-O3 -march=native -ffast-math -funroll-loops -ftree-vectorize") set (OPTIMIZATION_FLAGS "-O3 -march=native -mtune=native -ffast-math -funroll-loops -ftree-vectorize -flto")
endif () endif ()
set (STANDARD_CHECK "-std=f2018 -pedantic-errors" ) set (STANDARD_CHECK "-std=f2018 -pedantic-errors" )