-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
66 lines (51 loc) · 3.05 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
54
55
56
57
58
59
60
61
62
63
64
65
66
cmake_minimum_required(VERSION 2.8)
project(SEP-Graph)
############## DEPENDENCIES ##############
find_package(CUDA 9 REQUIRED)
message("-- CUDA Version: ${CUDA_VERSION_STRING}")
# GFlags
add_subdirectory(deps/gflags)
include_directories(${PROJECT_BINARY_DIR}/deps/gflags/include)
link_directories(${PROJECT_BINARY_DIR}/deps/gflags/lib)
# CUB
include_directories(${PROJECT_SOURCE_DIR}/deps/cub)
# JSON
include_directories(${PROJECT_SOURCE_DIR}/deps/json)
############## BUILD ##############
set(EXTRA_LIBS gflags pthread ${CUDA_TOOLKIT_TARGET_DIR}/lib64/stubs/libcuda.so ${CUDA_TOOLKIT_TARGET_DIR}/lib64/libnvToolsExt.so)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("Debug mode")
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_52,code=compute_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-g;-lineinfo;-Xcompiler;-ggdb;-std=c++11)
else ()
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_52,code=compute_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-O3;-DNDEBUG;-Xcompiler;-DNDEBUG;-std=c++11)
endif ()
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
# Addresses a bug where code is not compiled as C++11 in non-CUDA code and older g++ versions
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -DNDEBUG")
message("-- Host Compiler: ${CUDA_HOST_COMPILER}")
include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include)
# hybrid apps
cuda_add_executable(hybrid_pr src/utils/parser.cpp src/utils/utils.cpp src/utils/to_json.cpp #src/groute/graphs/csr_graph.cpp
samples/hybrid_pr/hybrid_pr.cu
samples/hybrid_pr/hybrid_pr_host.cpp
samples/hybrid_pr/main.cpp)
target_link_libraries(hybrid_pr ${EXTRA_LIBS})
cuda_add_executable(hybrid_bfs src/utils/parser.cpp src/utils/utils.cpp src/utils/to_json.cpp #src/groute/graphs/csr_graph.cpp
samples/hybrid_bfs/hybrid_bfs.cu
samples/hybrid_bfs/hybrid_bfs_host.cpp
samples/hybrid_bfs/main.cpp)
target_link_libraries(hybrid_bfs ${EXTRA_LIBS})
#target_compile_definitions(hybrid_bfs PUBLIC ARRAY_BITMAP)
cuda_add_executable(hybrid_sssp src/utils/parser.cpp src/utils/utils.cpp src/utils/to_json.cpp #src/groute/graphs/csr_graph.cpp
samples/hybrid_sssp/hybrid_sssp.cu
samples/hybrid_sssp/hybrid_sssp_host.cpp
samples/hybrid_sssp/main.cpp)
target_link_libraries(hybrid_sssp ${EXTRA_LIBS})
cuda_add_executable(hybrid_bc src/utils/parser.cpp src/utils/utils.cpp src/utils/to_json.cpp #src/groute/graphs/csr_graph.cpp
samples/hybrid_bc/hybrid_bc.cu
samples/hybrid_bc/hybrid_bc_host.cpp
samples/hybrid_bc/main.cpp)
target_link_libraries(hybrid_bc ${EXTRA_LIBS})
add_executable(gtools src/utils/parser.cpp src/utils/utils.cpp
samples/tools/gtools.cpp)
target_link_libraries(gtools gflags)