4.2.1.3 : Le fichier CMakeLists.txt
Écrivons le fichier CMakeLists.txt :
On créé notre bibliothèque de calcul vectorisé :
1 |
add_library(gray_scott_vectorized SHARED vectorized_propagation.cpp) |
On utilise encore un petit subterfuge pour changer le flag d'optimisation pour qu'il ne soit pas global afin de ne pas fausser les tests de performances :
1 |
set_property(TARGET gray_scott_vectorized PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2") |
Enfin, on lie notre bibliothèque à d'éventuelles dépendences :
1 |
target_link_libraries(gray_scott_vectorized TBB::tbb) |
On créé notre bibliothèque de calcul vectorisé :
1 |
add_library(gray_scott_vectorized_3x3 SHARED vectorized_propagation_3x3.cpp) |
On utilise encore un petit subterfuge pour changer le flag d'optimisation pour qu'il ne soit pas global afin de ne pas fausser les tests de performances :
1 |
set_property(TARGET gray_scott_vectorized_3x3 PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -funroll-loops -mavx2") |
Enfin, on lie notre bibliothèque à d'éventuelles dépendences :
1 |
target_link_libraries(gray_scott_vectorized_3x3 TBB::tbb) |
On créé notre bibliothèque de calcul vectorisé :
1 |
add_library(gray_scott_vectorized_3x3_v2 SHARED vectorized_propagation_3x3_v2.cpp) |
On utilise encore un petit subterfuge pour changer le flag d'optimisation pour qu'il ne soit pas global afin de ne pas fausser les tests de performances :
1 |
set_property(TARGET gray_scott_vectorized_3x3_v2 PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2") |
Enfin, on lie notre bibliothèque à d'éventuelles dépendences :
1 |
target_link_libraries(gray_scott_vectorized_3x3_v2 TBB::tbb) |
On créé notre bibliothèque de calcul vectorisé :
1 |
add_library(gray_scott_vectorized_3x3_v3 SHARED vectorized_propagation_3x3_v3.cpp) |
On utilise encore un petit subterfuge pour changer le flag d'optimisation pour qu'il ne soit pas global afin de ne pas fausser les tests de performances :
1 |
set_property(TARGET gray_scott_vectorized_3x3_v3 PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2") |
Enfin, on lie notre bibliothèque à d'éventuelles dépendences :
1 |
target_link_libraries(gray_scott_vectorized_3x3_v3 TBB::tbb) |
On créé notre bibliothèque de calcul vectorisé par bloc :
1 |
add_library(gray_scott_vectorized_3x3_block SHARED vectorized_propagation_3x3_block.cpp) |
On utilise encore un petit subterfuge pour changer le flag d'optimisation pour qu'il ne soit pas global afin de ne pas fausser les tests de performances :
1 |
set_property(TARGET gray_scott_vectorized_3x3_block PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2") |
Enfin, on lie notre bibliothèque à d'éventuelles dépendences :
1 |
target_link_libraries(gray_scott_vectorized_3x3_block TBB::tbb) |
On créé notre bibliothèque de calcul vectorisé par bloc :
1 |
add_library(gray_scott_vectorized_3x3_block_v2 SHARED vectorized_propagation_3x3_block_v2.cpp) |
On utilise encore un petit subterfuge pour changer le flag d'optimisation pour qu'il ne soit pas global afin de ne pas fausser les tests de performances :
1 |
set_property(TARGET gray_scott_vectorized_3x3_block_v2 PROPERTY COMPILE_FLAGS "-Ofast -fassociative-math -ftree-vectorize -march=native -mtune=native -mavx2") |
Enfin, on lie notre bibliothèque à d'éventuelles dépendences :
1 |
target_link_libraries(gray_scott_vectorized_3x3_block_v2 TBB::tbb) |
On créé notre bibliothèque de calcul vectorisé par bloc :
1 |
add_library(gray_scott_vectorized_3x3_block_v3 SHARED vectorized_propagation_3x3_block_v3.cpp) |
On utilise encore un petit subterfuge pour changer le flag d'optimisation pour qu'il ne soit pas global afin de ne pas fausser les tests de performances :
1 |
set_property(TARGET gray_scott_vectorized_3x3_block_v3 PROPERTY COMPILE_FLAGS "-Ofast -fassociative-math -ftree-vectorize -march=native -mtune=native -mavx2") |
Enfin, on lie notre bibliothèque à d'éventuelles dépendences :
1 |
target_link_libraries(gray_scott_vectorized_3x3_block_v3 TBB::tbb) |
Le fichier CMakeLists.txt complet :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
add_library(gray_scott_vectorized SHARED vectorized_propagation.cpp) set_property(TARGET gray_scott_vectorized PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2") target_link_libraries(gray_scott_vectorized TBB::tbb) add_library(gray_scott_vectorized_3x3 SHARED vectorized_propagation_3x3.cpp) set_property(TARGET gray_scott_vectorized_3x3 PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -funroll-loops -mavx2") target_link_libraries(gray_scott_vectorized_3x3 TBB::tbb) add_library(gray_scott_vectorized_3x3_v2 SHARED vectorized_propagation_3x3_v2.cpp) set_property(TARGET gray_scott_vectorized_3x3_v2 PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2") target_link_libraries(gray_scott_vectorized_3x3_v2 TBB::tbb) add_library(gray_scott_vectorized_3x3_v3 SHARED vectorized_propagation_3x3_v3.cpp) set_property(TARGET gray_scott_vectorized_3x3_v3 PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2") target_link_libraries(gray_scott_vectorized_3x3_v3 TBB::tbb) add_library(gray_scott_vectorized_3x3_block SHARED vectorized_propagation_3x3_block.cpp) set_property(TARGET gray_scott_vectorized_3x3_block PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2") target_link_libraries(gray_scott_vectorized_3x3_block TBB::tbb) add_library(gray_scott_vectorized_3x3_block_v2 SHARED vectorized_propagation_3x3_block_v2.cpp) set_property(TARGET gray_scott_vectorized_3x3_block_v2 PROPERTY COMPILE_FLAGS "-Ofast -fassociative-math -ftree-vectorize -march=native -mtune=native -mavx2") target_link_libraries(gray_scott_vectorized_3x3_block_v2 TBB::tbb) add_library(gray_scott_vectorized_3x3_block_v3 SHARED vectorized_propagation_3x3_block_v3.cpp) set_property(TARGET gray_scott_vectorized_3x3_block_v3 PROPERTY COMPILE_FLAGS "-Ofast -fassociative-math -ftree-vectorize -march=native -mtune=native -mavx2") target_link_libraries(gray_scott_vectorized_3x3_block_v3 TBB::tbb) |
Vous pouvez le télécharger ici.