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

Mathieu Faverge's avatar
Mathieu Faverge committed
28
# Generate the chameleon auxiliary headers for all possible precisions
29 30 31
# ----------------------------------------------------------------
set(TIMING_AUX_HDRS_GENERATED "")
set(ZHDR
32
    timing_zauxiliary.h
33 34 35 36 37 38 39 40 41 42 43 44 45 46
   )

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

set(TIMING_AUX_HDRS
    timing.h
    timing.c
    ${TIMING_AUX_HDRS_GENERATED}
   )

# Force generation of headers
# ---------------------------
add_custom_target(timing_include ALL SOURCES ${TIMING_AUX_HDRS})
47
set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};timing_include" CACHE INTERNAL "List of targets of sources")
48

49
if (NOT CHAMELEON_SIMULATION)
Mathieu Faverge's avatar
Mathieu Faverge committed
50
    # Generate the chameleon auxiliary sources for all possible precisions
51 52 53 54 55
    # ----------------------------------------------------------------
    set(TIMING_AUX_SRCS_GENERATED "")
    set(ZSRC
        timing_zauxiliary.c
       )
56

57 58
    precisions_rules_py(TIMING_AUX_SRCS_GENERATED "${ZSRC}"
                        PRECISIONS "${CHAMELEON_PRECISION}")
59

60
    set(TIMING_SRCS ${TIMING_AUX_SRCS_GENERATED})
61 62 63 64
    # Force generation of sources
    # ---------------------------
    add_custom_target(timing_aux_sources ALL SOURCES ${TIMINGS_SRCS})
    set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};timing_aux_sources" CACHE INTERNAL "List of targets of sources")
65

66 67 68 69
    # Create libchameleon_timing.a
    # -----------------------------
    add_library(chameleon_timing STATIC ${TIMING_SRCS})
    set_property(TARGET chameleon_timing PROPERTY LINKER_LANGUAGE Fortran)
70
    add_dependencies(chameleon_timing timing_include timing_aux_sources)
71
endif()
72

Mathieu Faverge's avatar
Mathieu Faverge committed
73
# Generate the chameleon testing sources for all possible precisions
74 75
# --------------------------------------------------------------
set(TIMINGS "")
Mathieu Faverge's avatar
Mathieu Faverge committed
76 77 78 79 80 81 82 83 84 85 86 87 88 89 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
set(ZSRC_LAP_INT
  # BLAS 3
  time_zgemm.c
  time_ztrsm.c
  # LAPACK
  time_zgels.c
  time_zgeqrf.c
  time_zgeqrf_hqr.c
  time_zgelqf.c
  time_zgetrf_incpiv.c
  time_zgetrf_nopiv.c
  #time_zgetrf.c
  time_zposv.c
  time_zpotrf.c
  # MIXED PRECISION
  #time_zcgesv.c
  #time_zcposv.c
  # OTHERS
  time_zlange.c
  #time_zgecfi.c
  #time_zgetrf_reclap.c
  #time_zgetrf_rectil.c
  #time_zgesv.c
  time_zgesv_incpiv.c
  time_zgesv_nopiv.c
  )

set(ZSRC_TIL_INT
  # BLAS 3
  time_zgemm_tile.c
  # LAPACK
  time_zgels_tile.c
  time_zgeqrf_hqr_tile.c
  time_zgeqrf_tile.c
  time_zgelqf_tile.c
  time_zgeqrs_tile.c
  time_zgetrf_incpiv_tile.c
  time_zgetrf_nopiv_tile.c
  time_zgetrs_incpiv_tile.c
  time_zgetrs_nopiv_tile.c
  #time_zgetrf_tile.c
  time_zposv_tile.c
  time_zpotrf_tile.c
  time_zpotrs_tile.c
  time_zsytrf_tile.c
  time_zpotri_tile.c
  # MIXED PRECISION
  #time_zcgesv_tile.c
  #time_zcposv_tile.c
  # OTHERS
  time_zlange_tile.c
  #time_zgebrd_tile.c
  #time_zgesvd_tile.c
  #time_zheevd_tile.c
  #time_zheev_tile.c
  #time_zhegv_tile.c
  #time_zlapack2tile.c
  #time_zgetri_tile.c
  #time_zgesv_tile.c
  time_zgesv_incpiv_tile.c
  time_zgesv_nopiv_tile.c
  )

139
if (NOT CHAMELEON_SIMULATION)
Mathieu Faverge's avatar
Mathieu Faverge committed
140 141 142 143 144 145
  set(ZSRC
    ${ZSRC_LAP_INT}
    ${ZSRC_TIL_INT}
    time_zgesvd_tile.c
    time_zheevd_tile.c
    )
146
else(NOT CHAMELEON_SIMULATION)
Mathieu Faverge's avatar
Mathieu Faverge committed
147 148 149
  set(ZSRC
    ${ZSRC_TIL_INT}
    )
150
endif(NOT CHAMELEON_SIMULATION)
151 152

precisions_rules_py(TIMINGS "${ZSRC}"
153
                    PRECISIONS "${CHAMELEON_PRECISION}")
154

155 156 157 158 159
# Force generation of sources
# ---------------------------
add_custom_target(timing_sources ALL SOURCES ${TIMINGS})
set(CHAMELEON_SOURCES_TARGETS "${CHAMELEON_SOURCES_TARGETS};timing_sources" CACHE INTERNAL "List of targets of sources")

160 161 162 163 164 165 166 167
# Add include and link directories
# --------------------------------
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
link_directories(${CMAKE_CURRENT_BINARY_DIR})

# Define what libraries we have to link with
# ------------------------------------------
168 169 170 171 172
set(libs_for_timings)
if(NOT CHAMELEON_SIMULATION)
    list(APPEND libs_for_timings chameleon_timing)
endif()

173 174
# timing executables depend on chameleon and cblas, lapacke, starpu (optional), mpi (already chameleon's dependencies)
list(APPEND libs_for_timings chameleon)
175
# message(STATUS "libs timings: ${libs_for_timings}")
PRUVOST Florent's avatar
PRUVOST Florent committed
176

177 178 179
foreach(_timing ${TIMINGS})
    get_filename_component(_name_exe ${_timing} NAME_WE)
    add_executable(${_name_exe} ${_timing})
180
    add_dependencies(${_name_exe} timing_include)
181 182 183
    set_property(TARGET ${_name_exe} PROPERTY LINKER_LANGUAGE Fortran)
    target_link_libraries(${_name_exe} ${libs_for_timings})
    install(TARGETS ${_name_exe}
184
            DESTINATION bin/timing)
185 186
endforeach()

187
#-------- Tests ---------
188 189 190 191 192
include(CTestLists.cmake)

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