You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

CMakeLists.txt 3.4 kB

5 years ago
10 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. include_directories(${PROJECT_SOURCE_DIR})
  2. include_directories(${PROJECT_BINARY_DIR})
  3. list (REMOVE_ITEM FLOAT_TYPES "HALF")
  4. set(LAPACK_SOURCES
  5. potrf/potrf_U_single.c
  6. potrf/potrf_L_single.c
  7. lauum/lauum_U_single.c
  8. lauum/lauum_L_single.c
  9. )
  10. # add a 'z' to filename for complex version
  11. set(LAPACK_MANGLED_SOURCES
  12. getf2/getf2_k.c
  13. lauu2/lauu2_U.c
  14. lauu2/lauu2_L.c
  15. potf2/potf2_U.c
  16. potf2/potf2_L.c
  17. )
  18. # sources that need TRANS set
  19. # this has a 'z' version
  20. set(TRANS_SOURCES
  21. getrs/getrs_single.c
  22. )
  23. # sources that need UNIT set
  24. # these do NOT have a z version
  25. set(UNIT_SOURCES
  26. trtri/trtri_U_single.c
  27. trtri/trtri_L_single.c
  28. )
  29. # these have a 'z' version
  30. set(UNIT_SOURCES2
  31. trti2/trti2_U.c
  32. trti2/trti2_L.c
  33. )
  34. GenerateNamedObjects("${LAPACK_SOURCES}")
  35. GenerateNamedObjects("${LAPACK_MANGLED_SOURCES}" "" "" false "" "" false 3)
  36. GenerateNamedObjects("laswp/generic/laswp_k_4.c" "" "laswp_plus" false "" "" false 3)
  37. GenerateNamedObjects("laswp/generic/laswp_k_4.c" "MINUS" "laswp_minus" false "" "" false 3)
  38. foreach (float_type ${FLOAT_TYPES})
  39. if (${float_type} STREQUAL "HALF")
  40. continue()
  41. endif()
  42. GenerateNamedObjects("getrf/getrf_single.c" "UNIT" "getrf_single" false "" "" false ${float_type})
  43. endforeach ()
  44. # dynamic_arch laswp needs arch specific code ?
  45. #foreach(TARGET_CORE ${DYNAMIC_CORE})
  46. # set(TSUFFIX "_${TARGET_CORE}")
  47. #
  48. #GenerateNamedObjects("laswp/generic/laswp_k_4.c" "" "laswp_plus" false "" ${TSUFFIX} false 3)
  49. #GenerateNamedObjects("laswp/generic/laswp_k_4.c" "MINUS" "laswp_minus" false "" ${TSUFFIX} false 3)
  50. #endforeach ()
  51. if (USE_THREAD)
  52. if (USE_OPENMP)
  53. set(GETRF_SRC getrf/getrf_parallel_omp.c)
  54. else ()
  55. set(GETRF_SRC getrf/getrf_parallel.c)
  56. endif ()
  57. # these do not have 'z' versions
  58. set(PARALLEL_SOURCES
  59. lauum/lauum_U_parallel.c
  60. lauum/lauum_L_parallel.c
  61. potrf/potrf_U_parallel.c
  62. potrf/potrf_L_parallel.c
  63. )
  64. # this has a z version
  65. list(APPEND TRANS_SOURCES
  66. getrs/getrs_parallel.c
  67. )
  68. # these do NOT have a z version
  69. list(APPEND UNIT_SOURCES
  70. trtri/trtri_U_parallel.c
  71. trtri/trtri_L_parallel.c
  72. )
  73. foreach (float_type ${FLOAT_TYPES})
  74. GenerateNamedObjects("${GETRF_SRC}" "UNIT" "getrf_parallel" false "" "" false ${float_type})
  75. endforeach()
  76. GenerateNamedObjects("${PARALLEL_SOURCES}")
  77. endif ()
  78. foreach (float_type ${FLOAT_TYPES})
  79. if (${float_type} STREQUAL "COMPLEX" OR ${float_type} STREQUAL "ZCOMPLEX")
  80. foreach (trans_src ${TRANS_SOURCES})
  81. string(REGEX MATCH "[a-z]/([a-z]+_)([a-z]+)" op_name ${trans_src})
  82. string(REPLACE "/" "/z" ztrans_src ${trans_src})
  83. GenerateNamedObjects("${ztrans_src}" "TRANS=1" "${CMAKE_MATCH_1}N_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  84. GenerateNamedObjects("${ztrans_src}" "TRANS=2" "${CMAKE_MATCH_1}T_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  85. GenerateNamedObjects("${ztrans_src}" "TRANS=3" "${CMAKE_MATCH_1}R_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  86. GenerateNamedObjects("${ztrans_src}" "TRANS=4" "${CMAKE_MATCH_1}C_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  87. endforeach ()
  88. else ()
  89. GenerateCombinationObjects("${TRANS_SOURCES}" "TRANS" "N" "" 4 "" false ${float_type})
  90. endif ()
  91. endforeach ()
  92. GenerateCombinationObjects("${UNIT_SOURCES}" "UNIT" "N" "" 4)
  93. GenerateCombinationObjects("${UNIT_SOURCES2}" "UNIT" "N" "" 0 "" "" 3)
  94. add_library(lapack OBJECT ${OPENBLAS_SRC})