-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
111 lines (89 loc) · 3.85 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(gpujoin LANGUAGES CXX CUDA)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_INCLUDES OFF)
set(ENABLE_PERFBENCHMARKING false)
find_package(CUDA)
# put predefined cmake projects in their own solution folder
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# CUDA_ARCHITECTURES was introduced in 3.18, however, we have to support older cmake versions as well
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.18.0")
cmake_policy(SET CMP0104 OLD)
set_property(GLOBAL PROPERTY CUDA_ARCHITECTURES OFF)
endif()
set(MY_CUDA_TARGET "pascal" CACHE STRING "CUDA target architecture chosen by the user at CMake configure time")
set_property(CACHE MY_CUDA_TARGET PROPERTY STRINGS pascal volta)
# Set CUDA target architectures
#set(CMAKE_CUDA_ARCHITECTURES 60 61 70 CACHE STRING "CUDA architectures")
#set(CMAKE_CUDA_ARCHITECTURES 60)
message(STATUS "CUDA target architectures: ${CMAKE_CUDA_FLAGS}")
# TODO cmake 3.17: use FindCUDAToolkit()
find_library(CUDART_LIBRARY cudart ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
# add dependencies
include(cmake/CPM.cmake)
CPMAddPackage(
NAME warpcore
GITHUB_REPOSITORY sleeepyjack/warpcore
GIT_TAG master
)
if(ENABLE_PERFBENCHMARKING)
include(cmake/lib/jevents.cmake)
add_compile_definitions(PERF_AVAILABLE=true)
endif(ENABLE_PERFBENCHMARKING)
include(cmake/lib/cub.cmake)
#include(cmake/lib/cuco.cmake)
include(cmake/lib/fast-interconnects.cmake)
include(cmake/lib/gtest.cmake)
include(cmake/lib/oneTBB.cmake)
include(cmake/lib/RadixSpline.cmake)
#include(cmake/lib/warpcore.cmake)
# CUB does not use NDEBUG but rather DEBUG and _DEBUG, so we define the latter here
add_compile_options("$<$<CONFIG:Debug>:-D_DEBUG>")
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
)
#add_executable(btree_lookup src/btree_lookup.cu)
#target_link_libraries(btree_lookup ${CUDART_LIBRARY} numa)
#add_executable(rs_lookup src/rs_lookup.cu)
#target_link_libraries(rs_lookup ${CUDART_LIBRARY} numa radixspline)
add_executable(index_lookup
src/generic_hj.cu
src/index_lookup.cu
src/index_lookup_partitioning.cu
src/measuring.cpp
src/device_properties.cpp
src/harmonia.cu
src/indexes.cpp
src/index_lookup_config.cpp
src/gpu_radix_partition.cu
)
set_target_properties(index_lookup PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
target_link_libraries(index_lookup ${CUDART_LIBRARY} numa radixspline onetbb fast_interconnects warpcore)
# additional nvcc flags
target_compile_options(index_lookup PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-rdc=true --expt-extended-lambda --expt-relaxed-constexpr>)
#target_compile_options(index_lookup PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:-Xptxas="-v">)
#target_compile_options(index_lookup PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:-DNRDC>")
# debug flag
#target_compile_options(index_lookup PRIVATE "$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:CUDA>>:-G>")
target_compile_options(index_lookup PRIVATE "$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:CUDA>>:-lineinfo>")
if(false)
# https://forums.developer.nvidia.com/t/passing-flags-to-nvcc-via-cmake/75768
# https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#ptxas-options-def-load-cache
target_compile_options(index_lookup PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:
#--generate-line-info
#--use_fast_math
#-Xptxas --def-load-cache=cg
#-Xptxas -dscm=cg
>)
endif()
add_executable(bf_search src/bf_search.cpp)
add_executable(random_access src/random_access.cu)
add_executable(cub_sort src/example_block_radix_sort.cu)
target_link_libraries(cub_sort cub)
add_executable(huge_pages src/huge_pages.cpp)
target_link_libraries(huge_pages numa)
add_subdirectory(src/tpch)
add_subdirectory(test)