-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
92 lines (82 loc) · 2.22 KB
/
CMakeLists.txt
File metadata and controls
92 lines (82 loc) · 2.22 KB
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
set(TARGET_NAME "restir_di")
file(
GLOB_RECURSE SOURCES
*.h *.hpp *.c *.cpp)
set(
CUDA_KERNELS
"gpu_kernels/copy_buffers.cu"
"gpu_kernels/per_pixel_ris.cu"
)
set(
OPTIX_KERNELS
"gpu_kernels/optix_gbuffer_kernels.cu"
"gpu_kernels/optix_restir_di_kernels.cu"
"gpu_kernels/optix_restir_di_rearch_kernels.cu"
)
set(
GPU_KERNEL_DEPENDENCIES
"../utils/cuda_util.h"
"../utils/optix_util.h"
"../utils/optixu_on_cudau.h"
"../common/common_shared.h"
"../common/common_device.cuh"
"${TARGET_NAME}_shared.h"
)
nvcuda_compile_ptx(
SOURCES ${CUDA_KERNELS}
DEPENDENCIES ${GPU_KERNEL_DEPENDENCIES}
TARGET_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${TARGET_NAME}/ptxes"
GENERATED_FILES CUDA_PTXES
NVCC_OPTIONS
"-Xcompiler" "\"/wd 4819 /Zc:__cplusplus\""
"$<$<CONFIG:Debug>:-D_DEBUG=1>"
"$<$<CONFIG:Debug>:-G>"
"--gpu-architecture=compute_75"
"-std=c++20"
"-cudart" "shared"
"--use_fast_math"
"--relocatable-device-code=true"
"-I${OPTIX_INCLUDE_DIR}"
)
nvcuda_compile_ptx(
SOURCES ${OPTIX_KERNELS}
DEPENDENCIES ${GPU_KERNEL_DEPENDENCIES}
TARGET_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${TARGET_NAME}/ptxes"
GENERATED_FILES OPTIX_PTXES
NVCC_OPTIONS
"-Xcompiler" "\"/wd 4819 /Zc:__cplusplus\""
"$<$<CONFIG:Debug>:-D_DEBUG=1>"
"$<$<CONFIG:Debug>:-lineinfo>"
"--gpu-architecture=compute_75"
"-std=c++20"
"-cudart" "shared"
"--use_fast_math"
"--relocatable-device-code=true"
"-I${OPTIX_INCLUDE_DIR}"
)
set_common_sources()
set_source_files_properties(
${GL3W_SOURCES} PROPERTIES
GENERATED TRUE
)
# essentials
source_group(
"essentials" REGULAR_EXPRESSION
"${CMAKE_CURRENT_SOURCE_DIR}/[^/]*\.(h|hpp|c|cpp)$")
source_group(
"essentials/GPU kernels" REGULAR_EXPRESSION
"${CMAKE_CURRENT_SOURCE_DIR}/gpu_kernels/[^/]*\.(cu)$")
add_executable(
"${TARGET_NAME}"
${COMMON_SOURCES}
${SOURCES}
${GL3W_SOURCES}
${CUDA_KERNELS}
${OPTIX_KERNELS}
)
target_compile_features("${TARGET_NAME}" PRIVATE cxx_std_20)
set_target_properties("${TARGET_NAME}" PROPERTIES CXX_EXTENSIONS OFF)
target_link_libraries(
"${TARGET_NAME}"
fakelib
)