-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
40 lines (34 loc) · 948 Bytes
/
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.10)
if (UNIX)
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
endif (UNIX)
set(PROJECT_NAME cuSolverRfBatch)
project (${PROJECT_NAME} LANGUAGES C CXX CUDA)
set(SRC_FILES
mmio_wrapper.cpp
cuSolverRfBatch.cpp
)
add_executable(${PROJECT_NAME} ${SRC_FILES})
add_library(mmio mmio.c)
# CUDA
find_library(CUDA_LIBRARY_CUDART cudart ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
find_library(CUDA_LIBRARY_CUSOLVER cusolver ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
find_library(CUDA_LIBRARY_CUSPARSE cusparse ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
target_include_directories(
${PROJECT_NAME}
PRIVATE
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
"./inc/"
)
target_link_libraries(
${PROJECT_NAME}
${CUDA_LIBRARY_CUDART}
${CUDA_LIBRARY_CUSOLVER}
${CUDA_LIBRARY_CUSPARSE}
mmio
)
if (MSVC)
add_compile_options("$<$<CONFIG:RELEASE>:/O2>")
endif (MSVC)
if (UNIX)
endif (UNIX)