4.1.2.2 : Le fichier CMakeLists.txt
Écrivons le fichier CMakeLists.txt :
On définit les sources de nos tests (les sources de la bibliothèque naïve NAIVE_PROPAGATION_SRC et le main) :
1 |
set(progNaiveSrc ${NAIVE_PROPAGATION_SRC} main.cpp) |
Nous allons faire des tests en (-O1, -O2, -O3 pour commencer :
1 2 3 4 5 |
phoenix_compileAndRunExample(perf_grayscott_seq_O0 "-O0" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_compileAndRunExample(perf_grayscott_seq_O1 "-O1" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_compileAndRunExample(perf_grayscott_seq_O2 "-O2" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_compileAndRunExample(perf_grayscott_seq_O3 "-O3" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_compileAndRunExample(perf_grayscott_seq_Ofast "-Ofast" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) |
Finalement, la comparaison des résultats :
1 2 3 |
phoenix_plotPerf("grayscott_seqBase" perf_grayscott_seq_O0 perf_grayscott_seq_O1 perf_grayscott_seq_O2 perf_grayscott_seq_O3 perf_grayscott_seq_Ofast) |
Le fichier CMakeLists.txt complet :
1 2 3 4 5 6 7 8 9 |
set(progNaiveSrc ${NAIVE_PROPAGATION_SRC} main.cpp) phoenix_compileAndRunExample(perf_grayscott_seq_O0 "-O0" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_compileAndRunExample(perf_grayscott_seq_O1 "-O1" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_compileAndRunExample(perf_grayscott_seq_O2 "-O2" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_compileAndRunExample(perf_grayscott_seq_O3 "-O3" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_compileAndRunExample(perf_grayscott_seq_Ofast "-Ofast" "${CONFIG_GRAYSCOTT}" ${progNaiveSrc}) phoenix_plotPerf("grayscott_seqBase" perf_grayscott_seq_O0 perf_grayscott_seq_O1 perf_grayscott_seq_O2 perf_grayscott_seq_O3 perf_grayscott_seq_Ofast) |
Vous pouvez le télécharger ici.