-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
93 lines (81 loc) · 2.71 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
project(sampling LANGUAGES CUDA)
cmake_minimum_required(VERSION 3.15)
include(CheckLanguage)
check_language(CUDA)
set(CUDA_PATH "/usr/local/cuda")
set(CMAKE_CUDA_COMPILER "/usr/local/cuda-11.0/bin/nvcc")
# GFlags
add_subdirectory(deps/gflags)
include_directories(${PROJECT_BINARY_DIR}/deps/gflags/include)
link_directories(${PROJECT_BINARY_DIR}/deps/gflags/lib)
############## BUILD ##############
set(EXTRA_LIBS gflags)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode arch=compute_75,code=sm_75 -rdc=true -dc -std=c++11 -res-usage -Xptxas -v ")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("Debug mode")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g -G -Xcompiler -ggdb -lnvrt -Woverloaded-virtual")
else()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -lineinfo -O3 -Xcompiler -DNDEBUG ")
endif()
#-I /usr/local/cuda-10.1/targets/x86_64-linux/include/ -L /usr/local/cuda-10.1/targets/x86_64-linux/lib/ -lnvrtc -lcudart -lcuda -lcudadevrt -Woverloaded-virtual
#SET(CUDA_SEPARABLE_COMPILATION ON)
set(CUDA_VERBOSE_BUILD ON)
include_directories(include)
if(NOT DEFINED CMAKE_CUDA_STANDARD)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
endif()
#add_executable(
# src/main.cu
# src/util.cu
# src/sampler_gbuffer.cu
# src/kernel.cu
# )
add_executable(sample
src/util.cu
src/vec.cu
src/kernel.cu
src/createTable.cu
)
#add_executable(sample_rw
# src/entry.cu
# src/util.cu
# src/vec.cu
# src/kernel.cu
# src/createTable.cu
# src/sample_rw.cu
# )
#add_executable(sample_rw2
# src/entry_rw.cu
# src/util.cu
# src/vec.cu
# src/kernel.cu
# src/createTable.cu
# src/sample_rw2.cu
# )
#target_link_libraries(main_gbuffer
# ${EXTRA_LIBS}
# ${CUDA_LIBRARIES}
# ${CUDA_CUDART_LIBRARY}
# ${CUDA_cudadevrt_LIBRARY}
# #-L. -L/usr/local/cuda/targets/x86_64-linux/lib -ldl -lnvrtc -lcudart -lcuda -lcudadevrt
# # -Wl,-b,binary,include/graph.cuh -fopenmp
# )
target_link_libraries(sample
${EXTRA_LIBS}
${CUDA_LIBRARIES}
#-L. -L/usr/local/cuda/targets/x86_64-linux/lib -ldl -lnvrtc -lcudart -lcuda -lcudadevrt
# -Wl,-b,binary,include/graph.cuh -fopenmp
)
#target_link_libraries(sample_rw
# ${EXTRA_LIBS}
# ${CUDA_LIBRARIES}
# #-L. -L/usr/local/cuda/targets/x86_64-linux/lib -ldl -lnvrtc -lcudart -lcuda -lcudadevrt
# # -Wl,-b,binary,include/graph.cuh -fopenmp
# )
#target_link_libraries(sample_rw2
# ${EXTRA_LIBS}
# ${CUDA_LIBRARIES}
# #-L. -L/usr/local/cuda/targets/x86_64-linux/lib -ldl -lnvrtc -lcudart -lcuda -lcudadevrt
# # -Wl,-b,binary,include/graph.cuh -fopenmp
# )