8.5.3.4 : The CMakeLists.txt file

There is the CMakeLists.txt file :
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
project(Reduction)
cmake_minimum_required(VERSION 3.0)

add_executable(reduction_O0 main.cpp)
set_property(TARGET reduction_O0 PROPERTY COMPILE_FLAGS "-O0")
target_link_libraries(reduction_O0 asterics_hpc)
runExample(reduction_O0)

add_executable(reduction_O1 main.cpp)
set_property(TARGET reduction_O1 PROPERTY COMPILE_FLAGS "-O1")
target_link_libraries(reduction_O1 asterics_hpc)
runExample(reduction_O1)

add_executable(reduction_O2 main.cpp)
set_property(TARGET reduction_O2 PROPERTY COMPILE_FLAGS "-O2")
target_link_libraries(reduction_O2 asterics_hpc)
runExample(reduction_O2)

add_executable(reduction_O3 main.cpp)
set_property(TARGET reduction_O3 PROPERTY COMPILE_FLAGS "-O3")
target_link_libraries(reduction_O3 asterics_hpc)
runExample(reduction_O3)

plotPerf("reductionBase" reduction_O0 reduction_O1 reduction_O2 reduction_O3)

add_executable(reduction_real_O0 reduction.cpp main_reduction.cpp)
set_property(TARGET reduction_real_O0 PROPERTY COMPILE_FLAGS "-O0")
target_link_libraries(reduction_real_O0 asterics_hpc)
runExample(reduction_real_O0)

add_executable(reduction_real_O1 reduction.cpp main_reduction.cpp)
set_property(TARGET reduction_real_O1 PROPERTY COMPILE_FLAGS "-O1")
target_link_libraries(reduction_real_O1 asterics_hpc)
runExample(reduction_real_O1)

add_executable(reduction_real_O2 reduction.cpp main_reduction.cpp)
set_property(TARGET reduction_real_O2 PROPERTY COMPILE_FLAGS "-O2")
target_link_libraries(reduction_real_O2 asterics_hpc)
runExample(reduction_real_O2)

add_executable(reduction_real_O3 reduction.cpp main_reduction.cpp)
set_property(TARGET reduction_real_O3 PROPERTY COMPILE_FLAGS "-O3")
target_link_libraries(reduction_real_O3 asterics_hpc)
runExample(reduction_real_O3)

add_executable(reduction_real_Ofast reduction.cpp main_reduction.cpp)
set_property(TARGET reduction_real_Ofast PROPERTY COMPILE_FLAGS "-Ofast")
target_link_libraries(reduction_real_Ofast asterics_hpc)
runExample(reduction_real_Ofast)

plotPerf("reductionReal" reduction_real_O0 reduction_real_O1 reduction_real_O2 reduction_real_O3 reduction_real_Ofast)

add_executable(reduction_real_vectorize_O3 reduction_vectorize.cpp main_vectorize.cpp)
set_property(TARGET reduction_real_vectorize_O3 PROPERTY COMPILE_FLAGS "-O3 -ftree-vectorize -march=native -mtune=native -mavx2")
target_link_libraries(reduction_real_vectorize_O3 asterics_hpc)
runExample(reduction_real_vectorize_O3)

add_executable(reduction_real_vectorize_Ofast reduction_vectorize.cpp main_vectorize.cpp)
set_property(TARGET reduction_real_vectorize_Ofast PROPERTY COMPILE_FLAGS "-Ofast -ftree-vectorize -march=native -mtune=native -mavx2")
target_link_libraries(reduction_real_vectorize_Ofast asterics_hpc)
runExample(reduction_real_vectorize_Ofast)

plotPerf("reductionVectorize" reduction_real_O3 reduction_real_Ofast reduction_real_vectorize_O3 reduction_real_vectorize_Ofast)

add_executable(reduction_real_intrinsics_O3 reduction_intrinsics.cpp main_intrinsics.cpp)
set_property(TARGET reduction_real_intrinsics_O3 PROPERTY COMPILE_FLAGS "-O3 -march=native -mtune=native -mavx2")
target_link_libraries(reduction_real_intrinsics_O3 asterics_hpc)
runExample(reduction_real_intrinsics_O3)

plotPerf("reductionIntrinsics" reduction_real_O3 reduction_real_Ofast reduction_real_vectorize_O3 reduction_real_vectorize_Ofast reduction_real_intrinsics_O3)

add_executable(reduction_real_intrinsics_interleave2_O3 reduction_intrinsics_interleave2.cpp main_intrinsics_interleave2.cpp)
set_property(TARGET reduction_real_intrinsics_interleave2_O3 PROPERTY COMPILE_FLAGS "-O3 -march=native -mtune=native -mavx2")
target_link_libraries(reduction_real_intrinsics_interleave2_O3 asterics_hpc)
runExample(reduction_real_intrinsics_interleave2_O3)

plotPerf("reductionIntrinsicsInterleave2" reduction_real_Ofast reduction_real_vectorize_Ofast reduction_real_intrinsics_O3 reduction_real_intrinsics_interleave2_O3)

add_executable(reduction_real_intrinsics_interleave4_O3 reduction_intrinsics_interleave4.cpp main_intrinsics_interleave4.cpp)
set_property(TARGET reduction_real_intrinsics_interleave4_O3 PROPERTY COMPILE_FLAGS "-O3 -march=native -mtune=native -mavx2")
target_link_libraries(reduction_real_intrinsics_interleave4_O3 asterics_hpc)
runExample(reduction_real_intrinsics_interleave4_O3)

plotPerf("reductionIntrinsicsInterleave4" reduction_real_Ofast reduction_real_vectorize_Ofast reduction_real_intrinsics_O3 reduction_real_intrinsics_interleave2_O3 reduction_real_intrinsics_interleave4_O3)

add_executable(reduction_real_intrinsics_interleave8_O3 reduction_intrinsics_interleave8.cpp main_intrinsics_interleave8.cpp)
set_property(TARGET reduction_real_intrinsics_interleave8_O3 PROPERTY COMPILE_FLAGS "-O3 -march=native -mtune=native -mavx2")
target_link_libraries(reduction_real_intrinsics_interleave8_O3 asterics_hpc)
runExample(reduction_real_intrinsics_interleave8_O3)

plotPerf("reductionIntrinsicsInterleave8" reduction_real_Ofast reduction_real_vectorize_Ofast reduction_real_intrinsics_O3 reduction_real_intrinsics_interleave2_O3 reduction_real_intrinsics_interleave4_O3 reduction_real_intrinsics_interleave8_O3)