-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
50 lines (37 loc) · 1.31 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
cmake_minimum_required(VERSION 3.10)
project(cuq LANGUAGES CXX)
project(cuq LANGUAGES CXX CUDA)
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_FLAGS "-lineinfo")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler -Werror") #flags to host compiler behind the nvcc
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Werror cross-execution-space-call,reorder,deprecated-declarations")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "-O2 -Wall -Wextra -Wshadow -Wpedantic -Wnon-virtual-dtor -Wunused -Wdouble-promotion")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -rdynamic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
include_directories("${PROJECT_SOURCE_DIR}/include")
#
# Library
#
add_library(cuq SHARED
src/cuq.cpp
src/device_selection.cu
)
target_link_libraries(cuq rt cudart nvidia-ml)
install(TARGETS cuq DESTINATION lib)
install(FILES include/cuq.h DESTINATION include)
add_executable(concurrent_gpu_test
examples/concurrent_gpu_demo.cu
)
set_target_properties( concurrent_gpu_test
PROPERTIES CUDA_SEPARABLE_COMPILATION ON
POSITION_INDEPENDENT_CODE ON
)
target_link_libraries(concurrent_gpu_test PRIVATE cudart cuq)
#
# Tests sub directory
#
add_subdirectory(tests)
include(CTest)
add_test (all_tests tests/all_tests)
# set(CMAKE_BUILD_TYPE Debug)