forked from kurapov-peter/dwarf_bench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
124 lines (104 loc) · 2.67 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
112
113
114
115
116
117
118
119
120
121
122
123
124
cmake_minimum_required(VERSION 3.14)
project(dwarf_bench)
find_package(TBB REQUIRED)
find_package(OpenCL REQUIRED)
find_package(oclhelpers 0.1.3 REQUIRED)
find_package(CUDA)
option(ENABLE_DPCPP ON)
option(ENABLE_CUDA OFF)
option(ENABLE_EXAMPLES ON)
option(ENABLE_EXPERIMENTAL OFF)
if(ENABLE_DPCPP)
find_package(oneDPL REQUIRED)
add_definitions(-DDPCPP_ENABLED)
if(ENABLE_EXPERIMENTAL)
add_definitions(-DEXPERIMENTAL)
endif()
endif()
if(CUDA_FOUND AND ENABLE_CUDA)
message(STATUS "Using ${CUDA_VERSION} headers")
if (${CUDA_VERSION_MAJOR} GREATER_EQUAL 11)
add_definitions(-DCUDA_OCL_API_CHANGED)
endif()
add_definitions(-DCUDA_ENABLED)
endif()
find_package(Boost 1.61 COMPONENTS program_options filesystem REQUIRED)
list(APPEND CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake
)
include(KernelFunctions)
include(FetchContent)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(common)
add_subdirectory(scan)
add_subdirectory(constant)
add_subdirectory(sort)
add_subdirectory(reduce)
add_subdirectory(hash)
add_subdirectory(join)
add_subdirectory(probe)
add_subdirectory(groupby)
if(ENABLE_EXAMPLES)
add_subdirectory(example)
endif()
set(bench_libs
common
standalone_scan
constant
tbbsort
)
if(ENABLE_DPCPP)
add_subdirectory(common/dpcpp)
list(APPEND bench_libs
dpcpp_constant
scan
radix
reduce
hash_build
nested_loop_join
join_helpers_lib
cuckoo_hash_build
join
groupby
groupby_local
hash_build_non_bitmask
)
if(ENABLE_EXPERIMENTAL)
list(APPEND bench_libs
slab_hash_build
slab_join
slab_probe
omnisci_join
)
endif()
if(ENABLE_CUDA)
list(APPEND bench_libs
dpcpp_constant_cuda
scan_cuda
radix_cuda
)
endif()
endif()
set(${CMAKE_CXX_FLAGS_DEBUG} "${CMAKE_CXX_FLAGS_DEBUG} -O0")
set(bench_sources bench.cpp register_dwarfs.cpp register_dwarfs.hpp)
add_executable(${PROJECT_NAME} ${bench_sources})
target_link_libraries(${PROJECT_NAME} PRIVATE Boost::program_options ${bench_libs})
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR})
add_kernel(vadd)
add_executable(simple simple.cpp)
target_link_libraries(simple PRIVATE common OpenCL::OpenCL oclhelpers::oclhelpers)
target_include_directories(simple PRIVATE ${PROJECT_SOURCE_DIR})
option(ENABLE_TESTS ON)
if(ENABLE_TESTS)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.11.0
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_subdirectory(tests)
endif()