-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (40 loc) · 1.32 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.17)
project(trt_batched_nms)
find_package(autoware_tensorrt_common)
if (NOT ${autoware_tensorrt_common_FOUND})
message(WARNING "The autoware_tensorrt_common package is not found. Please check its dependencies.")
return()
endif ()
find_package(autoware_cmake REQUIRED)
autoware_package()
include(CheckLanguage)
check_language(CUDA)
if (CMAKE_CUDA_COMPILER)
enable_language(CUDA)
else ()
message(WARNING "CUDA is not found. preprocess acceleration using CUDA will not be available.")
endif ()
find_library(NVINFER_LIB nvinfer PATHS ${TENSORRT_ROOT}/lib)
find_library(NVPLUGIN_LIB nvinfer_plugin PATHS ${TENSORRT_ROOT}/lib)
include_directories(
include
)
cuda_add_library(${PROJECT_NAME}_plugin SHARED
src/nms/batched_nms_kernel.cpp
src/nms/kernel.cu
src/nms/allClassNMS.cu
src/nms/gatherNMSOutputs.cu
src/nms/permuteData.cu
src/nms/sortScoresPerClass.cu
src/nms/sortScoresPerImage.cu
src/trt_batched_nms.cpp
)
target_link_libraries(${PROJECT_NAME}_plugin ${CUDA_LIBRARIES} ${NVINFER_LIB} ${NVPLUGIN_LIB} ${OpenCV_LIBS} dl)
install(TARGETS ${PROJECT_NAME}_plugin
LIBRARY DESTINATION lib
)
if (BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif ()
ament_package()