forked from OpenMathLib/OpenBLAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
98 lines (79 loc) · 2.63 KB
/
CMakeLists.txt
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
92
93
94
95
96
97
include_directories(${PROJECT_SOURCE_DIR})
set(LAPACK_SOURCES
getrf/getrf_single.c
potrf/potrf_U_single.c
potrf/potrf_L_single.c
lauum/lauum_U_single.c
lauum/lauum_L_single.c
)
# add a 'z' to filename for complex version
set(LAPACK_MANGLED_SOURCES
getf2/getf2_k.c
lauu2/lauu2_U.c
lauu2/lauu2_L.c
potf2/potf2_U.c
potf2/potf2_L.c
)
# sources that need TRANS set
# this has a 'z' version
set(TRANS_SOURCES
getrs/getrs_single.c
)
# sources that need UNIT set
# these do NOT have a z version
set(UNIT_SOURCES
trtri/trtri_U_single.c
trtri/trtri_L_single.c
)
# these have a 'z' version
set(UNIT_SOURCES2
trti2/trti2_U.c
trti2/trti2_L.c
)
GenerateNamedObjects("${LAPACK_SOURCES}")
GenerateNamedObjects("${LAPACK_MANGLED_SOURCES}" "" "" false "" "" false 3)
# TODO: laswp needs arch specific code
GenerateNamedObjects("laswp/generic/laswp_k.c" "" "laswp_plus" false "" "" false 3)
GenerateNamedObjects("laswp/generic/laswp_k.c" "MINUS" "laswp_minus" false "" "" false 3)
if (SMP)
if (USE_OPENMP)
set(GETRF_SRC getrf/getrf_parallel_omp.c)
else ()
set(GETRF_SRC getrf/getrf_parallel.c)
endif ()
# these do not have 'z' versions
set(PARALLEL_SOURCES
${GETRF_SRC}
lauum/lauum_U_parallel.c
lauum/lauum_L_parallel.c
potrf/potrf_U_parallel.c
potrf/potrf_L_parallel.c
)
# this has a z version
list(APPEND TRANS_SOURCES
getrs/getrs_parallel.c
)
# these do NOT have a z version
list(APPEND UNIT_SOURCES
trtri/trtri_U_parallel.c
trtri/trtri_L_parallel.c
)
GenerateNamedObjects("${PARALLEL_SOURCES}")
endif ()
foreach (float_type ${FLOAT_TYPES})
if (${float_type} STREQUAL "COMPLEX" OR ${float_type} STREQUAL "ZCOMPLEX")
foreach (trans_src ${TRANS_SOURCES})
string(REGEX MATCH "[a-z]/([a-z]+_)([a-z]+)" op_name ${trans_src})
string(REPLACE "/" "/z" ztrans_src ${trans_src})
GenerateNamedObjects("${ztrans_src}" "TRANS=1" "${CMAKE_MATCH_1}N_${CMAKE_MATCH_2}" false "" "" false ${float_type})
GenerateNamedObjects("${ztrans_src}" "TRANS=2" "${CMAKE_MATCH_1}T_${CMAKE_MATCH_2}" false "" "" false ${float_type})
GenerateNamedObjects("${ztrans_src}" "TRANS=3" "${CMAKE_MATCH_1}R_${CMAKE_MATCH_2}" false "" "" false ${float_type})
GenerateNamedObjects("${ztrans_src}" "TRANS=4" "${CMAKE_MATCH_1}C_${CMAKE_MATCH_2}" false "" "" false ${float_type})
endforeach ()
else ()
GenerateCombinationObjects("${TRANS_SOURCES}" "TRANS" "N" "" 4 "" false ${float_type})
endif ()
endforeach ()
GenerateCombinationObjects("${UNIT_SOURCES}" "UNIT" "N" "" 4)
GenerateCombinationObjects("${UNIT_SOURCES2}" "UNIT" "N" "" 0 "" "" 3)
add_library(lapack OBJECT ${OPENBLAS_SRC})