-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (26 loc) · 921 Bytes
/
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
cmake_minimum_required(VERSION 3.8)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xptxas -dlcm=ca")
# set nvcc path and architecture
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
set(CMAKE_CUDA_ARCHITECTURES 86)
project(tc LANGUAGES CUDA CXX)
set(CMAKE_CUDA_STANDARD 17)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -O3") # Added -O3 optimization for CUDA./
find_package(CUDA REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
# Fetch additional dependencies
include(FetchContent)
FetchContent_Declare(
argparse
GIT_REPOSITORY https://github.com/p-ranav/argparse.git
)
FetchContent_MakeAvailable(argparse)
# Add the source directory
include_directories(${CMAKE_CURRENT_LIST_DIR}/src)
add_subdirectory(src)
add_executable(tc main.cu)
target_link_libraries(tc src argparse)
set_target_properties(tc PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
)