From 1eda18b9e55a33f470dd952c842feeec5814902f Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 1 Feb 2022 14:47:18 +0100 Subject: [PATCH] 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 --- cmake/Compiler-GNU.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Compiler-GNU.cmake b/cmake/Compiler-GNU.cmake index cafcfabca..5e2bf2ce6 100644 --- a/cmake/Compiler-GNU.cmake +++ b/cmake/Compiler-GNU.cmake @@ -12,9 +12,9 @@ endif () if (OPTIMIZATION STREQUAL "OFF") set (OPTIMIZATION_FLAGS "-O0") elseif (OPTIMIZATION STREQUAL "DEFENSIVE") - set (OPTIMIZATION_FLAGS "-O2 -mtune=generic") + set (OPTIMIZATION_FLAGS "-O2 -mtune=generic -flto") 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 () set (STANDARD_CHECK "-std=f2018 -pedantic-errors" )