-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (30 loc) · 1.06 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
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(MyCUDAProject LANGUAGES CXX CUDA)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include_directories("../include")
set(CMAKE_CUDA_COMPILER "D:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64")
set(CUDA_ARCH_FLAGS "-gencode arch=compute_89,code=sm_89")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CUDA_ARCH_FLAGS} -lineinfo -Xptxas -v")
set(COMMON_CUDA_SOURCES
../src/KernelsExp1.cu
../src/TimerSpin.cu
)
# Experiment 1
set(EXPERIMENT1_SOURCES
../src/Experiment1.cu
)
add_executable(Experiment1 ${EXPERIMENT1_SOURCES} ${COMMON_CUDA_SOURCES})
target_link_libraries(Experiment1 cudart)
# Experiment 2
set(EXPERIMENT2_SOURCES
../src/Experiment2.cu
)
add_executable(Experiment2 ${EXPERIMENT2_SOURCES} ${COMMON_CUDA_SOURCES})
target_link_libraries(Experiment2 cudart)
# Experiment 3
set(EXPERIMENT3_SOURCES
../src/Experiment3.cu
)
add_executable(Experiment3 ${EXPERIMENT3_SOURCES} ${COMMON_CUDA_SOURCES})
target_link_libraries(Experiment3 cudart)