forked from hvcl-old/hetero13
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
53 lines (47 loc) · 2.2 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
41
42
43
44
45
46
47
48
49
50
51
52
53
############################################################################################
# <summary> CMakeLists.txt for libWB and CUDA. </summary>
# <date> 2013-01-07 </date>
# <author> Tran Minh Quan. edit by Johannes Kast, Michael Sarahan </author>
############################################################################################
project(hetero13)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
find_package(CUDA REQUIRED)
# collect source files
if(CUDA_FOUND)
# compared to class settings, we let NVidia's FindCUDA CMake detect
# whether to build x64. We tell it to support most devices, though,
# to make sure more people can easily run class code without knowing
# about this compiler argument
if (MSVC)
set(CUDA_NVCC_FLAGS "")
else (MSVC)
set(CUDA_NVCC_FLAGS "
-gencode;arch=compute_20,code=sm_20;
-gencode;arch=compute_11,code=sm_11;
-gencode;arch=compute_12,code=sm_12;
-gencode;arch=compute_13,code=sm_13;")
endif (MSVC)
# add -Wextra compiler flag for gcc compilations
if (UNIX)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler -Wall;")
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler -Wextra")
endif (UNIX)
# add debugging to CUDA NVCC flags. For NVidia's NSight tools.
set(CUDA_NVCC_FLAGS_DEBUG ${CUDA_NVCC_FLAGS_DEBUG} "-G")
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CUDA_INCLUDE_DIRS})
else(CUDA_FOUND)
message("CUDA is not installed on this system.")
endif()
file( GLOB wbhdr *.hpp *.h )
file( GLOB wbsrc *.cpp *.c )
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CUDA_INCLUDE_DIRS})
CUDA_ADD_EXECUTABLE(MP0 mp0.cu ${wbhdr} ${wbsrc})
CUDA_ADD_EXECUTABLE(MP1 mp1.cu ${wbhdr} ${wbsrc})
CUDA_ADD_EXECUTABLE(MP2 mp2.cu ${wbhdr} ${wbsrc})
CUDA_ADD_EXECUTABLE(MP3 mp3.cu ${wbhdr} ${wbsrc})
CUDA_ADD_EXECUTABLE(MP4 mp4.cu ${wbhdr} ${wbsrc})
CUDA_ADD_EXECUTABLE(MP5 mp5.cu ${wbhdr} ${wbsrc})
CUDA_ADD_EXECUTABLE(MP6 mp6.cu ${wbhdr} ${wbsrc})