-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (67 loc) · 2.12 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
cmake_minimum_required(VERSION 3.5)
project(PWCNet)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CUDA_COMPILER "/usr/local/cuda/bin/nvcc")
set(CMAKE_CUDA_STANDARD 14)
# compile a CUDA file into an object file
IF(NOT CMAKE_CUDA_COMPILE_OBJECT)
SET(CMAKE_CUDA_COMPILE_OBJECT
"${CMAKE_CUDA_COMPILER} -o <OBJECT> -c <SOURCE>")
ENDIF(NOT CMAKE_CUDA_COMPILE_OBJECT)
add_executable(
PWCNet
main.cpp
PWCNet.cpp
PWCNet.h
Layers/LeakyReluLayer.cpp
Layers/LeakyReluLayer.h
Layers/LeakyReluLayerGpu.cu
Layers/LeakyReluLayerGpu.h
Layers/PluginFactory.cpp
Layers/PluginFactory.h
Layers/LeakyReluLayerGpu.h
Layers/CostVolumeLayer.cpp
Layers/CostVolumeLayer.h
Layers/ImageWarpLayer.cpp
Layers/ImageWarpLayer.h
Utils/common.h
Utils/buffer.h
Utils/logging.h
Utils/logger.h
Utils/logger.cpp
Utils/half.h
Utils/cudaUtils.cpp
Utils/cudaUtils.h
Utils/cudaUtilsGpu.cu
Utils/cudaUtilsGpu.h
Utils/TensorUtils.cpp
Utils/TensorUtils.h
Layers/ReshapeLayer.cpp
Layers/ReshapeLayer.h
Utils/Profiler.h)
target_compile_options(PWCNet PUBLIC "-fno-rtti")
set_source_files_properties( Layers/LeakyReluLayerGpu.cu Utils/cudaUtilsGpu.cu PROPERTIES LANGUAGE CUDA )
set(CUDART_LIB "/usr/local/cuda/lib64/libcudart.so" )
set(CUDNN_LIB "/usr/lib/aarch64-linux-gnu/libcudnn.so" )
set(CUDA_DEP_LIBS
${CUDART_LIB}
${CUBLAS_LIB}
${CUDNN_LIB}
nvinfer
${RT_LIB}
${CMAKE_DL_LIBS}
${CMAKE_THREAD_LIBS_INIT}
)
# Necessary to link nvinfer_plugin library.
target_link_libraries(PWCNet
PUBLIC ${CUDA_DEP_LIBS}
-Wl,--unresolved-symbols=ignore-in-shared-libs
)
target_include_directories(PWCNet PRIVATE "/usr/local/cuda/include")
set_target_properties(PWCNet PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL")
add_custom_command(
TARGET PWCNet POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/pwcnet_trt
${CMAKE_CURRENT_BINARY_DIR}/pwcnet_trt
)