代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_STANDARD 17)
project(ChipSum VERSION 1.2)
configure_file(ChipSumConfig.h.in ChipSumConfig.h)
set(CMAKE_CXX_FLAGS "-Wall"${CMAKE_CXX_FLAGS})
set(CHIPSUM_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CHIPSUM_SOURCES "")
set(CHIPSUM_HEADERS "")
add_subdirectory("chipsum")
set(ChipSum_ENABLE_KokkosKernels ON)
if(ChipSum_ENABLE_KokkosKernels)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tpls/kokkos-kernels-build/lib)
set(KokkosKernels_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tpls/kokkos-kernels-build/lib)
elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tpls/kokkos-kernels-build/lib64)
set(KokkosKernels_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tpls/kokkos-kernels-build/lib64)
endif()
add_definitions("-DChipSum_USE_KokkosKernels=on")
set(KokkosKernels_DIR ${KokkosKernels_LIB_DIR}/cmake/KokkosKernels)
find_package(KokkosKernels REQUIRED)
set(CMAKE_CXX_COMPILER ${Kokkos_CXX_COMPILER})
list(APPEND CHIPSUM_LIBS "Kokkos::kokkoskernels")
endif()
#INCLUDE CUSPARSE
find_package(CUDA)
if(CUDA_FOUND)
list(APPEND CHIPSUM_LIBS "cusparse")
endif()
#INCLUDE ROCSPARSE
FIND_PACKAGE(ROCM)
if(ROCM_FOUND)
list(APPEND CHIPSUM_LIBS "rocsparse")
endif()
add_definitions("-fopenmp")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/chipsum/solver)
add_library(chipsum ${CHIPSUM_SOURCES} ${CHIPSUM_HEADERS})
list(APPEND CHIPSUM_LIBS chipsum)
install(TARGETS chipsum DESTINATION lib)
install(FILES ChipSum.hpp DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
set(CHIPSUM_ENABLE_TEST ON)
set(CHIPSUM_ENABLE_EXAMPLE ON)
set(CHIPSUM_ENABLE_PERF_TEST ON)
set(CHIPSUM_ENABLE_UNIT_TEST ON)
if(CHIPSUM_ENABLE_TEST)
add_subdirectory("tests")
endif()
if(CHIPSUM_ENABLE_EXAMPLE)
add_subdirectory("examples")
endif()
if(CHIPSUM_ENABLE_PERF_TEST)
add_subdirectory("perf_test")
endif()
if(CHIPSUM_ENABLE_UNIT_TEST)
add_subdirectory("unit_test")
endif()
#"examples/vector/axpby.cpp" "examples/matrix/lu.cpp" "tests/test1.cpp" "perf_test/perf_axpby.cpp"
add_executable(ChipSum "perf_test/perf_dot.cpp")
install(TARGETS ChipSum DESTINATION bin)
target_link_libraries(ChipSum PUBLIC ${CHIPSUM_LIBS})
target_include_directories(ChipSum PUBLIC ${PROJECT_BINARY_DIR})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。