-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
39 lines (31 loc) · 1.06 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(cuSparseApp)
INCLUDE(cmake/SBELUtils.cmake)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
enable_cuda_support()
MESSAGE(STATUS "Cuda version: ${CUDA_VERSION}")
SET(CUSPARSEAPP_HEADERS
cusparse/common.h
)
#SET(CUSPARSEAPP_CUHEADERS
#)
# CUSP dependency. Note that we always include CUSP headers using
# include <cusp/header.h>.
find_path(CUSP_INCLUDE_DIR
NAMES cusp/array1d.h
HINTS ${CUDA_TOOLKIT_INCLUDE}
DOC "Top-level CUSP directory")
if(CUSP_INCLUDE_DIR)
message(STATUS "CUSP headers found in ${CUSP_INCLUDE_DIR}/cusp")
else()
message(FATAL_ERROR "CUSP headers not found. Please set CUSP_INCLUDE_DIR.")
endif()
cuda_include_directories(${CUSP_INCLUDE_DIR})
SOURCE_GROUP("Headers" FILES ${CUSPARSEAPP_HEADERS})
# SOURCE_GROUP("CUDA Headers" FILES ${CUSPARSEAPP_CUHEADERS})
# SOURCE_GROUP("MM_IO" FILES ${MMIO_FILES})
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
)
cuda_add_executable(example example.cu ${CUSPARSE_HEADERS})
target_link_libraries(example cusparse cusolver)