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.5 kB

10 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. include_directories(${PROJECT_SOURCE_DIR})
  2. include_directories(${PROJECT_BINARY_DIR})
  3. list (REMOVE_ITEM FLOAT_TYPES "BFLOAT16")
  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. if (NOT RELAPACK_REPLACE)
  35. GenerateNamedObjects("${LAPACK_SOURCES}")
  36. GenerateNamedObjects("${LAPACK_MANGLED_SOURCES}" "" "" false "" "" false 3)
  37. else()
  38. GenerateNamedObjects("${LAPACK_MANGLED_SOURCES}" "" "" false "" "" false 3)
  39. endif()
  40. GenerateNamedObjects("laswp/generic/laswp_k_4.c" "" "laswp_plus" false "" "" false 3)
  41. GenerateNamedObjects("laswp/generic/laswp_k_4.c" "MINUS" "laswp_minus" false "" "" false 3)
  42. foreach (float_type ${FLOAT_TYPES})
  43. if (${float_type} STREQUAL "HALF")
  44. continue()
  45. endif()
  46. GenerateNamedObjects("getrf/getrf_single.c" "UNIT" "getrf_single" false "" "" false ${float_type})
  47. endforeach ()
  48. # dynamic_arch laswp needs arch specific code ?
  49. #foreach(TARGET_CORE ${DYNAMIC_CORE})
  50. # set(TSUFFIX "_${TARGET_CORE}")
  51. #
  52. #GenerateNamedObjects("laswp/generic/laswp_k_4.c" "" "laswp_plus" false "" ${TSUFFIX} false 3)
  53. #GenerateNamedObjects("laswp/generic/laswp_k_4.c" "MINUS" "laswp_minus" false "" ${TSUFFIX} false 3)
  54. #endforeach ()
  55. if (USE_THREAD)
  56. if (USE_OPENMP)
  57. set(GETRF_SRC getrf/getrf_parallel_omp.c)
  58. else ()
  59. set(GETRF_SRC getrf/getrf_parallel.c)
  60. endif ()
  61. # these do not have 'z' versions
  62. set(PARALLEL_SOURCES
  63. lauum/lauum_U_parallel.c
  64. lauum/lauum_L_parallel.c
  65. potrf/potrf_U_parallel.c
  66. potrf/potrf_L_parallel.c
  67. )
  68. # this has a z version
  69. list(APPEND TRANS_SOURCES
  70. getrs/getrs_parallel.c
  71. )
  72. # these do NOT have a z version
  73. list(APPEND UNIT_SOURCES
  74. trtri/trtri_U_parallel.c
  75. trtri/trtri_L_parallel.c
  76. )
  77. foreach (float_type ${FLOAT_TYPES})
  78. GenerateNamedObjects("${GETRF_SRC}" "UNIT" "getrf_parallel" false "" "" false ${float_type})
  79. endforeach()
  80. GenerateNamedObjects("${PARALLEL_SOURCES}")
  81. endif ()
  82. foreach (float_type ${FLOAT_TYPES})
  83. if (${float_type} STREQUAL "COMPLEX" OR ${float_type} STREQUAL "ZCOMPLEX")
  84. foreach (trans_src ${TRANS_SOURCES})
  85. string(REGEX MATCH "[a-z]/([a-z]+_)([a-z]+)" op_name ${trans_src})
  86. string(REPLACE "/" "/z" ztrans_src ${trans_src})
  87. GenerateNamedObjects("${ztrans_src}" "TRANS=1" "${CMAKE_MATCH_1}N_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  88. GenerateNamedObjects("${ztrans_src}" "TRANS=2" "${CMAKE_MATCH_1}T_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  89. GenerateNamedObjects("${ztrans_src}" "TRANS=3" "${CMAKE_MATCH_1}R_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  90. GenerateNamedObjects("${ztrans_src}" "TRANS=4" "${CMAKE_MATCH_1}C_${CMAKE_MATCH_2}" false "" "" false ${float_type})
  91. endforeach ()
  92. else ()
  93. GenerateCombinationObjects("${TRANS_SOURCES}" "TRANS" "N" "" 4 "" false ${float_type})
  94. endif ()
  95. endforeach ()
  96. GenerateCombinationObjects("${UNIT_SOURCES}" "UNIT" "N" "" 4)
  97. GenerateCombinationObjects("${UNIT_SOURCES2}" "UNIT" "N" "" 0 "" "" 3)
  98. add_library(lapack OBJECT ${OPENBLAS_SRC})