CMakeLists.txt 5.41 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
###
#
# @copyright (c) 2009-2014 The University of Tennessee and The University
#                          of Tennessee Research Foundation.
#                          All rights reserved.
# @copyright (c) 2012-2014 Inria. All rights reserved.
# @copyright (c) 2012-2014 IPB. All rights reserved.
#
###
#
#  @file CMakeLists.txt
#
13
14
#  @project CHAMELEON
#  CHAMELEON is a software package provided by:
15
16
17
18
19
20
#     Inria Bordeaux - Sud-Ouest,
#     Univ. of Tennessee,
#     King Abdullah Univesity of Science and Technology
#     Univ. of California Berkeley,
#     Univ. of Colorado Denver.
#
21
#  @version 0.9.0
22
23
24
25
26
27
28
29
30
#  @author Cedric Castagnede
#  @author Emmanuel Agullo
#  @author Mathieu Faverge
#  @author Florent Pruvost
#  @date 13-07-2012
#
###


31
# check if magma_dgetrf_incpiv_gpu is accessible in libmagma and activate it in chameleon
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
if ( CBLAS_FOUND AND LAPACKE_FOUND AND LAPACK_FOUND AND CUDA_FOUND AND CUDA_CUBLAS_LIBRARIES AND MAGMA_FOUND )
    set(CMAKE_REQUIRED_LIBRARIES "${CBLAS_LIBRARIES};${LAPACKE_LIBRARIES};${LAPACK_SEQ_LIBRARIES};${CUDA_LIBRARIES};${CUDA_CUBLAS_LIBRARIES};${MAGMA_LIBRARIES};${COREBLAS_LIBRARIES}")
    unset(MAGMA_DGETRF_INCPIV_GPU_FOUND CACHE)
    check_function_exists(magma_dgetrf_incpiv_gpu MAGMA_DGETRF_INCPIV_GPU_FOUND)
    if ( MAGMA_DGETRF_INCPIV_GPU_FOUND )
        message(STATUS "Set HAVE_MAGMA_GETRF_INCPIV_GPU")
        add_definitions(-DHAVE_MAGMA_GETRF_INCPIV_GPU)
    endif()
endif()

# Generate the magma headers for all possible precisions
# ------------------------------------------------------
set(RUNTIME_HDRS_GENERATED "")
set(ZHDR
  include/codelet_z.h
)

precisions_rules_py(RUNTIME_HDRS_GENERATED "${ZHDR}"
                    PRECISIONS "s;d;c;z;ds;zc"
                    TARGETDIR  "include")

# Define the list of headers
# --------------------------
set(RUNTIME_HDRS
    include/morse_starpu.h
    include/codelets.h
    ${RUNTIME_HDRS_GENERATED}
    )

# Force generation of headers
# ---------------------------
add_custom_target(runtime_starpu_include ALL SOURCES ${RUNTIME_HDRS})

# Generate the morse common for all possible precisions
# -----------------------------------------------------
set(RUNTIME_COMMON_GENERATED "")
set(ZSRC
    control/zprofiling.c
    control/zlocality.c
    )

precisions_rules_py(RUNTIME_COMMON_GENERATED "${ZSRC}"
74
                    PRECISIONS "${CHAMELEON_PRECISION}"
75
76
77
78
79
80
81
82
83
84
85
86
87
88
                    TARGETDIR "control")

set(RUNTIME_COMMON
    control/control.c
    control/context.c
    control/descriptor.c
    control/async.c
    control/options.c
    control/profiling.c
    control/workspace.c
    codelets/codelet_dataflush.c
    ${RUNTIME_COMMON_GENERATED}
    )
    
89
foreach(_prec ${CHAMELEON_PRECISION})
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
    set_source_files_properties(control/profiling.c PROPERTIES COMPILE_FLAGS "-DPRECISION_${_prec}")
endforeach()

# Generate the morse sources for all possible precisions
# ------------------------------------------------------
set(RUNTIME_SRCS_GENERATED "")
set(ZSRC
    codelets/codelet_zcallback.c
    codelets/codelet_ztile_zero.c
    codelets/codelet_zasum.c
    ##################
    # BLAS 1
    ##################
    codelets/codelet_zaxpy.c
    ##################
    # BLAS 3
    ##################
    codelets/codelet_zgemm.c
    codelets/codelet_zhemm.c
    codelets/codelet_zher2k.c
    codelets/codelet_zherk.c
    codelets/codelet_zsymm.c
    codelets/codelet_zsyr2k.c
    codelets/codelet_zsyrk.c
    codelets/codelet_ztrmm.c
    codelets/codelet_ztrsm.c
    ##################
    # LAPACK
    ##################
    codelets/codelet_zgeadd.c
    codelets/codelet_zgelqt.c
    codelets/codelet_zgeqrt.c
    codelets/codelet_zgessm.c
    codelets/codelet_zgessq.c
    codelets/codelet_zgetrf.c
    codelets/codelet_zgetrf_incpiv.c
    codelets/codelet_zgetrf_nopiv.c
    codelets/codelet_zhessq.c
    codelets/codelet_zlacpy.c
    codelets/codelet_zlange.c
    codelets/codelet_zlanhe.c
    codelets/codelet_zlansy.c    
    codelets/codelet_zlantr.c    
    codelets/codelet_zlaset2.c
    codelets/codelet_zlaset.c
    codelets/codelet_zlauum.c
    codelets/codelet_zplghe.c
    codelets/codelet_zplgsy.c
    codelets/codelet_zplrnt.c
    codelets/codelet_zplssq.c
    codelets/codelet_zpotrf.c
    codelets/codelet_zssssm.c
    codelets/codelet_zsyssq.c
    codelets/codelet_zsytrf_nopiv.c    
    codelets/codelet_ztrasm.c
    codelets/codelet_ztrssq.c
    codelets/codelet_ztrtri.c
    codelets/codelet_ztslqt.c
    codelets/codelet_ztsmlq.c
    codelets/codelet_ztsmqr.c
    codelets/codelet_ztsqrt.c
    codelets/codelet_ztstrf.c
    codelets/codelet_zttlqt.c
    codelets/codelet_zttmlq.c
    codelets/codelet_zttmqr.c
    codelets/codelet_zttqrt.c
    codelets/codelet_zunmlq.c
    codelets/codelet_zunmqr.c
    )
list(REMOVE_DUPLICATES ZSRC)    

precisions_rules_py(RUNTIME_SRCS_GENERATED "${ZSRC}"
162
                    PRECISIONS "${CHAMELEON_PRECISION}"
163
164
165
166
167
168
169
170
171
172
173
174
175
176
                    TARGETDIR "codelets")

set(RUNTIME_SRCS
  ${RUNTIME_COMMON}
  ${RUNTIME_SRCS_GENERATED}
  )

# include directories
# -------------------
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)

# Add library
# -----------
177
178
add_library(chameleon_starpu ${RUNTIME_SRCS})
set_property(TARGET chameleon_starpu PROPERTY LINKER_LANGUAGE Fortran)
179

180
181
add_dependencies(chameleon_starpu
  chameleon_include
182
183
184
185
186
187
188
  coreblas_include
  control_include
  runtime_starpu_include
)

# installation
# ------------
189
install(TARGETS chameleon_starpu
190
191
192
193
194
        DESTINATION lib)

###
### END CMakeLists.txt
###