-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (35 loc) · 1.16 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
cmake_minimum_required(VERSION 3.21)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
set (CMAKE_CXX_STANDARD 17)
project(perftool)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
# GPU libraries
find_package(CUDAToolkit)
if (NOT CUDAToolkit_FOUND)
find_package(HIP REQUIRED)
find_package(hipBLAS REQUIRED)
find_package(rocBLAS REQUIRED)
find_package(hipSOLVER REQUIRED)
find_package(rocSOLVER REQUIRED)
add_definitions(-DHAVE_HIP)
if(USE_MAGMA)
find_package(MAGMA REQUIRED)
add_definitions(-DHAVE_MAGMA)
set(GPU_LIBRARIES hip::host roc::hipblas roc::rocblas roc::hipsolver roc::hipsolver magma)
else()
set(GPU_LIBRARIES hip::host roc::hipblas roc::rocblas roc::hipsolver roc::hipsolver)
endif()
enable_language(HIP)
set_source_files_properties(
${SOURCES} PROPERTIES LANGUAGE HIP)
else()
set(GPU_LIBRARIES CUDA::cudart CUDA::cublas CUDA::cusolver)
add_definitions(-DHAVE_CUDA)
endif()
message("GPU LIBS " ${GPU_LIBRARIES})
add_executable(dgemm src/dgemm.cpp)
add_executable(dsyevd src/dsyevd.cpp)
target_link_libraries(dgemm PUBLIC ${GPU_LIBRARIES})
target_link_libraries(dsyevd PUBLIC ${GPU_LIBRARIES})